The translation was generated automatically and may contain mistakes
How to cancel or refund a payment
This section is intended for developers who have already connected VK Pay.
If you want to connect and start accepting payments through VK Pay, write to vkpay_solutions@vk.team .
More about the service - in the section About VK Pay .
With help Payment system API (hereinafter — the system API) you can make a cancellation, refund or partial refund of the payment — more in the section Terms of cancellation and refund of payments .
Full and partial refunds are available for payment methods: bank card and VK Wallet.
If you want to return a payment, send a request for a refund method POST /transaction/refund .
Terms of cancellation and refund of payments
Refunds and cancellations are carried out by the operator of the payment system - VK Payment Solutions" (hereinafter - the operator).
What is the difference between cancellation and refund of payment
Cancellation | Return | |
|---|---|---|
Time limit for the operation. | Until 23:00 Moscow time on the same day when the payment was made. | From 23:00 Moscow time on the same day when the payment was made.
You can return the money within 365 days from the date of payment. |
Recorded in register of successful payments and returns . | No.. | Yes.. |
Partial refund of payment. | No.. | Yes.. |
Refund of payment commission. | Yes.. | No.. |
More information about cancellations and refunds can be found in p. 4.6 Terms of payment services .
Cancellation of payment
Cancellation — this is the cancellation of the payment until 23:00 Moscow time on the same day when it was held.
In this case, the payment and cancellation transactions do not fall into the register of successful payments and returns . You can’t partially cancel the payment — you can only return the funds in full. When the payment is canceled, the operator returns the commission for the payment made.
For example, the buyer paid 100 ₽ for the goods.. This amount includes 3 ₽ commission, which the store pays to the operator for services. If the payment is canceled, the operator will return the entire amount to the buyer together with the commission - 100 ₽.
Important! To connect the return of the commission when you cancel the payment, write to the technical support at the address vkpay_solutions@vk.team .
Refund of payment
Return — this is the cancellation of the payment after 23:00:00 Moscow time of the same day when it was held.
In this case, the payment and return operations fall into register of successful payments and returns . When you return the payment, you can return the funds both partially and completely. The commission upon return and partial return is not returned. The refund is possible within 365 days from the date of payment.
For example, the buyer paid 100 ₽ for the goods.. This amount includes 3 ₽ commission, which the store pays to the operator for services. When returning, the operator will keep 3 ₽ commissions for himself, and 97 ₽ will return to the buyer. The store will need to pay 3 ₽ to the buyer received back 100 ₽.
How to return payment
- 1.
- 2.
- 3.Respond to the notification Form a response body with information about the success or failure of processing the notification, sign the response and send it to the payment system.
Step 1. Send a Return Request
Form POST request to the system API, sign it and send it to the URL: https://api.money.mail.ru/money/2-03/transaction/refund .
In the request, pass the required parameter transaction_id ID of the transaction.
Parameter amount Optionally:
- •If you want to return the entire payment, the parameter
amountcan not be transmitted. By default, the payment amount will return in full. - •If you want to return the payment in part, specify the amount in the request
amountand currency of paymentcurrency. In this case, the amount you indicated will be returned, minus the commission.
Example of a chargeback request
?2?The command line $ curl -vL -X POST -d 'version=2-03&data=ewogICJ0cmFuc2FjdGlvbl9pZCI6ICJFRUVBRjMyMi0xMEJELTExRTgtOTNERi1DQkFBOTg0RDRGRkYiLAogICJhbW91bnQiOiAiMS41MCIsCiAgImN1cnJlbmN5IjogIlJVQiIsCiAgInJlYXNvbiI6ICJKdXN0IHJlZnVuZCIsCiAgIm1lcmNoYW50X3BhcmFtIjogInRleHQiLAogICJpc3N1ZXJfaWQiOiAic3RyaW5nIgp9&signature=fe476a9d66e96ab38fc65ee10a46d9ded546381c' https://api.money.mail.ru/money/2-03/transaction/refund
#### Пример `body` для запроса на возврат платежа
```JSON
{
"transaction_id": "EEEAF322-10BD-11E8-93DF-CBAA984D4FFF",
"amount": "1.50",
"currency": "RUB",
"reason": "Just refund",
"merchant_param": "text",
"issuer_id": "string"
}
Field parameters body Request for Refund of Payment
Parameter | Type | Description |
|---|---|---|
transaction_id Mandatory | string | The payment transaction ID for which you want to make a refund. Format: UUID by RFC 4122 . |
amount Non-binding | number | Refund amount. You need to transfer if you want to return only part of the payment. By default, the payment amount will return in full. Example: -21.05 |
currency Non-binding | string | Currency of the refund amount ISO 4217 . The value must coincide with the currency of payment. You need to pass if a parameter is passed amount .
Acceptable value: RUB . |
reason Non-binding | string | Assignment of payment. |
merchant_param Non-binding | string | Additional data that you wish to transmit. |
issuer_id Non-binding | string | The return transaction ID is on your side. If not specified, the default transaction ID will be used on the payment system side. |
Example body Responding to a chargeback request
{
"transaction_id": "EEEAF322-10BD-11E8-93DF-CA984DA4FFBF",
"action": "stop",
"action_param": {
"status": "success",
"is_reverse": "true"
}
}Step 2. Get a payment system response
In response to the request, the payment system will return a response with the transaction status in the field action.status and payment notice. Check the signature of the response Process the data and respond to the notification .
Field parameters body Responding to a chargeback request
Parameter | Type | Description |
|---|---|---|
transaction_id | string | The return transaction ID. Format: UUID by RFC 4122 . |
action | string | Status of return:
• wait Transaction not completed, request transaction status with reasonable request interval transaction/status until the status is transferred to stop .
• stop — the transaction status is final, the value is contained in action_param . |
action_param | object | With action = stop The payment system will return additional parameters for action : the status of the transaction and a sign of cancellation of the payment.
With action = wait The empty meaning will come back. |
Object Parameters action_param
Additional parameters for the scenario action , come back in the body of the response to the request for the return of the payment .
Parameter | Type | Description |
|---|---|---|
status | string | Clarification of Transaction Status for action = stop . Possible meanings status :
• success The transaction is successful.
• fail The transaction is unsuccessful. |
is_reverse | boolean | A sign that the transaction is a cancellation of payment:
• true Cancellation of payment.
• fail A return was made. |
Step 3. Reply to Payment Notification
After the transaction, the payment system will return notification with the result of the transaction.
Check the signature of the notification using the public key of the payment system, which you received when you connected. Then decrypt the notification data, process and send the system API a response with the result of the processing. More specifically, in reply to payment notification .
Errors in Return of Payment
Mistake | Description |
|---|---|
ERR_ACCESS_DENIED | You can’t make a refund on someone else’s transaction. Check transaction_id and repeat the request. |
ERR_ALREADY_REFUNDED | The payment has already been fully refunded. |
ERR_AMOUNT_GREATER_THAN_ALLOWED | The requested refund amount is greater than the payment amount. |
ERR_CONFIG | Configuration error — contact technical support at vkpay_solutions@vk.team . |
ERR_CURRENCY_MISMATCH | The return currency is different from the payment currency. Specify the same currency with which the payment was made and repeat the request. |
ERR_NOMONEY | There are not enough funds to return the requested amount. |
ERR_PARTIAL_REFUND_DENIED | Partial return is prohibited. |
ERR_PAY_METHOD_DISABLED | Payment method disabled or unavailable — contact technical support at vkpay_solutions@vk.team . |
ERR_PAYER_AWAITING_FOR_CLOSING | The transaction is not possible: the recipient’s VK Wallet is waiting to be closed. |
ERR_PAYER_BANNED | The transaction is impossible: the recipient of the payment is blocked. |
ERR_PAYER_CLOSED | The transaction is not possible: the recipient’s VK wallet is closed. |
ERR_PAYER_PWD_BANNED | The transaction is impossible: the recipient of the payment is blocked. |
ERR_PAYER_UNVERIFIED | The transaction is not possible: the recipient of the payment has not been identified. |
ERR_RATE_LIMIT | The maximum allowable number of returns per transaction is exceeded: by default - one return in 15 minutes. Try to repeat the request later. |
ERR_REFUND_FAILED | The return ended with an error. Try repeating the request again. |
ERR_REFUND_TTL | The transaction cannot be refunded: the time has expired when the payment can be refunded. You can make a refund within 365 days from the date of payment. |
ERR_TRANSACTION_NOT_FOUND | Транзакция не найдена. Проверьте transaction_id and repeat the request. |
ERR_WALLET_LIMIT | The operation is impossible: the limits for transfers through the VK Wallet are exceeded. |
ERR_WRONG_TRANSACTION_STATUS | Operation impossible: incorrect transaction status. |