Skip to main content

Getting Started

The Scantrust Admin Rest API is the default way in which all the apps, portal and mobile landing pages communicate with the backend. In order to access this API, developers need to obtain the following:

  1. A valid activated company account on the Scantrust Enterprise Portal
  2. A user within that company with sufficient access rights to access the required information. Typically this will be a user with at least the SCM User Role in order to do SCM uploads, but other configurations with different access rights are also available (SCM Admin, Brand Manager etc.).
  3. That user must then create a User Authorization token. Using a User Authorization Token is recommended as it gives fine-grained control over what in information can be accessed by the automation.
  4. This User Authorization token must then be used for all requests to the REST API.

Endpoint and Features

The public-facing REST API endpoints can be accessed at https://api.staging.scantrust.io/ for testing. For production, use https://api.scantrust.com/.

The admin api can be used for several common use-cases:

  1. Creating Products and assigning codes to those products
  2. Updating other code-information such as serial number and activation status
  3. Assign data to SCM fields to enable track and trace
  4. Generating Codes with Work Orders
  5. Upload your own custom codes
  6. Download Scan Data
  7. Download Code data (of activated / blacklisted codes)

Network details

For more restricted enterprise environments, see the Network Access Details on how to configure the appropriate network access.

Code examples

We have also included one Javascript code example to get you started:

Should you need other samples, please contact support to ask one of our friendly developers for help. :)

Error handling

All implementations need to take care of handling the following HTTP error codes:

Sure, below are the recommended handling by the REST client program for each of these HTTP response codes:

HTTP Response CodeSummaryHandling by REST Client Program
200The request was successfulParse and utilize the data received in the response by the program.
201The request was successful and a new resource was createdParse and utilize the data received in the response by the program, and then us the newly created objectaccordingly.
400The request was malformed or invalidHandle the error scenario as returned in the body of the error message. Log and inform the admin to correct the request. It's important to note that the 400 returns a BODY which states the reason of the error. Logging this is important in troubleshooting. Also note that Scantrust records these 400 errors and you can contact Scantrust Support to get further information why your request was invalid
401Authentication credentials of the the UAT token in the request header were missing or incorrectHandle the error scenario in the program, log and report to the admin to update the UAT token with valid credentials in the request header.
403The user does not have sufficient permissions to access the requested resourceHandle the error scenario in the program and contact the administrator to check the UAT token validity and access rights in the program.
404The requested resource could not be found on the serverHandle the error scenario in the program and prompt the user to check their input parameters or retry the request later.
429The user has exceeded a rate limitHandle the error scenario in the program and wait until the retry-after interval given in the response header then retry the request.
500An error occurred on the server while processing the requestHandle the error scenario in the program, log and notify the administrator or retry the request later.
503The server is currently unavailableHandle the error scenario in the program and log and notify the administrator to retry the request later.