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 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp