Manage Checkout Lifecycle

This API is in Beta. Endpoints and schemas may change without prior notice.

The body carries any combination of name, description, status, and is_default; at least one field is required. Metadata (name/description) is editable in any status, including ARCHIVED; configuration and styling of an archived checkout stay frozen (the Publish endpoint rejects it).

Lifecycle state machine

stateDiagram-v2 [*] --> PUBLISHED: Create Checkout PUBLISHED --> NOT_PUBLISHED: unpublish NOT_PUBLISHED --> PUBLISHED: publish PUBLISHED --> ARCHIVED: archive NOT_PUBLISHED --> ARCHIVED: archive ARCHIVED --> NOT_PUBLISHED: restore (step 1 of 2)
  • Publish (status: PUBLISHED) is only valid from NOT_PUBLISHED.
  • Restore is two-step: an ARCHIVED checkout goes back to draft first (status: NOT_PUBLISHED), then can be published (status: PUBLISHED). A direct ARCHIVED → PUBLISHED patch is rejected with 400 INVALID_STATUS_TRANSITION.
  • Patching to the current status is also rejected with 400.
  • Promote (is_default: true) force-publishes the checkout from any state (including ARCHIVED) and atomically demotes the previous default. When sent together with status, the promotion wins and status is ignored. is_default: false is rejected with 400; demote a default by promoting another checkout.
  • The default checkout is guarded: archiving or unpublishing it is rejected with 409 so the account’s storefront is never left without a live checkout.
PATCH/checkouts/{checkout_code}

Renames, publishes, unpublishes, archives, restores, or promotes the checkout. The body carries any combination of name, description, status, and is_default; at least one field is required (an empty body is rejected with 400). Status transitions follow the lifecycle state machine: publish (PUBLISHED) is only valid from NOT_PUBLISHED; an ARCHIVED checkout is restored in two steps (status: NOT_PUBLISHED first, then status: PUBLISHED); patching to the current status is rejected. Metadata (name/description) remains editable while ARCHIVED. is_default accepts only true: it promotes the checkout to account default, force-publishing it from any state, and atomically demotes the previous default; when is_default: true is sent together with status, the promotion wins and status is ignored. The default checkout cannot be archived or unpublished.

Header Parameters

X-Idempotency-Keystring

Optional client key, up to 64 characters. Best-effort; re-sending the same key is not guaranteed to be de-duplicated.

Path Parameters

checkout_codestringrequired

The unique identifier of the checkout to update (UUID, 36 chars). Non-UUID values are rejected with 400 before processing.

Body application/json

namestring

New checkout name. Unique per account (a duplicate name is rejected with 409). Editable in any status, including ARCHIVED.

descriptionstring

New checkout description. Editable in any status, including ARCHIVED.

status"PUBLISHED" | "NOT_PUBLISHED" | "ARCHIVED"

Target lifecycle status. PUBLISHED is only reachable from NOT_PUBLISHED; NOT_PUBLISHED is reachable from PUBLISHED (unpublish) or ARCHIVED (restore); ARCHIVED is reachable from PUBLISHED or NOT_PUBLISHED. Any other transition (including patching to the current status) is rejected with 400. Unknown values are rejected with 400.

is_defaultboolean

Only true is accepted: promotes this checkout to account default, force-publishing it from any state and atomically demoting the previous default. false is rejected with 400; demote by promoting another checkout instead.

Response

The updated checkout summary. The identifier is exposed as the top-level id. Read the resulting status with the Fetch endpoint.

idstring

Checkout identifier (UUID).

namestring

Checkout name.

descriptionstring

Checkout description.

is_defaultboolean

Whether this checkout is the account’s default.

is_activeboolean

Whether the checkout is active (serving traffic).

created_atstring<date-time>

Creation timestamp (ISO-8601).

Empty body, invalid or same-status transition, unknown status value, is_default: false, a non-UUID checkout_code, or a malformed JSON body.

codestring
messagesstring[]

Not authenticated, or the account is not in the beta allowlist.

The checkout was not found for this account.

codestring
messagesstring[]

Duplicate name, or the checkout is the account’s default and cannot be archived or unpublished.

Request
curl -X PATCH "https://api-sandbox.whitelabel.com/v1/checkouts/<checkout_code>" \
  -H "Content-Type: application/json" \
  -H "X-Idempotency-Key: <X-Idempotency-Key>" \
  -H "PUBLIC-API-KEY: <PUBLIC-API-KEY>" \
  -H "PRIVATE-SECRET-KEY: <PRIVATE-SECRET-KEY>" \
  -H "X-Account-Code: <X-Account-Code>" \
  -d '{
  "name": "string",
  "description": "string",
  "status": "PUBLISHED",
  "is_default": true
}'
Response
{
  "id": "string",
  "name": "string",
  "description": "string",
  "is_default": true,
  "is_active": true,
  "created_at": "1970-01-01T00:00:00.000Z"
}