仕入先商品
POST
/webhook-supplier-products
const url = 'https://api.smaregi.dev/TARGET-CONTRACT-ID/pos/webhook-supplier-products';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"contractId":"string","event":"string","action":"created","ids":[{"supplierId":"1","division":"1","targetId":"1"},{"supplierId":"1","division":"2","targetId":"10"}]}'};
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/webhook-supplier-products \ --header 'Content-Type: application/json' \ --data '{ "contractId": "string", "event": "string", "action": "created", "ids": [ { "supplierId": "1", "division": "1", "targetId": "1" }, { "supplierId": "1", "division": "2", "targetId": "10" } ] }'Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Smaregi-Event
string
イベント名 pos:supplier-products
Request Body
Section titled “Request Body”Media typeapplication/json
object
contractId
契約ID
string
event
イベント
string
action
アクション
- created: 登録
- deleted: 削除
- bulk-update: 一括更新
- bulk-deleted: 一括削除
string
ids
Array<object>
object
supplierId
仕入先ID
string
division
区分
TargetIdが部門ID、商品IDのいずれを指すか指定します。(1:部門ID、2:商品ID)
string
targetId
対象のID
仕入先に紐づく部門IDか商品IDを指定します。
string
Example
{ "contractId": "string", "event": "string", "action": "created", "ids": [ { "supplierId": "1", "division": "1", "targetId": "1" }, { "supplierId": "1", "division": "2", "targetId": "10" } ]}