Is there a way to identify where a checkout validation was triggered?

Hi everyone,

I’m trying to understand if there is a way to identify where a particular checkout validation was triggered from.

I have a validation rule that I want to apply only when the customer checks out through the Online Store checkout. I don’t want the same validation to run for checkouts coming from other channels, such as the Shop app.

Is there any way to determine the source or channel of the checkout when the validation is triggered?

For example, I’d like to know whether the validation was triggered from:

  • Online Store checkout

  • Shop app checkout

  • Other Shopify checkout surfaces/channels

If there is a supported API, field, checkout context, or recommended approach for identifying the checkout source, I’d appreciate any guidance.

Thanks! :folded_hands:

Hi @Aravind_R

The current Cart and Checkout Validation Function input doesn’t include a documented sales-channel field, so it doesn’t provide a reliable way to distinguish Online Store checkout from the Shop app. buyerJourney.step tells you the stage of the purchase, such as cart interaction or checkout completion, but doesn’t identify the channel.

You can see the available input fields here: https://shopify.dev/docs/api/functions/latest/cart-and-checkout-validation

You could set a custom cart attribute in your storefront and read it in the Function, but I’d be careful about relying on that for channel detection. Product-page accelerated checkout buttons skip the cart and don’t support cart attributes, so a missing attribute doesn’t mean the checkout came from Shop: https://help.shopify.com/en/manual/online-store/dynamic-checkout/dynamic-checkout#cart-attributes

What does the validation check, and which Function API version are you using? I might be able to find a workaround for you

Hi @Yoni-Shopify

Thanks for your response!

We are a mandatory app that adds a cart attribute and a cart item property on the cart page. We use checkout interaction validation to check whether either of these is missing and prevent the customer from proceeding to checkout if the required data is missing.

We are currently using API version 2026-01.

Thanks for clarifying. I’m checking whether your validation can be limited to Online Store checkouts.

I haven’t confirmed a supported approach yet. I’ll follow up here when I have more information.

Hi @Aravind_R I’ve confirmed that Cart and Checkout Validation doesn’t currently support limiting a rule to Online Store checkouts.

I don’t have a supported workaround to recommend for this setup.

I suggest making this an Online Store theme integration requirement for merchants who enable your mandatory validation feature.

  1. Theme integration: Add a dedicated cart attribute when the customer uses the supported Online Store cart or express-checkout flow.
  2. Validation logic: If the identifier is present, validate the required cart attribute and line-item property. If it is absent, skip validation.
  3. Merchant responsibility: Clearly document that the feature requires the supported theme integration and that checkout flows bypassing this integration may not be validated.
  4. Testing: Verify normal checkout, product-page express checkout, cart-page express checkout, and Shop app checkout.

Important: Don’t use Cart Transform or buyerJourney.step as channel identifiers. Treat the marker as a flow indicator, not secure proof of the sales channel.

This approach is reasonable if merchants accept the limitation that validation is guaranteed only for the checkout flows your theme integration supports.

I dont see another option.

So if you can tell the exact objective of this validaiton can think of a way around using some hooks but Shopify will not give any specific signal.