Refund
Request
Query parameters
Name | Parameter type | 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 |
Parameter type
stringDefinition
The address to which the refund should be madeParameter type
booleanDefinition
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 amountParameter type
uuidrequired_without: order_idDefinition
Invoice uuidParameter type
stringmin:1max:128alpha_dashrequired_without: uuidDefinition
Invoice order ID
* - mandatory parameter
Request example
curl https://api.cryptomus.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"
}'
COPYResponse
Response example
1{
2 "state": 0,
3 "result": []
4}
COPYPossible errors
Validation errors
code : 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}
5
COPYIf 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