Void or Cancel


The Void and Cancel requests both reverse a transaction, but their use depends critically on the original transaction's status. Both operations use the same request structure but differ in their RequestType.

📘

Settled Transactions

If the transaction has already been captured and the settlement batch is closed (e.g., it's the next day), a Void is not possible. You must use a Refund request instead.

Request

The Refund request uses the same endpoint as the initial /charge-token request. The API determines it's a settlement based on the RequestType value within the BasicInfo object.

See the example below:

{
  "basicInfo": {
    "requestType": 4,          // Example: 4 for Cancel OR 5 for Void
    "entryMode": 1,
    "amount": 25.00,           // The full amount of the original transaction
    "currency": "EUR",
    "countryCode": "DE",
    "tokenModel": 1,
    "cvc": null,
    "token": null,
    "merchantRequestId": "NEW_CANCEL_VOID_ID_003", // New unique ID for this reversal request
    "transactionId": "ORIGINAL_NAYAX_TRX_98765", // ID of the original transaction being reversed
    "transactionTimeUtc": "2025-08-28T10:30:00Z", // Time of the original transaction
    "isSaveTokenWithoutConsent": false
  },
  "machineInfo": {
    "machineId": "0434334921100366"
  },
  "cardHolderInfo": {},
  "paymentInfo": {},
  "additionalInfo": {},
  "validationKey": "AUTH_VALID_KEY_XYZ_REVERSAL"
}

Note that the RequestType is set to the value corresponding to a Refund (e.g., 3). The Amount specifies the refund amount (which can be less than the original capture amount for a partial refund).

Request Parameters

The following table highlights the critical fields used to define a Refund request:

ParameterTypeDescription
RequestTypeInt324 for Cancel ot 5 for Void.
AmountDecimalMust be the full amount of the original authorization/sale.
MerchantRequestIdStringA new, unique ID for this specific reversal attempt.
TransactionIdStringThe unique Nayax ID returned in the original response.
TransactionTimeUtcDateTimeThe UTC timestamp of the original transaction.
ValidationKeyStringCryptographic key to authenticate this specific reversal request.

Response

A successful validation returns a 200 OK status and a body containing the validated merchant details:

{
  "status": {
    "verdict": "Approved",
    "code": 0,
    "statusMessage": "Payment processed successfully."
  },
  "basicInfo": {
    "amount": 25.5,
    "currency": "EUR",
    "merchantRequestId": "MERCHANT_MIT_001",
    "transactionId": "NAYAXTRANS98765",
    "transactionTimeUtc": "2025-08-28T10:30:00Z"
  },
  "paymentInfo": {
    "amount": 25.5,
    "currency": "EUR",
    "nayaxTokenId": "NAYAXTOK12345",
    "siteId": 1,
    "providerTransactionId": "PSP_TRANS_ABC",
    "decimalPlace": 2
  }
}

Response Parameters

The table below describes the parameters of the response:

ParameterTypeDescription
verdictStringApproved or Declined. The final decision.
codeInt32Response code: 0 for approved otherwise, the relevant decline code.
statusMessageStringA descriptive message about the transaction outcome.
amountDecimalThe transaction amount processed.
currencyStringThe currency of the transaction.
merchantRequestIdStringThe unique ID from the original request.
transactionIdStringThe unique transaction ID assigned by the Nayax system.
transactionTimeUtcDateTimeThe UTC timestamp when the transaction was completed.
nayaxTokenIdStringThe token ID used for the charge.
siteIdInt32The site ID associated with the payment.
providerTransactionIdStringThe unique ID assigned by the Payment Service Provider (PSP).
decimalPlaceInt32The number of decimal places used for the currency/amount.