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)

Request Examples

cURL
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"]
  }'
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']
    ]
]);

$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']
  })
});

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."
    ]
  }
}