コンテンツにスキップ

確認した予約規約を公開する

POST
/api/v1/settings/legal/booking-terms/publish
curl --request POST \
--url https://app.goyoka.com/api/v1/settings/legal/booking-terms/publish \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "expected_content_hash": "example" }'

公開前にGET /settings/legal/booking-terms⁠で本文を確認し、preview.content_hash⁠をそのままexpected_content_hash⁠へ渡してください。本文と構造化データを含むcanonical hash⁠を取引内で照合し、違えば409 SETTINGS_OPERATION_BLOCKED(details.blocks[].code:CONTENT_HASH_MISMATCH)で公開しません。実際の本文やhash⁠はエラーに含めません。CONTENT_HASH_MISMATCH⁠はGET⁠し直して本文と条件を確認し、最新のpreview.content_hash⁠をexpected_content_hash⁠へ渡してください。小文字hex64桁以外は422⁠です。

予約確認メールの版固定URL⁠は変えません。409 SETTINGS_OPERATION_BLOCKED⁠のdetails.blocks⁠はcode⁠とmessage⁠の1要素配列です。

EMPTY_BODY⁠は本文を補ってください。機微scope⁠のlegal:publish単独で呼べます。salon-settings:read/write⁠を暗黙に含まず、GET⁠にはsalon-settings:read、下書き保存にはsalon-settings:write⁠が要ります。鍵やトークンの持ち主が現在のお店のメンバーであることを確認します。同canonical hash⁠は200/changed:false/published:false⁠で版・日時・参照を変えません。本文が同じでも構造化データの条件が違えば新版になります。任意の冪等キーを使えます。保存競合は409 SETTINGS_OPERATION_BLOCKED⁠で、details.blocks[].code⁠はCONCURRENT_UPDATE⁠です。GET⁠で読み直してから同じ要求をやり直してかまいません。公開済みのお店では下書きの条件は公開するまで適用されません。未公開のお店の条件実変更PATCH⁠には追加のlegal:publish⁠が要ります。公開直後の次の描画で本文と管理画面の状態を読み直し、新しい予約の条件、確定メール本文のキャンセル要約、契約要約・返金予定額に公開した条件が使われます。開いた画面の自動更新はありません。この操作のメール0通、再同意の依頼も送りません。過去の予約・同意記録・過去版と過去予約の条件や返金予定額は維持します。公開済み文書の取り下げはできません。

必要な範囲: legal:publish

ヘッダーのパラメータ

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

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

メディアタイプapplication/json
object
expected_content_hash
必須
string
例自動生成
{
"expected_content_hash": "example"
}

確認した予約規約を公開する

メディアタイプapplication/json
object
data
必須
object
kind
必須
string
取りうる値: SALON_PRIVACY BOOKING_TERMS TOKUSHO
changed
必須
boolean
published
必須
boolean
revision_id
必須
string | null 形式: uuid
published_version
必須
integer | null
> 0
published_at
必須
string | null 形式: date-time
例
{
"data": {
"kind": "SALON_PRIVACY"
}
}

利用できないヘッダ

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