Cancellation Response To A Prior Outbound Request-To-Pay
Overview
You will receive notification of the outcome of a cancellation request via an outboundRequestToPayCancellationResponse operation. If the cancellation was successful, the status will be indicated as CANCELLED
. Otherwise the status will reflect the current status of the RTP.
Note that if the associated outboundRequestToPay was rejected or had already expired then the outboundRequestToPayCancellationRequest operation will be considered failed even though there was ultimately no payment. This is because the final status of the outboundRequestToPay will be something other than a cancellation - REJECTED
or EXPIRED
. An RTP cancellation will only be deemed successful if the final RTP status has been updated to CANCELLED
.
Implementing the API
Receive Cancellation Response
Electrum sends an outboundRequestToPayCancellationResponse
message to your /transactions/outbound/request-to-pay/cancellation-response
endpoint.
The full message schema can be found in the API reference documentation. Code and payload samples are shown below.
- Partner API sandbox
https://example.com/path/payments/partner-api/v1/transactions/outbound/request-to-pay/cancellation-response
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://example.com/path/payments/partner-api/v1/transactions/outbound/request-to-pay/cancellation-response \
-H 'Content-Type: application/json' \
-H 'traceparent: string' \
-H 'tracestate: string' \
-d '{
"status": {
"status": "CANCELLED"
},
"schema": "RequestToPayCancellationResponse",
"messageIdentifiers": {
"messageIdentification": "336b84c5592c3ebfa5553f6e191b6eaa",
"creationDateTime": "2022-05-04T03:05:10Z"
},
"originalMessageIdentifiers": {
"messageIdentification": "8fd51c7124ba4819b9253e296a68e1da",
"creationDateTime": "2022-05-04T03:02:01Z"
},
"originalTransactionIdentifiers": {
"endToEndIdentification": "6249118655591098",
"transactionIdentification": "RRN000000001",
"uetr": "f27a34ad-c5ab-4b70-a3f9-946d743eaeaa"
}
}'
No content
Respond With Success
If you receive the message successfully and are able to process it, then respond with an HTTP 202
status. Process the message as per Step 3.
Respond With An Error
If you experience an error while handling the request and are unable to submit it for asynchronous processing, then respond with an appropriate error response.