Category Position APIs

Control the order in which products appear within one category or several categories.

Last updated

On this page

Overview

Use these APIs to manage the order in which products are displayed within categories. One API updates product positions in a single category. The other handles multiple categories. You can update product positions across multiple stores asynchronously.

Asynchronous updates

You can also update category positions asynchronously. The URLs are the same as the regular ones, but end with /async.

The asynchronous API returns a success message immediately if everything is alright, but it may take a couple of minutes for the position changes to be applied.

Update Position for one Category API

Use this API to change the positions of products in a specific category. Provide the category ID in the request body.

MethodPath
POST/api/v1/position/category
POST/api/v2/position/category
POST/api/v1/position/category/async
POST/api/v2/position/category/async

Request body

JSON
{
"website_tokens" : [ //required, (array of strings) an array of website tokens you get from Athena XAI
  "{{ website_token_1 }}",
  "{{ website_token_2 }}",
  "{{ website_token_3 }}",
  …
],
"data" : {
  "category_id" : 34, //required, (integer) id of the category you want to update
  "product_positions" : [ //required, (array of integers) an array of product ids arranged in the desired order
     619545,
     619544,
     619542,
     …
  ]
}
}

Successful response

JSON
{
"message": "Success"
}

Update Positions for multiple categories API

Use this API to update product positions in multiple categories. Provide the category IDs in the request body.

You can send category positions in batches, with an array of a smaller number of products whose positions need to change. The example below shows this.

MethodPath
POST/api/v1/position/categories
POST/api/v2/position/categories
POST/api/v1/position/categories/async
POST/api/v2/position/categories/async

Request body

JSON
{
"website_tokens" : [ //required, (array of strings) an array of website tokens you get from Athena XAI
  "{{ website_token_1 }}",
  "{{ website_token_2 }}",
  "{{ website_token_3 }}",
  …
],
[
  {
     "categories" : [4,33,44,...], //required, (array of integers) an array of ids of categories
     "product_positions" : [ //required, (array of integers) an array of product ids arranged in the desired order
        619545,
        619544,
        619542,
        …
     ]
  },
  {
     "categories" : [4,33,44,...],
     "product_positions" : [
        632746,
        632743,
        632739,
        …
     ]
  },
  …
]
}

Successful response

JSON
{
"message": "Success"
}