AlmondTill/G3N API

updateStorefront

mutation · in the family Storefront

What it does

Edit a storefront — its name, selling location, theme, web address, collections, browse tree or channel division.

Edit a Storefront's editable fields — an ordinary revision, not a state change; a doomed Storefront cannot be edited (CONFLICT/IMMUTABLE). Refused while your organization's account is restricted. Send the record's current revision; a stale one is refused (CONFLICT/REVISION_STALE) — read again and retry.

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:

What happens

While the site is LIVE, the theme, selling location and web address are locked — take it down, edit, then republish; the name and merchandising edit freely.

Arguments

NameTypeRequiredNotes
idID ID!yesThe id of the record.
revisionID ID!yesThe revision id you read on the record; the change is refused if an edit landed in the meantime.
inputEditStorefrontInput EditStorefrontInput!yesEdit-input for a Storefront.

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

graphql
mutation ExampleUpdateStorefront($id: ID!, $revision: ID!, $input: EditStorefrontInput!) {
  updateStorefront(id: $id, revision: $revision, input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    logicalFacilityId
    theme
    customDomain
    collectionIds
    categoryId
    divisionId
  }
}

Variables:

json
{
  "id": "01900000-0000-7000-8000-beb0bb590000",
  "revision": "01900000-0000-7000-8000-b7960e180000",
  "input": {
    "caption": "Blue jeans"
  }
}

Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.

Example response

json
{
  "data": {
    "updateStorefront": {
      "id": "01900000-0000-7000-8000-beb0bb590000",
      "sysId": "SF-EXMP-0000-000F",
      "type": "Storefront",
      "caption": "Blue jeans",
      "status": "draft",
      "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

Dry run

Add dryRun: true to the request envelope (extensions.at) to rehearse this call: every check runs, the write is rehearsed against the current records and nothing is stored; the answer is the refusal a real call would give, or the record it would create. Every response to a rehearsal carries dryRun: true, so a rehearsed record is never mistaken for a saved one.