Contents

Inventory

What you can sell now, per item and location: stock on hand, minus what is reserved for open orders and the safety stock, never below zero. With channel, the sales channel's allocation rules apply too: only the locations it sells from, minus the pieces held for other channels, within its caps. Pre-order quantities are not included.

Base URL, authentication and conventions of this API are on the Commerce API page.

get/inventory

Get availability

Requires the inventory:read scope.

Availability for up to 100 items per call, by SKU or barcode (or both). Only locations with stock or reservations for the item are listed; an SKU or barcode Nucleo does not know is left out of the answer. With channel, that sales channel's allocation rules apply. Scope inventory:read.

GET https://api-commerce.nucleoplatform.com/api/commerce/v1/inventory
Authentication: Bearer token
Rate limit: 600 requests per 1m, per connection — Default limit; ask Nucleo support if you need another one.

Query parameters

  • skustring

    Comma-separated SKUs.

    Example: TEE-BLK-M,TEE-BLK-L
  • barcodestring

    Comma-separated barcodes (EAN/UPC).

    Example: 8056377587370
  • channelstring

    A sales channel type (for example shopify) or the id of a sales channel connection.

Responses

  • 200Availability per item.
    Headers
    • X-Request-Id The id of this call. Quote it if you contact support; errors repeat it as request_id.
    • channelstring | nullrequired
    • dataarray of objectrequired
      Attributes of each item
      • skustring | null
      • barcodestring
      • availableinteger

        Sum of available over the listed locations.

      • incominginteger

        Pieces on inbound shipments expected in the next 365 days, not yet received.

      • locationsarray of object
        Attributes of each item
        • location_codestring | null
        • on_handinteger
        • reservedinteger

          Held for open orders.

        • availableinteger
  • 400The request is not valid: validation_failed (with details per parameter or field), invalid_cursor, invalid_json (the body is not a JSON object) or unknown_item (with details per line, for example lines.0).
    Headers
    • X-Request-Id The id of this call. Quote it if you contact support; errors repeat it as request_id.
    • errorobjectrequired
      Child attributes
      • codestringrequired

        Machine-readable code. Branch on this, never on message.

      • messagestringrequired
      • request_idstringrequired
      • detailsobject

        For validation_failed, the messages per parameter.

  • 401unauthorized: the key is missing or wrong, or the call comes from an IP outside the connection's allowlist.
    Headers
    • X-Request-Id The id of this call. Quote it if you contact support; errors repeat it as request_id.
    • errorobjectrequired
      Child attributes
      • codestringrequired

        Machine-readable code. Branch on this, never on message.

      • messagestringrequired
      • request_idstringrequired
      • detailsobject

        For validation_failed, the messages per parameter.

  • 403The key is right but cannot do this: insufficient_scope (the key lacks the scope of the call), connection_paused or connection_not_active (the connection is paused or not turned on yet).
    Headers
    • X-Request-Id The id of this call. Quote it if you contact support; errors repeat it as request_id.
    • errorobjectrequired
      Child attributes
      • codestringrequired

        Machine-readable code. Branch on this, never on message.

      • messagestringrequired
      • request_idstringrequired
      • detailsobject

        For validation_failed, the messages per parameter.

  • 429rate_limited: wait for the seconds in Retry-After.
    Headers
    • X-Request-Id The id of this call. Quote it if you contact support; errors repeat it as request_id.
    • Retry-After Seconds to wait before the next call.
    • errorobjectrequired
      Child attributes
      • codestringrequired

        Machine-readable code. Branch on this, never on message.

      • messagestringrequired
      • request_idstringrequired
      • detailsobject

        For validation_failed, the messages per parameter.

Request
curl -X GET 'https://api-commerce.nucleoplatform.com/api/commerce/v1/inventory?sku=TEE-BLK-M%2CTEE-BLK-L&barcode=8056377587370' \
  -H "Authorization: Bearer $NUCLEO_ACCESS_TOKEN" \
  -H 'Accept: application/json'
Response
{
  "channel": null,
  "data": [
    {
      "sku": "TEE-BLK-M",
      "barcode": "8056377587370",
      "available": 5,
      "incoming": 0,
      "locations": [
        {
          "location_code": "WH1",
          "on_hand": 6,
          "reserved": 1,
          "available": 5
        }
      ]
    }
  ]
}
Was this page helpful?