Skip to main content

Cancel

Cancel API method cancels an authorized but non-captured transaction. Blocked funds on the consumers funding source are released.

API Parameters

FieldDescriptionTypeLengthMandatory
transactionIdUnique transaction identifier.String36Yes
modificationIdYour unique reference for the requested modification. Used to distinguish between retry and new modification.String64Yes
descriptionDescription of the i.e. the reason for the cancel.String127No
merchantKeyMerchant identifier.String36Yes
customReferencesFor external party usagecustomReferencesObjectNo
info

In retry situations, please make sure to always use the same modificationID as provided in the initial request. SmartPay uses the modificationID to recognize retries and will always provide you this the same result as in the initial request posted with the same modificationID.

info

The request must have the following headers:

  • Content-Type: application/json
  • Accept-Language: en-US
  • Origin: { Origin }

Example

Request

Path:

POST {Base URL}/payment/cancel

Header:

Content-Type: application/json
Accept-Language: en-US
{
"transactionId": "933a0fab-80a0-42c5-b010-c71174f4ab32",
"modificationId": "f7c55bb3-0002-4363-9a33-56af8d5e691e",
"description": "SMP-Cancel-01",
"merchantKey": "31928de9-1344-469f-b0eb-8e5d0fef3d21"
}

Response

Status Code:

200 (OK)

Header:

Content-Type: application/json
Accept-Language: en-US
{
"reconciliationReferenceId": "CpdDbgEGIX8hmo8lJwwse",
"description": "Purchase 1x product ABC",
"paymentStatus": "CANCELLED",
"creationDate": "2020-12-16T08:09:19.296Z",
"lastStatusDate": "2020-12-16T08:10:46.797Z",
"transactionOverview": {
"amount": 10.99,
"currencyCode": "EUR",
"mit": false,
"transactionId": "933a0fab-80a0-42c5-b010-c71174f4ab32",
"paymentMethod": "CARDS"
},
"modification": {
"modificationData": {
"type": "CANCELLATION",
"modificationId": "f7c55bb3-0002-4363-9a33-56af8d5e691e",
"reconciliationReferenceId": "CpdDbgEGIX8hmo8lJwwse"
},
"modificationAmount": {
"description": "SMP-Cancel-01",
"amount": 10.99,
"currencyCode": "EUR"
},
"status": "CANCELLED",
"creationDate": "2020-12-16T08:09:19.296Z",
"statusHistory": [
{
"status": "CANCEL_PENDING",
"statusDate": "2020-12-16T08:10:45.790Z",
"modificationAmount": {
"amount": 10.99,
"currencyCode": "EUR"
}
},
{
"status": "CANCELLED",
"statusDate": "2020-12-16T08:10:46.737Z",
"modificationAmount": {
"amount": 10.99,
"currencyCode": "EUR"
}
}
]
}
}
info

We unified the modification API responses. Please refer to the modification API response model for further details on API responses and error handling.