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. Nothing is merged: read GET /api/v1/online-store, edit, and send it all back. ONE FIELD OF IT IS VALIDATED and the rest is opaque, held only to being a JSON object within the 512 KB bound. global.custom_font_id is checked against the store's uploaded font families. A family that EXISTS but is missing the 400 or the 700 weight in the normal style is refused with 400 invalid_body naming draft.global.custom_font_id, because a one-weight family fails nowhere: the browser synthesises the missing bold and every heading in the store renders in a smeared copy of the regular face. AN ID THAT RESOLVES TO NOTHING IS ACCEPTED, whether the family was deleted or belongs to another store. Such a document renders the Google family rather than a wrong typeface, and refusing it would lock a merchant out of editing the very draft that names it. If the font library cannot be read at all the write is refused with 503 font_check_unavailable rather than stored unchecked, because a check that could not run is not a check that passed. Retry shortly.

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