Refunds
(POST /refund)
It is important for merchants that the operation tickets do not repeat on the same day to identify transactions. With refunds, there are three different methods to consider, which will be exemplified:
- Referenced Refund: Instead of sending the card details, the identifier of the transaction (
transaction_id
) for which the refund is requested is sent. With this method, the amount will be refunded to the card used in the original transaction. - Refund with Card Data: The card details and the ticket number are explicitly indicated.
- Refund via Token: This operation is the same as the
Refund with Card Data
, except that instead of sending the card details explicitly, the token associated with it is sent.
Payload
- amount (string, required): Amount of the operation
1000
- currency (string, required): Any currency defined according to ISO_4217 is valid
EUR
- order (string): Ticket of the operation
sipay-order-001
- reconciliation (string): Identifier for bank reconciliation (p37)
1234sipay
- transaction_id (string): Identifier of the transaction
000024899463550243139
- pan (string): Card number
6712009000000458
- month (string): Expiration month of the card
12
- year (string): Expiration year of the card
2017
- token (string): Alphanumeric code associated with the card data. It is used to store the card data in a secure vault and facilitate future operations with that card without the card data having to travel over the network again, thus securing the purchase process.
sipay-token-test-359ef8ce5c5f4003b71692e446908c27
- fastpay (object):
- request_id (string): Card identifier returned by FastPay
- format: [0-9a-fA-F]
- length: 32
- request_id (string): Card identifier returned by FastPay
- catcher (object):
{"token": "1b5925567684485eb1590c105cf8c9ba"}
- custom_01 (string): Customizable field
custom_001
- custom_02 (string): Customizable field
custom_002
Request example - Referenced Refund
{
"key": "589365da65c48cff87d0874a",
"resource": "359ef8ce5c5f4003b71692e446908c27",
"nonce": "1234567890",
"mode": "sha256",
"payload": {
"amount": "1000",
"currency": "EUR",
"order": "sipay-order-001",
"reconciliation": "1234sipay",
"transaction_id": "000024899463550243139",
"custom_01": "custom_001",
"custom_02": "custom_002"
}
}
Request example - Refund with Card Data
{
"key": "589365da65c48cff87d0874a",
"resource": "359ef8ce5c5f4003b71692e446908c27",
"nonce": "1234567890",
"mode": "sha256",
"payload": {
"amount": "1000",
"currency": "EUR",
"order": "sipay-order-001",
"reconciliation": "1234sipay",
"pan": "6712009000000458",
"month": "12",
"year": "2017",
"custom_01": "custom_001",
"custom_02": "custom_002"
}
}
Request example - Refund via Token
{
"key": "589365da65c48cff87d0874a",
"resource": "359ef8ce5c5f4003b71692e446908c27",
"nonce": "1234567890",
"mode": "sha256",
"payload": {
"amount": "1000",
"currency": "EUR",
"order": "sipay-order-001",
"reconciliation": "1234sipay",
"token": "sipay-token-prueba-359ef8ce5c5f4003b71692e446908c27",
"custom_01": "custom_001",
"custom_02": "custom_002"
}
}
Request example - Refund via Prior Card Capture in FastPay
{
"key": "589365da65c48cff87d0874a",
"resource": "359ef8ce5c5f4003b71692e446908c27",
"nonce": "1234567890",
"mode": "sha256",
"payload": {
"amount": "1000",
"currency": "EUR",
"order": "sipay-order-001",
"reconciliation": "1234sipay",
"catcher": {
"request_id": "f5a57382056b4383affa3d1aa617118b"
},
"custom_01": "custom_001",
"custom_02": "custom_002"
}
}
Success - 0 - refund
- code (string, required): Internal operation code. Refer to Response Codes
- amount (string, required): Amount of the operation
1000
- currency (string, required): Currency used in the operation
EUR
- order (string, required): Operation ticket
sipay-order-001
- reconciliation (string, required): Identifier for bank reconciliation (p37)
1234-sipay
- card_trade (string, required): Card issuer. Request more information.
undefined
- card_type (string, required): Type of the card. Request more information.
undefined
- transaction_id (string, required): Transaction identifier.
000024899463550243139
- masked_card (string, required): Masked card number
6712 00** ****0205
- approval (string, required): Approval code from the entity
346179
- authorizator (string, required): Authorizing entity of the operation
BANCO SANTANDER, S.A.
Response example
{
"type": "success",
"code": "0",
"detail": "refund",
"description": "Refund processed successfully",
"uuid": "2df61337-c0c5-4b90-ab8c-6098c8b118ce",
"request_id": "5901ba6d7710014a2c89",
"payload": {
"amount": "1000",
"currency": "EUR",
"order": "sipay-order-001",
"reconciliation": "1234sipay",
"card_trade": "undefined",
"card_type": "undefined",
"transaction_id": "000024899463550243139",
"code": "0",
"masked_card": "6712 00** ****0205",
"approval": "346179",
"authorizator": "BANCO SANTANDER, S.A."
}
}