Cancel A Prior Outbound Request-To-Pay
Overview
This operation instructs Electrum to notify an industry participant to cancel a prior outboundRequestToPay operation if the transaction has not yet been completed. This does not guarantee a successful cancellation, however, as the requested payment may already have been paid, been rejected, or expired.
Implementing the API
Send Cancellation Request
Send an outboundRequestToPayCancellationRequest
message to the /transactions/outbound/request-to-pay/cancellation-request
endpoint.
The full message schema can be found in the API reference documentation. Code and payload samples are shown below.
- Payments API sandbox
https://example.com/path/payments/api/v1/transactions/outbound/request-to-pay/cancellation-request
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://example.com/path/payments/api/v1/transactions/outbound/request-to-pay/cancellation-request \
-H 'Content-Type: application/json' \
-H 'traceparent: string' \
-H 'tracestate: string' \
-d '{
"reasonCode": "CUST",
"schema": "RequestToPayCancellation",
"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
Receive Acknowledgement
Electrum will respond with an HTTP 202
status if the request can be processed successfully, or an error response if a problem occurs.
Timeout
If you don't receive any response from Electrum — this may happen because of a networking issue or other technical error — then you may retry the request. The recommended procedure is to retry the operation with the same payload up to 3 times at 1 second intervals, until you receive a 202
response.
The outboundRequestToPayCancellationRequest
operation is idempotent. This means it is safe for you to send retries. If Electrum has already received the original message, then a retry of the same message will be recognised as a duplicate and will not affect the processing of the transaction.