On Android payment terminals S1E Barcode, S1E2L, S1F2L, and S1U2 you can use Terminal API requests to:
- Activate the scan button on the terminal so that your staff can scan a single item.
- Cancel scanning to deactivate the barcode scanner and the scan button.
- Specify how much time you want to allow for scanning.
You don't need to set up the scanning button in the Customer Area to use this method.
You can also start a batch scan session to scan multiple barcodes at once.
Requirements
Before you begin, take into account the following requirements, limitations, and preparations.
Requirement | Description |
---|---|
Integration type | A Terminal API integration with payment terminals. |
Hardware | Android terminal models S1E Barcode, S1E2L, S1F2L, or S1U2 that have a barcode scanner. |
Setup steps | Before you begin:
|
How it works
- Your staff scans an item.
- A successful scan deactivates the barcode scanning button, and you receive the barcode content in the admin request response.
- With the logic that you have created, you pass the content from the response to your POS app.
Activate the barcode scanner for a single scan
To activate the barcode scanner for a single scan, you only need to send a request.
-
Create a JSON object with the following data elements:
Parameter Required Description Session
An object with: Id
: your unique reference of the scanning session.Type
: Once activates the barcode scanner.
Operation
An object with: Type
: ScanBarcode.TimeoutMs
: how long the barcode scanner stays on, in milliseconds (from 0 to 30000).
-
Encode the JSON object to Base64.
-
Make a POST request to a Terminal API endpoint, specifying:
-
MessageHeader
: the standardSaleToPOIRequest.MessageHeader
object. Specify:Parameter Required Description ProtocolVersion
3.0 MessageClass
Service MessageCategory
Admin MessageType
Request ServiceID
Your unique ID for this request, consisting of 1-10 alphanumeric characters. Must be unique within the last 48 hours for the terminal ( POIID
) being used.SaleID
Your unique ID for the POS system component to send this request from. POIID
The unique ID of the terminal to send this request to. Format: [device model]-[serial number].
AdminRequest
: the request body. This must include:ServiceIdentification
: the Base64-encoded JSON object.
The terminal operator can now scan a barcode.
-
-
In the response, note:
- If successful, the following fields are returned:
Response.Result
: SuccessAdditionalResponse
: contains the Base64-encoded barcode content.
- If unsuccessful, the following fields are returned:
Response.Result
: FailureErrorCondition
: Cancel, Aborted, UnavailableService, or NotFoundAdditionalResponse
: contains the reason for failure as a Base64-encoded string. Decoding the string results in a message of the following format:{ "message": "Admin ScanBarcode request canceled due to Timeout" }
.
The format of the
AdditionalResponse
can be a Base64-encoded or URL-encoded. To always receive theAdditionalResponse
in one of those formats, contact our Support Team. - If successful, the following fields are returned:
-
If
Response.Result
is Success, decode the Base64-encoded string in theAdditionalResponse
.
Note that this contains:Barcode.Data
: the content of the scanned barcode.Barcode.Symbology
: the format of the scanned barcode. If the symbology is not recognized, the response returnsUNKNOWN
.
For more information on the Terminal API request structure, see the Terminal API fundamentals.
-
You process the content from the response in your POS app with the logic that you have implemented.
If you want to turn off the barcode scanner before the timeout, you need to send a request to cancel the scanning session.
Cancel scanning session
If you want to cancel the activation of the terminal's barcode scanner before the specified timeout, you need to send an AdminRequest
with the Session.Type
End.
-
Create a JSON object with the following data elements:
Parameter Required Description ServiceIdentification.Session
An object with: Id
: the unique reference of the session.Type
: End cancels the scanning session.
-
Encode the JSON object to Base64.
-
Make a POST request to a Terminal API endpoint, specifying:
-
MessageHeader
: the standardSaleToPOIRequest.MessageHeader
object. Specify:Parameter Required Description ProtocolVersion
3.0 MessageClass
Service MessageCategory
Admin MessageType
Request ServiceID
Your unique ID for this request, consisting of 1-10 alphanumeric characters. Must be unique within the last 48 hours for the terminal ( POIID
) being used.SaleID
Your unique ID for the POS system component to send this request from. POIID
The unique ID of the terminal to send this request to. Format: [device model]-[serial number].
AdminRequest
: the request body. This must include:ServiceIdentification
: the Base64-encoded JSON object.
-
-
If the cancel request succeeds, in the
AdminResponse
note:Response.Result
: SuccessAdditionalResponse
: contains the Base64-encoded message. Decoding the string results in a message of the following format:{ "message": "Admin ScanBarcode request was successfully canceled" }
The format of the
AdditionalResponse
can be a Base64-encoded or URL-encoded. To always receive theAdditionalResponse
in one of those formats, contact our Support Team.