Skip to content

SKU Generation and Validation (V2) ​

Use these endpoints to automatically generate human-readable SKU codes based on brand, category, and variant attributes, and to validate SKU uniqueness within your store.


1. Generate Product SKU ​

Generates a standardized SKU code from product properties and checks if it is available for use.

Endpoint ​

POST /v2/products/skus/generate

Authentication ​

  • Requires merchant authentication: Authorization: Bearer JWT_TOKEN.
  • Requires X-MerchantApiKey: MERCHANT_API_KEY.

Headers ​

json
{
  "Authorization": "Bearer JWT_TOKEN",
  "X-MerchantApiKey": "MERCHANT_API_KEY",
  "Content-Type": "application/json"
}

Request body ​

Field NameTypeRequiredDescription
productNamestringYesName of the product.
brandIdstringNoUnique identifier of the brand.
brandNamestringNoBrand name string.
categoryIdstringNoCategory identifier.
categoryNamestringNoCategory name string.
attributesobjectNoKey-value pairs of variant attributes (e.g. {"Color": "Black", "Size": "XL"}).
json
{
  "productName": "Aero Sport Shoes",
  "brandName": "Nike",
  "categoryName": "Footwear",
  "attributes": {
    "Color": "Black",
    "Size": "42"
  }
}

Responses ​

200 OK ​

json
{
  "status": true,
  "message": "SKU generated",
  "data": {
    "sku": "NIK-FOO-AER-BLA-42",
    "normalizedSku": "NIK-FOO-AER-BLA-42",
    "available": true,
    "conflictProductId": null,
    "conflictSkuId": null
  }
}

2. Validate Product SKU ​

Checks if a custom SKU code is available for use within your store. When editing an existing product or SKU, you can provide exclude parameters to ignore self-conflicts.

Endpoint ​

GET /v2/products/skus/validate

Authentication ​

  • Requires merchant authentication: Authorization: Bearer JWT_TOKEN.
  • Requires X-MerchantApiKey: MERCHANT_API_KEY.

Query parameters ​

ParameterTypeRequiredDescription
skustringYesThe SKU code string to validate.
excludeProductIdstringNoProduct ID to exclude from conflict check when updating an existing product.
excludeProductSkuIdstringNoVariant SKU ID to exclude from conflict check.

Responses ​

200 OK ​

json
{
  "status": true,
  "message": "SKU validation completed",
  "data": {
    "sku": "NIK-FOO-AER-BLA-42",
    "normalizedSku": "NIK-FOO-AER-BLA-42",
    "available": true,
    "conflictProductId": null,
    "conflictSkuId": null
  }
}

Build with joy