Docs

Importing Historic Data 

Once your Apple App Store or Google Play Store app is connected to Chargebee, you might want to import historical purchases into Chargebee. This document guides you through the process of importing that data.

Import using Bulk Operations 

You can import historical purchases into Chargebee using the bulk import capability. This method is ideal when migrating large volumes of subscription data from the Apple App Store or Google Play Store. Follow the steps to perform a bulk import of historical purchases:

  1. Use the Bulk Operations to bulk import your historic subscriptions.

  2. While selecting the operation in bulk import, choose the Recorded Purchases operation from the dropdown, and then select Record a purchase. This operation internally uses the Record a Purchase API to import subscription data.

  3. Prepare your data file in the following format:

    • In this CSV, the recorded_purchase[app_id] field is the Connected App ID for the app whose purchases you're importing.
      You can connect your app and generate the App ID by following these steps.
    • The customer[id] is the Chargebee Customer ID to which the purchase will be linked.
      Note: The customer ID must already exist in Chargebee for the bulk import to work.
    • If you're importing Apple purchases and have the corresponding purchase transaction IDs, fill in the apple_app_store[transaction_id] column.
    • If you don't have the Apple transaction IDs, you can fill in the apple_app_store[receipt] and apple_app_store[product_id] columns instead.
    • For Google purchases, use the google_play_store[purchase_token] column.
  4. Proceed with the rest of the steps until the bulk import is processed.

  5. Once the operation is complete, you'll be notified via email. You can also track progress as explained here.

Limitations 

  1. As noted here, the Record a Purchase API is asynchronous.
    Therefore, even if the bulk import shows a successful status, individual purchases may fail during validation by the respective app stores.
  2. Currently, only the initial purchase and the latest transaction are imported for Apple and Google.
Note

For recorded purchases that fail:

  • If the webhook was enabled during the import, you'll receive the record_purchase_failed event.
  • If the webhook was not enabled, you can view the failed purchases in the Chargebee Recorded Purchase UI.
Was this article helpful?
Loading…