在庫相対値更新
POST
/stock/{product_id}/add
const url = 'https://api.smaregi.dev/TARGET-CONTRACT-ID/pos/stock/example/add';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"storeId":"123456789012345","stockAmount":"1234567890","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 POST \ --url https://api.smaregi.dev/TARGET-CONTRACT-ID/pos/stock/example/add \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "storeId": "123456789012345", "stockAmount": "1234567890", "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": "1234567890", "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" }}Media typeapplication/json
object
type
required
string
title
required
string
detail
string
status
integer
Examples
{ "type": "about:blank", "title": "Bad Request", "detail": "更新後の在庫数は[999999999]以下である必要があります", "status": 400}{ "type": "about:blank", "title": "Bad Request", "detail": "更新後の在庫数は[-999999999]以上である必要があります", "status": 400}{ "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}