PUT
Save a store policy

Authorizations

Authorization
string
header
required

A secret API key. Publishable keys cannot reach this API. A key may carry an expiry, and an expired key is refused exactly like an unknown one, with a 401 that names no reason; check the key's expires_at in the dashboard rather than inferring it from a response. When a merchant rolls a key's secret they choose a grace window of up to 3 days, and for its duration BOTH the new secret and the one it replaced authenticate, so an integration moves over on its own deploy schedule instead of at the instant the button is pressed. Move before the window closes: after it, the old secret is refused. Nothing else about this contract moves with a roll. The key keeps its id and its scopes, so the only thing an integration updates is the credential itself.

Headers

Idempotency-Key
string
required

A unique key per logical write. Replaying a request with the same key returns the first response byte for byte instead of applying the write twice.

Path Parameters

policyType
string
required

Body

application/json

REPLACES THE WHOLE DOCUMENT: title, body and status travel together every time, there is no partial-field patch. status is REQUIRED rather than defaulting to draft when omitted, unlike the dashboard form this mirrors, because an integrator's omitted field silently unpublishing a LIVE policy while checkout keeps running is exactly the surprise this API's additive-only rule elsewhere exists to prevent. EVERY SAVE IS ATTRIBUTED AND RECOVERABLE. The call stamps updated_by_key_id on the row (never a fabricated staff identity, since an api key is not one) and appends the prior state to an append-only history before returning, so a merchant can always see who changed what and when, and reconstruct what the text said before this call. DELETE IS NOT PUBLISHED. Removing a policy takes the terms off the storefront while checkout keeps completing, and there is no dedicated restore route even though the history above could inform a manual fix from the dashboard.

title
string
required

The merchant's own heading for the document.

status
enum<string>
required

published means shoppers can read it on the storefront immediately. Case-insensitive on the way in, served lower-case.

Available options:
draft,
published
body
string

The policy text, stored verbatim. Not HTML-escaped and not stripped of markup; whatever renders it owns its own output safety. Omitted or empty both store an empty document.

Response

Success

data
object