Skip to main content

Scanning

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

URL

https://(TerminalIP):8080/POSitiveWebLink/1.1.0/rest/scan

An HTTPS GET request should be sent to the above URL with the following parameters:

POST /scan - Query String Parameters
Field NameStateData TypeDescription
tidMandatoryString

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.

preferFrontCameraOptionalBooleanDetermines whether the scanner should use the Front Camera (if available). Set to true to use the front-facing camera.

Default = false.
timeoutSecOptionalIntegerDetermines how long in seconds to wait for the scanner before cancelling the request.

Default = 60 seconds.
POST /transaction - Header Parameters
AuthorizationMandatoryStringThis field should be populated with a value of
Bearer 6945595921271780

Example Request

GET https://192.168.0.101:8080/POSitiveWebLink/1.1.0/rest/scan?tid=1760011990&preferFrontCamera=false&timeoutSec=20

/scan API Response

If properly formatted, you will receive a 200 HTTP response with the following fields:

GET /scan - Response
Field NameData TypeDescription
resultCodeIntegerThe outcome of the Scan attempt. Can be one of the following values:
1Success
2Timeout
3Cancelled
dataStringBase64 encoded barcode/QR results.

In the event of an unsuccessful scan, this field will be "null".

Example Responses

{
"resultCode": 1,
"data": "aHR0cHM6Ly9kZXZlbG9wZXIuZG5hcGF5bWVudHMuY29tLw=="
}
note

Both QR codes and Barcodes are returned as base64 encoded strings.