Cancel payment
Use case
In this example, we will review how to cancel a payment draft.
Use case data
API parameters with values
We will cancel the PAYM-21736 payment.
...api/v3/payments/PAYM-21736...
An optional comment.
"comment": "Cancel payment"Sample API call
To cancel the payment, use the following endpoint:
https://payment-api.sandbox.tuumplatform.com/api/v3/payments/{paymentId}/cancel
Sample request
The sample request body is as follows:
"comment": "Cancel payment"curl --location 'https://payment-api.sandbox.tuumplatform.com/api/v3/payments/PAYM-21736/cancel' \
--header 'x-channel-code: SYSTEM' \
--header 'x-auth-token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiSm9obiBPZmZpY2VyIiwiZW1wbG95ZWVJZCI6IjEiLCJ0ZW5hbnRDb2RlIjoiTUIiLCJleHBpcnlEVGltZSI6IjIwMjQtMTItMDJUMTM6MjU6MzEiLCJleHAiOjE3MzMxNDU5MzEsInJvbGVzIjpbIkFETUlOIiwiUE9TVElOR1NfVEVBTSJdfQ.W9yv0iAmm3QoQILoCJit9uZbp10kSRQsWoIq9spDG2w' \
--header 'Content-Type: application/json' \
--data '"comment": "Cancel payment"'Sample response
Below you will find the response to the sample request:
Result
The payment with the paymentId: PAYM-21736 has been set to the CANCELLED status.
Last updated
Was this helpful?