POST api/payments/requests/{paymentId}/cancel
Records that the payment failed or was cancelled on the terminal: the request becomes a payment failure, with the error and the terminal's response in its log. Safe to repeat: if the request has already been cancelled, the existing failure is returned. Responses: 200 with the failure. 404 if there's no such request. 409 if the payment has already been confirmed.
Request Information
URI Parameters
| Name | Description | Type | Additional information |
|---|---|---|---|
| paymentId |
The payment request's PaymentId. |
globally unique identifier |
Required |
Body Parameters
The error and the terminal's response.
PaymentRequestCancellationDT| Name | Description | Type | Additional information |
|---|---|---|---|
| FailureLog |
The error, for the payment failure's log. |
string |
None. |
| ResponseData |
The terminal's raw response, if there was one. |
string |
None. |
Request Formats
application/json, text/json
Sample:
{
"failureLog": "sample string 1",
"responseData": "sample string 2"
}
Response Information
Resource Description
The payment failure.
PaymentFailureDT| Name | Description | Type | Additional information |
|---|---|---|---|
| PaymentId | globally unique identifier |
None. |
|
| PaymentReference | string |
None. |
|
| UserId | globally unique identifier |
None. |
|
| ContextUserId | globally unique identifier |
None. |
|
| SessionId | globally unique identifier |
None. |
|
| PaymentTypeId | string |
None. |
|
| PaymentFailureLog | string |
None. |
|
| PaymentTimeStamp | date |
None. |
|
| PaymentFeeAmount | decimal number |
None. |
|
| HardwareId | string |
None. |
|
| PaymentRecipientId | globally unique identifier |
None. |
|
| CardType | string |
None. |
|
| PaymentNetAmount | decimal number |
None. |
|
| LedgerCode | string |
None. |
|
| RequestData | string |
None. |
|
| IsSaved | boolean |
None. |
Response Formats
application/json, text/json
Sample:
{
"paymentId": "ed3399f2-de7d-43a7-adab-392ef06214b7",
"paymentReference": "sample string 2",
"userId": "f8d624d0-6bab-47da-bb64-3b0a5d8efca0",
"contextUserId": "1fd6bf8c-0642-49d2-9491-2a003d630938",
"sessionId": "e0aa14e0-d800-4e3f-b015-72cf8a10e710",
"paymentTypeId": "sample string 6",
"paymentFailureLog": "sample string 7",
"paymentTimeStamp": "2026-11-04T14:41:43.998028+00:00",
"paymentFeeAmount": 9.0,
"hardwareId": "sample string 10",
"paymentRecipientId": "d444b2e4-0ee9-4996-8283-56f9b8d7fa95",
"cardType": "sample string 12",
"paymentNetAmount": 13.0,
"ledgerCode": "sample string 14",
"requestData": "sample string 15",
"isSaved": true
}