Skip to main content
mutation

Requires write_validations access scope.

Creates a cart and checkout validation: a server-side rule enforced before a customer can complete checkout. Each validation is powered by a cart and checkout validation function that you provide using functionId or functionHandle.

Use validationCreate to apply custom rules at checkout, such as limiting item quantities, enforcing order minimums or maximums, or blocking checkout for restricted shipping addresses. Validations run on Shopify's servers and are enforced throughout checkout, so they can't be bypassed by the client.

Validation errors always block checkout progress. The blockOnFailure field controls whether runtime exceptions, such as timeouts, also block checkout.

•ValidationCreateInput!
required

The input fields for a new validation.


Was this section helpful?

Anchor to ValidationCreatePayload returnsValidationCreatePayload returns

•[ValidationUserError!]!
non-null

The list of errors that occurred from executing the mutation.

•Validation

The created validation.


Was this section helpful?