Refunding payments with SEPA Credit Transfer (pacs.007)
This tutorial describes how you can refund (reverse) SEPA Credit Transfer (SCT) payments with the Refund API (also known as the pacs.007 endpoint of the Payments Hub API) and accompanies the information found in the
For this tutorial, consider a scenario where you are a payment provider, and your merchant in Cádiz has a customer in Lisbon who purchases an item for which they later want a refund. The Refund API can be used to reverse the EUR transfer and return part of the money from the merchant account to the customer's account.
Sandbox
The instructions in this tutorial apply to the Sandbox environment
Refund the payment
A customer is not happy with their purchase and they request a refund from your merchant, who forwards the request to you. You can then initiate the payment refund using the pacs.007 HTTP request.
This section describes how to make a partial refund via a pacs.007 HTTP request to the Refund API.
Request body
The request must include a JSON payload object in the request body. The JSON payload is a pacs.007 ISO message with the fIToFIPmtRvsl root element, and it contains the request details for refunding a payment.
The following table only provides information about some especially important fields. For details on all the required and optional message fields, see Message field definition for pacs.007 .
Table: Refund the payment - Relevant request body elements.
Message field | Description | Data type | Required/Optional |
|---|---|---|---|
grpHdr.msgId | Message ID, which must uniquely identify each request you send. This ID is used internally for idempotency of the API. | String | Required |
grpHdr.creDtTm | Date and time of the payment refund request | String | Required |
grpHdr.nbOfTxs | Number of transactions within the message. Value: 1 | Number | Required |
grpHdr.sttlmInf.sttlmMtd | Settlement method. Value: CLRG | String | Required |
txInf.rvslId | Unique payment refund ID for the end customer | String | Optional |
txInf.rvsdIntrBkSttlmAmt | Data structure containing the payment currency and the amount to be refunded. The currency must be EUR and the amount must be a positive value. The Refund API validates that the amount is less than the original payment amount. | Object | Required |
Code for the payment reversal | String | Required | |
txInf.rvslRsnInf.addtlInf | Array of the client reference for the inbound payment to be refunded. The array can contain the following elements:
· fitoFICstmrCdtTrf.cdtTrfTxInf.rmtInf.strd.cdtrRefInf.ref · fitoFICstmrCdtTrf.cdtTrfTxInf.pmtId.endToEndId · fitoFICstmrCdtTrf.cdtTrfTxInf.pmtId.txId · fitoFICstmrCdtTrf.grpHdr.msgId · paymentsHubId returned in the response body of the original payment request. This element is mandatory.
· Null, zero, or rmtinf = Creditor reference ID · e2eid = End-to-end ID · txid = Transaction ID · msgid = Message ID · payhubid = Payments Hub ID This element is optional. If it is not provided, the value of element [0] must be the creditor reference ID.
| Array | Required |
Example request body:
{
"fitoFIPmtRvsl": {
"grpHdr": {
"msgId": "8899402864411437377893795",
"creDtTm": "2021-05-18T15:43:13.455Z",
"nbOfTxs": "1",
"sttlmInf": {
"sttlmMtd": "CLRG"
}
},
"txInf": [
{
"rvslId": "8899402864411437377893795",
"rvsdIntrBkSttlmAmt": {
"value": 10,
"ccy": "EUR"
},
"rvslRsnInf": [
{
"rsn": {
"cd": "AC01"
},
"addtlInf": [
"e171018d-a783-3300-915a-3bb9c1928a2b"
]
}
]
}
]
}
}