How to handle user cancel one time purchase to redirect user back to the app

Topic summary

A developer is experiencing an issue with their Shopify app’s billing flow for a one-time purchase credit system.

The Problem:

  • When users cancel the payment confirmation, they are redirected outside the embedded app environment
  • The developer needs users to remain within or return to the embedded app even after canceling a transaction

Current Status:

  • The issue involves the Shopify Billing API implementation
  • Screenshots show the confirmation flow and the problematic redirect behavior
  • The developer is seeking guidance on proper redirect handling for canceled transactions

This appears to be an open question with no responses yet, looking for best practices or technical solutions to maintain the embedded app context during payment cancellations.

Summarized with AI on October 31. AI used: claude-sonnet-4-5-20250929.

Hello,

My shopify app uses the billing api to get user to pay for the in-app credit system. However, I noticed that if the user cancels the confirmation url, the user will be taken outside the embedded app.

I need to properly take the user back to the embedded app even if the user cancels the transaction.

Can someone help me? Thanks!