Unified Refunds
POST /payment/api/v1/{request_id}/refund
If the payment method supports refunds, you can process refunds using just the reference number of the transaction from this endpoint.
Request
URL Parameters
- request_id(string): Unique identifier for the sales process. To refund a sale, the request_id must be the same as the one created when generating the payment link.
Payload
- amount (integer): Amount to be refunded. Required for partial refunds.
- currency (string): Currency of the refund in ISO_4217 format. Must be the same as the currency used for the sale.
Response
Payload
- code: Response code. 0 indicates success, anything else should be treated as an error.
- amount: Amount that has just been refunded.
- remaining_amount: Amount remaining for refund.
- order: Ticket for the operation. Must be the same as in the sale.
- currency: Currency used in the operation. Any currency defined according to ISO_4217 will be valid.
- payment_method_name: Payment method.
- extra: Payment method details.
Examples
Example - Card
Request
{
"key": "{{key}}",
"resource": "{{resource}}",
"mode": "sha256",
"nonce": "123123",
"payload": {
"amount": 15000
}
}
Response
{
"type": "resource.status",
"code": "0",
"detail": "Refund processed succesfully.",
"payload": {
"code": "0",
"amount": 15000,
"remaining_amount": 0,
"order": "578d626c713e4be49fb38cf2bf4e4273",
"currency": "EUR",
"payment_method_name": "card",
"extra": {
"amount": 15000,
"currency": "EUR",
"order": "578d626c713e4be49fb38cf2bf4e4273",
"reconciliation": "",
"authorizator": "",
"approval": "",
"transaction_id": "000027346264324817858",
"card_trade": "undefined",
"card_type": "undefined",
"masked_card": ""
}
},
"request_id": "62695e1ca72bfcb0525986a4",
"uuid": "62695e1ca72bfcb0525986a4"
}