Bulk Add Products to Categories
# Bulk Add Products to Categories
Adds multiple products to multiple categories simultaneously in a single bulk operation. Supports up to 50 category-product relationship items per request, automatically handling sort order and publishing update events for affected products and categories.
POST
/api/v1/{team_slug}/{app_slug}/categories/products/bulk
PurposeAdds multiple products to multiple categories simultaneously in a single bulk operation.
Required inputsteam_slug path app_slug path
Primary response200 ยท Products added to categories successfully
Operation keymanagement-api:POST:/api/v1/{team_slug}/{app_slug}/categories/products/bulk
## API ownership
- API family: Management API
- Best for: Trusted back-office workflows that create, update, organize, or delete merchant-owned data.
- Do not use from: Browser-only storefront code or public clients.
- Guide route: [/apis/management/latest](/apis/management/latest)
The OpenAPI contract defines the method, path, parameters, request body, and responses for this operation.
## Operation
- Method: `POST`
- Path: `/api/v1/{team_slug}/{app_slug}/categories/products/bulk`
- Summary: Bulk Add Products to Categories
- Description: Adds multiple products to multiple categories simultaneously in a single bulk operation. Supports up to 50 category-product relationship items per request, automatically handling sort order and publishing update events for affected products and categories.
- OpenAPI contract:
management-api
- Operation ID: Not documented in the OpenAPI contract.
- Stable operation key: `management-api:POST:/api/v1/{team_slug}/{app_slug}/categories/products/bulk`
Operation key uses API family, method, and path because this OpenAPI contract does not publish an operation ID.
## Parameters
| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| team_slug | path | Yes | string | Team slug |
| app_slug | path | Yes | string | App slug |
## Request body
- Required: Yes
- Description: Product and category relationships to create
- Content: application/json (object)
### Bulk Modify Category Products Payload
| Property | Type | Required | Details |
| --- | --- | --- | --- |
| `items` | object[] | Yes | maxItems: 50 |
#### Bulk Category Product Relationship Item
| Property | Type | Required | Details |
| --- | --- | --- | --- |
| `category_id` | string | Yes | - |
| `products` | object[] | Yes | minItems: 1 |
#### Bulk Category Product Ref
| Property | Type | Required | Details |
| --- | --- | --- | --- |
| `is_main_category` | boolean | No | - |
| `order` | integer | No | - |
| `product_id` | string | Yes | - |
**Generated example (synthetic):**
```json
{
"items": [
{
"category_id": "string",
"products": [
{
"is_main_category": null,
"order": null,
"product_id": null
}
]
}
]
}
```
## Responses
| Status | Description | Content |
| --- | --- | --- |
| 200 | Products added to categories successfully | application/json (object) |
| 400 | Invalid request | application/json (object) |
| 401 | Unauthorized access | application/json (object) |
| 500 | Internal server error | application/json (object) |
### 200 - object
#### Bulk Add Products To Categories Response
| Property | Type | Required | Details |
| --- | --- | --- | --- |
| `data` | object | No | - |
| `details` | string[] | No | Additional contextual information about the response. Used to provide supplementary details beyond the main data payload, such as validation warnings or processing notes |
| `success` | boolean | No | - |
##### Bulk Add Products To Categories
| Property | Type | Required | Details |
| --- | --- | --- | --- |
| `failed` | object[] | No | - |
| `successful` | object[] | No | - |
##### Bulk Category Product Failed Op
| Property | Type | Required | Details |
| --- | --- | --- | --- |
| `category_id` | string | No | - |
| `product_id` | string | No | - |
| `reason` | string | No | - |
##### Bulk Category Product Relationship Item
| Property | Type | Required | Details |
| --- | --- | --- | --- |
| `category_id` | string | Yes | - |
| `products` | object[] | Yes | minItems: 1 |
**Generated example (synthetic):**
```json
{
"data": {
"failed": [
{
"category_id": "string",
"product_id": "string",
"reason": "string"
}
],
"successful": [
{
"category_id": "string",
"products": []
}
]
},
"details": [
"string"
],
"success": false
}
```
### 400 - object
#### Error Message
| Property | Type | Required | Details |
| --- | --- | --- | --- |
| `details` | string[] | No | - |
| `message` | string | No | - |
| `success` | boolean | No | - |
**Generated example (synthetic):**
```json
{
"details": [
"string"
],
"message": "string",
"success": false
}
```
### 401 - object
#### Error Message
| Property | Type | Required | Details |
| --- | --- | --- | --- |
| `details` | string[] | No | - |
| `message` | string | No | - |
| `success` | boolean | No | - |
**Generated example (synthetic):**
```json
{
"details": [
"string"
],
"message": "string",
"success": false
}
```
### 500 - object
#### Error Message
| Property | Type | Required | Details |
| --- | --- | --- | --- |
| `details` | string[] | No | - |
| `message` | string | No | - |
| `success` | boolean | No | - |
**Generated example (synthetic):**
```json
{
"details": [
"string"
],
"message": "string",
"success": false
}
```
## Contract identity
Use these fields to confirm you are implementing the intended endpoint contract.
- API family: Management API
- Method: `POST`
- Path: `/api/v1/{team_slug}/{app_slug}/categories/products/bulk`
- Operation ID: Not documented in the OpenAPI contract.
- Stable operation key: `management-api:POST:/api/v1/{team_slug}/{app_slug}/categories/products/bulk`
- OpenAPI tag: Categories, Bulk
- OpenAPI summary: Bulk Add Products to Categories