Contents
Variants
Variants of a product, addressed by their id or sku.
Base URL, authentication and conventions of this API are on the Catalog API page.
/products/{product}/variantsList the variants of a product
Path parameters
productstringrequiredProduct id or SKU.
Example:TEE-001
Responses
200The variants.application/json
dataarray of VariantrequiredAttributes of each item
idintegerskustringbarcodestring | nulloptionsobjectThe options that tell variants apart: attribute code → option code (
{"size": "m"}). Option codes are normalised, so a size sent asMcomes back asm.coststring | nullPurchase or production cost of this variant, as a string with two decimals (
"12.50");nullwhen none is set. No currency is stored with it.weightnumber | nullweight_unitstring | nullpricesarray of objectAttributes of each item
price_liststringcurrencystring | nullpricestring | nullExample:19.90sale_pricestring | nullPrice after the sale running today on this list (a sale price list in Pricing), or the discounted price set on the row;
nullwhen neither applies.
stockarray of objectRead only after creation: the quantity Nucleo Commerce last reported for each location.
Attributes of each item
locationstringavailableintegeron_handinteger
404
product_not_found,variant_not_found,image_not_found,import_not_found,webhook_not_found,channel_not_found,locale_not_found, ornot_foundfor a path that does not exist.application/jsonerrorobjectrequiredChild attributes
codestringrequiredStable machine-readable code. Branch on it, not on the message.
messagestringrequiredrequest_idstringrequiredSame as the
X-Request-Idheader. Quote it to support.detailsobject
curl -X GET https://api-catalog.nucleoplatform.com/api/catalog/v1/products/TEE-001/variants \
-H "Authorization: Bearer $NUCLEO_ACCESS_TOKEN" \
-H 'Accept: application/json'const res = await fetch("https://api-catalog.nucleoplatform.com/api/catalog/v1/products/TEE-001/variants", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.NUCLEO_ACCESS_TOKEN}`,
Accept: "application/json",
},
});
const data = await res.json();
console.log(res.status, data);<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$response = $client->request('GET', 'https://api-catalog.nucleoplatform.com/api/catalog/v1/products/TEE-001/variants', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('NUCLEO_ACCESS_TOKEN'),
'Accept' => 'application/json',
],
'http_errors' => false,
]);
echo $response->getStatusCode(), PHP_EOL;
echo $response->getBody();{
"data": [
{
"id": 1,
"sku": "string",
"barcode": "string",
"options": {},
"cost": "string",
"weight": 1.5,
"weight_unit": "string",
"prices": [
{
"price_list": "string",
"currency": "string",
"price": "19.90",
"sale_price": "string"
}
],
"stock": [
{
"location": "string",
"available": 1,
"on_hand": 1
}
]
}
]
}{
"error": {
"code": "string",
"message": "string",
"request_id": "string",
"details": {}
}
}/products/{product}/variantsAdd or update a variant
Creates the variant (201) or updates the variant of this product with the same SKU (200).
Path parameters
productstringrequiredProduct id or SKU.
Example:TEE-001
Headers
Idempotency-KeystringAny string of 1–255 printable ASCII characters, unique per change you mean (a UUID is fine). Sending the same request again with the same key within 48 hours returns the first answer without doing the work again (header
Idempotent-Replayed: true). The same key with a different request is a409 idempotency_key_reused; while the first request is still running,409 idempotency_key_in_progresswithRetry-After: 1. Answers429and5xxare not stored: retry them with the same key. Webhook secrets are never stored: a replayed webhook creation or rotation answers withsecret: null.max length 255Example:2b5c0d2e-7d2a-4f6e-9a51-0c8a1e7f3b44
Request bodyapplication/json
skustringrequiredUnique in the whole catalog.
max length 255pattern ^[A-Za-z0-9][A-Za-z0-9._-]*$barcodestringUnique in the whole catalog.
max length 255sizestringSize code; becomes the variant's size option (read back in
options, as a normalised option code).max length 255costnumber | nullPurchase or production cost of this variant. Rounded to two decimals on save. No currency is stored with it: use the same currency for every cost in the catalog. Leaving it out keeps the current cost;
nullremoves it;0is a cost of zero.min 0max 9999999999.99weightnumber | nullLeaving it out keeps the current weight;
nullremoves it.min 0max 9999999.999weight_unitstringOne ofgkglbozpricesarray of PriceInputAttributes of each item
price_liststringrequiredPrice list code (
GET /price-lists).pricenumberrequiredmin 0max 99999999.9999sale_pricenumber | nullDiscounted price on that list.
min 0max 99999999.9999
stockarray of StockInputAttributes of each item
locationstringrequiredLocation code (
GET /locations).availableintegerrequiredInitial quantity at that location: only where the variant has no stock yet.
Responses
200The variant as it is now, and what happened.application/json
dataVariantrequiredChild attributes
idintegerskustringbarcodestring | nulloptionsobjectThe options that tell variants apart: attribute code → option code (
{"size": "m"}). Option codes are normalised, so a size sent asMcomes back asm.coststring | nullPurchase or production cost of this variant, as a string with two decimals (
"12.50");nullwhen none is set. No currency is stored with it.weightnumber | nullweight_unitstring | nullpricesarray of objectAttributes of each item
price_liststringcurrencystring | nullpricestring | nullExample:19.90sale_pricestring | nullPrice after the sale running today on this list (a sale price list in Pricing), or the discounted price set on the row;
nullwhen neither applies.
stockarray of objectRead only after creation: the quantity Nucleo Commerce last reported for each location.
Attributes of each item
locationstringavailableintegeron_handinteger
resultWriteResultrequiredChild attributes
statusstringrequiredpartial: some variants or attribute values could not be written (seeerrors), the rest was. An attribute outside the product's attribute set is one of them.skipped: nothing to write (only empty values). An attribute the catalog doesn't know is a400, not a skip.One ofcreatedupdatedpartialskippederrorsarray of objectrequiredAttributes of each item
variant_skustring | nullmessagestring
notesarray of stringrequiredFields not written and why.
201The variant as it is now, and what happened.application/json
dataVariantrequiredChild attributes
idintegerskustringbarcodestring | nulloptionsobjectThe options that tell variants apart: attribute code → option code (
{"size": "m"}). Option codes are normalised, so a size sent asMcomes back asm.coststring | nullPurchase or production cost of this variant, as a string with two decimals (
"12.50");nullwhen none is set. No currency is stored with it.weightnumber | nullweight_unitstring | nullpricesarray of objectAttributes of each item
price_liststringcurrencystring | nullpricestring | nullExample:19.90sale_pricestring | nullPrice after the sale running today on this list (a sale price list in Pricing), or the discounted price set on the row;
nullwhen neither applies.
stockarray of objectRead only after creation: the quantity Nucleo Commerce last reported for each location.
Attributes of each item
locationstringavailableintegeron_handinteger
resultWriteResultrequiredChild attributes
statusstringrequiredpartial: some variants or attribute values could not be written (seeerrors), the rest was. An attribute outside the product's attribute set is one of them.skipped: nothing to write (only empty values). An attribute the catalog doesn't know is a400, not a skip.One ofcreatedupdatedpartialskippederrorsarray of objectrequiredAttributes of each item
variant_skustring | nullmessagestring
notesarray of stringrequiredFields not written and why.
400The request must change:
validation_failed(seedetails, one list of messages per field),invalid_json,invalid_cursor,product_not_written,variant_not_written,not_written,image_not_downloadable. application/jsonerrorobjectrequiredChild attributes
codestringrequiredStable machine-readable code. Branch on it, not on the message.
messagestringrequiredrequest_idstringrequiredSame as the
X-Request-Idheader. Quote it to support.detailsobject
403
read_only_key: this key cannot write.application/jsonerrorobjectrequiredChild attributes
codestringrequiredStable machine-readable code. Branch on it, not on the message.
messagestringrequiredrequest_idstringrequiredSame as the
X-Request-Idheader. Quote it to support.detailsobject
404
product_not_found,variant_not_found,image_not_found,import_not_found,webhook_not_found,channel_not_found,locale_not_found, ornot_foundfor a path that does not exist.application/jsonerrorobjectrequiredChild attributes
codestringrequiredStable machine-readable code. Branch on it, not on the message.
messagestringrequiredrequest_idstringrequiredSame as the
X-Request-Idheader. Quote it to support.detailsobject
curl -X POST https://api-catalog.nucleoplatform.com/api/catalog/v1/products/TEE-001/variants \
-H "Authorization: Bearer $NUCLEO_ACCESS_TOKEN" \
-H 'Idempotency-Key: 2b5c0d2e-7d2a-4f6e-9a51-0c8a1e7f3b44' \
-H 'Content-Type: application/json' \
-d '{
"sku": "string",
"barcode": "string",
"size": "string",
"cost": 0,
"weight": 0,
"weight_unit": "g",
"prices": [
{
"price_list": "string",
"price": 0,
"sale_price": 0
}
],
"stock": [
{
"location": "string",
"available": 1
}
]
}'const res = await fetch("https://api-catalog.nucleoplatform.com/api/catalog/v1/products/TEE-001/variants", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.NUCLEO_ACCESS_TOKEN}`,
"Idempotency-Key": "2b5c0d2e-7d2a-4f6e-9a51-0c8a1e7f3b44",
"Content-Type": "application/json",
},
body: JSON.stringify({
"sku": "string",
"barcode": "string",
"size": "string",
"cost": 0,
"weight": 0,
"weight_unit": "g",
"prices": [
{
"price_list": "string",
"price": 0,
"sale_price": 0
}
],
"stock": [
{
"location": "string",
"available": 1
}
]
}),
});
const data = await res.json();
console.log(res.status, data);<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$response = $client->request('POST', 'https://api-catalog.nucleoplatform.com/api/catalog/v1/products/TEE-001/variants', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('NUCLEO_ACCESS_TOKEN'),
'Idempotency-Key' => '2b5c0d2e-7d2a-4f6e-9a51-0c8a1e7f3b44',
],
'json' => [
'sku' => 'string',
'barcode' => 'string',
'size' => 'string',
'cost' => 0,
'weight' => 0,
'weight_unit' => 'g',
'prices' => [
[
'price_list' => 'string',
'price' => 0,
'sale_price' => 0,
],
],
'stock' => [
[
'location' => 'string',
'available' => 1,
],
],
],
'http_errors' => false,
]);
echo $response->getStatusCode(), PHP_EOL;
echo $response->getBody();{
"data": {
"id": 1,
"sku": "string",
"barcode": "string",
"options": {},
"cost": "string",
"weight": 1.5,
"weight_unit": "string",
"prices": [
{
"price_list": "string",
"currency": "string",
"price": "19.90",
"sale_price": "string"
}
],
"stock": [
{
"location": "string",
"available": 1,
"on_hand": 1
}
]
},
"result": {
"status": "created",
"errors": [
{
"variant_sku": "string",
"message": "string"
}
],
"notes": [
"string"
]
}
}{
"data": {
"id": 1,
"sku": "string",
"barcode": "string",
"options": {},
"cost": "string",
"weight": 1.5,
"weight_unit": "string",
"prices": [
{
"price_list": "string",
"currency": "string",
"price": "19.90",
"sale_price": "string"
}
],
"stock": [
{
"location": "string",
"available": 1,
"on_hand": 1
}
]
},
"result": {
"status": "created",
"errors": [
{
"variant_sku": "string",
"message": "string"
}
],
"notes": [
"string"
]
}
}{
"error": {
"code": "validation_failed",
"message": "The request is not valid: see details.",
"request_id": "7c0f8a1e-3b2d-4e5f-9a6b-1c2d3e4f5a6b",
"details": {
"variants.0.prices.0.price_list": [
"Unknown price list \"usa\". GET /price-lists lists them."
]
}
}
}{
"error": {
"code": "string",
"message": "string",
"request_id": "string",
"details": {}
}
}{
"error": {
"code": "string",
"message": "string",
"request_id": "string",
"details": {}
}
}/products/{product}/variants/{variant}Update a variant
Only the fields sent change. The SKU cannot change through the API.
Path parameters
productstringrequiredProduct id or SKU.
Example:TEE-001variantstringrequiredVariant id or SKU.
Headers
Idempotency-KeystringAny string of 1–255 printable ASCII characters, unique per change you mean (a UUID is fine). Sending the same request again with the same key within 48 hours returns the first answer without doing the work again (header
Idempotent-Replayed: true). The same key with a different request is a409 idempotency_key_reused; while the first request is still running,409 idempotency_key_in_progresswithRetry-After: 1. Answers429and5xxare not stored: retry them with the same key. Webhook secrets are never stored: a replayed webhook creation or rotation answers withsecret: null.max length 255Example:2b5c0d2e-7d2a-4f6e-9a51-0c8a1e7f3b44
Request bodyapplication/json
skustringrequiredUnique in the whole catalog.
max length 255pattern ^[A-Za-z0-9][A-Za-z0-9._-]*$barcodestringUnique in the whole catalog.
max length 255sizestringSize code; becomes the variant's size option (read back in
options, as a normalised option code).max length 255costnumber | nullPurchase or production cost of this variant. Rounded to two decimals on save. No currency is stored with it: use the same currency for every cost in the catalog. Leaving it out keeps the current cost;
nullremoves it;0is a cost of zero.min 0max 9999999999.99weightnumber | nullLeaving it out keeps the current weight;
nullremoves it.min 0max 9999999.999weight_unitstringOne ofgkglbozpricesarray of PriceInputAttributes of each item
price_liststringrequiredPrice list code (
GET /price-lists).pricenumberrequiredmin 0max 99999999.9999sale_pricenumber | nullDiscounted price on that list.
min 0max 99999999.9999
stockarray of StockInputAttributes of each item
locationstringrequiredLocation code (
GET /locations).availableintegerrequiredInitial quantity at that location: only where the variant has no stock yet.
Responses
200The variant as it is now, and what happened.application/json
dataVariantrequiredChild attributes
idintegerskustringbarcodestring | nulloptionsobjectThe options that tell variants apart: attribute code → option code (
{"size": "m"}). Option codes are normalised, so a size sent asMcomes back asm.coststring | nullPurchase or production cost of this variant, as a string with two decimals (
"12.50");nullwhen none is set. No currency is stored with it.weightnumber | nullweight_unitstring | nullpricesarray of objectAttributes of each item
price_liststringcurrencystring | nullpricestring | nullExample:19.90sale_pricestring | nullPrice after the sale running today on this list (a sale price list in Pricing), or the discounted price set on the row;
nullwhen neither applies.
stockarray of objectRead only after creation: the quantity Nucleo Commerce last reported for each location.
Attributes of each item
locationstringavailableintegeron_handinteger
resultWriteResultrequiredChild attributes
statusstringrequiredpartial: some variants or attribute values could not be written (seeerrors), the rest was. An attribute outside the product's attribute set is one of them.skipped: nothing to write (only empty values). An attribute the catalog doesn't know is a400, not a skip.One ofcreatedupdatedpartialskippederrorsarray of objectrequiredAttributes of each item
variant_skustring | nullmessagestring
notesarray of stringrequiredFields not written and why.
400The request must change:
validation_failed(seedetails, one list of messages per field),invalid_json,invalid_cursor,product_not_written,variant_not_written,not_written,image_not_downloadable. application/jsonerrorobjectrequiredChild attributes
codestringrequiredStable machine-readable code. Branch on it, not on the message.
messagestringrequiredrequest_idstringrequiredSame as the
X-Request-Idheader. Quote it to support.detailsobject
404
product_not_found,variant_not_found,image_not_found,import_not_found,webhook_not_found,channel_not_found,locale_not_found, ornot_foundfor a path that does not exist.application/jsonerrorobjectrequiredChild attributes
codestringrequiredStable machine-readable code. Branch on it, not on the message.
messagestringrequiredrequest_idstringrequiredSame as the
X-Request-Idheader. Quote it to support.detailsobject
curl -X PATCH 'https://api-catalog.nucleoplatform.com/api/catalog/v1/products/TEE-001/variants/{variant}' \
-H "Authorization: Bearer $NUCLEO_ACCESS_TOKEN" \
-H 'Idempotency-Key: 2b5c0d2e-7d2a-4f6e-9a51-0c8a1e7f3b44' \
-H 'Content-Type: application/json' \
-d '{
"sku": "string",
"barcode": "string",
"size": "string",
"cost": 0,
"weight": 0,
"weight_unit": "g",
"prices": [
{
"price_list": "string",
"price": 0,
"sale_price": 0
}
],
"stock": [
{
"location": "string",
"available": 1
}
]
}'const res = await fetch("https://api-catalog.nucleoplatform.com/api/catalog/v1/products/TEE-001/variants/{variant}", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.NUCLEO_ACCESS_TOKEN}`,
"Idempotency-Key": "2b5c0d2e-7d2a-4f6e-9a51-0c8a1e7f3b44",
"Content-Type": "application/json",
},
body: JSON.stringify({
"sku": "string",
"barcode": "string",
"size": "string",
"cost": 0,
"weight": 0,
"weight_unit": "g",
"prices": [
{
"price_list": "string",
"price": 0,
"sale_price": 0
}
],
"stock": [
{
"location": "string",
"available": 1
}
]
}),
});
const data = await res.json();
console.log(res.status, data);<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$response = $client->request('PATCH', 'https://api-catalog.nucleoplatform.com/api/catalog/v1/products/TEE-001/variants/{variant}', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('NUCLEO_ACCESS_TOKEN'),
'Idempotency-Key' => '2b5c0d2e-7d2a-4f6e-9a51-0c8a1e7f3b44',
],
'json' => [
'sku' => 'string',
'barcode' => 'string',
'size' => 'string',
'cost' => 0,
'weight' => 0,
'weight_unit' => 'g',
'prices' => [
[
'price_list' => 'string',
'price' => 0,
'sale_price' => 0,
],
],
'stock' => [
[
'location' => 'string',
'available' => 1,
],
],
],
'http_errors' => false,
]);
echo $response->getStatusCode(), PHP_EOL;
echo $response->getBody();{
"data": {
"id": 1,
"sku": "string",
"barcode": "string",
"options": {},
"cost": "string",
"weight": 1.5,
"weight_unit": "string",
"prices": [
{
"price_list": "string",
"currency": "string",
"price": "19.90",
"sale_price": "string"
}
],
"stock": [
{
"location": "string",
"available": 1,
"on_hand": 1
}
]
},
"result": {
"status": "created",
"errors": [
{
"variant_sku": "string",
"message": "string"
}
],
"notes": [
"string"
]
}
}{
"error": {
"code": "validation_failed",
"message": "The request is not valid: see details.",
"request_id": "7c0f8a1e-3b2d-4e5f-9a6b-1c2d3e4f5a6b",
"details": {
"variants.0.prices.0.price_list": [
"Unknown price list \"usa\". GET /price-lists lists them."
]
}
}
}{
"error": {
"code": "string",
"message": "string",
"request_id": "string",
"details": {}
}
}/products/{product}/variants/{variant}Delete a variant
Deletes the variant with its prices and stock.
Path parameters
productstringrequiredProduct id or SKU.
Example:TEE-001variantstringrequiredVariant id or SKU.
Headers
Idempotency-KeystringAny string of 1–255 printable ASCII characters, unique per change you mean (a UUID is fine). Sending the same request again with the same key within 48 hours returns the first answer without doing the work again (header
Idempotent-Replayed: true). The same key with a different request is a409 idempotency_key_reused; while the first request is still running,409 idempotency_key_in_progresswithRetry-After: 1. Answers429and5xxare not stored: retry them with the same key. Webhook secrets are never stored: a replayed webhook creation or rotation answers withsecret: null.max length 255Example:2b5c0d2e-7d2a-4f6e-9a51-0c8a1e7f3b44
Responses
204Deleted.
404
product_not_found,variant_not_found,image_not_found,import_not_found,webhook_not_found,channel_not_found,locale_not_found, ornot_foundfor a path that does not exist.application/jsonerrorobjectrequiredChild attributes
codestringrequiredStable machine-readable code. Branch on it, not on the message.
messagestringrequiredrequest_idstringrequiredSame as the
X-Request-Idheader. Quote it to support.detailsobject
409
idempotency_key_reused,idempotency_key_in_progress,webhook_limit. application/jsonerrorobjectrequiredChild attributes
codestringrequiredStable machine-readable code. Branch on it, not on the message.
messagestringrequiredrequest_idstringrequiredSame as the
X-Request-Idheader. Quote it to support.detailsobject
curl -X DELETE 'https://api-catalog.nucleoplatform.com/api/catalog/v1/products/TEE-001/variants/{variant}' \
-H "Authorization: Bearer $NUCLEO_ACCESS_TOKEN" \
-H 'Idempotency-Key: 2b5c0d2e-7d2a-4f6e-9a51-0c8a1e7f3b44'const res = await fetch("https://api-catalog.nucleoplatform.com/api/catalog/v1/products/TEE-001/variants/{variant}", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.NUCLEO_ACCESS_TOKEN}`,
"Idempotency-Key": "2b5c0d2e-7d2a-4f6e-9a51-0c8a1e7f3b44",
},
});
const data = await res.json();
console.log(res.status, data);<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
$response = $client->request('DELETE', 'https://api-catalog.nucleoplatform.com/api/catalog/v1/products/TEE-001/variants/{variant}', [
'headers' => [
'Authorization' => 'Bearer ' . getenv('NUCLEO_ACCESS_TOKEN'),
'Idempotency-Key' => '2b5c0d2e-7d2a-4f6e-9a51-0c8a1e7f3b44',
],
'http_errors' => false,
]);
echo $response->getStatusCode(), PHP_EOL;
echo $response->getBody();HTTP 204 — Deleted.{
"error": {
"code": "string",
"message": "string",
"request_id": "string",
"details": {}
}
}{
"error": {
"code": "string",
"message": "string",
"request_id": "string",
"details": {}
}
}