Skip to main content

Lookup Scan Info

Overview

The Scantrust Consumer API is intended to be called from the Scantrust Consumer App (STC) landing page after a scantrust code has been scanned. It can also be called by any other third-party web- or mobile app / landing page as long as a valid API-key is used. For the required setup steps and an example, see the introduction

GET: /api/v2/consumer/scan/{scan_id}/combined-info/

Get the code info for a scan_id

Use the scan_id as it was passed into the landing page as part of the redirect

Example :

https://api.scantrust.com/api/v2/consumer/scan/5c9e2527-3120-410c-bd6c-665668dce3dc/combined-info/

This endpoint will return an object containing information about the qr code, campaign, and the scan result:

Code Information

  • Product
  • Brand
  • QR Code infos
  • SCM Data

Campaign Info

  • Name
  • Products inside that campaign
  • Campaign settings (eg: is serial number lookup allowed)

Scan Info

  • App used to scan
  • Result ("ok" or "failure")
  • Type of query (reason)
  • Reason why the scan failed (auth_failure_mode)
  • Country where the scan was made

Response codes

Response (401) : Unauthorized

If the X-ScanTrust-Consumer-Api-Key header is missing, the API will return a 401 error code. Please add the correct API key (see Introduction)

Response (403) : Forbidden

If the campaign linked to the API key is not found, not activated or doesn’t contain any product, the API will return a 403 error code Please scan the correct QR Code or add the correct API key (see Introduction)

Response (200): Status OK

{
"code" : {
"product": {
"id": 95,
"name": "Château Collotype",
"image": "https://cc.scantrust.com/c/20/product/generic-wine-bo-qderkb.png",
"description": "Tamper-evident label",
"sku": "COL-75ML",
"client_url": "http://www.scantrust.com"
},
"brand": {
"id": 15,
"name": "Winery Collotype",
"description": "This is a test brand.",
"image": "https://cc.scantrust.com/c/20/brand/d9d055b7-0e2b-45f7-ab5c-5e02d7e76d10-kabtun.png"
},
"qrcode": {
"message": "560AC5E52101I918149054B258CC1",
"creation_date": "2015-08-26T12:24:40.139076Z",
"serial_number": "21F29SAL",
"is_blacklisted": false,
"activation_status": "active",
"blacklist_reason": "none",
"is_consumed": false
},
"scm_data": [{
"name": "Production Date",
"key": "production_date",
"position": 0,
"type": "date",
"value": "January 1, 2015"
}, {
"name": "Sell-by Date",
"key": "sell_by_date",
"position": 1,
"type": "date",
"value": "April 15, 2019"
}, {
"name": "Port of Entry",
"key": "entry_port",
"position": 2,
"type": "text",
"value": "Venice"
}, {
"name": "Intended Markets",
"key": "intended_market",
"position": 3,
"type": "list",
"value": "Italy"
}, {
"name": "Distributor",
"key": "distributor",
"position": 4,
"type": "text",
"value": ""
}],
"scan_count": 1
}
"campaign": {
"products": [{
"id": 95,
"name": "Château Collotype",
"image": "https://cc.scantrust.com/c/20/product/generic-wine-bo-qderkb.png",
"description": "Tamper-evident label",
"sku": "COL-75ML",
"client_url": "http://www.scantrust.com"
}],
"name": "Collotype Campaign",
"options": {
"is_enabled": true,
"serial_number_lookup_enabled": true,
"complaints": {
"is_enabled": true,
"to_email": "support@scantrust.com"
},
"wechat": {
"is_enabled": false,
"channel_redirect": {
"is_enabled": false,
"landing_page": "https://www.scantrust.com/result-pages/wechat-redirect.html",
"channel_id": ""
}
},
"mark_consumed": false,
"ga_key": "KEY123",
"stc_config": {}
}
},
"scan": {
"app": "consumer",
"reason": "serial",
"result": "ok",
"auth_failure_mode": "",
"country": "CN"
}