Skip to main content

Documentation Index

Fetch the complete documentation index at: https://devzone.nayax.com/llms.txt

Use this file to discover all available pages before exploring further.

The authorize method places a financial hold (pre-authorization) on a previously identified card. This represents the second phase of a two-step transaction, occurring after a successful cardDetect call. Use this method to:
  • Guarantee payment by reserving a maximum dollar amount before the fueling session begins.
  • Verify card validity and fund availability before the pump is activated.
  • Capture a final amount that is less than or equal to the initial hold.
Example of the authorization prompt on a Nayax device: Authorize

Requests

This command relies on the card data stored in the terminal’s session buffer from the preceding detection phase. A data object is not required, but optional fields can be included to pass product and user context to the terminal. The following example shows a minimal request:
{
"command": "authorize",
"requestId": "req-002"
}
The following example shows a request with optional data fields:
{
"command": "authorize",
"requestId": "req-002",
"data": {
"products": ["Diesel", "Unleaded", "CNG"],
"userData": ["NYX-1234", "932747"]
}
}

Parameter Definitions

The table below describes the fields for the authorization request:
NameTypeRequiredDescription
commandstringYesSet to "authorize".
requestIdstringYesA unique identifier for tracking the response.
productsarray of stringsNoList of allowed product names (e.g., ["Diesel", "Unleaded"]).
userDataarray of stringsNoArbitrary user data to associate with the transaction, such as plate number or odometer reading.

Responses

The terminal returns a response after communicating with the financial gateway. A successful response contains the transactionId, which is mandatory for the subsequent settlement. The following example shows a typical response:
{
"requestId": "req-002",
"data": {
"transactionId": "TXN-20260113-003000",
"authorizedAmount": 50000,
"state": "AUTHORIZED",
"cardBrand": "MASTERCARD",
"cardEntryMode": "CHIP",
"maskedPan": "************5678",
"aid": "A0000000031010"
}
}

Response Parameters

Below are the parameters returned in the data object upon a successful authorization:
NameTypeDescription
transactionIdstringThe unique ID for this authorized hold. Save this value for the settle command.
authorizedAmountintegerThe exact amount approved and held by the bank (refer to decimalPlace).
statestringReturns AUTHORIZED upon success.
cardBrandstringThe brand of the card used (e.g., MASTERCARD).
cardEntryModestringThe method used to read the card (e.g., CHIP).
maskedPanstringThe masked card number for logging and receipt printing.
aidstringThe Application Identifier for the EMV transaction.