メニュー
POST
/webhook-menus
const url = 'https://api.smaregi.dev/TARGET-CONTRACT-ID/waiter/webhook-menus';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"contractId":"smaregi","event":"waiter:menus","action":"created","menuIds":["1","2","3"]}'};
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/waiter/webhook-menus \ --header 'Content-Type: application/json' \ --data '{ "contractId": "smaregi", "event": "waiter:menus", "action": "created", "menuIds": [ "1", "2", "3" ] }'プラットフォームAPIで参照できるメニューの登録、更新、削除を通知します。
サブメニュー専用フラグ(submenuOnly)による送信条件と action は以下のとおりです。
| 操作・変更 | action |
|---|---|
submenuOnly=false で登録 |
created |
submenuOnly=true で登録 |
送信しない |
false から false の更新 |
updated |
false から true の更新 |
deleted |
true から false の更新 |
created |
true から true の更新 |
送信しない |
削除前が false のメニューを削除 |
deleted |
削除前が true のメニューを削除 |
送信しない |
複数メニューを一度に処理する場合は、メニューごとに判定し、action ごとに分けて通知します。
対象となるメニューがない場合は通知しません。
Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Smaregi-Event
string
イベント名 waiter:menus
Request Body
Section titled “Request Body”Media typeapplication/json
object
contractId
契約ID
string
event
イベント
string
action
アクション
created: 登録updated: 更新deleted: 削除
string
menuIds
メニューIDリスト
array
Examples
Exampleリクエスト例
{ "contractId": "smaregi", "event": "waiter:menus", "action": "created", "menuIds": [ "1", "2", "3" ]}Responses
Section titled “Responses”OK