The Scanning API is also a RESTful endpoint residing on the target terminal, however it consists solely of GET requests with appropriate parameters as detailed below. Furthermore, the API is intended to capture barcode and QR code data ONLY and will return this data as a Base64 encoded string.
/scan API Request
HTTPS GET request should be sent to the above URL with the following parameters:
|POST /scan - Query String Parameters|
|Field Name||State||Data Type||Description|
This is the Serial Number of the terminal that should print the request. This is printed on a label on the rear of the device.
|preferFrontCamera||Optional||Boolean||Determines whether the scanner should use the Front Camera (if available). Set to true to use the front-facing camera.|
Default = false.
|timeoutSec||Optional||Integer||Determines how long in seconds to wait for the scanner before cancelling the request.|
Default = 60 seconds.
|POST /transaction - Header Parameters|
|Authorization||Mandatory||String||This field should be populated with a value of|
/scan API Response
If properly formatted, you will receive a
200 HTTP response with the following fields:
|GET /scan - Response|
|Field Name||Data Type||Description|
|resultCode||Integer||The outcome of the Scan attempt. Can be one of the following values:|
|data||String||Base64 encoded barcode/QR results.|
In the event of an unsuccessful scan, this field will be "null".
- Successful QR Code
- Successful Barcode
Both QR codes and Barcodes are returned as base64 encoded strings.