跳至內容
ShopentlyLearn

建立 · 庫存調整 — 庫存

更改實際和可銷售產品數量。

POST/api/v1/inventory/stock-adjustments

cURL 請求

curl --disable --globoff --fail-with-body --silent --show-error \
  --proto '=https' --connect-timeout 5 --max-time 30 \
  --request POST \
  --url https://shop.onshopently.com/api/v1/inventory/stock-adjustments \
  --header 'Authorization: Bearer EXAMPLE_ACCESS_TOKEN' \
  --header 'Idempotency-Key: example-create_adjustment_api_v1_inventory_stock_adjustments_post' \
  --header 'Content-Type: application/json' \
  --data-raw '{"expected_version":0,"locations":[{"location_id":"example","on_hand":1}],"reason":"Example","target_id":"example","target_type":"product","warehouse_id":"example"}'

回應

{
  "data": {
    "deleted": false,
    "id": "stock_v1_WyJleGFtcGxlIiwicHJvZHVjdCIsImV4YW1wbGUiXQ",
    "version": 1
  },
  "meta": {
    "request_id": "example"
  }
}

所需權限

身份驗證
存取權杖
最低方案
STANDARD
金鑰權限
編輯庫存inventory.stock:update