在庫API

倉庫全体の在庫レベルをリアルタイムで監視します。

エンドポイント
GET

/inventory

inventory:read

すべての商品の在庫レベルを取得します。倉庫と在庫不足ステータスによるフィルタリングをサポートしています。

GET

/inventory/:productId

inventory:read

すべての倉庫における特定商品の在庫情報を取得します。

フィールドリファレンス
フィールド必須説明

id

string

いいえ

一意の在庫レコードID(読み取り専用)

productId

string

いいえ

商品識別子

productSku

string

いいえ

商品SKU

productName

string

いいえ

商品名(読み取り専用)

warehouseId

string

いいえ

倉庫識別子

warehouseName

string

いいえ

倉庫名(読み取り専用)

quantity

integer

いいえ

現在の在庫数量

reservedQuantity

integer

いいえ

保留中の注文のための予約数量

availableQuantity

integer

いいえ

利用可能数(数量からリザーブ分を差し引いたもの)

minThreshold

integer

いいえ

在庫不足アラートのしきい値

updatedAt

datetime

いいえ

最終在庫更新タイムスタンプ

クエリパラメータ(リスト)
フィールド必須説明

page

integer

いいえ

ページ番号(デフォルト:1)

limit

integer

いいえ

1ページあたりのアイテム数(デフォルト:20、最大:100)

warehouseId

string

いいえ

倉庫IDでフィルタ

lowStock

boolean

いいえ

在庫不足しきい値以下の商品のみ表示

使用例
在庫レベルを一覧表示
bash
curl "https://api.mercozy.com/api/v1/external/inventory?lowStock=true" \
  -H "X-API-Key: mk_live_your_key_here"
特定商品の在庫を取得
bash
curl "https://api.mercozy.com/api/v1/external/inventory/prod_abc123" \
  -H "X-API-Key: mk_live_your_key_here"
レスポンス例
json
{
  "data": {
    "productId": "prod_abc123",
    "productName": "Premium Widget",
    "sku": "WDG-001",
    "quantity": 42,
    "lowStockThreshold": 10,
    "warehouseId": "wh_main",
    "warehouseName": "Main Warehouse",
    "updatedAt": "2025-12-15T10:30:00Z"
  }
}