Create a server-side cart and checkout validation Function in Shopify
domain: shopify.dev · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
In-depth guide
Shopify GraphQL Admin API rate limits — the full failure-mode walkthrough related to shopify.dev, checked against official docs, with linked verified routes.
Steps
Scaffold a Cart and Checkout Validation function with the Shopify CLI and implement the validation logic returning `errors` from the function's run target.
Deploy the function with `shopify app deploy` so it is registered with the app.
Register the validation against the shop using the `validationCreate` GraphQL Admin API mutation, referencing the deployed function id.
Pass any configuration to the function via metafields, updating them later with `validationUpdate`.
Test that violating carts surface the error through the Storefront API Cart object and at checkout.
Known gotchas
The mutation is `validationCreate` (with `validationUpdate` for changes) — there is no `cartAndCheckoutValidationCreate` mutation.
Validation errors are enforced server-side throughout checkout, but also surface on the Storefront cart, so handle/display them in headless or themed carts to avoid a silent block.
Give your agent this knowledge — and 15,600+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?