The request used for making a refund is refund.do
(see Connection URLs).
Orders that initiate recurring payments cannot be reversed and refunded, as in these cases there is no real debiting.
Upon this request, the funds for the specified order are to be returned to the payer. The request will end with an error if the funds have not been debited for this order. To process a refund operation, it is necessary to have the corresponding permissions in the system.
In this document, the following data type conventions are used when describing request and response parameters:
The request parameters are given in table below.
Name | Type | Mandatory | Description |
---|---|---|---|
|
AN..30 | Yes |
Login of the service account of the merchant. |
|
AN..30 | Yes |
Merchant's service account password. |
|
ANS36 | Yes |
Identifier of the order in the payment system. It is unique within the system. Missing if order registration failed due to an error detailed in ErrorCode. |
|
N..12 | Yes |
Payment amount in minimum currency units. |
|
String | No |
Additional parameters of the request. Format: {«Name1»: «Value1», «Name2»: «Value2»}. It is forbidden to pass reserved names in the parameter (if they are passed, the order may be rejected):
|
If you specify amount=0 in the request, a refund is made for the entire amount of the order.
The response parameters are given in table below.
Name | Type | Mandatory | Description |
---|---|---|---|
|
ANS..3 | No |
Error code. Can be missing if the result has not caused an error. |
|
|
No |
|
Error code | Error text |
---|---|
0 |
The request has been processed without system errors. |
5 |
Access denied. |
5 |
The user must change the password. |
5 |
|
5 |
Incorrect amount. |
6 |
Wrong order number. |
7 |
Payment must be in the correct state. |
7 |
The refund amount exceeds the debited amount. |
7 |
System error. |
userName=test-api&password=testPwd&orderId=148a2a67-25ff-7d1b-b28d-391800a7dca8&amount=101000
{"errorCode":0}