Billing API implementation flow

A typical install process looks like this:

  1. User Clicks “Get” on App Store Listing
  2. App Receives Shop Domain And Redirects User Back To Install Page With client_id, scope, redirect_uri and state.
  3. User Clicks “Install” and is redirected back to your app using the redirect_uri above for authentication. Response should include a code, HMAC, timestamp, state and shop. The app should validate the returned response by comparing the sent state to the returned state, as well as validating the return HMAC.
  4. App generates an oauth access token using the returned code and your app API Key & secret.
  5. App creates a recurring application charge with the plan name, price, return_url, trial_days and test status. App then redirects user to the returned confirmation_url.
  6. User accepts charge and is redirected back to your App using the redirect_url defined in the recurring application charge creation. Returned user carries a charge_id in the URL.
  7. App looks up the recurring application charge status using the returned charge_id. If user has accepted the charge, app activates the charge.
  8. App completes necessary install functions. For example in your case this would include adding the Script Tag.

Once the user has accepted the recurring application charge you shouldn’t need to create another one, unless the customer cancels. Keep the returned charge_id stored so you can make a API call to check the status of the charge if needed.

Good luck with your app!

Cheers,

Joel.