Cancel or Refund
POST/payment/cancelOrRefund
Cancels or fully refunds a transaction depending on the transaction status.
Please refer to the API method Refund to perform a partial refund.
Request
Header Parameters
Must be application/json
Must be be en-US
The origin of the request
The client making the request
- application/json
- Body
- Example
Bodyrequired
Unique transaction identifier.
Possible values: <= 36 characters
Your unique reference for the requested modification. Used to distinguish between retry and new modification.
Possible values: <= 64 characters
Description of the reason for the cancel/refund.
Possible values: <= 127 characters
Merchant identifier.
Possible values: <= 36 characters
customReferences object
For external party usage. Please refer to Data Model for more details.
generic custom reference
Possible values: <= 255 characters
generic custom reference
Possible values: <= 255 characters
generic custom reference
Possible values: <= 255 characters
{
"transactionId": "933a0fab-80a0-42c5-b010-c71174f4ab32",
"modificationId": "f7c55bb3-0002-4363-9a33-56af8d5e691e",
"description": "SMP-CancelOrRefund-01",
"merchantKey": "31928de9-1344-469f-b0eb-8e5d0fef3d21"
}
Responses
- 200
- 400
- 401
- 403
- 404
- 500
Successful cancellation
- application/json
- Schema
- Example (auto)
- Example
Schema
- Array [
- ]
- Array [
- ]
External payment provider unique transaction identifier.
Within SmartPay, each order on your side is represented by one checkout transactionID. You may use this transactionID to perform the initial checkout, retrieve an overall status or for later modifications, like manual capture or refunds.
On the payment side, this may lead to multiple financial transactions, e.g., one payment transaction about the captured amount (which will be settled to your account), and later a refund transaction (which will be debited from your account / deducted from your payout).
The reconciliationReferenceId has been introduced to allow you to keep track of those financial transactions, as it represents the financial transactionID, as you would see it in the payment provider's merchant portal (e.g., our Merchant Panel) or settlement files.
QixTLEO28YngDAUuaUEOiTransaction description, as specified by you in the checkout API request.
4 pcs windscreen wipersCurrent payment status of the initial transaction. Please refer here for more information.
Possible values: [CREATED, CAPTURED, AUTHORIZATION_PENDING, AUTHORIZATION_COMPLETED, FAILED, CAPTURE_PENDING, CANCELLATION_PENDING, EXPIRED, CANCELLED, SETTLED, CHARGEBACK]
CAPTUREDTransaction creation date and time.
2020-12-15T14:38:59.150ZTransaction status changing date and time
2020-12-15T14:40:25.008ZTransaction identifier provided by the merchant
GHssjkauhdaku658702transactionOverview objectrequired
The unique identifier of the transaction generated on transaction creation.
Possible values: <= 36 characters
123e4567-e89b-12d3-a456-426614174000paymentProviderResponse sent in the Complete Autorize response in case of error.
Transaction modification amount
Possible values: Value must match regular expression ^\d{1,18}\.\d{2}$
falseTransaction modification currency. The 3-letter currency ISO-4217 code.
EURcustomReferences object
For external party usage. Please refer to Data Model for more details.
generic custom reference
Possible values: <= 255 characters
generic custom reference
Possible values: <= 255 characters
generic custom reference
Possible values: <= 255 characters
Unique customer identifier
john-doe-27deal object
Details of the deal. Used only for 3RI payments (Partial or split shipment and Delayed shipment use cases).
The total amount of the deal. The sum of all payments with the same dealReference may not exceed this amount. Used only for Split Shipment flow.
Possible values: >= 0.01, Value must match regular expression ^\d{1,18}\.\d{2}$
19.99Deal identifier.
Possible values: <= 21 characters
rJIUUztdDPPqh4Zaw98pqDeal type
Possible values: <= 6 characters, [3RIPSS, 3RIDS]
3RIPSSFlag to show if created transaction relates to merchant-initiated transactions.
falseUsed payment option code. Please refer to the Data Model for more information.
Payment option CARDS is returned by SmartPay in case the actual card brand has not been selected by the consumer yet or if it could not be determined.
CARDSDisplays the origin flag marked upon creation of the transaction.
Possible values: [HOSTED_PAYMENT_PAGE, PAYMENT_AUTHORIZE_S2S, CHECKOUT, SUBSCRIPTION_MIT, MERCHANT_MIT]
CHECKOUTIf provided, the payment is processed in favour of the indicated submerchant account, and the main merchant account number is ignored.
123456789External payment provider reference of the Pre-Payment or Payment Upon Invoice. To be sent each time there is a value present in the data source.
THNkjjkfdhjk7798798modification objectrequired
Array of all performed transaction modifications.
Date and time of the modification processing start.
error errorBadRequestExternal
indicates at which level of processing the error appeared
Possible values: [gateway_processing, payment_provider_processing]
errorDetails object
Additional error details, as received from the third party
Error message returned by payment gateway
Possible values: <= 400 characters
Error message returned by payment provider
Possible values: <= 400 characters
Date and time of the modification processing completion.
modificationAmount object
The payment amount to be charged against the payment option.
Transaction modification amount
Possible values: >= 0.01, Value must match regular expression ^\d{1,18}\.\d{2}$
49.99Transaction modification currency. The 3-letter currency ISO-4217 code
Possible values: >= 3 characters and <= 3 characters
EURA terse description of the good or service being sold i.e., the reason for the payment
Possible values: <= 127 characters
windscreen wipers 4 pcsmodificationData object
Additional details of the modification
SmartPay internal unique identifier for cancel request.
SmartPay internal unique identifier for capture request.
customReferences object
A list of custom references submitted by the merchant along with a modification request (e.g., Capture, Cancel, Refund). Can be different from the customReference value provided in the Create Checkout API.
generic custom reference
Possible values: <= 255 characters
generic custom reference
Possible values: <= 255 characters
generic custom reference
Possible values: <= 255 characters
For external party usage.
abcd123paymentSplitResults object[]
Defines destinations for which the payment was split and their results.
Transaction modification amount
Possible values: >= 0.01, Value must match regular expression ^\d{1,18}\.\d{2}$
49.99Transaction modification currency. The 3-letter currency ISO-4217 code
Possible values: >= 3 characters and <= 3 characters
EURA terse description of the good or service being sold i.e., the reason for the payment
Possible values: <= 127 characters
windscreen wipers 4 pcsDestination merchant account alias
Possible values: <= 127 characters
destination-ref-1In case of a failed Debit Account or Refund request, contains error description in the following format [ {'responseCode'} ] {responseDescription}.
Unique reference of the split transaction received in response of Debit Account or Refund.
Mapped to responseCode received from Debit Account or Refund. If the code returns 0000, it is a SUCCESS, otherwise it's ERROR.
Possible values: <= 127 characters
Message in case of error during KC Program refund.
Stores the refund reference in case the merchant to program refund was successful.
Reflects the status of the refund from merchant to program level in SmartPay - success/error.
External provider unique transaction identifier - unique reference for capture or cancel and refund unique reference for refund.
SmartPay internal unique identifier for refund request.
Type of the performed transaction modification.
Possible values: [CAPTURE, CANCELATION, CHARGEBACK, SETTLEMENT, REFUND]
CAPTUREActualized transaction or refund status after the performed modification.
statusHistory object[]
Text message explaining the error issue
modificationAmount objectrequired
Transaction modification amount
Possible values: >= 0.01, Value must match regular expression ^\d{1,18}\.\d{2}$
49.99Transaction modification currency. The 3-letter currency ISO-4217 code
Possible values: >= 3 characters and <= 3 characters
EURA terse description of the good or service being sold i.e., the reason for the payment
Possible values: <= 127 characters
windscreen wipers 4 pcsSmartPay code of the payment option used.
VISAstored payment option reference
8ac7a4a18d43bde5018d44ede3d21db5Status of the transaction modification or initial payment transaction.
Modification transaction status changing date and time.
{
"reconciliationReferenceId": "QixTLEO28YngDAUuaUEOi",
"description": "4 pcs windscreen wipers",
"paymentStatus": "CAPTURED",
"creationDate": "2020-12-15T14:38:59.150Z",
"lastStatusDate": "2020-12-15T14:40:25.008Z",
"partnerReference": "GHssjkauhdaku658702",
"transactionOverview": {
"transactionId": "123e4567-e89b-12d3-a456-426614174000",
"acquirerResponse": "string",
"amount": false,
"currencyCode": "EUR",
"customReferences": {
"custom1": "string",
"custom2": "string",
"custom3": "string"
},
"customerAccountId": "john-doe-27",
"deal": {
"amount": 19.99,
"dealReference": "rJIUUztdDPPqh4Zaw98pq",
"typeCode": "3RIPSS"
},
"mit": false,
"paymentMethod": "CARDS",
"paymentOrigin": "CHECKOUT",
"targetMerchantAccountReference": 123456789
},
"transactionReference": "THNkjjkfdhjk7798798",
"modification": {
"creationDate": "2024-07-29T15:51:28.071Z",
"error": {
"error": "gateway_processing",
"errorDetails": {
"context": {},
"gatewayDescription": "string",
"paymentProviderDescription": "string"
}
},
"lastStatusDate": "2024-07-29T15:51:28.071Z",
"modificationAmount": {
"amount": 49.99,
"currencyCode": "EUR",
"description": "windscreen wipers 4 pcs"
},
"modificationData": {
"cancelId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"captureId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"customReferences": {
"custom1": "string",
"custom2": "string",
"custom3": "string"
},
"modificationId": "abcd123",
"paymentSplitResults": [
{
"destinationReference": "destination-ref-1",
"error": "string",
"splitUniqueReference": "string",
"status": "string",
"amount": 49.99,
"currencyCode": "EUR",
"description": "windscreen wipers 4 pcs"
}
],
"programRefundErrorMessage": "string",
"programRefundId": "string",
"programRefundStatus": "string",
"reconciliationReferenceId": "string",
"refundId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"type": "CAPTURE"
},
"status": "string",
"statusHistory": [
{
"error": "string",
"modificationAmount": {
"amount": 49.99,
"currencyCode": "EUR",
"description": "windscreen wipers 4 pcs",
"option": "VISA",
"storedPaymentOptionReference": "8ac7a4a18d43bde5018d44ede3d21db5"
},
"status": "string",
"statusDate": "2024-07-29T15:51:28.071Z"
}
]
}
}
{
"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"
}
}
]
}
}
Bad Request
For error handling, please refer to this section.
- application/json
- Schema
- Example (auto)
- Example
Schema
- string
- string[]
errorDetails object
message object
{
"error": "string",
"errorDetails": {
"context": {},
"gatewayDescription": "string",
"paymentProviderDescription": "string"
},
"message": "string"
}
{
"traceId": "00-1234567890abcdef0123456789abcdef-0123456789abcdef-00",
"errors": [
{
"message": "Value out of bounds. Value must be between 1 and 100",
"code": "value_out_of_bounds",
"property": "someField",
"context": {
"minimum": 1,
"maximum": 100
}
}
]
}
Unauthenticated
For error handling, please refer to this section.
- application/json
- Schema
- Example (auto)
- Example
Schema
- string
- string[]
errorDetails object
message object
{
"error": "string",
"errorDetails": {
"context": {},
"gatewayDescription": "string",
"paymentProviderDescription": "string"
},
"message": "string"
}
{
"traceId": "00-1234567890abcdef0123456789abcdef-0123456789abcdef-00",
"errors": [
{
"message": "You are not authenticated to perform this request.",
"code": "unauthorized"
}
]
}
Forbidden
For error handling, please refer to this section.
- application/json
- Schema
- Example (auto)
- Example
Schema
- string
- string[]
errorDetails object
message object
{
"error": "string",
"errorDetails": {
"context": {},
"gatewayDescription": "string",
"paymentProviderDescription": "string"
},
"message": "string"
}
{
"traceId": "00-1234567890abcdef0123456789abcdef-0123456789abcdef-00",
"errors": [
{
"message": "You do not have permissions to perform this request.",
"code": "forbidden"
}
]
}
Not Found
For error handling, please refer to this section.
- application/json
- Schema
- Example (auto)
- Example
Schema
- string
- string[]
errorDetails object
message object
{
"error": "string",
"errorDetails": {
"context": {},
"gatewayDescription": "string",
"paymentProviderDescription": "string"
},
"message": "string"
}
{
"traceId": "00-1234567890abcdef0123456789abcdef-0123456789abcdef-00",
"errors": [
{
"message": "Resource not found.",
"code": "not_found"
}
]
}
Internal Server Error
For error handling, please refer to this section.
- application/json
- Schema
- Example (auto)
- Example
Schema
- string
- string[]
errorDetails object
message object
{
"error": "string",
"errorDetails": {
"context": {},
"gatewayDescription": "string",
"paymentProviderDescription": "string"
},
"message": "string"
}
{
"traceId": "00-1234567890abcdef0123456789abcdef-0123456789abcdef-00",
"errors": [
{
"message": "Internal server error."
}
]
}