コンテンツにスキップ

営業時間と例外日を置き換える

PATCH
/api/v1/settings/hours
curl --request PATCH \
--url https://app.goyoka.com/api/v1/settings/hours \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "days": [ { "weekday": 1, "ranges": [ { "start_time": "example", "end_time": "example" } ] } ], "settings": { "buffer_before_minutes": 1, "buffer_after_minutes": 1, "slot_granularity_minutes": 1, "min_notice_minutes": 1, "max_advance_days": 1 }, "overrides": [ { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "type": "CLOSED", "start_date": "2026-04-15", "end_date": "2026-04-15", "start_time": "example", "end_time": "example", "label": "example", "location_name": "example", "location_address": "example", "access_note": "example" } ] }'

days は 7 曜日を一度ずつ指定して全置換します。各 range は start_time < end_time。settings は 5 欄すべて指定、省略すると保持します。overrides は省略で保持、空配列で全削除、配列で全置換。同店の既存 ID は維持し、他店・未知 ID は 404。既存予約は変更しません。鍵やトークンの持ち主が現在このお店のメンバーであることを確認します。同値でも所属がなければ409 SETTINGS_OPERATION_BLOCKED(NOT_CURRENT_MEMBER)で拒否します。

409 SETTINGS_OPERATION_BLOCKED⁠のdetails.blocks⁠はcode⁠とmessage⁠の1要素配列です。

必要な範囲: salon-settings:write

ヘッダーのパラメータ

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

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

メディアタイプapplication/json
object
days
必須
Array<object>
object
weekday
必須
integer
<= 6
ranges
必須
Array<object>
object
start_time
必須
string
/^([01]\d|2[0-3]):[0-5]\d$/
end_time
必須
string
/^([01]\d|2[0-3]):[0-5]\d$/
settings
object
buffer_before_minutes
必須
integer
<= 240
buffer_after_minutes
必須
integer
<= 240
slot_granularity_minutes
必須
integer
>= 5 <= 120
min_notice_minutes
必須
integer
max_advance_days
必須
integer
>= 1 <= 365
overrides
Array<object>
object
id
string 形式: uuid
type
必須
string
取りうる値: CLOSED CUSTOM_HOURS TRIP
start_date
必須
string 形式: date
end_date
string | null 形式: date
start_time
string | null
/^([01]\d|2[0-3]):[0-5]\d$/
end_time
string | null
/^([01]\d|2[0-3]):[0-5]\d$/
label
string | null
120文字以下
location_name
string | null
120文字以下
location_address
string | null
300文字以下
access_note
string | null
2000文字以下

営業時間と例外日を置き換える

メディアタイプapplication/json
object
data
必須
object
days
必須
Array<object>
object
weekday
必須
integer
<= 6
ranges
必須
Array<object>
object
start_time
必須
string | null
/^([01]\d|2[0-3]):[0-5]\d$/
end_time
必須
string | null
/^([01]\d|2[0-3]):[0-5]\d$/
settings
必須
object
buffer_before_minutes
必須
integer
<= 240
buffer_after_minutes
必須
integer
<= 240
slot_granularity_minutes
必須
integer
>= 5 <= 120
min_notice_minutes
必須
integer
max_advance_days
必須
integer
>= 1 <= 365
overrides
必須
Array<object>
object
id
必須
string 形式: uuid
type
必須
string
取りうる値: CLOSED CUSTOM_HOURS TRIP
start_date
必須
string 形式: date
end_date
必須
string 形式: date
start_time
必須
string | null
/^([01]\d|2[0-3]):[0-5]\d$/
end_time
必須
string | null
/^([01]\d|2[0-3]):[0-5]\d$/
label
必須
string | null
120文字以下
location_name
必須
string | null
120文字以下
location_address
必須
string | null
300文字以下
access_note
必須
string | null
2000文字以下
例
{
"data": {
"overrides": [
{
"type": "CLOSED"
}
]
}
}

利用できないヘッダ

メディアタイプ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"
}
}