ExternalCancel
/ExternalCancel method is used by the third-party server to cancel a transaction that has been authorized but not yet settled. Cancellation is necessary if a failure occurs during the interaction or on the third-party server. This process is vital for releasing any funds captured on the consumer’s payment card.
While the API method is always /ExternalCancel, the financial terminology depends on the machine flow type:
- Pre-Authorization Flow: This method is called to as a “Cancel”.
- Pre-Selection Flow: This the method is referred a “Void”.
Identifying the Transaction
To successfully cancel a transaction, your request must include the three required identifiers that exactly match the original transaction data.- NayaxTransactionID: The unique ID generated during authorization.
- SiteID: The identifier for the machine’s location.
- MachineAuTime: The exact authorization timestamp. Optional field but recommended
- MachineAUTime is currently not available for Marshall machines due to Transfer Data not providing this information to the machine (hence the 3rd party servers would not have this information when trying to send the ExternalCancel)
Troubleshooting Declined Cancellations
If a cancellation request is declined, the response will return ErrorCode 51: “External Cancel Failed”.- Mandatory Use: You must send an
ExternalCancelimmediately if you know no product or service will be provided. - Consumer Impact: If not canceled, consumer funds will remain captured, leading to a poor user experience and potential disputes.
- Audit Trail: It is recommended to include a
ReasonCodeandReasonText(e.g., “75 - Service not provided”) to document why the transaction was voided.
Body
Request details for canceling an external payment transaction (e.g., voiding a pre-authorization).
Nayax Internal Unique identifier for the transaction being cancelled.
987654321
Spark Unique identifier for this transaction.
"f8e7d6c5-b4a3-2109-fedc-ba9876543210"
Optional. Indication for the Nayax Engine in which Site the transaction originated. Echo value from Authorization Callback.
2
The date time string of when the /Authorization or /Sale took place, in local (machine) time.
"20251212110000500"
Unique Identifier for the Nayax Terminal.
255"NX0087654321"
Indicates the type of TerminalId. 1 - Nayax HW serial, 2 - Nayax Machine ID
1, 2 1
Indicates which cancellation flow is implemented. 1 - Pre-Authorization Cancel, 2 - Pre-Selection Void
1, 2 1
Conditional. Cancel reason code.
"01"
Conditional. Detailed description or text of the cancel reason. Either ReasonCode or ReasonText must be provided. ExternalCancel request without both will cause failure.
"User requested cancellation"
Always mandatory. Amount to be cancelled. Can’t be higher than the authorized amount.
5
Response
Success
Response details for an external transaction cancellation request.
The Spark unique identifier for this transaction.
"f8e7d6c5-b4a3-2109-fedc-ba9876543210"
The status of the cancellation request.
For Credit card implementation, when the transaction is approved, this is the External (usually Card issuer's) Authorization Code.
"D4E5F6"
The date time string of when the /Authorization or /Sale took place, in local (machine) time.
"20251212110000500"