コンテンツにスキップ

メニューを丸ごと置き換え(送らなかった行は削除)

PUT
/api/v1/events/{id}/menus
curl --request PUT \
--url https://app.goyoka.com/api/v1/events/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/menus \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "menus": [ { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "service_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "price_yen": 1, "duration_minutes": 1, "timing_mode": "FIXED", "required": true, "display_order": 1, "buffer_before_minutes": 1, "buffer_after_minutes": 1, "menu_category": { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "open_by_default": true, "sort_order": 1, "parent_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }, "menu_category_key": "example", "selection_group_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ], "boxes": { "source": "LEDGER" }, "dry_run": true }'

メニューを丸ごと置き換え、送らなかった行は削除します。先にGET⁠して全行を読んでください。配列順を優先します。boxes省略は箱と所属を保持します。EVENT箱ではmenu_category_key省略時にmenu_category.id⁠からkey⁠を補います。menu_category⁠は読取投影で、箱の変更はboxes⁠とmenu_category_key⁠を使います。selection_group_id⁠は既存値の往復だけを受けます。service_id付き行のname・price_yen・duration_minutes⁠は台帳のメニューが正本でbody値を無視し、料金変更はservices_update⁠を使ってください。完全一致の往復は書き込みません。任意の冪等キーを使えます。

保存状態で拒否する変更は409 EVENT_EDIT_BLOCKED⁠です。details.blocks⁠は理由の配列で、code⁠で分岐しmessage⁠を表示します。

アーカイブ済みイベントは404 NOT_FOUND⁠です。

BOOKING_INPUT_INVALID⁠は、欄名を持つ業務エラーならdetails.fieldErrors、欄名がない場合はdetails⁠なしとなる経路もあります。MCP⁠でも業務エラーはstructuredContent.error⁠に返します。入力の形の誤りは、REST⁠では422 VALIDATION(details.fieldErrors)、MCP⁠ではツールの入力検査のエラー文を返します。

ハンドラ内で検査するメニューID・箱のID⁠やkey⁠の重複、selection_group_id⁠の変更、箱の指定と所属の不整合は422 VALIDATION⁠です。これはMCP⁠でもstructuredContent.error⁠にcode:VALIDATION⁠とdetails.fieldErrors⁠を返します。

必要な範囲: events:write

id
必須
string 形式: uuid

ヘッダーのパラメータ

「ヘッダーのパラメータ」の節へ
Idempotency-Key
string

同じ内容の再送に同じ値を使います。異なる内容との再利用や処理中の再送は409 IDEMPOTENCY_KEY_REUSED⁠です。

メディアタイプapplication/json
object
menus
必須
Array<object>
object
id
string 形式: uuid
service_id
string | null 形式: uuid
name
必須
string
1文字以上 120文字以下
price_yen
必須
integer
<= 2147483647
duration_minutes
必須
integer
>= 1 <= 2147483647
timing_mode
必須
string
取りうる値: FIXED INDIVIDUAL
required
必須
boolean
display_order
integer
>= -2147483648 <= 2147483647
buffer_before_minutes
integer
<= 2147483647
buffer_after_minutes
integer
<= 2147483647
menu_category
object
id
必須
string 形式: uuid
name
必須
string
60文字以下
open_by_default
必須
boolean
sort_order
必須
integer
>= -2147483648 <= 2147483647
parent_id
string | null 形式: uuid
menu_category_key
string | null
1文字以上
selection_group_id
string | null 形式: uuid
boxes
どれか1⁠つ:
object
source
必須
string
取りうる値: LEDGER
dry_run

true⁠で保存せず、送った内容で保存したときに足す・消す・変える行を preview に返します(data は保存済みのまま)。お店の人に変わる中身を見せてから保存するときに使います。冪等キーは保存のときとは別のキーを使うか、付けないでください(同じキーだと本文が違うので保存が断られます)。

boolean

メニューを丸ごと置き換え(送らなかった行は削除)

メディアタイプapplication/json
object
data
必須
Array<object>
object
id
必須
string 形式: uuid
service_id
必須
string | null 形式: uuid
name
必須
string
1文字以上 120文字以下
price_yen
必須
integer
<= 2147483647
duration_minutes
必須
integer
>= 1 <= 2147483647
timing_mode
必須
string
取りうる値: FIXED INDIVIDUAL
required
必須
boolean
display_order
必須
integer
>= -2147483648 <= 2147483647
buffer_before_minutes
必須
integer
<= 2147483647
buffer_after_minutes
必須
integer
<= 2147483647
menu_category
必須
object
id
必須
string 形式: uuid
name
必須
string
60文字以下
open_by_default
必須
boolean
sort_order
必須
integer
>= -2147483648 <= 2147483647
parent_id
string | null 形式: uuid
selection_group_id
必須
string | null 形式: uuid
menu_category_source
必須
string
取りうる値: LEDGER EVENT
preview

dry_run:true のときだけ返す下見。added は新しく足す行(index は送った配列の位置)、removed は送らなかったので消える行、changed は id ありで値が変わる行と変わる欄の名前です。保存はしていません。

object
saved
必須
boolean
added
必須
Array<object>
object
index
必須
integer
label
必須
string
removed
必須
Array<object>
object
id
必須
string
label
必須
string
warning
必須
string | null
changed
必須
Array<object>
object
id
必須
string
label
必須
string
fields
必須
Array<string>
unchanged_count
必須
integer
order_changed
必須
boolean
notes
必須
Array<string>
例
{
"data": [
{
"timing_mode": "FIXED"
}
],
"menu_category_source": "LEDGER",
"preview": {
"saved": false
}
}

利用できないヘッダ

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}

鍵が無い・無効

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}

範囲不足

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}

見つからない

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}

予約・冪等キーの競合

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}

本文が1 MiB⁠を超えている

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}

入力の検証失敗

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}

回数の上限

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}
RateLimit-Limit
integer
>= 1

固定窓内の回数上限

RateLimit-Remaining
integer

固定窓内の残り回数

RateLimit-Reset
integer

窓終了までの秒数

Retry-After
integer
>= 1

再試行までの待機秒数

内部エラー

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}