クーポン商品
POST
/webhook-coupon-products
const url = 'https://api.smaregi.dev/TARGET-CONTRACT-ID/pos/webhook-coupon-products';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"contractId":"string","event":"string","action":"created","ids":[{"couponId":"1","type":"1","division":"2","itemId":"1"},{"couponId":"1","type":"2","division":"2","itemId":"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-coupon-products \ --header 'Content-Type: application/json' \ --data '{ "contractId": "string", "event": "string", "action": "created", "ids": [ { "couponId": "1", "type": "1", "division": "2", "itemId": "1" }, { "couponId": "1", "type": "2", "division": "2", "itemId": "10" } ] }'Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Smaregi-Event
string
イベント名 pos:coupon-products
Request Body
Section titled “Request Body”Media typeapplication/json
object
contractId
契約ID
string
event
イベント
string
action
アクション
- created: 登録
- edited: 更新
- deleted: 削除
- bulk-deleted: 一括削除
string
ids
Array<object>
object
couponId
クーポンID
string
type
クーポンアイテムタイプ
(1:適用条件、2:商品付与)
string
division
クーポンアイテム区分
ItemId の値が何を示すものかを指定します。(1:部門ID、2:商品ID、3:グループコード)
string
itemId
アイテムID
クーポンに紐づくアイテムを特定するための、その区分におけるID。
string
Example
{ "contractId": "string", "event": "string", "action": "created", "ids": [ { "couponId": "1", "type": "1", "division": "2", "itemId": "1" }, { "couponId": "1", "type": "2", "division": "2", "itemId": "10" } ]}