Skip to main content

CancelOrRefund

The API method CancelOrRefund cancels or fully refunds a transaction depending on the transaction status. See the API method Refund to perform a partial refund.

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/refund.String127No
merchantKeyMerchnat identifier.String36Yes
customReferencesFor external party usagecustomReferencesObjectNo
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/cancelOrRefund

Header:

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

Response

Status Code:

200 (OK)

Header:

Content-Type: application/json
Accept-Language: en-US
{
"reconciliationReferenceId": "FJ9wbkRjJZsRYCrjgaGGY",
"description": "SMP-Transaction-01",
"paymentStatus": "CANCELED",
"creationDate": "2020-12-15T14:35:44.532Z",
"lastStatusDate": "2020-12-15T14:36:45.031Z",
"transactionOverview": {
"amount": 35.99,
"currencyCode": "EUR",
"mit": false,
"transactionId": "933a0fab-80a0-42c5-b010-c71174f4ab32",
"paymentMethod": "IDEAL",
},
"modification": {
"modificationData": {
"type": "CANCELATION",
"modificationId": "cancel-1234",
"reconciliationReferenceId": "FJ9wbkRjJZsRYCrjgaGGY"
},
"modificationAmount": {
"description": "SMP-CancelOrRefund-01",
"amount": 35.99,
"currencyCode": "EUR"
},
"status": "CANCELED",
"creationDate": "2020-12-15T14:35:44.532Z",
"statusHistory": [
{
"status": "CANCELATION_PENDING",
"statusDate": "2020-12-15T14:36:44.328Z",
"modificationAmount": {
"amount": 35.99,
"currencyCode": "EUR"
}
},
{
"status": "CANCELED",
"statusDate": "2020-12-15T14:36:44.852Z",
"modificationAmount": {
"amount": 35.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.