API Playground

Test the product creation endpoint with your data.

Authentication Required

You need to Login to test the API playground

Create Product Endpoint

Submit product data for creation and enrichment

POST

The create product endpoint allows you to submit product codes (EAN, ASIN, MINSAN) or raw product data (title, brand, description, images) for creation and enrichment.

Each creation request will consume credits based on the requested services and the selected model.

Note: This endpoint consumes credits based on the complexity of the analysis. See the credit consumption details below.
Endpoint URL
POST https://api.commerceclarity.com/api/v1/products/create

Request Parameters

Parameter Type Required Description
codes string Conditional Product codes (EAN, ASIN, or MINSAN) separated by commas. Up to 100 codes can be specified in a single call if no other parameters (sku, product_handle, title, brand, images, description) are provided. If any of these parameters are included, only one code can be specified. Required if no description or images provided.
sku string Optional Customer SKU for the product
product_handle string Optional Customer product handle/slug
title string Optional Product title
brand string Optional Product brand
images array Conditional Product images URLs (array)
description string Conditional Product description
notes string Optional Additional notes for product generation
countries array Required Countries for which to create the product (required, array of ISO 2-letter codes)
agent_model string Optional Agent model to use (v1 or v2, default: v2)

Credit Consumption

Each API call to the analysis endpoint will consume credits from your account based on the requested services and the selected agent model.

Component Credits Used Description
Agent Model v2 5 Content Credits Product import with the alternative model
Agent Model v1 1 content credit Product import with the basic model
Additional Country +1 content credit Each country beyond the first consumes 1 additional credit.
Image Standardization +1 content credit If enabled in user settings, consumes 1 credit per product.
Credit Calculation Example
Creating a product with v2 in 3 countries with image standardization: 5 (v2) + 2 (2 additional countries) + 1 (standardization) = 8 credits.

Request Examples

cURL - Create from Codes
curl -X POST https://api.commerceclarity.com/api/v1/products/create \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "codes": "8001841001234",
    "countries": ["it"],
    "agent_model": "v2"
  }'
cURL - Create from Data
curl -X POST https://api.commerceclarity.com/api/v1/products/create \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Premium Coffee Beans",
    "brand": "CoffeeMax",
    "description": "High quality arabica coffee beans",
    "images": [
      "https://example.com/image1.jpg",
      "https://example.com/image2.jpg"
    ],
    "countries": ["it", "fr"],
    "agent_model": "v2"
  }'
PHP (Guzzle)
$client = new \GuzzleHttp\Client();

$response = $client->post('https://api.commerceclarity.com/api/v1/products/create', [
    'headers' => [
        'Authorization' => 'Bearer ' . $apiToken,
        'Content-Type' => 'application/json',
    ],
    'json' => [
        'codes' => '8001841001234',
        'countries' => ['it'],
        'agent_model' => 'v2'
    ]
]);

$data = json_decode($response->getBody(), true);
JavaScript (Fetch)
const response = await fetch('https://api.commerceclarity.com/api/v1/products/create', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${apiToken}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    codes: '8001841001234',
    countries: ['it'],
    agent_model: 'v2'
  })
});

const data = await response.json();

Response Examples

Success - Single Product

Success Response (201)
{
  "status": "success",
  "message": "All 1 product(s) successfully queued for import",
  "data": {
    "total_requested": 1,
    "successful": 1,
    "failed": 0,
    "imported_products": [
      {
        "code": "8001841001234",
        "status": "queued"
      }
    ],
    "failures": []
  }
}

Success - Multiple Products

Success Response (201)
{
  "status": "success",
  "message": "All 3 product(s) successfully queued for import",
  "data": {
    "total_requested": 3,
    "successful": 3,
    "failed": 0,
    "imported_products": [
      {
        "code": "8001841001234",
        "status": "queued"
      },
      {
        "code": "8001841001235",
        "status": "queued"
      },
      {
        "code": "8001841001236",
        "status": "queued"
      }
    ],
    "failures": []
  }
}

Partial Success

Partial Success Response (207)
{
  "status": "partial",
  "message": "Imported 2 of 3 product(s), 1 failed",
  "data": {
    "total_requested": 3,
    "successful": 2,
    "failed": 1,
    "imported_products": [
      {
        "code": "8001841001234",
        "status": "queued"
      },
      {
        "code": "8001841001235",
        "status": "queued"
      }
    ],
    "failures": [
      {
        "code": "invalid_code",
        "reason": "product_code_invalid",
        "message": "The provided code is not valid"
      }
    ]
  }
}

Error Response

Error Response - Validation (422)
{
  "status": "error",
  "code": "validation_failed",
  "errors": {
    "countries": [
      "The countries field is required."
    ]
  }
}