Follow

How to Upload and Download Products via Scantrust API

This article presents the steps of uploading and downloading products with the Scantrust API. Firstly, you will need a UAT token with the following permissions: 

  • product_create
  • product_delete
  • product_edit
  • product_view

You'll also need at least one Brand set up in the Portal: each product you create needs to be assigned to a brand.

Important:

To get access to the Scantrust REST API, you can use an API platform such as Postman, this is the world's most popular API platform, with over 17 million users and 500,000 organizations worldwide. The tool comes with a flexible, and collaborative environment that allows you to design, develop, document, and test your APIs faster.

You can try the web application or download and install this app from this link: https://www.postman.com/downloads/. In any case, you must sign up with a valid email address. 

Note: In the Scantrust context, Postman should be used only for testing purposes. It should not be intended to use on real scenarios or project implementations.

Steps to configure Postman:

1. Please open Postman, in the home page you should be able to see the following:

 

Picture1.png

2. Then, please click on the tap labeled: “Workspaces”, in the upper left corner: 

 

Picture2.png

3. Then, please click on the option labeled: “My workspace”: 

Picture3.png

4. Once you are in your workspace, please click on the “+” sign as follows: 

Picture4.png

5. After that, a new tab will appear with a preconfigured API request: GET:

Picture5.png 

6. Now, it is important to set up the API Authorization, to do that, please click on the tab labeled as:               “Authorization”: 

Picture6.png

7. Then, click on the "Type" section and select: "API Key" option, as follows: 

Picture7.png

8. Now, type the word: "Authorization" on the key field, then copy your UAT token from the ST portal            and paste it into the field labeled as: “Value”, including the characters UAT: UAT [your token],                    leaving a spacebar between the UAT string and the token: 

Picture8.png

9. Then, go to the “Body” tab, select “raw” and select “JSON”:

Picture9.png

Steps to upload products with Scantrust API:

1. At this point, you are ready to upload a product using Scantrust API. For the first step, you must change the API request to POST. Please click on the request button and select the “POST” option: 

 

Picture10.png

2. To set up this request you must type the URL, which in this case is the following: https://api.scantrust.com/api/v2/products/

 

Picture11.png

3. Then, on the body tab, please write the following: 

{
"sku": "PR3",
"brand": 2841,
"name": "Product three",
"description": "The third product in a line of many others.",
"client_url": "http://www.examplebrand.com/productone",
"campaign": 575
}

In which, the SKU refers to the Unique product SKU in the company, the brand refers to the ID (integer) or reference (string) of the brand, and the name refers to the name of the product. All of those are required fields to set the request. 

On the other hand, the description field refers to a brief description of the product, the client URL, refers to a product URL that may be used to redirect codes if a campaign is not active for the product, and the image let you Include a product image, typically used on STC landing pages. If not set, the brand image will be used and the campaign which is the ID of an existing campaign in the company to which this product must be added. All of these are optional fields. 

4. Once you finish your code script, we can click on the SEND button:

Picture12.png

5. When a product is successfully posted, a response looks as follows:

Picture13.png

If the upload was successful, the status response should be 200 or 201. Then you can double-check on the Scantrust portal, the creation of this new product. 

Steps to download products with Scantrust API:

You will need a UAT token with the following permissions: 

  • product_view

In this case, we will retrieve the product information of an entire company or a specific product just using the product SKU. 

1. Please, go to your workspace in postman and open a new tab with the “+” sign: 

Picture4.png

2. Then, go to the “Body” tab, and select “none”:

Picture14.png 

3. In order to download products information, you must set up a GET request by typing the URL,                 which in this case is the following: https://api.scantrust.com/api/v2/products/:

Picture15.png

4. Then, click on the SEND button: 

Picture16.png

5. When the API request was successful, the status response should be 200 and the response will be               given: 

Picture17.png

This response includes all of the products that are included in your company, with specific attributes such as SKU, name, description, brand, and some others. 

6. If you want to know specific product information,  we must set up the GET request by typing the               URL, which in this case is the following: https://api.scantrust.com/api/v2/products/?sku_exact=            [SKU]:

mceclip0.png

In this case, the response includes only the product information of the ID that you indicated on the URL.

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments