Skip to main content
Stock queries provide real-time visibility into inventory levels. Each stock record represents a variant at a specific location with on-hand, reserved, and available quantities.

List Stock Records

curl -X GET "https://api.sushigo.com/api/v1/stock?inventory_location_id=1&min_on_hand=1" \
  -H "Authorization: Bearer YOUR_TOKEN"

Query Parameters

inventory_location_id
integer
Filter by inventory location
item_variant_id
integer
Filter by item variant
min_on_hand
number
Filter by minimum on-hand quantity (e.g., 1 to show only items with stock)
per_page
integer
default:"15"
Items per page

Response

data
array

Example Response

{
  "status": 200,
  "data": [
    {
      "id": 1,
      "inventory_location_id": 1,
      "item_variant_id": 5,
      "on_hand": 150.0,
      "reserved": 10.0,
      "available": 140.0,
      "weighted_avg_cost": 27.80,
      "inventory_location": {
        "id": 1,
        "name": "Almacén Principal",
        "type": "MAIN",
        "operating_unit": {
          "id": 1,
          "name": "Sucursal Centro"
        }
      },
      "item_variant": {
        "id": 5,
        "code": "ARR-KG",
        "name": "Arroz Premium 1kg",
        "item": {
          "id": 1,
          "sku": "INS-001",
          "name": "Arroz Sushi Premium"
        }
      }
    }
  ],
  "meta": {
    "current_page": 1,
    "per_page": 15,
    "total": 42
  }
}

Stock by Location

Get a detailed stock summary for a specific inventory location, including all variants stored there.
curl -X GET "https://api.sushigo.com/api/v1/stock/by-location/1" \
  -H "Authorization: Bearer YOUR_TOKEN"

Path Parameters

id
integer
required
Inventory location ID

Response

data
object

Example Response

{
  "status": 200,
  "data": {
    "inventory_location": {
      "id": 1,
      "name": "Almacén Principal",
      "type": "MAIN",
      "operating_unit": "Sucursal Centro"
    },
    "summary": {
      "total_variants": 3,
      "total_on_hand": 425.0,
      "total_reserved": 25.0,
      "total_available": 400.0,
      "total_inventory_value": 11835.00
    },
    "items": [
      {
        "item_variant_id": 5,
        "item_variant_code": "ARR-KG",
        "item_variant_name": "Arroz Premium 1kg",
        "item_name": "Arroz Sushi Premium",
        "item_sku": "INS-001",
        "on_hand": 150.0,
        "reserved": 10.0,
        "available": 140.0,
        "weighted_avg_cost": 27.80,
        "total_value": 4170.00
      },
      {
        "item_variant_id": 12,
        "item_variant_code": "SALM-KG",
        "item_variant_name": "Salmón Fresco 1kg",
        "item_name": "Salmón Fresco",
        "item_sku": "INS-002",
        "on_hand": 25.0,
        "reserved": 5.0,
        "available": 20.0,
        "weighted_avg_cost": 285.00,
        "total_value": 7125.00
      }
    ]
  }
}

Errors

  • 404 - Inventory location not found

Stock by Variant

Get a detailed stock summary for a specific item variant, showing quantities across all locations.
curl -X GET "https://api.sushigo.com/api/v1/stock/by-variant/5" \
  -H "Authorization: Bearer YOUR_TOKEN"

Path Parameters

id
integer
required
Item variant ID

Response

data
object

Example Response

{
  "status": 200,
  "data": {
    "item_variant": {
      "id": 5,
      "code": "ARR-KG",
      "name": "Arroz Premium 1kg",
      "item_name": "Arroz Sushi Premium",
      "item_sku": "INS-001"
    },
    "summary": {
      "total_locations": 2,
      "total_on_hand": 250.0,
      "total_reserved": 15.0,
      "total_available": 235.0,
      "avg_weighted_cost": 27.75,
      "total_inventory_value": 6937.50
    },
    "locations": [
      {
        "inventory_location_id": 1,
        "location_name": "Almacén Principal",
        "location_type": "MAIN",
        "operating_unit": "Sucursal Centro",
        "on_hand": 150.0,
        "reserved": 10.0,
        "available": 140.0,
        "weighted_avg_cost": 27.80,
        "total_value": 4170.00
      },
      {
        "inventory_location_id": 2,
        "location_name": "Cocina",
        "location_type": "KITCHEN",
        "operating_unit": "Sucursal Centro",
        "on_hand": 100.0,
        "reserved": 5.0,
        "available": 95.0,
        "weighted_avg_cost": 27.70,
        "total_value": 2770.00
      }
    ]
  }
}

Errors

  • 404 - Item variant not found

Understanding Stock Fields

Stock Quantities:
  • on_hand - Physical quantity in the location
  • reserved - Quantity allocated to orders or production
  • available - Quantity available for new allocations (on_hand - reserved)
Costing:
  • weighted_avg_cost - Weighted average cost calculated from stock movements
  • Updated automatically when receiving inventory
Use min_on_hand=1 in the list endpoint to show only items with stock, or min_on_hand=0.01 to include all variants that have ever had stock.

Build docs developers (and LLMs) love