ChargebeeAPI

Import Receipt

Idempotency Supported
Try in API Explorer

Verifies an Apple App Store or Google Play Store in-app purchase receipt and imports subscriptions for all historical purchases made by the customer.

Tip An in_app_subscription is created for every unique original_transaction_id . Apple creates original_transaction_id for every create, upgrade, or downgrade of the subscription. A receipt hardly contains more than 100 original_transaction_id s. If a receipt contains more than 100 original_transaction_id s, Chargebee creates all subscription records but this endpoint returns the first 100 records in the response.

CSV upload has a file size limitation that increases the processing time and the number of receipts. This API removes such limitations and allows you to import historical in-app subscription receipts.

Note : This API verifies receipt or token through Apple or Google and then processes them via Chargebee. For bulk imports, limit API calls to 6 per minute (10 seconds apart) to ensure successful subscription imports.

Path Parameter

{in_app_subscription_app_id}: The handle created by Chargebee for your Apple App Store or Google Play Store app. It can be obtained from the Chargebee web app. The following are instructions to obtain the value of the path parameter for the Apple App Store and Google Play Store.

  • Apple App Store: To obtain the value for {in_app_subscription_app_id}, click View Keys within the Sync Overview page of the web app and use the value of generated App ID for this parameter. See detailed steps here.
  • Google Play Store: To obtain the value for {in_app_subscription_app_id}, click Set up notifications within the Sync Overview page of the web app and use the value of generated App ID for this parameter. See detailed steps here.

Sample Request

URL Format

POST https://[site].chargebee.com/api/v2/in_app_subscriptions/{in-app-subscription-app-id}/import_receipt

Input Parameters

receipt
required, string, max chars=65k

Apple App Store: The Base64 encoded App Store in-app purchase receipt taken from the Apple device after successful creation of the in-app purchase subscription. Google Play Store: The purchase token taken from the Android device after the successful creation of an in-app purchase subscription.

product
optional, string

Parameters for product

customer
optional, string

Parameters for customer

Returns

in_app_subscriptionsalways returned

Array of in_app_subscription object