Assign products to the category

POST https://app.ecwid.com/api/v3/{storeId}/categories/{categoryId}/assignProducts

Request and response example

Request:

POST /api/v3/1003/categories/9691094/assignProducts HTTP/1.1
Authorization: Bearer secret_token
Host: app.ecwid.com
Content-Type: application/json
Cache-Control: no-cache

{
  "productIds": [
    37208339,
    37208345
  ]
}

Response:

{
  "updateCount": 1
}

Required access scopes

Your app must have the following access scopes to make this request: update_catalog

Path params

All path params are required.

Param
Type
Description

storeId

number

Ecwid store ID.

categoryId

number

Internal category ID.

Headers

The Authorization header is required.

Header
Format
Description

Authorization

Bearer secret_ab***cd

Access token of the application.

Request JSON

A JSON object with the following fields:

Field
Type
Description

productIds

array of numbers

List of products that will be assigned to the category. Newly assigned products are put at the end of the product list in the category.

Response JSON

A JSON object with the following fields:

Field
Type
Description

updateCount

number

The number of updated items that defines if the request was successful. One of:

1 if the item was updated,

0 if the item was not updated.

Last updated

Was this helpful?