Add a hosted checkout to your mobile app

Get a step-by-step overview of how to add a Paddle-hosted external purchase flow for your iOS app, letting you go direct to customers while remaining compliant.

With recent developments in legislation around the App Store, you can link users in the United States to an external checkout for purchases in iOS apps.

You can use hosted checkouts to let users securely make purchases outside your app — no hosting required. Customers tap a button in your app to open a checkout that's fully hosted by Paddle, then they're redirected to your app when they complete their purchase.

What are we building?

In this tutorial, we'll use hosted checkouts in Paddle to build an external purchase flow for in-app purchases in iOS apps.

We'll walk through handling fulfilment using the RevenueCat x Paddle integration or webhooks.

Illustration showing a mobile checkout flow. On the left, a payment screen with product details, price, and payment options. On the right, a confirmation screen with a success message and return to app button.

What's not covered

This tutorial doesn't cover:

  • Handling authentication

    We assume you already have a way to identify your users, like Firebase or Sign in with Apple.

  • Native in-app purchases

    We'll launch Paddle Checkout in Safari then redirect users back to your app. Like the App Store, Paddle Checkout supports Apple Pay with no additional setup, plus other popular payment options.

  • Subscription lifecycle management

    You can use Paddle to handle all parts of the subscription lifecycle, including updating payment methods and canceling subscriptions using the prebuilt customer portal. We cover that elsewhere in our docs.

Before you begin

Sign up for Paddle

You'll need a Paddle account to get started. You can sign up for two kinds of account:

  • Sandbox — for testing and evaluation
  • Live — for selling to customers

For this tutorial, we recommend signing up for a sandbox account. You can transition to a live account later when you've built your integration and you're ready to start selling.

If you sign up for a live account, you'll need to complete account verification. This is where we ask for some information from you to make sure that we can work together. While we're verifying your account, you can't launch a checkout or sell on the Paddle platform.

Prep your iOS development environment

As part of our tutorial, we're going to update our app to include a link to a hosted checkout for purchases. You'll need:

  • Some knowledge of iOS development, access to your iOS project, and Xcode on macOS.
  • A correctly configured URL scheme so you can redirect users back to your app.

You don't need to make changes to your iOS app to create a hosted checkout in Paddle, so you can come back to this later if you're working with a developer.

Overview

Add a hosted checkout to your app to link out for in-app purchases in five steps:

  1. Map your product catalog

    Create products and prices in Paddle that match your in-app purchase options.

  2. Create a hosted checkout

    Create a hosted checkout in the Paddle dashboard, including where to redirect customers to after purchase.

  3. Add a checkout button to your app

    Create a button that opens the hosted checkout URL when tapped.

  4. Handle fulfillment and provisioning

    Use RevenueCat or process webhooks to fulfill purchases after a customer completes a checkout.

  5. Take a test payment

    Make a test purchase to make sure your purchase flow works correctly.

1. Map your product catalog

Before we add a hosted checkout to our app, we need to set up our product catalog in Paddle to match the in-app purchases we offer.

Model your pricing

A complete product in Paddle is made up of two parts:

  • A product entity that describes the item, like its name, description, and an image.
  • At least one related price entity that describes how much and how often a product is billed.

You can create as many prices for a product as you want to describe all the ways they're billed.

In this example, we'll create a single product and single price for a one-time item called Lifetime Access.

Create products and prices

You can create products and prices using the Paddle dashboard or the API.

  1. Go to Paddle > Catalog > Products.

  2. Click New product.

  3. Enter details for your new product, then click Save when you're done.

  4. Under the Prices section on the page for your product, click New price.

  5. Enter details for your new price. Set the type to One-time to create a one-time price.

  6. Click Save when you're done.

  7. Click the action menu next to a price in the list, then choose Copy price ID from the menu. Keep this for later.

Illustration showing the new product drawer in Paddle. It shows fields for product name, tax category, and description

Prices list in the Paddle dashboard, with the action menu open and copy ID selected.

2. Create a hosted checkout

Next, create a hosted checkout. A hosted checkout is a link that users can use to make a purchase. It's unique to your account.

You can create multiple hosted checkouts if you have different apps or want to create links that redirect to different places in your app.

  1. Go to Paddle > Checkout > Hosted checkout.

  2. Click New hosted checkout.

  3. Enter a name and a description. This is typically your app name and any details for your reference. They're not shown to customers.

  4. Enter a redirect URL. This should be a custom URL scheme that bounces users back to your app when their purchase is completed, for example myapp://example-redirect.

  5. Click Save when you're done.

  6. Click the action menu next to the hosted checkout you just created, then choose Copy URL from the menu. Keep this for the next step.

Screenshot of the Paddle dashboard showing the 'New hosted checkout' form. The form includes required fields for Name, an optional Description text area with an information icon, and an optional Redirect URL field with an information icon. There's a 'Save' button in the blue color in the top right corner of the form."

Screenshot of the Paddle dashboard 'Hosted checkouts' list view. The interface displays a table with columns for Name, Description, and Redirect URL. Multiple entries are shown with placeholder content. A context menu is open for one of the items showing three options: Edit (with pencil icon), Copy URL (with copy icon), and Archive (with trash icon in red).

3. Add a checkout button to your app

Now, update your iOS app to add a button that:

  1. Checks to see if in-app purchases are allowed on the device.

  2. Checks to see if a user already purchased the item.

  3. Constructs a URL using your hosted checkout launch URL, and a price_id query parameter with the price ID you copied previously as the value.

Here's an example using SwiftUI:

Prefill information — recommended

To make for a more seamless user experience, you can use URL parameters to pass additional information to the hosted checkout.

In this updated example, we pass customer details and a unique identifier for the customer in RevenueCat.

4. Handle fulfillment and provisioning

When a customer completes a purchase, they'll be redirected back to your app. At this point, you need to handle fulfilment and unlock the features they bought.

If you use the RevenueCat x Paddle integration to handle entitlements, you're all set!

Here's how it works:

  1. Paddle automatically sends data to RevenueCat about the completed checkout.

  2. RevenueCat grants the user an entitlement based on your product configuration.

  3. Use the RevenueCat SDK to check entitlement status in your iOS app.

Illustration of the new destination drawer in Paddle. It shows fields for description, type, URL, and version. Under those fields, there's a section called events with a checkbox that says 'select all events'

5. Test the complete flow

Mobile app screen with light blue background showing a running show icon in a circular light blue container. Text reads 'Unlock lifetime access' Below is a prominent blue button with white text saying 'Buy now for $25.00'.

Illustration of the Paddle checkout screen showing product details, price summary, and payment method options including Apple Pay.

Mobile app screen showing a success message with a mint green circular icon containing a yellow unlocked padlock. Text reads 'Lifetime access unlocked. Enjoy!' Below is a bright green button with white text saying 'Start now'.

We're now ready to test the complete purchase flow end-to-end! If you're using a sandbox account, you can take a test payment using our test card details:

Email addressAn email address you own
CountryAny valid country supported by Paddle
ZIP code (if required)Any valid ZIP or postal code
Card number4242 4242 4242 4242
Name on cardAny name
Expiration dateAny valid date in the future.
Security code100

Next steps

That's it! Now you've built a purchase workflow that links out to Paddle Checkout, you might like to hook into other features of the Paddle platform.

Learn more about Paddle

When you use Paddle, we take care of payments, tax, subscriptions, and metrics with one unified platform. Customers can self-serve with the portal, and Paddle handles any order inquiries for you.

Build a web checkout

Our tutorial uses a hosted checkout to build a payment workflow. You can also Paddle.js to build pricing pages and signup flows on the web, then redirect people to your app.

Build advanced subscription functionality

Paddle Billing is designed for subscriptions as well as one-time items. You can use Paddle to build workflows to pause and resume subscriptions, flexibly change billing dates, and offer trials.