Skip to main content
POST
/
CancelTransaction
CancelTransaction
curl --request POST \
  --url https://{domain}/api/CancelTransaction \
  --header 'Content-Type: application/json' \
  --data '
{
  "NayaxTransactionId": 123,
  "SparkTransactionId": "<string>",
  "SiteId": 123,
  "MachineAuTime": "<string>",
  "TerminalId": "<string>",
  "TerminalIdType": 123,
  "CancellationType": 123,
  "ReasonCode": 123,
  "ReasonText": "<string>",
  "CancelAmount": 123
}
'
{
  "SparkTransactionId": "<string>",
  "Status": {
    "Verdict": "<string>",
    "ErrorDescription": "<string>",
    "ErrorCode": 123
  },
  "CardBrand": "<string>",
  "CardLast4Digits": "<string>",
  "AuthCode": "<string>",
  "MachineAuTime": "<string>",
  "AuTime": "<string>",
  "CancelTime": "<string>",
  "CurrencyCode": "<string>",
  "CurrencyNumeric": "<string>",
  "FiscalRrn": "<string>",
  "NayaxRRN": "<string>"
}
The /CancelTransaction endpoint is a POST request that allows you to cancel a transaction currently in progress. This method is referred to as “Cancel” in the Pre-Authorization flow and “Void” in the Pre-Selection flow.

Body

application/json

The request to cancel a transaction.

The request body for canceling a transaction. This is used to cancel a pre-authorized transaction or void a pre-selected one, providing details such as the transaction ID, the reason for cancellation, and the amount.

NayaxTransactionId
integer<int64>

The unique transaction ID assigned by Nayax, provided in the /TransactionCallback.

SparkTransactionId
string

The unique session ID from the initial /StartAuthentication request.

SiteId
integer<int16>

The ID of the site where the transaction occurred.

MachineAuTime
string

The timestamp of the cancellation from the device in its local timezone. The format is yyyyMMddHHmmssSSS.

TerminalId
string

The serial or external ID of the terminal used.

Maximum string length: 255
TerminalIdType
integer<int32>

Defines the type of ID used for the TerminalId parameter. Use 1 for the HW Serial or 2 for the Nayax Machine ID.

CancellationType
integer<int32>

Indicates which cancellation flow is being implemented. Use 1 for a Pre-Authorization Cancel or 2 for a Pre-Selection Void.

ReasonCode
integer<int16>

The internal code explaining the reason for the cancellation.

ReasonText
string | null

A human-readable explanation of the cancellation reason. This parameter is optional.

CancelAmount
number<double>

The amount to be canceled in major currency units (e.g., dollars or euros).

Response

200 - application/json
object | null

Success. The transaction has been successfully canceled.

The response object for a canceled transaction, confirming the outcome of the cancellation and providing key details such as transaction identifiers, timestamps, and payment information.

SparkTransactionId
string | null

The ID of the canceled session.

Status
object

An object containing the final verdict of the cancellation and a descriptive message.

CardBrand
string | null

The brand of the card used for the transaction (e.g., "Visa", "MasterCard").

CardLast4Digits
string | null

The last four digits of the card used.

AuthCode
string | null

The authorization code for the cancellation.

MachineAuTime
string | null

The timestamp of the cancellation from the device, in the format yyyyMMddHHmmssSSS.

AuTime
string | null

The timestamp from the authorization server.

CancelTime
string | null

The server timestamp of the cancellation confirmation, in the format yyyyMMddHHmmssSSS.

CurrencyCode
string | null

The ISO currency code (e.g., "EUR").

CurrencyNumeric
string | null

The ISO numeric currency code (e.g., "978" for EUR).

FiscalRrn
string | null

The fiscal reference number for the receipt or audit trail.

NayaxRRN
string | null

The Nayax reference number of the transaction.