startStorefrontEditGeneration
Requires permission storefront:storefront:update.
Start an async job that turns the seller's request about the page on screen into checked edits to its values (copy, options, style, visibility, order, names, theme tokens) — never code — or, when the seller asks a question about the editor, the page or the buyer app, a short answer in words (result.answer) that changes nothing. Returns a jobId immediately — poll storefrontEditGenerationJob(jobId) until COMPLETED/FAILED/CANCELLED. Writes nothing: the editor applies the edits. Meters AI credits when it runs.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation StartStorefrontEditGeneration($input: StartStorefrontEditInput!) {
startStorefrontEditGeneration(input: $input) {
status
costDisplay
creditsUsedCents
error
jobId
partial
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation StartStorefrontEditGeneration($input: StartStorefrontEditInput!) {\n startStorefrontEditGeneration(input: $input) {\n status\n costDisplay\n creditsUsedCents\n error\n jobId\n partial\n }\n}",
"variables": {
"input": {
"draft": {},
"pageId": "string",
"request": "string"
}
}
}
EOF
Variables:
{
"input": {
"draft": {},
"pageId": "string",
"request": "string"
}
}
Response:
{
"data": {
"startStorefrontEditGeneration": {
"status": "CANCELLED",
"costDisplay": "string",
"creditsUsedCents": 0,
"error": "string",
"jobId": "id",
"partial": "string"
}
}
}
startStorefrontEditGeneration(
input: StartStorefrontEditInput!
): StorefrontEditJob!
Arguments
startStorefrontEditGeneration.input ● StartStorefrontEditInput! non-null input
The seller's request, the editor's draft, the page on screen and what is selected.
Type
StorefrontEditJob object
A started storefront edit.