PUT
Replace a storefront template's draft markup

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

templateName
string
required

Body

application/json

BOTH KEYS ARE REQUIRED and neither is defaulted. An omitted draft_markup would mean an empty template rather than an unchanged one, and defaulting expected_updated_at would make the unsafe write the easy one. published_markup, published, name, store_id, chrome and updated_at 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.

draft_markup
string
required

The whole template, which REPLACES the stored draft. It is validated on the way in against the same gate that guards the rendered page, and against a stricter one for chrome kinds; a refusal is 400 invalid_markup naming the construct. Nothing here reaches a shopper until you publish.

expected_updated_at
string | null
required

The updated_at you last read. NULL asserts that this store has no template of this name, 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 template_modified. Nothing on this resource records an author, so this is the only thing that can tell two writers of one name apart.

Response

Success

data
object