PUT
Replace the storefront builder draft

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.

Body

application/json

ALL THREE KEYS ARE REQUIRED and none is defaulted. Defaulting schema_version would store your document under a format it was not written for, and defaulting expected_updated_at would make the unsafe write the easy one. published, published_at, updated_at, store_id and published_by are refused BY NAME rather than ignored, so a client that tried to change the live storefront directly is told instead of being answered 200 while nothing happened.

schema_version
integer
required

The builder document format. A version this backend does not know is a 400 rather than a document stored and rendered as nothing.

draft
object
required

The whole builder document, which REPLACES the stored draft. It is opaque to this API: no field of it is validated beyond being a JSON object within the 512 KB bound, and nothing is merged. Read GET /api/v1/online-store, edit, send it all back.

expected_updated_at
string | null
required

The updated_at you last read. NULL asserts that this store has no configuration at all, which is the only way a first write can name a version that does not exist; it is refused the moment a row does exist, so it cannot be used to skip the check. A mismatch is 409 config_modified.

Response

Success

data
object