Skip to main content
See Branding your checkout for what a theme contains and the theme safety rules for what it may not.

Who can call

Publishable keys and shopper sessions are refused. Themes and assets belong to the store and are shared by test and live mode. Publish and make default change what live shoppers see. They need a live secret key, or a dashboard user with settings:manage who has completed step-up. A test key gets 403 FORBIDDEN. Drafts, uploads, previews, validation and brand pulls work with either kind of key.

Theme endpoints

The theme object

Create

from is { "preset": "blank" | "fashion" | "gaming" | "nonprofit" | "minimal" }, { "theme_id": "..." } to copy another theme’s draft, or "blank" ({ "name": "Empty", "from": "blank" }). A store can have 20 themes; the 21st is THEME_LIMIT.

Update

PATCH /v1/themes/:id takes name and/or draft. Unknown fields are rejected. The draft is validated in full: a document with any problem is a THEME_INVALID error and nothing is saved.

Validate

Preview

sample, scheme and viewport are all required. sample is checkout or link; scheme is light or dark; viewport is phone or desktop.
The link needs no sign-in and expires after 15 minutes. It shows the draft with sample data, is never cached or indexed, and never creates a session.

Delete

Deleting a theme is refused with THEME_IN_USE while it is the store’s default (details.reason: "default") or while any payment link names it (details.reason: "links", details.links: the link ids). If something else still references the theme when the delete runs, the reason is referenced. Sessions that already used the theme are not blocked; they render the default theme afterwards.

Brand pulls

Both return the new draft theme. from-store returns 404 NOT_FOUND when the connection is unknown or has not sent a brand yet. name is optional. A store can pull 10 times an hour (429 RATE_LIMITED). An unreadable site is BRAND_FETCH_FAILED (422) with details.reason of not_https, private_address, too_large, timeout, too_many_redirects, bad_status or network_error.

Theme assets

Send exactly one file and a kind of logo, image or font. Limits: PNG, JPEG, WebP or GIF up to 2 MB; SVG up to 512 KB (sanitised); .woff2 fonts up to 500 KB. Images are checked by content, re-encoded and stored on Tendr’s asset origin. A store can hold 200 assets.
Reference an asset in a theme by id, never by URL. An asset that a theme’s draft or published version still uses (by id, or by URL in its CSS or HTML) cannot be deleted: ASSET_IN_USE with details.themes.

Sessions with themes and line items

POST /v1/checkout/sessions accepts two more fields:
A 51st item is 400 VALIDATION_ERROR; a unit_amount with too many decimals is 400 VALIDATION_ERROR with the item index in details.field. Line items are display data for the order summary: the amount you send is what the shopper pays. Payment links name a theme with theme_id on create and update; null clears it.

Errors