Inventory

Version 1.0

The Inventory Entity serves as a critical component of our platform, ensuring accurate tracking and management of stock levels across multiple locations. Designed to be the definitive source of truth for inventory data, this entity provides merchants with a centralized system for monitoring availability, reservations, and future stock allocations. With robust support for inventory updates, batch processing, and seamless synchronization across sales channels, the Inventory Entity empowers businesses to optimize stock control, prevent overselling, and enhance fulfillment operations. By offering a structured and reliable inventory framework, this entity plays a pivotal role in maintaining operational efficiency and delivering a seamless commerce experience.


Inventory Entity

  • Name
    id
    Type
    unsigned bigint
    Description

    The unique identifier for the inventory entity.

  • Name
    inventory_location_id
    Type
    unsigned bigint
    Description

    The unique identifier for the inventory location.

  • Name
    product_id
    Type
    unsigned bigint
    Description

    The unique identifier for the product.

  • Name
    product_variant_id
    Type
    unsigned bigint
    Description

    The unique identifier for the product variant.

  • Name
    available
    Type
    unsigned integer
    Description

    The available quantity of the product.

  • Name
    reserved
    Type
    unsigned integer
    Description

    The reserved quantity of the product.

  • Name
    pre_booked
    Type
    unsigned integer
    Description

    The pre-booked quantity of the product.

  • Name
    sku
    Type
    varchar(255)
    Description

    The stock keeping unit of the product.

  • Name
    barcode
    Type
    varchar(255)
    Description

    The barcode of the product.

  • Name
    country_of_origin
    Type
    varchar(2)
    Description

    The country of origin of the product.

  • Name
    commodity_description
    Type
    varchar(255)
    Description

    The commodity description of the product.

  • Name
    tax_code
    Type
    varchar(255)
    Description

    The tax code of the product.

The Inventory resource

JSON
{
  "id": 1,
  "inventory_location_id": 1,
  "product_id": 1,
  "product_variant_id": 1,
  "available": 100,
  "reserved": 0,
  "pre_booked": 0,
  "sku": "ABC123",
  "barcode": "123456789",
  "country_of_origin": "US",
  "commodity_description": "Sample Product",
  "tax_code": "TAX001"
}

Batch Inventory Update

Batch Inventory Update

This endpoint allows you to batch inventory update.

Parameters

  • Name
    brand
    Type
    varchar(255)
    Required
    Description

    The brand of the product.

  • Name
    productCode
    Type
    varchar(64)
    Required
    Description

    The code of the product.

  • Name
    variants
    Type
    array
    Required
    Description

    An array of variants for the product.

Update Product Inventory

POST
/v1/batch/inventory
curl --request POST \
  --url https://local.qooly.test/api/v1/batch/inventory \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer token' \
  --data '{
    data: [
      {
        "brand": "Sample Brand",
        "productCode": "ABC123",
        "variants": [
          {
            "barcode": 123456789,
            "sku": "ABC123",
            "inventoryItems": [
              {
              "inventoryLocationCode": 50001,
              "available": 100
              },
              {
              "inventoryLocationCode": 50002,
              "available": 200
              }
            ]
          },
          {
            "barcode": 987654321,
            "sku": "ABC321",
            "inventoryItems": [
                {
                "inventoryLocationCode": 50001,
                "available": 50
                },
                {
                "inventoryLocationCode": 50002,
                "available": 100
                }
            ],
            "futureInventoryItems": [
              {
                "inventoryLocationCode": 50001,
                "available": 150,
                "availableFrom": "2024-01-07",
              }
            ]
          }
        ]
      },
      {
        "brand": "Sample Brand 2",
        "productCode": "ABC312",
        "variants": [
          {
            "barcode": 123453456,
            "sku": "ABC312",
            "inventoryItems": [
              {
              "inventoryLocationCode": 50001,
              "available": 100
              },
              {
              "inventoryLocationCode": 50002,
              "available": 200
              }
            ]
          },
          {
            "barcode": 987312342,
            "sku": "ABC213",
            "inventoryItems": [
              {
              "inventoryLocationCode": 50001,
              "available": 50
              },
              {
              "inventoryLocationCode": 50002,
              "available": 100
              }
            ],
            "futureInventoryItems": [
              {
              "inventoryLocationCode": 50001,
              "available": 150,
              "availableFrom": "2024-01-07",
              }
            ]
          }
        ]
      }
    ]
  }'