publishStorefront
mutation · in the family Storefront
What it does
Take a draft storefront live — the whole configuration is re-checked and the custom web address (if set) is claimed.
Publish a draft Storefront: THE INVALID_CONFIG gate re-validates the whole config record-aware (selling LF active · theme ∈ the roster · collections active · division active + channel-kind · category active — VALIDATION/INVALID naming the miss) AND the custom domain (when set) claims its global uniqueness marker in the same transaction — CONFLICT/IDENTITY_TAKEN if another published site holds the name (cross-tenant blind: the refusal names nothing foreign). v1 provisions NO serving infrastructure. Requires the unrestricted capability + the record's current revision.
Before you call
A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.
Capability area: System and integration setup — Registers, connections and the settings your systems run on.
Roles that may call it:
- Owner
- System Administrator
- An API key whose scope allows
api:publishStorefront
Careful
Refused if any referenced piece is missing or inactive, or if another live storefront already holds that web address.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
id | ID ID! | yes | The id of the record. |
revision | ID ID! | yes | The revision id you read on the record; the change is refused if an edit landed in the meantime. |
reason | String | no |
Concurrency
Send the record’s current revision from your last read as revision. A stale revision is refused as CONFLICT/REVISION_STALE — read the record again and retry with the new value.
Returns
Storefront Storefront! — A Storefront — the ecom DTC publish-config document: which selling facility the site sells from, which canned theme renders it, which collections it merchandises, which browse tree and channel division frame it, and (optionally) the custom domain it claims. The lifecycle: born draft (claiming nothing) → publish (THE INVALID_CONFIG gate re-validates every ref record-aware + the global domain marker claims in the same transaction — CONFLICT/IDENTITY_TAKEN if another published site holds the name) → unpublish (the marker releases) → republish (the same gate + re-claim). published never dooms — unpublish first. The serving estate is deliberately absent v1: publish flips state, claims the domain, validates config — it provisions nothing; this record is the control plane the DTC workstream will consume. SEO copy rides the Decoration attachment, never fields here.
Example request
mutation ExamplePublishStorefront($id: ID!, $revision: ID!, $reason: String) {
publishStorefront(id: $id, revision: $revision, reason: $reason) {
id
sysId
type
caption
status
parentId
rootId
createdAt
updatedAt
revisionNum
revision
logicalFacilityId
theme
customDomain
collectionIds
categoryId
divisionId
}
}Variables:
{
"id": "01900000-0000-7000-8000-beb0bb590000",
"revision": "01900000-0000-7000-8000-b7960e180000",
"reason": "Correcting a miscount."
}Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.
Example response
{
"data": {
"publishStorefront": {
"id": "01900000-0000-7000-8000-beb0bb590000",
"sysId": "SF-EXMP-0000-000F",
"type": "Storefront",
"caption": "Blue jeans",
"status": "published",
"parentId": "01900000-0000-7000-8000-eacdfcfd0000",
"rootId": "01900000-0000-7000-8000-a1295a650000",
"createdAt": "2027-01-31T00:00:00.000Z",
"updatedAt": "2027-01-31T00:00:00.000Z",
"revisionNum": 1,
"revision": "01900000-0000-7000-8000-53c6eea90000",
"logicalFacilityId": "01900000-0000-7000-8000-10c08c590000",
"theme": "<theme>",
"customDomain": "<custom domain>",
"collectionIds": [
"01900000-0000-7000-8000-66cfa8b10000"
],
"categoryId": "01900000-0000-7000-8000-afb3e5910000",
"divisionId": "01900000-0000-7000-8000-a5e990060000"
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": {
"name": "genesis",
"number": 0
},
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}Errors this call can answer
VALIDATION/INVALID— Something in the request is not valid. Retry: no. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. Retry: no. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. Retry: no. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. Retry: yes. (RATE_LIMIT)NOT_FOUND/*— That record could not be found. Retry: no. (NOT_FOUND)CONFLICT/*— The record’s state, or a change made in the meantime, does not allow this; the codes are on the CONFLICT page. (CONFLICT)VALIDATION/VERSION_REQUIRED— The request did not say which app version it came from. Retry: no. (VALIDATION)