Product ID Integrations


Background

Since ChannelAdvisor Product IDs are required for many Product requests and referenced in some Orders requests too, this page provides some efficient methods of utilizing Product ID retrieval and storage to avoid hitting API call limits and system processing limits across small and large catalogs.

We are open to hearing about efficient integrations and may document them here - recommend methodology on the ChannelAdvisor Developer Forum.


Store Product ID in Client System - Page Through Sku/Product ID Combos

Good for: Clients with fewer than 250k products in ChannelAdvisor system if method to $select and @data.nextLink insructions below are followed.

Method: retrieve all product IDs from ChannelAdvisor system on regular basis.

Alert! Clients with > 250,000 products attempting this method will hit timeouts and never retrieve all products.

  • Add a specific 'ProfileID' to any $select in the examples below if retrieving product IDs across multiple profiles.
    • Or include a specific ProfileID value in the $filter as an alternate method to only retrieve the IDs from a specific profile.
  • This request will drastically increase the number of Sku/ID combos returned in the response. 
  • Use the @odata.nextLink at the bottom of the response as the next link to page through results and maintain an efficient integration. Do not force code different $skip counts in this link, fewer Skus/IDs are received in response in the response and processing will be less efficient.

Resource URL / Endpoint

GET https://api.channeladvisor.com/v1/Products?$select=Sku,ID

Example Request
GET https://api.channeladvisor.com/v1/Products?access_token=xxxxxxxxxx&$select=Sku,ID
Example Response (Success)
200 OK
{
  "@odata.context": "https://api.channeladvisor.com/v1/$metadata#Products(Sku,ID)",
  "value": [
    {
      "Sku": "AL-85590-Shoe",
      "ID": 22098461
    },
    {
      "Sku": "CG0001",
      "ID": 22120969
    },
    {
      "Sku": "AnotherId11",
      "ID": 22120970
    },
    {
      "Sku": "AnotherId12",
      "ID": 22120971
    },
    {
      "Sku": "AnotherId13",
      "ID": 22120972
    },
    {
      "Sku": "AnotherId14",
      "ID": 22120973
    },
    {
      "Sku": "1",
      "ID": 23426391
    },
// Removed same repeating pattern of response on a number of Skus to save space
    {
      "Sku": "TestSKU0000010",
      "ID": 25030559
    },
    {
      "Sku": "TestSku_DO_NOT_SHIP2",
      "ID": 25044113
    }
  ],
  "@odata.nextLink": "https://api.channeladvisor.com/v1/Products?access_token={{access_token}}&$select=Sku%2CID&$skip=100"
}

Store Product ID in Client System - Retrieving Product IDs Based on SKU Value

Good for: Clients of any size (large and small)

Method: retrieve product IDs by SKU (or in a list of SKUs). This does require one extra request, so when working with a large number of products, consider executing this process prior to going live to spread out requests and avoid hitting the API limits.

  • Add a specific 'ProfileID' to any $select in the examples below if retrieving product IDs across multiple profiles.
    • Or include a specific ProfileID value in the $filter as an alternate method to only retrieve the IDs from a specific profile.
  • This method avoids the need to implement anything that would indicate the product has already been retrieved - proper coding can check to see if the Product ID is stored prior to placing the GET requests.

Resource URL / Endpoint for Single Sku / Product ID Retrieval

GET https://api.channeladvisor.com/v1/Products?$filter=Sku eq 'SKU'&$select=ID

Example Request
GET https://api.channeladvisor.com/v1/Products?access_token=xxxxxxxxxx&$filter=Sku eq 'skuvalue12345'&$select=ID
Example Response (Success)
200 OK
{
  "@odata.context": "https://api.channeladvisor.com/v1/$metadata#Products(Sku,ID)",
  "value": [
    {
      "ID": 23426392
    }
  ]
}

Resource URL / Endpoint for Multiple Sku / Product ID Retrieval

GET https://api.channeladvisor.com/v1/Products? $filter=Sku eq 'SKU1' or Sku eq 'SKU2' or Sku eq 'SKU3'&$select=Sku,ID
  • Limit the number of SKUs included in this approach to avoid longer response times.

Example Request
GET https://api.channeladvisor.com/v1/Products?access_token=xxxxxxxxxx&$filter=Sku eq 'skuvalue12345' or Sku eq 'skuvalue98765' or Sku eq 'myskuvalue'&$select=Sku,ID
Example Response (Success)
200 OK
{
  "@odata.context": "https://api.channeladvisor.com/v1/$metadata#Products(Sku,ID)",
  "value": [
    {
      "Sku": "skuvalue12345",
      "ID": 25398136
    },
    {
      "Sku": "skuvalue98765",
      "ID": 25726395
    },
    {
      "Sku": "myskuvalue",
      "ID": 25726397
    }
  ]
}

Store Product ID in Client System - Retrieving Product IDs Daily

Good For: Smaller clients (< 250k products), and larger clients who can execute another method during day 1 of mass product creation.

Method: retrieve product IDs once a day to capture only the products created that day (timing for creation is UTC).

Alert!: Clients with > 250,000 products attempting this method will hit timeouts and never retrieve all new products from day 1 of product creation in the ChannelAdvisor system, but will likely work well on an ongoing basis.

  • Add a specific 'ProfileID' to any $select in the examples below if retrieving product IDs across multiple profiles.
    • Or include a specific ProfileID value in the $filter as an alternate method to only retrieve the IDs from a specific profile.
  • 'eq' cannot be used in this instance as the timestamp is assumed to be 12:00.00 AM UTC.
  • Use the @odata.nextLink at the bottom of the response as the next link to page through results and maintain an efficient integration. Do not force code different $skip counts in this link, fewer Skus/IDs are received in response in the response and processing will be less efficient.
  • This method effectively delays the process of retrieving a product ID - if a need arises to provide an update to product data before the end of the day, implement something like Method 2 to help bridge any gaps.

Resource URL / Endpoint

GET https://api.channeladvisor.com/v1/Products?$filter=CreateDateUTC ge YYYY-MM-DD and CreateDateUTC lt YYYY-MM-DD&$select=Sku,ID

Example Request
GET https://api.channeladvisor.com/v1/Products?access_token=xxxxxxxxxx&$filter=CreateDateUTC ge 2016-06-28 and CreateDateUTC lt 2016-06-29&$select=Sku,ID
Example Response (Success)
200 OK
{
  "@odata.context": "https://api.channeladvisor.com/v1/$metadata#Products(Sku,ID)",
  "value": [
    {
      "Sku": "TestChildSKU-99400",
      "ID": 25398133
    },
    {
      "Sku": "TestParentSKU-99480",
      "ID": 25398134
    },
    {
      "Sku": "TestChildSKU-99401",
      "ID": 25398135
    },
    {
      "Sku": "TestChildSKU-99402",
      "ID": 25398136
    },
    {
      "Sku": "TestChildSKU-99403",
      "ID": 25398137
    },
    {
      "Sku": "TestChildSKU-99404",
      "ID": 25398138
    }
  ]
}

Retrieve ID, Store in Memory, Place Request Requiring Product ID, Memory Dump

Good for: Clients of any size (large or small)

Method: same as single SKU GET request above in method 2. This also requires one extra request, so the timing of requests (or method of integration) requires closer consideration to avoid hitting API limits with high SKU count profiles. Smaller profiles will only need to consider timing to avoid hitting the API limits.

  • Add a specific 'ProfileID' to any $select in the examples below if retrieving product IDs across multiple profiles.
    • Or include a specific ProfileID value in the $filter as an alternate method to only retrieve the IDs from a specific profile.

Next Step: store that ID in memory and use it in the followup request that requires the ID, then dump the stored ID.


Resource URL / Endpoint

GET  https://api.channeladvisor.com/v1/Products? $filter=Sku eq 'SKU'&$select=ID

Example Request
GET https://api.channeladvisor.com/v1/Products?access_token=xxxxxxxxxx&$filter=Sku eq 'skuvalue12345'&$select=ID
Example Response (Success)
200 OK
{
  "@odata.context": "https://api.channeladvisor.com/v1/$metadata#Products(Sku,ID)",
  "value": [
    {
      "ID": 23426392
    }
  ]
}
Next Call
Any product request using the temporarily stored ID 23426392.

Asynchronous Retrieval of Product Data

Good for: Larger clients needing to capture large groups of data at once that would otherwise timeout.

Method: place a request to retrieve data and download the resulting response file with all data in it.


Resource URL / Endpoint

POST https://api.channeladvisor.com/v1/ProductExport

Read more and find examples about this method via the Product Exports section.