Create Products (Bulk) API

Overview

Creates multiple products in a single request.

Method

POST

Endpoint

POST /v2/catalogs/{catalogId}/products/bulk

Base URL

https://in1.api.clevertap.com/v2/catalogs/{catalogId}/products/bulk

Region

Refer Region for more details.

Headers

These headers must be included with every API request to ensure authentication and validate the request.

HeaderDescriptionRequired
Content-TypeContent type of the request. Must be application/json.Yes
X-CleverTap-Account-IdCleverTap account ID associated with the catalog.Yes
X-CleverTap-PasscodeAPI passcode used to authenticate the request.Yes

Path Parameter

The following path parameter is required to identify the catalog:

ParameterTypeRequiredDescription
catalogIdNumberYesUnique identifier of the catalog where products are created.

Request Parameters

The following parameters define the products to be created in the catalog:

ParameterTypeRequiredDescription
productsarrayYesList of products to be added to the catalog.
products.identitystringYesUnique identifier of the product within the catalog, for example, a SKU. Allowed: 1–500 characters.
products.namestringYesName of the product. Allowed: 1-1000 characters.
products.imageUrlstringNoPublic URL of the product image.Allowed a maximum of 2000 characters.
products.attributesobjectNoKey-value pairs representing the product attributes defined in the catalog schema.
products.attributes.fieldvariesNoValue of a specific catalog attribute. The data type must match the type defined in the catalog schema.
createdBystringYesEmail address of the user or system creating these products.
📘

imageUrl is optional here, but required on the single-product endpoint

The Create Single Product API requires imageUrl, this bulk endpoint does not. A product created in bulk without an image will render with an empty image slot wherever it is surfaced, so supply it unless you are deliberately backfilling.

Example Request

This example creates multiple products in the specified catalog:

{
  "products": [
    {
      "identity": "SKU-12345",
      "name": "Wireless Bluetooth Headphones",
      "imageUrl": "https://example.com/images/headphones.jpg",
      "attributes": {
        "brand": "AudioTech",
        "price": 89.99,
        "category": "Electronics",
        "in_stock": true
      }
    },
    {
      "identity": "SKU-12346",
      "name": "USB-C Charging Cable",
      "imageUrl": "https://example.com/images/cable.jpg",
      "attributes": {
        "brand": "TechCable",
        "price": 12.99,
        "category": "Accessories",
        "in_stock": true
      }
    }
  ],
  "createdBy": "[email protected]"
}
📘

Note

If a product fails validation, the error is reported for that product while other valid products continue to be processed.

Example Response

This example shows a successful response with all products created.

{
  "successCount": 2,
  "failedCount": 0,
  "products": [
    {
      "identity": "SKU-12345",
      "name": "Wireless Bluetooth Headphones",
      "imageUrl": "https://example.com/images/headphones.jpg",
      "attributes": {
        "brand": "AudioTech",
        "price": 89.99,
        "category": "Electronics",
        "in_stock": true
      },
      "status": "ACTIVE",
      "createdAt": "2023-11-10T10:30:00Z",
      "createdBy": "[email protected]",
      "updatedBy": "[email protected]"
    },
    {
      "identity": "SKU-12346",
      "name": "USB-C Charging Cable",
      "imageUrl": "https://example.com/images/cable.jpg",
      "attributes": {
        "brand": "TechCable",
        "price": 12.99,
        "category": "Accessories",
        "in_stock": true
      },
      "status": "ACTIVE",
      "createdAt": "2023-11-10T10:30:00Z",
      "createdBy": "[email protected]",
      "updatedBy": "[email protected]"
    }
  ],
  "errors": []
}

Partial Success Response

When some products fail, the response includes both successful products and error details.

{
  "successCount": 1,
  "failedCount": 1,
  "products": [
    {
      "identity": "SKU-12345",
      "name": "Wireless Bluetooth Headphones",
      "status": "ACTIVE",
      "createdAt": "2023-11-10T10:30:00Z"
    }
  ],
  "errors": [
    {
      "identity": "SKU-12346",
      "errorMessage": "Product with identity SKU-12346 already exists",
      "errorType": "ALREADY_EXISTS"
    }
  ]
}

Response Parameters

The response includes bulk operation results along with system-generated fields for successful products.

ParameterTypeDescription
successCountintegerNumber of products that were successfully created.
failedCountintegerNumber of products that failed to be created.
productsarrayList of products that were successfully created.
products.statusstringCurrent status of the product, for example, ACTIVE or INACTIVE.
products.createdAtstringDate and time when the product was created.
products.updatedBystringEmail address of the user who last updated the product.
errorsarrayList of products that could not be created, along with error details.
errors.identitystringIdentity of the product that failed to be created.
errors.errorMessagestringDescription of why the product creation failed.
errors.errorTypestringError category indicating the reason for failure, for example, ALREADY_EXISTS.

Limitations

The following limits apply to a single request:

LimitValueResponse on breach
Maximum products per request100400, CleverTap code 110, Maximum 100 products/identities allowed in bulk request
Maximum payload size500 KB413, CleverTap code 111, The payload size exceeds the permissible limit of 500KB

The payload cap is checked against the request's Content-Length before the body is parsed, so an oversized request is rejected without creating any products.

Error Codes

This API returns a standard HTTP status code along with a plain-text message describing the issue.

HTTP StatusWhen
400catalogId, products, or createdBy is missing; the body is not valid JSON; or the request exceeds 100 products.
401Authentication failed, or the catalogs feature is not enabled on the account's plan.
403Catalog feature is not enabled for this account (CleverTap code 101).
404The specified catalog does not exist.
409A conflicting resource already exists. Per-product conflicts are reported in errors rather than as a top-level 409.
413Request payload exceeds 500 KB (CleverTap code 111).
500Unexpected server-side error.
503The account is not ready to serve requests yet. Retry shortly.

Did this page help you?
CleverTap Ask AI Widget (CSP-Safe)