saveStorefrontDraft
Requires permission storefront:storefront:update.
Save the storefront editor's draft. Buyers do not see it until it is published. Refused when it is not a storefront document, is over the size limit, or breaks the store page rule.
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 SaveStorefrontDraft($input: SaveStorefrontDraftInput!) {
saveStorefrontDraft(input: $input) {
updatedAt
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation SaveStorefrontDraft($input: SaveStorefrontDraftInput!) {\n saveStorefrontDraft(input: $input) {\n updatedAt\n }\n}",
"variables": {
"input": {
"draft": {}
}
}
}
EOF
Variables:
{
"input": {
"draft": {}
}
}
Response:
{
"data": {
"saveStorefrontDraft": {
"updatedAt": "2025-01-15T00:00:00Z"
}
}
}
saveStorefrontDraft(
input: SaveStorefrontDraftInput!
): StorefrontDraftSaved!
Arguments
saveStorefrontDraft.input ● SaveStorefrontDraftInput! non-null input
The details of the storefront draft to save.
Type
StorefrontDraftSaved object
The result of saving the storefront theme draft.