在庫更新
PATCH
/stock/{product_id}
const url = 'https://api.smaregi.dev/TARGET-CONTRACT-ID/pos/stock/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"storeId":"123456789012345","stockAmount":"123456789","stockHistory":{"memo":"string"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.smaregi.dev/TARGET-CONTRACT-ID/pos/stock/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "storeId": "123456789012345", "stockAmount": "123456789", "stockHistory": { "memo": "string" } }'在庫情報を更新します。
在庫数は、入力された値と同じになるよう更新します。
対象プラン
- スタンダード
- プレミアム
- プレミアムプラス
- フードビジネス
- リテールビジネス
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”product_id
required
string
商品ID
Request Body
Section titled “Request Body”Media typeapplication/json
object
storeId
required
店舗ID
※ ユーザーアクセストークンを利用する場合、ユーザーの所属する店舗IDを指定してください。
string format: int
stockAmount
required
在庫数
string format: int
stockHistory
在庫変動履歴
object
memo
メモ
在庫変動履歴に設定するメモ
string
Example
{ "storeId": "123456789012345", "stockAmount": "123456789", "stockHistory": { "memo": "string" }}Responses
Section titled “Responses”取得成功
Media typeapplication/json
object
productId
商品ID
string
storeId
店舗ID
string
stockAmount
在庫数
string
updDateTime
更新日時
string
stockHistory
在庫変動履歴
object
id
在庫変動履歴ID
string
memo
メモ
string
Example
{ "productId": "string", "storeId": "string", "stockAmount": "string", "updDateTime": "string", "stockHistory": { "id": "string", "memo": "string" }}- 店舗IDが存在しない場合
Media typeapplication/json
object
type
required
string
title
required
string
detail
string
status
integer
Examples
ExampleURI指定の店舗IDが存在しない場合
{ "type": "about:blank", "title": "Bad Request", "detail": "指定された店舗IDのリソースが見つかりません", "status": 400}- URI指定の商品IDが存在しない場合
Media typeapplication/json
object
type
required
string
title
required
string
detail
string
status
integer
Examples
Exampleリソースが存在しない場合
{ "type": "about:blank", "title": "NotFound", "detail": "指定されたIDのリソースが見つかりません", "status": 404}