Skip to main content

Download Products

Overview

There are 2 ways to download products:

  1. Download a products.csv file from the scantrust portal under the products section
  2. Download the products with the Scantrust Product API

products

The below process describes how to download products using the Scantrust Product Api. You will need a UAT token with at minimum the following permissions:

  • product_view

The UAT token must be set in the header fields of all requests as described in Authentication & Tokens.

API Design

GET: /api/v2/products/

Returns all products for a company

ParameterRequired?Description
is_archivedoptionalboolean. default 0=not archived
limitoptionalnumber, default=20
offsetoptionalnumber
orderingoptionalflag: -creation_date = created at (desc)

Response (200): Status OK

{
"count": 73,
"next": "https://api.staging.scantrust.io/api/v2/products/?is_archived=0&limit=20&offset=20&ordering=-creation_date",
"previous": null,
"results": [
{
"id": 6326,
"uuid": "a69ba3ee-3009-44e4-9622-c2c2c25e8f17",
"sku": "tom-prefix-testing-pro",
"image": null,
"name": "tom-prefix-testing-pro",
"description": "testing",
"label": "tom-prefix-testing-pro",
"brand": {
"id": 1115,
"name": "Chicago Girl",
"image": "https://s3-eu-west-1.amazonaws.com/cc-staging.scantrust.com/c/446/brand/blob-znaohi.png"
},
"company": {
"id": 446,
"uuid": "d7210852-db2c-4e91-b783-ca608cdfbe32",
"name": "Chicago Merchants"
},
"creation_date": "2021-02-01T03:24:42.468939Z",
"client_url": "https://www.baidu.com",
"is_archived": false,
"code_count": 0,
"active_code_count": 0,
"blacklisted_code_count": 0,
"campaign": {
"id": 2207,
"name": "tom-prefix-sid",
"description": "prefix testing",
"is_archived": false
},
"smartlabel": null
},
...
]
}

GET: /api/v2/products/?sku__exact={sku}

This endpoint can be used to retrieve a specific product ID by SKU. By passing ?sku__exact={sku} to the endpoint URL, the system will look for an exact match within the company's products. Only one result should be returned since SKU is unique per company.

Response (200): Status OK

When a product is found, the result is provided as an array. The first object in that array should be used to know the ID.

{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": 959,
"uuid": "701b1a6f-e751-4c20-8012-028063322fb0",
"sku": "prod2",
"image": null,
"name": "Product #2",
"description": "",
"label": "Product #2",
"brand": {
"id": 749,
"name": "100 Brand",
"image": null
},
"company": {
"id": 871,
"uuid": "1fc1a571-1918-4f7d-b826-510752156cdf",
"name": "Test brand"
},
"creation_date": "2017-02-16T08:59:08.774705Z",
"client_url": "",
"is_archived": false,
"code_count": 0,
"active_code_count": 0,
"blacklisted_code_count": 0,
"campaign": {
"id": 188,
"name": "test campaign",
"description": "camp",
"is_archived": false
}
}
]
}

Example product not found

{
"count": 0,
"next": null,
"previous": null,
"results": []
}