Docs

Configurations & Historic Data Processing 

Your Apple Store app is now connected to Chargebee. This document guides you through the process of configuring connection keys generated by Chargebee in App Store connect, import of products and upload receipts from the App Store. During this process you will complete the following steps:

  • Import App Store Products from your app as plans within Chargebee.
  • Upload App Store Receipts from your app for historic subscription data to Chargebee.

Connection Keys 

After the import of Products and In-App Purchase receipts to your Chargebee site, you must configure the following connection keys:

  • Notification URL
  • App ID

Notification URL 

Your Chargebee site must be updated with the most recent changes associated with subscriptions on App Store. This can be accomplished with the use of Notification URLs wherein App Store sends notifications to your server of real-time changes in a subscription's status.

Note

Enable v1 notifications in the Apple App Store for subscriptions created without receipts. Chargebee depends on receipt data to update subscription statuses. Apple's v2 notifications do not have receipt information; therefore, Chargebee cannot process v2 notifications for subscriptions imported without receipts. Learn more about app store notifications.

Follow the steps below to configure the Notification URL

  1. Click View Keys in the Sync Overview page.

  2. Click Copy to copy the Notification URL to your clipboard.

  3. Login to your App Store Connect  account.

  4. Select applicable app from My Apps.

  5. Click App Information from the General left menu.

  6. Navigate to the App Store Server Notifications section.

  7. Click Setup URL in the Production Server URL/Sandbox Server URL as applicable.

  8. Enter the copied URL to the Server URL field.

  9. Select Version 1 Notifications or Version 2 Notifications radio button as required.

  10. Click Save.

Note
  • To correctly configure the Production Server URL and Sandbox Server URL in App Store Connect, use the Notification URL generated from your Chargebee live site for the Production Server URL and the Notification URL generated from your Chargebee test site for the Sandbox Server URL.
  • If you want to receive the notifications from Apple App Store at your backend then configure your server URL in App Store Connect and ensure that the notifications URL generated by Chargebee is configured at your backend. Chargebee needs the Apple App Store notification in the raw format as it was sent by Apple App Store. By doing this you ensure that the notifications from Apple App Store are received by your server as well as by Chargebee.

App ID 

The App ID is a unique identifier created for your Apple app within Chargebee. This identifer is configured within the backend server of your app to create unique API endpoints, which can be used extensively for completing API actions.
Follow the steps below to retrieve this information.

  1. Click View Keys in the Sync Overview page.

  2. Click Copy to copy the App ID to your clipboard.

Note

Click here  to view the API docs associated with App ID.

Import Products 

You can choose to bulk import your product details including plan name, billing frequency, and price from your app.

Note
  • Click Proceed, if you have no historical product data or would like to skip importing the information.
  • The price field must have numeral input only. Chargebee appends the applicable currency to the apple product to create a corresponding plan.
  • If you have not imported Apple App Store plans in the test Chargebee site, then all the plans will be created in Chargebee test site with a daily frequency. This is because in the sandbox environment, renewals occur in durations of minutes (e.g. 5 minutes = 1 month ), and in Chargebee, the minimum renewal duration is one day.
  • If the plans with daily frequency are migrated from test Chargebee site to live Chargebee site then same daily plans will be created in live Chargebee site. So in order to correct the plan frequencies, it is suggested to re-import the plans in live Chargebee site.

Follow the steps below to import your product details to Chargebee:

  1. Click Product Import.

  2. Click Upload CSV.

  3. Prepare the bulk import file. Click Sample file and create entries for each product. Ensure the file is saved in csv format.
    Note: When entering prices in the CSV file, use cents as the unit. For example, enter 3900 in the price column for USD 39.

  4. Drag the updated file to the field or click Browse to upload the import file.

  5. Click Proceed after the successful upload of your bulk import file.

  6. After successful upload, the data within the bulk import file is validated and associated plans are created within your Chargebee site.

  7. Click Proceed to upload your product offerings to Chargebee.

Bulk Import Errors 

Any errors identified during the data validation process will result in the plan associated with that product information not being created. Such errors can be attributed to various reasons such as incorrect currency, frequency, or product ID.

  • The entries in the apple_product_id and currency combination must be unique.
  • The entries in the name field must be unique.

Failure to adhere to these guidelines will result in errors while creating plans.

The data validation functionality assists in identifying the errors allowing you to resolve them more effectively or skipping the upload of products with errors. Determine your course of action based on the options below:

Skip Products with Errors

  1. Click Skip errors to skip products with errors.

  2. Click Yes, Proceed in the confirmation pop-up box to continue the upload process.

  3. Click Yes, Proceed to upload In-App Purchase Receipts.

Fix Errors in Bulk Upload file

  1. Click Show errors to expand the list of errors.

  2. Click Download all errors if you wish to save the error log for future reference.

  3. Click Reupload CSV to access the bulk import file and make the corrections necessary from the error log.

  4. Review the Import Product document for assistance with uploading the import file.

Upload In App Receipts 

You can choose to import your historical subscriptions associated IAP for the product offerings available on your app using this functionality. Addtionally, if you choose to use API's, only the latest transaction of the in-app receipts will be processed.
The following guidelines apply to In-App Receipts:

  • The price of the Apple product that is imported to Chargebee determines the price of subscription. Hence it is imperative that all applicable products are imported to Chargebee before importing historic subscriptions to Chargebee.
  • Upload a single receipt per customer as Chargebee can retrieve all transactions with a single receipt by validating the receipt with Apple's APIs.
  • Since there are multiple transactions associated with a receipt and Apple doesn't associate price information with each transaction, the price of the Apple product imported to Chargebee is considered for all transactions.
Note
  • Chargebee support is extended to receipts processed for iOS7 and higher only.
  • Click Proceed if you do not wish to import historical subscriptions or have no in-app purchases yet.
  • The size of the file being uploaded must not exceed 20MB.
  • The price field must have numeral input only. Chargebee appends the applicable currency to the apple product to create a corresponding subscription.
  • The customer_id is not a mandatory field in the csv file.
  • The customer_email is not a mandatory field in the csv file.
  • If historic subscription has a different price than the product price then we will not be able to record the old subscription with old price since Apple does not provide historic price details in the API response.
  • During the CSV import webhook event actions will be triggered. To disable these webhook event actions during the import please use import receipt API .

Follow the steps below to import your In-App Purchase Receipts to Chargebee:

Ensure that all your Apple products are uploaded to Chargebee previously.

  1. Click Upload In-App Purchase Receipts.

  2. Click Upload CSV.

  3. Prepare the bulk import file. Click Sample file and create entries for each of the historical subscriptions. Ensure that the file is saved in CSV format after your changes are made.

  4. Drag the updated file to the field or click Browse to upload the import file.

  5. Click Proceed after the successful upload of your bulk import file.

  6. After successful upload, the data within the bulk import file is validated and associated historical subscriptions are created within your Chargebee site.

Bulk Import Errors 

Any errors identified during the data validation process will result in the historical subscriptions associated with that product information not being created. Such errors can be attributed to various reasons such as incorrect currency, frequency, or product ID.

The data validation functionality assists in identifying the errors allowing you to resolve them more effectively or skipping the upload of products with errors. Determine your course of action based on the options below:

Note

If you chose to Skip, all subscription data associated with the product will not be available within Chargebee.

Skip Records with Errors

  1. Click Skip errors to skip records with errors.
  2. Click Yes, Proceed in the confirmation pop-up box to continue the import process.
  3. After processing the in-app receipts, the subscription created and skipped displays.
  4. Click Proceed.

The Sync Overview acts as the landing page for your integration with App Store. This view lists all of the subscriptions details including status of the subscription and sync statistics for the last 24 hours.

Was this article helpful?
Loading…