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 displayConfirm method presents the customer with a binary choice on the terminal screen. This serves as a streamlined way to handle user consent or simple decision points within the transaction flow. Use this method to:
  • Ask for agreement on terms, such as “Do you agree to a $100 pre-authorization hold?”
  • Confirm physical actions, like “Is the nozzle back in the holster?”
  • Prompt the user for receipt preferences, such as “Would you like a printed receipt?”
  • Offer quick prompts for additional services, like “Add a car wash for $5.00?”
Examples of the two-choice option prompts on a Nayax device:

Requests

The request requires a title and the text for the specific prompt. You can customize the labels of the two buttons to fit your specific use case. The following example shows a typical request:
{
"command": "displayConfirm",
"requestId": "req-010",
"data": {
"title": "Do You Want A Receipt?",
"yesLabel": "Pay at pump",
"noLabel": "Pay in store",
"yesImage": "payatpump",
"noImage": "payinstore"
}
}

Parameter Definitions

The table below describes the parameters available for this request:
NameTypeRequiredDescription
commandstringYesSet to "displayConfirm".
requestIdstringYesA unique identifier for tracking the response.
titlestringYesThe header text displayed at the top of the confirmation box.
messagestringYesThe specific question or prompt text shown to the user.
confirmLabelstringNoThe text for the affirmative button (Defaults to “Yes” or “OK”).
cancelLabelstringNoThe text for the negative button (Defaults to “No” or “Cancel”).
This is a text only request example:
{
"command": "displayConfirm",
"requestId": "req-010",
"data": {
"title": "Confirm Amount",
"yesLabel": "Confirm",
"noLabel": "Cancel"
}
}
This is an image only request example:
{
"command": "displayConfirm",
"requestId": "req-011",
"data": {
"title": "Choose Payment Method",
"yesImage": "payatpump",
"noImage": "payinstore"
}
}
This is a text and image request example:
{
"command": "displayConfirm",
"requestId": "req-012",
"data": {
"title": "Select Service",
"yesLabel": "Pay at Pump",
"noLabel": "Pay in Store",
"yesImage": "payatpump",
"noImage": "payinstore"
}
}

Responses

The terminal returns the user’s choice immediately after a button is pressed. The following example shows a typical response:
{
"requestId": "req-010",
"data": {
"selectedIndex": 0
}
}

Response Parameters

The data object contains the outcome of the confirmation prompt:
NameTypeDescription
confirmedbooleanReturns true if the user selected the affirmative button, and false otherwise.
statestringReturns COMPLETED upon a button press or CANCELLED if the user timed out.