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.

get/products/{product}/variants

List the variants of a product

GET https://api-catalog.nucleoplatform.com/api/catalog/v1/products/{product}/variants
Authentication: Bearer token
Rate limit: 600 requests per 1m, per key (default; the catalog owner can set 1–6,000)

Path parameters

  • productstringrequired

    Product id or SKU.

    Example: TEE-001

Responses

  • 200The variants.
    • dataarray of Variantrequired
      Attributes of each item
      • idinteger
      • skustring
      • barcodestring | null
      • optionsobject

        The options that tell variants apart: attribute code → option code ({"size": "m"}). Option codes are normalised, so a size sent as M comes back as m.

      • coststring | null

        Purchase or production cost of this variant, as a string with two decimals ("12.50"); null when none is set. No currency is stored with it.

      • weightnumber | null
      • weight_unitstring | null
      • pricesarray of object
        Attributes of each item
        • price_liststring
        • currencystring | null
        • pricestring | null
          Example: 19.90
        • sale_pricestring | null

          Price after the sale running today on this list (a sale price list in Pricing), or the discounted price set on the row; null when neither applies.

      • stockarray of object

        Read only after creation: the quantity Nucleo Commerce last reported for each location.

        Attributes of each item
        • locationstring
        • availableinteger
        • on_handinteger
  • 404product_not_found, variant_not_found, image_not_found, import_not_found, webhook_not_found, channel_not_found, locale_not_found, or not_found for a path that does not exist.
    • errorobjectrequired
      Child attributes
      • codestringrequired

        Stable machine-readable code. Branch on it, not on the message.

      • messagestringrequired
      • request_idstringrequired

        Same as the X-Request-Id header. Quote it to support.

      • detailsobject
Request
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'
Response
{
  "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
        }
      ]
    }
  ]
}
post/products/{product}/variants

Add or update a variant

Requires a read and write key.

Creates the variant (201) or updates the variant of this product with the same SKU (200).

POST https://api-catalog.nucleoplatform.com/api/catalog/v1/products/{product}/variants
Authentication: Bearer token
Rate limit: 600 requests per 1m, per key (default; the catalog owner can set 1–6,000)

Path parameters

  • productstringrequired

    Product id or SKU.

    Example: TEE-001

Headers

  • Idempotency-Keystring

    Any 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 a 409 idempotency_key_reused; while the first request is still running, 409 idempotency_key_in_progress with Retry-After: 1. Answers 429 and 5xx are not stored: retry them with the same key. Webhook secrets are never stored: a replayed webhook creation or rotation answers with secret: null.

    max length 255
    Example: 2b5c0d2e-7d2a-4f6e-9a51-0c8a1e7f3b44

Request bodyapplication/json

  • skustringrequired

    Unique in the whole catalog.

    max length 255pattern ^[A-Za-z0-9][A-Za-z0-9._-]*$
  • barcodestring

    Unique in the whole catalog.

    max length 255
  • sizestring

    Size code; becomes the variant's size option (read back in options, as a normalised option code).

    max length 255
  • costnumber | null

    Purchase 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; null removes it; 0 is a cost of zero.

    min 0max 9999999999.99
  • weightnumber | null

    Leaving it out keeps the current weight; null removes it.

    min 0max 9999999.999
  • weight_unitstring
    One ofgkglboz
  • pricesarray of PriceInput
    Attributes of each item
    • price_liststringrequired

      Price list code (GET /price-lists).

    • pricenumberrequired
      min 0max 99999999.9999
    • sale_pricenumber | null

      Discounted price on that list.

      min 0max 99999999.9999
  • stockarray of StockInput
    Attributes of each item
    • locationstringrequired

      Location code (GET /locations).

    • availableintegerrequired

      Initial quantity at that location: only where the variant has no stock yet.

Responses

  • 200The variant as it is now, and what happened.
    • dataVariantrequired
      Child attributes
      • idinteger
      • skustring
      • barcodestring | null
      • optionsobject

        The options that tell variants apart: attribute code → option code ({"size": "m"}). Option codes are normalised, so a size sent as M comes back as m.

      • coststring | null

        Purchase or production cost of this variant, as a string with two decimals ("12.50"); null when none is set. No currency is stored with it.

      • weightnumber | null
      • weight_unitstring | null
      • pricesarray of object
        Attributes of each item
        • price_liststring
        • currencystring | null
        • pricestring | null
          Example: 19.90
        • sale_pricestring | null

          Price after the sale running today on this list (a sale price list in Pricing), or the discounted price set on the row; null when neither applies.

      • stockarray of object

        Read only after creation: the quantity Nucleo Commerce last reported for each location.

        Attributes of each item
        • locationstring
        • availableinteger
        • on_handinteger
    • resultWriteResultrequired
      Child attributes
      • statusstringrequired

        partial: some variants or attribute values could not be written (see errors), 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 a 400, not a skip.

        One ofcreatedupdatedpartialskipped
      • errorsarray of objectrequired
        Attributes of each item
        • variant_skustring | null
        • messagestring
      • notesarray of stringrequired

        Fields not written and why.

  • 201The variant as it is now, and what happened.
    • dataVariantrequired
      Child attributes
      • idinteger
      • skustring
      • barcodestring | null
      • optionsobject

        The options that tell variants apart: attribute code → option code ({"size": "m"}). Option codes are normalised, so a size sent as M comes back as m.

      • coststring | null

        Purchase or production cost of this variant, as a string with two decimals ("12.50"); null when none is set. No currency is stored with it.

      • weightnumber | null
      • weight_unitstring | null
      • pricesarray of object
        Attributes of each item
        • price_liststring
        • currencystring | null
        • pricestring | null
          Example: 19.90
        • sale_pricestring | null

          Price after the sale running today on this list (a sale price list in Pricing), or the discounted price set on the row; null when neither applies.

      • stockarray of object

        Read only after creation: the quantity Nucleo Commerce last reported for each location.

        Attributes of each item
        • locationstring
        • availableinteger
        • on_handinteger
    • resultWriteResultrequired
      Child attributes
      • statusstringrequired

        partial: some variants or attribute values could not be written (see errors), 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 a 400, not a skip.

        One ofcreatedupdatedpartialskipped
      • errorsarray of objectrequired
        Attributes of each item
        • variant_skustring | null
        • messagestring
      • notesarray of stringrequired

        Fields not written and why.

  • 400The request must change: validation_failed (see details, one list of messages per field), invalid_json, invalid_cursor, product_not_written, variant_not_written, not_written, image_not_downloadable.
    • errorobjectrequired
      Child attributes
      • codestringrequired

        Stable machine-readable code. Branch on it, not on the message.

      • messagestringrequired
      • request_idstringrequired

        Same as the X-Request-Id header. Quote it to support.

      • detailsobject
  • 403read_only_key: this key cannot write.
    • errorobjectrequired
      Child attributes
      • codestringrequired

        Stable machine-readable code. Branch on it, not on the message.

      • messagestringrequired
      • request_idstringrequired

        Same as the X-Request-Id header. Quote it to support.

      • detailsobject
  • 404product_not_found, variant_not_found, image_not_found, import_not_found, webhook_not_found, channel_not_found, locale_not_found, or not_found for a path that does not exist.
    • errorobjectrequired
      Child attributes
      • codestringrequired

        Stable machine-readable code. Branch on it, not on the message.

      • messagestringrequired
      • request_idstringrequired

        Same as the X-Request-Id header. Quote it to support.

      • detailsobject
Request
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
    }
  ]
}'
Response
{
  "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"
    ]
  }
}
patch/products/{product}/variants/{variant}

Update a variant

Requires a read and write key.

Only the fields sent change. The SKU cannot change through the API.

PATCH https://api-catalog.nucleoplatform.com/api/catalog/v1/products/{product}/variants/{variant}
Authentication: Bearer token
Rate limit: 600 requests per 1m, per key (default; the catalog owner can set 1–6,000)

Path parameters

  • productstringrequired

    Product id or SKU.

    Example: TEE-001
  • variantstringrequired

    Variant id or SKU.

Headers

  • Idempotency-Keystring

    Any 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 a 409 idempotency_key_reused; while the first request is still running, 409 idempotency_key_in_progress with Retry-After: 1. Answers 429 and 5xx are not stored: retry them with the same key. Webhook secrets are never stored: a replayed webhook creation or rotation answers with secret: null.

    max length 255
    Example: 2b5c0d2e-7d2a-4f6e-9a51-0c8a1e7f3b44

Request bodyapplication/json

  • skustringrequired

    Unique in the whole catalog.

    max length 255pattern ^[A-Za-z0-9][A-Za-z0-9._-]*$
  • barcodestring

    Unique in the whole catalog.

    max length 255
  • sizestring

    Size code; becomes the variant's size option (read back in options, as a normalised option code).

    max length 255
  • costnumber | null

    Purchase 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; null removes it; 0 is a cost of zero.

    min 0max 9999999999.99
  • weightnumber | null

    Leaving it out keeps the current weight; null removes it.

    min 0max 9999999.999
  • weight_unitstring
    One ofgkglboz
  • pricesarray of PriceInput
    Attributes of each item
    • price_liststringrequired

      Price list code (GET /price-lists).

    • pricenumberrequired
      min 0max 99999999.9999
    • sale_pricenumber | null

      Discounted price on that list.

      min 0max 99999999.9999
  • stockarray of StockInput
    Attributes of each item
    • locationstringrequired

      Location code (GET /locations).

    • availableintegerrequired

      Initial quantity at that location: only where the variant has no stock yet.

Responses

  • 200The variant as it is now, and what happened.
    • dataVariantrequired
      Child attributes
      • idinteger
      • skustring
      • barcodestring | null
      • optionsobject

        The options that tell variants apart: attribute code → option code ({"size": "m"}). Option codes are normalised, so a size sent as M comes back as m.

      • coststring | null

        Purchase or production cost of this variant, as a string with two decimals ("12.50"); null when none is set. No currency is stored with it.

      • weightnumber | null
      • weight_unitstring | null
      • pricesarray of object
        Attributes of each item
        • price_liststring
        • currencystring | null
        • pricestring | null
          Example: 19.90
        • sale_pricestring | null

          Price after the sale running today on this list (a sale price list in Pricing), or the discounted price set on the row; null when neither applies.

      • stockarray of object

        Read only after creation: the quantity Nucleo Commerce last reported for each location.

        Attributes of each item
        • locationstring
        • availableinteger
        • on_handinteger
    • resultWriteResultrequired
      Child attributes
      • statusstringrequired

        partial: some variants or attribute values could not be written (see errors), 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 a 400, not a skip.

        One ofcreatedupdatedpartialskipped
      • errorsarray of objectrequired
        Attributes of each item
        • variant_skustring | null
        • messagestring
      • notesarray of stringrequired

        Fields not written and why.

  • 400The request must change: validation_failed (see details, one list of messages per field), invalid_json, invalid_cursor, product_not_written, variant_not_written, not_written, image_not_downloadable.
    • errorobjectrequired
      Child attributes
      • codestringrequired

        Stable machine-readable code. Branch on it, not on the message.

      • messagestringrequired
      • request_idstringrequired

        Same as the X-Request-Id header. Quote it to support.

      • detailsobject
  • 404product_not_found, variant_not_found, image_not_found, import_not_found, webhook_not_found, channel_not_found, locale_not_found, or not_found for a path that does not exist.
    • errorobjectrequired
      Child attributes
      • codestringrequired

        Stable machine-readable code. Branch on it, not on the message.

      • messagestringrequired
      • request_idstringrequired

        Same as the X-Request-Id header. Quote it to support.

      • detailsobject
Request
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
    }
  ]
}'
Response
{
  "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"
    ]
  }
}
delete/products/{product}/variants/{variant}

Delete a variant

Requires a read and write key.

Deletes the variant with its prices and stock.

DELETE https://api-catalog.nucleoplatform.com/api/catalog/v1/products/{product}/variants/{variant}
Authentication: Bearer token
Rate limit: 600 requests per 1m, per key (default; the catalog owner can set 1–6,000)

Path parameters

  • productstringrequired

    Product id or SKU.

    Example: TEE-001
  • variantstringrequired

    Variant id or SKU.

Headers

  • Idempotency-Keystring

    Any 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 a 409 idempotency_key_reused; while the first request is still running, 409 idempotency_key_in_progress with Retry-After: 1. Answers 429 and 5xx are not stored: retry them with the same key. Webhook secrets are never stored: a replayed webhook creation or rotation answers with secret: null.

    max length 255
    Example: 2b5c0d2e-7d2a-4f6e-9a51-0c8a1e7f3b44

Responses

  • 204Deleted.
  • 404product_not_found, variant_not_found, image_not_found, import_not_found, webhook_not_found, channel_not_found, locale_not_found, or not_found for a path that does not exist.
    • errorobjectrequired
      Child attributes
      • codestringrequired

        Stable machine-readable code. Branch on it, not on the message.

      • messagestringrequired
      • request_idstringrequired

        Same as the X-Request-Id header. Quote it to support.

      • detailsobject
  • 409idempotency_key_reused, idempotency_key_in_progress, webhook_limit.
    • errorobjectrequired
      Child attributes
      • codestringrequired

        Stable machine-readable code. Branch on it, not on the message.

      • messagestringrequired
      • request_idstringrequired

        Same as the X-Request-Id header. Quote it to support.

      • detailsobject
Request
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'
Response
HTTP 204 — Deleted.