Docs

Log in to read the version of docs relevant to your site, or use the dropdown versions

Importing Historic Data

After you connect your Apple App Store or Google Play Store app to Chargebee, you may want to import historical purchases. This document explains how to import that data.

Import using Bulk Operations

Use Chargebee's bulk import feature to import historical purchases, especially when migrating large volumes of subscription data from the Apple App Store or Google Play Store. Follow these steps to perform a bulk import:

  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. After the operation is complete, Chargebee will notify you by email. You can also track progress as explained in the Bulk Operations documentation.

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:

If a recorded purchase fails:

  • If the webhook is enabled during import, Chargebee sends the record_purchase_failed event.
  • If the webhook is not enabled, you can view failed purchases in the Chargebee Recorded Purchase UI.

Was this article helpful?