Quickstart: Query Stock

Query real-time stock levels for your products.

Prerequisites You need your API credentials and an access token. See the Authentication Guide to get started.

Step 1: Get an Access Token

See the Authentication Guide for full details and alternative methods.

Bash
TOKEN=$(curl -s -X POST https://app.logistics-wms.com/api/external/v1/auth/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET" \
  | jq -r '.access_token')

Step 2: Query Stock for a Product

Use the stock endpoint to query current inventory levels. You can query stock for one or more products at a time by providing their external codes.

curl
curl -X POST https://app.logistics-wms.com/api/external/v1/product/stock \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "externalCodes": ["ERP-SKU-001", "ERP-SKU-002"]
  }'

Response

JSON Response (200 OK)
[
  {
    "externalCode": "ERP-SKU-001",
    "description": "Wireless Bluetooth Headphones",
    "bulk": 450,
    "containers": 0,
    "reservedShipping": 30,
    "existence": 450,
    "available": 420,
    "lots": [
      {
        "lotCode": "LOT-2026-A",
        "expirationDate": "2028-12-31",
        "bulk": 450,
        "containers": 0,
        "reservedShipping": 30,
        "existence": 450,
        "available": 420
      }
    ],
    "stockMovements": [
      {
        "movementType": "RECEPTION",
        "quantity": 500,
        "date": "2026-04-15T10:30:00",
        "documentCode": "REC-001"
      },
      {
        "movementType": "SHIPPING",
        "quantity": -50,
        "date": "2026-04-16T08:00:00",
        "documentCode": "SO-001"
      }
    ]
  },
  {
    "externalCode": "ERP-SKU-002",
    "description": "USB-C Charging Cable",
    "bulk": 1200,
    "containers": 50,
    "reservedShipping": 0,
    "existence": 1250,
    "available": 1250,
    "lots": [],
    "stockMovements": []
  }
]

Understanding Stock Fields

Field Description
bulk Units stored loose (not in containers) and available in picking locations
containers Units stored in containers (e.g., pallets, boxes) typically in reserve/buffer locations
reservedShipping Units already allocated to pending shipping orders (not yet dispatched)
existence Total physical stock = bulk + containers
available Stock available for new orders = existence - reservedShipping
Important The available field is the most relevant for e-commerce stock synchronization. Use this value to update your storefront's available-to-sell quantity.

Advanced: Query by Lot and Location

The stock response includes lot-level detail when the product is lot-tracked. Each lot entry contains the same stock fields (bulk, containers, reservedShipping, existence, available) broken down by lot.

For products with expiration dates, the expirationDate field on each lot lets you implement FEFO (First Expired, First Out) logic in your system.

Stock Movements

The stockMovements array provides a history of stock changes. Each movement includes the type, quantity (positive for additions, negative for removals), timestamp, and the associated document code. See the Enum Reference for all RestAPIStockMovementType values.

Next steps
  • Set up webhooks to receive real-time stock updates instead of polling
  • Review the Error Catalog for handling edge cases
  • Explore the full API Reference for all available parameters