How to Block a User on Clicking "Continue" to Payment Page in Shopify One Page Checkout?

Topic summary

A developer is creating a Shopify One Page Checkout extension and needs to conditionally block users from reaching the payment page.

Core Requirement:

  • Intercept the “Continue” button action during checkout
  • Validate user eligibility via an external API call
  • Only permit progression to payment if the API returns a positive/valid response

Current Status:
The developer is seeking guidance on implementation approaches and best practices for this checkout flow validation. No solutions or responses have been provided yet in this discussion.

Summarized with AI on November 1. AI used: claude-sonnet-4-5-20250929.

I’m building a Shopify One Page Checkout extension, and I need to block a user from proceeding to the payment page unless certain conditions are met. Specifically, I want to intercept the “Continue” button click, and only allow the user to continue if an API returns a positive value.

Can anyone guide me on how to implement this logic in the checkout flow? I want to ensure that if the API call returns a negative or invalid value, the user cannot proceed to the payment page.

Looking forward to any suggestions or best practices to achieve this!

Thanks in advance for your help!