---
title: "Update Gift Stock"
method: PUT
path: "/gifts/{id}/stocks"
tags: ["Gifts"]
---

# Update Gift Stock

`PUT /gifts/{id}/stocks`

To update the gift stock with its ID<br> 使用商品 ID 更新贈品在各個倉庫的庫存

## Path parameters

- `id` string, required

## Request body

- object
  - `warehouse_id` string, required — Warehouse’s id<br>倉庫 id<br>-----<br>Only warehouse with status "active" can be updated<br>只有 status “active” 的 warehouse stock 的可以更新
  - `quantity` number, required — Quantity<br>(新增/減少)商品數量<br><br>Negative number is allowed<br>允許更新庫存為負值
  - `is_replace` boolean — Whether replacing the original quantity<br>是否取代原本數量<br><br>true: replace the product's quantity with the number you provided<br>取代原本數量<br><br>false: increase/decrease the quantity with the number you provided<br>增加/減少數量

## Response `200`

OK

- ProductStock
  - `id` string — Product's ID<br>商品ID
  - `title_translations` object — Title translations<br>商品名稱
    - `en` string — Merchant defined English name<br>店家定義英文名稱
    - `zh-hant` string — Merchant defined Traditional Chinese name<br>店家定義繁體中文名稱
    - `zh-cn` string — Merchant defined Simplified Chinese name<br>店家定義簡體中文名稱
    - `vi` string — Merchant defined Vietnamese name<br>店家定義越南文名稱
    - `ms` string — Merchant defined Malaysian name<br>店家定義馬來西亞文名稱
    - `ja` string — Merchant defined Japanese name<br>店家定義日文名稱
    - `th` string — Merchant defined Thai name<br>店家定義泰文名稱
    - `id` string — Merchant defined Indian name<br>店家定義印度文名稱
    - `de` string — Merchant defined Deutsch name<br>店家定義德文名稱
    - `fr` string — Merchant defined France name<br>店家定義法文名稱
  - `unlimited_quantity` true | false — Unlimited product quantity or not.<br>商品數量是否無限
  - `stocks` object — Product's Stock<br>庫存
    - `warehouse_id` string
    - `quantity` integer
  - `variations` object — Product's Variation<br>規格品
    - `id` string
    - `fields_translations` object — Product variation name<br>規格名稱
      - `en` string[] — Merchant defined English name<br>店家定義英文名稱
      - `zh-hant` string[] — Merchant defined Traditional Chinese name<br>店家定義繁體中文名稱
      - `zh-cn` string[] — Merchant defined Simplified Chinese name<br>店家定義簡體中文名稱
      - `vi` string[] — Merchant defined Vietnamese name<br>店家定義越南文名稱
      - `ms` string[] — Merchant defined Malaysian name<br>店家定義馬來西亞文名稱
      - `ja` string[] — Merchant defined Japanese name<br>店家定義日文名稱
      - `th` string[] — Merchant defined Thai name<br>店家定義泰文名稱
      - `id` string[] — Merchant defined Indian name<br>店家定義印度文名稱
      - `de` string[] — Merchant defined Deutsch name<br>店家定義德文名稱
      - `fr` string[] — Merchant defined France name<br>店家定義法文名稱
    - `stocks` object
      - `warehouse_id` string
      - `quantity` integer

## Other responses

- `404` — Not found error
- `500` — Server error

---

[API](https://skmtc.net/shoplineapp/apis/shopline-open-api.md) · [All operations](https://skmtc.net/shoplineapp/apis/shopline-open-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/shoplineapp/shopline-open-api/revisions/1675ac12cde7/schema)
