Main
/Payouts
/Refund
Copy page
Refunds are made using the payout API key. The sign header of the request must be generated using your payout API key. How to get the payout API key
| Name | Parameter type | Default value | Definition |
|---|---|---|---|
| address* | string | The address to which the refund should be made | |
| is_subtract* | boolean | Whether to take a commission from the merchant's balance or from the refund amounttrue - take the commission from merchant balancefalse - reduce the refundable amount by the commission amount | |
| uuid* | uuidrequired_without: order_id | Invoice uuid | |
| order_id* | stringmin:1max:128alpha_dashrequired_without: uuid | Invoice order ID | |
| amount | stringmax:40null | null | Refund amount |
* - mandatory parameter
curl https://api.heleket.com/v1/payment/refund \
-X POST \
-H 'merchant: 8b03432e-385b-4670-8d06-064591096795' \
-H 'sign: fe99035f86fa436181717b302b95bacff1' \
-H 'Content-Type: application/json' \
-d '{
"uuid": "8b03432e-385b-4670-8d06-064591096795",
"address": "TDD97yguPESTpcrJMqU6h2ozZbibv4Vaqm",
"is_subtract": "true"
}'Copy
1{
2 "state": 0,
3 "result": []
4}Copycode : 422
example responses:
If the invoice with the uuid or order_id you provided doesn’t exist:
1{
2 "state": 1,
3 "message": "Payment was not found"
4} CopyIf you will not pass a uuid and order_id, you will receive this message. It means that at least one of the parameters is required.
1{
2 "state": 1,
3 "errors": {
4 "uuid": ["validation.required_without"],
5 "order_id": ["validation.required_without"]
6 }
7}CopyIf payouts are blocked on your merchant, you will receive this error message. This happens, for example, when you change your password and payouts are blocked for 24 hours.
1{
2 "state": 1,
3 "message": "You are forbidden"
4}
5CopyIf merchant wallet that is connected to an invoice does not exist:
1{
2 "state": 1,
3 "message": "Undefined merchant wallet"
4}CopyIf the invoice is not finalized or not paid.
1{
2 "state": 1,
3 "message": "Refunds are made only for completed payments"
4}CopyIf the amount to be refunded exceeds the amount of the invoice payment:
1{
2 "state": 1,
3 "message": "The refund amount should not be more than the amount paid"
4}CopyIf technical work occurs and the payment is temporarily unavailable, you can receive this error message:
1{
2 "state": 1,
3 "message": "Server error"
4}Copy