Cancelling payments with SEPA Credit Transfer (camt.056)
This tutorial describes how you can cancel SEPA Credit Transfer (SCT) payments with the Payments Hub API and accompanies the information in the Payment Cancellation tutorial here
For this tutorial, consider a scenario where a customer has sent a payment, but realizes that it was incorrect, and wants to cancel it. The Payments Hub API can be used to request the cancellation of any payment like this.
Sandbox
The instructions in this tutorial apply to the Sandbox environment
Request body
The request must include a JSON payload object in the request body. The JSON payload is a camt.056 ISO message with the fitoFIPmtCxlReq root element, and it contains the request details for cancelling 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 camt.056 .
Table: Cancel the payment - Relevant request body elements.
Message field | Description | Data type | Required/Optional |
|---|---|---|---|
Assignment ID that uniquely identifies the investigation assignment. This ID is used internally for idempotency of the API. | String | Required | |
assgnmt.assgnr | Data structure containing the assigner details. For this scenario, this is the customer’s agent. | Object | Required |
assgnmt.assgne | Data structure containing the assignee details. For this scenario, this is the merchant’s agent. | Object | Required |
undrlyg.txInf.cxlId | Unique payment cancellation ID for the end customer | String | Required |
undrlyg.txInf.orgnlTxRef.intrBkSttlAmt | Data structure containing the payment currency and the amount of the original transaction. The currency must be EUR and the amount must be a positive value. | Object | Optional |
undrlyg.txInf.cxlRsnInf | Array of information about the cancellation reason | Array | Required |
undrlyg.txInf.orgnlTxRef | Data structure containing the transaction reference used to identify the original transaction | Object | Required |
Example request body:
{
"fitoFIPmtCxlReq": {
"assgnmt": {
"id": "MsgId-2046908283",
"assgnr": {
"agt": {
"finInstnId": {
"bicfi": "BSCHESMMXXX"
}
}
},
"assgne": {
"agt": {
"finInstnId": {
"bicfi": "BBVAESMMXXX"
}
}
},
"creDtTm": "2022-03-10T13:20:31.475+01:00"
},
"undrlyg": [
{
"txInf": [
{
"cxlId": "TransactionId-2046908283",
"orgnlEndToEndId": "endToEndId",
"cxlRsnInf": [
{
"orgtr": {
"nm": "customer-error-name",
"id": {
"orgId": {
"anyBIC": "BSABESBBXXX"
}
}
},
"rsn": {
"cd": "DUPL"
}
}
],
"orgnlTxRef": {
"intrBkSttlmAmt": {
"value": 10.04,
"ccy": "EUR"
},
"pmtTpInf": {
"svcLvl": [
{
"prtry": "SEPA"
}
]
},
"cdtrAgt": {
"finInstnId": {
"bicfi": "BSCHGBM0XXX",
"pstlAdr": {
"twnNm": "Madrid",
"ctry": "ES",
"adrLine": [
"Somewhere in Madrid"
]
}
}
},
"cdtrAcct": {
"id": {
"iban": "GB91BARC20032634945865"
},
"ccy": "EUR"
}
}
}
]
}
]
}
}