Skip to main content

Web Billing

IAPHUB offers a seamless solution for selling subscriptions and digital goods on the web.

By enabling Web Billing, you can:

  • Easy Setup: Connect your Stripe account in just a few clicks.
  • Unified Management: Handle both mobile (iOS/Android) and web transactions in a single place.
  • Web Checkout: Sell subscriptions and digital goods with a secure, hosted checkout page.
  • Web Customer Portal: Provide a fully localized, self-service portal for users to manage their subscriptions (cancel, resume, upgrade) without writing a single line of code.
  • Cross-Platform Entitlements: Web purchases are automatically detected by the IAPHUB SDK in your mobile app, using your existing setup—no additional code required.

Configuration

To start processing web payments, you need to connect your Stripe account to IAPHUB.

  1. Go to the IAPHUB Dashboard.
  2. Navigate to Settings -> Web.
  3. Locate the Stripe section.
  4. Click the button to connect IAPHUB to Stripe.
Already using Stripe?

If you are already using Stripe for an internal system, we strongly recommend creating a new Stripe App dedicated to IAPHUB. This ensures that transactions are kept separate and prevents any conflicts with your existing webhooks or data.

Sandbox & Production

You can connect both Sandbox and Production environments. We recommend connecting the Sandbox environment first to test the integration before enabling real payments in Production.

Sandbox Configuration

To test payments without using a real credit card, you must enable the Sandbox Mode.

  1. In the Web settings page, scroll down to the Sandbox Mode section.
  2. Check the Enabled box.
  3. Add the email addresses you intend to use for testing in the Sandbox emails list.
Important

Only users with an email address listed in the Sandbox emails will be able to perform sandbox transactions. When testing the checkout flow, make sure to enter one of these authorized emails.

Sandbox Behavior

To facilitate testing:

  • Sandbox subscriptions automatically renew every 24 hours, regardless of the product duration.
  • Sandbox subscriptions are automatically cancelled after 5 days.

Once you have finished testing and are ready to process real payments, you can safely disable the Sandbox Mode to prevent any accidental sandbox transactions.

App Configuration

To ensure the billing portal and emails function correctly, you must provide some details about your application.

  1. In the Web settings page, scroll down to the App section.
  2. Fill in the required information:
    • App Name: The name displayed in emails and the billing portal. You can add multiple languages to localize the name.
    • Support Email: The email users should contact for support.

Once Stripe is connected, you can use the IAPHUB Web Checkout and Web Customer Portal.

Web Checkout

Use this link to direct users to a payment page where they can purchase a product.

http://billing.iaphub.com/:webKey/checkout?product=:productAlias&email=:email&userId=:userId

Parameters:

ParameterTypeDescription
webKeyPathRequired. The app web key found in the dashboard settings.
productQueryRequired. The alias of the product (e.g. premium_1m).
userIdQueryRequired. The user ID (same as the one provided to the login method of the IAPHUB SDK).
emailQuery(Optional) The customer's email address. If omitted, the user will be prompted to enter it.

Web Customer Portal

Use this link for users to manage their existing subscriptions (e.g., cancel, upgrade, update payment method). When accessing this link, users will be asked to enter their email address. They will receive a one-time code in their inbox to log in securely.

http://billing.iaphub.com/:webKey/portal?email=:email

Parameters:

ParameterTypeDescription
webKeyPathRequired. The app web key found in the dashboard settings.
emailQuery(Optional) The customer's email address. If omitted, the user will be prompted to enter it (unless already logged in).

SDK Integration

The IAPHUB SDK automatically handles web purchases without requiring complex manual synchronization.

1. Purchase on Web

Once a web purchase is processed successfully:

  1. IAPHUB records the new transaction by listening to Stripe webhooks.
  2. The purchase webhook is triggered to notify your server (if enabled).
  3. The transaction becomes available through the Get Transaction API.

2. Handle Purchase in App

When the user returns to your mobile app:

3. Handle Subscription Updates

Renewals, cancellations, refunds, and other updates are automatically synchronized. IAPHUB listens to Stripe webhooks and refreshes the subscription state using the Stripe API whenever a notification is received. These events will trigger their respective webhooks (e.g. subscription_renewal, subscription_cancel, subscription_expire).

Beta

This is the latest feature offered by IAPHUB and it is still in beta testing.

We have many improvements coming your way in the near future, such as:

  • Processing a web payment directly from the IAPHUB SDK
  • Processing payments for unauthenticated users (when the user ID is not known)

If you have any feedback or feature requests, feel free to contact us at [email protected].