What do you need to know
The following are the key points that will help you understand Apple App Store and Google Play Store integrations in Chargebee.
It is recommended to go through these points before setting up the integration.
The following are the points to know about Apple App Store and Google Play Store integration in general.
- Both Apple App Store and Google Play Store integrations are supported for Product Catalog 1.0 (PC 1.0) and Product Catalog 2.0 (PC 2.0) accounts in Chargebee. Therefore, irrespective of your account type you can integrate these stores into Chargebee.
- We generate a webhook or notifications URL once the integration is completed and this needs to be configured in the respective stores for Chargebee to receive notifications from these stores. This notification URL can be obtained by referring to the documentation on Apple App Store and Google Play Store .
- Post integration, you need to either use Chargebee's SDK(iOS , Android , or Flutter ) or Process Purchase Command API to create an initial in-app subscription in Chargebee.
Note: Chargebee cannot create an initial subscription by receiving notification from these stores due to the lack of information on the price and currency of purchase.
- To use SDK or API you need an App ID or SDK key(Apple App Store or Google Play Store ) and a Publishable Key .
- We recommend using Chargebee's SDK for quick integration at the client end without implementing server APIs. In-app subscriptions are supported by Chargebee's iOS , Android , or Flutter SDKs.
- Apple and Google do not pass the Apple Id and Google Id or any other information about the customer to your application or Chargebee. We recommend passing the Customer Id while invoking the API / purchaseProduct method of SDK, though it is an optional parameter. If you don't pass this parameter, then the Customer Id in Chargebee will be the same as the Subscription Id.
- If the initial subscription is not created using SDK or Process Purchase Command API and the notifications URL is configured for the respective stores, then Chargebee does not process these notifications and returns an error - "Failed to update subscription because it's missing in Chargebee. Import subscription data, and try again."
To resolve this error you can import the subscription data by using the Import Receipt API. Once the initial subscription is recorded in Chargebee you can retry processing the failed notification.
- Once the initial subscription is created in Chargebee, we use webhook events from Apple App Store or Google Play Store and maintain the subscription status in Chargebee.
- In the Chargebee user interface, apply the Channel filter and select APP STORE or PLAY STORE to view store-specific data. This filter can be applied to pages - Customers, Subscriptions, Plans, and Invoices in Chargebee.
About Apple App Store and Google Play Store Plans
Apple App Store or Google Play Store refers to subscription plans as in-app subscription products within their documentation. So both terms plans and products are used in this section.
The following are the points to know about Apple App Store and Google Play Store plans or products.
- Apple or Google products cannot be created using the Chargebee admin user interface. You need to import products from their respective stores to Chargebee. Learn more about importing Apple and Google products.
- While importing products, please ensure that products corresponding to all the currencies configured in the stores are imported to Chargebee.
- Importing Apple or Google products is only needed if you want to import historic subscriptions from these stores to Chargebee or use the
retrieveProductIdentifers SDK method to retrieve Apple or Google product IDs from Chargebee.
- Suppose you are using the Process Purchase Command API or
purchaseProduct SDK method(Apple / Google ) to create in-app subscriptions in Chargebee without importing Apple or Google products. In such a case, plans are going to auto-create in Chargebee with the price and currency information available with the API or SDK method.
- Suppose you have a trial period associated with an in-app subscription product in the Apple App Store or Google Play Store then you don't need to import the same. When an in-app subscription is created in Chargebee, we automatically associate the trial period with the plan and subscription created in Chargebee.
- Suppose you are on Product Catalog 1.0 (PC 1.0) and have imported the products from the Apple App Store or Google Play Store; then Chargebee will auto-create the plans. The plan ID will be created by appending the currency code to the related product ID of the Apple or Google store.
- Suppose you are on Product Catalog 2.0 (PC 2.0) and have imported the products from the Apple App Store or Google Play Store then Chargebee will auto-create the product family as ‘Apple-App-store' or ‘Google-Play-store' and create plans within these product families for the imported products. The plan ID in Chargebee will be the same as the product ID of the Apple APP Store or Google Play Store and the plan price point ID will be created by appending the currency code to the related plan ID. All these plans will be associated with the channel - APP STORE or PLAY STORE.
- Any changes done to the plans in Chargebee will not reflect in Apple App Store or Google Play Store. Therefore, if you want to change in-app subscription plans then make changes to respective in-app subscription products in Apple App Store or Google Play Store.
- Suppose you have made changes to in-app subscription product details like price-point or subscription duration of a product in the Apple App Store or Google Play Store. In such a case, you can either edit the related plan in Chargebee using the admin user interface or import(Apple / Google ) the same plan again to reflect the changes in Chargebee.
- Suppose the price-point of an in-app subscription product is changed in Apple App Store or Google Play Store and by chance you missed changing the same in Chargebee. In such a case, Chargebee will override the plan price and create new subscriptions with the updated price-point of the Apple App Store or Google Play Store. Renewals for these new subscriptions will happen as per the new price point but existing subscriptions will renew as per the old price-point.
- Suppose the price point of a product is changed in Apple App Store or Google Play Store and if the same change is done in Chargebee plan as well, then new subscriptions as well as the renewals for existing subscriptions will occur as per the new price-point of the plan.