Docs
You are viewing:
Product Catalog 2.0
The Apple App Store integration helps you record in-app subscription purchases made on the Apple app store using Storekit 2.0 in Chargebee and maintain the subscription state in Chargebee by listening to Apple server notifications.
If you are using Apple App store integration offered by mobile subscriptions legacy solution then go through below key points to understand how both legacy and new solutions can be enabled on the same Chargebee site.
Apple App store integration of Mobile subscriptions legacy solution and new Omnichannel solution can co-exist in the same Chargebee site. All you need to do is to connect your apps again to the same Chargebee site by using the new solution as mentioned here. You will view both the legacy and new solution under Apps section in the Chargebee site once the apps are connected.
There's no need to make any changes to mobile SDK implementation in your App or backend implementation to capture the subscriptions into new system. Whenever a subscription is created in the legacy solution using purchase method of SDK or process purchase command API, corresponding subscription will be auto-created in the new Omnichannel solution. Thus there's no need to implement the Omnichannel APIs by using the App ID generated in the new system.
There's no need to configure the Notifications URL generated by the new solution in the App Store Connect account. Chargebee will listen to the notifications in the old system and auto-consume these notifications in the new system.
At customer level, you can view the the subscription created through the legacy solution and also the link to view the corresponding Omnichannel subscription in the new system.
These are the steps that you need to complete to make your app ready for in-app purchases.
Configure the products that your app merchandises in App Store Connect. Learn more about configuring in-app purchase products in App Store Connect. If you are a developer building a test app with sample in-app subscription products, you can configure the products in the StoreKit configuration file.
Apple's Storekit 2.0 framework offers the entire set of Swift APIs that help you retrieve the in-app purchase products configured in Apple App Store Connect, make a purchase using the purchase method, keep track of the purchase using the account token, and get the purchase and verification result.
Since Storekit 2.0 does the transaction verification, no additional server verification is needed. So, every time your app receives a transaction from Storekit 2, the transaction has passed through the verification process, and thus, you can grant access to the paid content to the end user.
Go through this WWDC link and Apple developer guide to implement the purchase flow in your app. For every transaction made using the Storekit 2.0 framework, Apple will return a signed JSON Web Signature (JWS) token. The transaction type contains the signed JWS payload which represents the signed transaction. You need to pass this signed transaction to Chargebee to record the purchase in Chargebee.
Once you have an active Chargebee test or live site, follow these steps to start recording in-app subscription purchases in Chargebee.
Connect your apps listed in the Apple App Store to Chargebee to record and manage your Apple App Store subscriptions through Chargebee. Once your app is connected, Chargebee will generate a unique App ID that can be used for recording purchases and a unique Notifications URL that can be used to relay the Apple in-app subscription state change events to Chargebee.
To connect your app with Chargebee, follow the steps:
Login to your Chargebee site and navigate to Apps on the left menu. Click Go to Marketplace.
Click Mobile App Store > Apple App Store
Click Connect and Proceed.
Enter Setup Credentials and click Proceed. To access Apple App Store APIs, Chargebee needs you to set up the credentials below. To find these details, open App Store Connect and go to Users and Access > Integrations > App Store Connect API.
In the Choose an App section, select the application that you want to add. Click Add App.
View the newly connected app on the Apps page under the Your Connected Apps section. Click Add App to connect another app to Chargebee. If you want to modify the credentials of your Apple App Store in Chargebee, click Update Credentials.
Once you have successfully connected your App to Chargebee, click on your connected App to land on the Purchase info page. Since no purchases are made, this page will be blank.
On the Purchase Info page, click the App Settings to view the unique App ID generated by Chargebee. Copy the App ID to record a purchase and the Notifications URL to pass the Apple server notifications to Chargebee.
If you want to connect apps that are linked to a different apple app store account, then you need to enter the account credentials for this account as well in Chargebee. Follow the steps:
To view subscription purchases made on the Apple App Store in Chargebee, you must record these purchases using the Record a Purchase API. You need the App ID to invoke this API.
app_id
, transaction_id
, and customer_id
parameters in the Record a Purchase API. This returns a recorded_purchase
resource with the status in_process
. This will initiate the verification of provided Apple transactions by invoking Apple API. Upon successful verification of the transaction, the purchase will be recorded in Chargebee, and an Omnichannel subscription corresponding to this purchase will be created in Chargebee. Learn more about implementing record a purchases API.Configure the notification URL in App Store Connect to sync subscription state changes with Chargebee for real-time updates.
To set up the notification URL in App Store Connect, follow these steps:
Once Chargebee's notification URL is successfully set in App Store Connect, Chargebee will receive the Apple server notifications for subscription state changes in the App Store and generate corresponding omnichannel webhook events.
These omnichannel webhook events are needed for your downstream operations, such as provisioning content, generating reports, planning email campaigns, etc. Learn more about the omnichannel webhook events generated by Chargebee.
To receive these omnichannel subscription state change events from Chargebee, you need to subscribe to the omnichannel subscription webhook events. Learn more about subscribing to webhook events from Chargebee.
As an app developer, you may want to view purchases and transactions made through the Apple App Store. The Purchases page in Chargebee displays all recorded Apple purchases. When you click on a purchase, Chargebee calls Apple's APIs to retrieve the latest transactions and events related to that purchase.
Note
Apple's APIs only provide data for the last 180 days. Therefore, this page will display transactions and events from the past 180 days.
To view in-app purchases and the details of the purchase in Chargebee, follow these steps:
As a customer care, marketing, or revenue growth professional, you can use Chargebee's Omnichannel Subscriptions page to view all the omnichannel subscriptions corresponding to all Apple App Store. App-specific filters can be applied to view subscriptions corresponding to specific apps. You can click any omnichannel subscription ID and access the omnichannel subscription's details page to check the subscription details and thus quickly respond to customer queries.
To view an omnichannel subscription corresponding to a customer in Chargebee, follow these steps:
[seealso] API References
Was this article helpful?