The Validation API enables you to provide your own validation of a cart and checkout. ## Extension targets The Validation API exposes the following [targets](/docs/apps/build/app-extensions/configure-app-extensions#targets): | Target | Output type | Description | | ------ | ----------- | ----------- | | `purchase.validation.fetch` | [FunctionFetchResult](/docs/api/functions/reference/cart-checkout-validation/graphql/functionfetchresult) | See [Network access for Shopify Function](/docs/apps/build/functions/input-output/network-access) | | `purchase.validation.run` | [FunctionRunResult](#functionrunresult) | Outputs the list of validation errors | ## Input The `RunInput` object is the complete schema that your function can receive as [input](/docs/apps/build/functions/input-output#input). For a list of fields that the Validation API's `Input` object accepts, refer to [Input](/docs/api/functions/reference/cart-checkout-validation/graphql/input). ### Example The following example shows an input query:
Field | Target value | |
---|---|---|
cart |
$.cart | |
email |
$.cart.buyerIdentity.email | |
phone |
$.cart.buyerIdentity.phone | |
address1 |
$.cart.deliveryGroups[0].deliveryAddress.address1 | |
address2 |
$.cart.deliveryGroups[0].deliveryAddress.address2 | |
city |
$.cart.deliveryGroups[0].deliveryAddress.city | |
company |
$.cart.deliveryGroups[0].deliveryAddress.company | |
countryCode |
$.cart.deliveryGroups[0].deliveryAddress.countryCode | |
firstName |
$.cart.deliveryGroups[0].deliveryAddress.firstName | |
lastName |
$.cart.deliveryGroups[0].deliveryAddress.lastName | |
phone |
$.cart.deliveryGroups[0].deliveryAddress.phone | |
provinceCode |
$.cart.deliveryGroups[0].deliveryAddress.provinceCode | |
zip |
$.cart.deliveryGroups[0].deliveryAddress.zip |