The Record a Purchase API allows you to record in-app purchases made through channels such as the Apple App Store and Google Play Store in Chargebee. When you invoke this API, it initiates a purchase recording job and returns the recorded_purchase resource in the response. As part of the job, the API verifies the provided source specific request payload like transaction_id for Apple App Store or purchase_token for Google Play Store with the source such as apple_app_store or google_play_store respectively. If the verification is successful, the corresponding purchase is recorded in Chargebee. Upon completion, the recorded_purchase resource will include the relevant omnichannel_transaction_id and omnichannel_subscription_id.
Since this operation is asynchronous, you need to check the status attribute of the recorded_purchase resource to track the job status: in_process, completed, or failed.
Note: Upon successful completion of this asynchronous operation, Chargebee triggers the omnichannel_subscription_created event.
If the recorded_purchase status is failed, review the error_detail attribute and take corrective action to re-record the purchase.
You can use this API to record new and older purchases made on Apple App Store or Google Play Store by passing the transaction_id or purchase_token respectively received during the subscription purchase. You can record purchases for subscriptions that are in Active or Expired status.
Sample Request
URL Format
Input Parameters
App Identifier in Chargebee. This is the handle created by Chargebee for your app. To get the app_id:
- For Apple, follow these steps.
- For Google, follow these steps.
The source specific request payload that will be used to record the purchase. Provide parameters as apple_app_store[]
Returns
Resource object representing Recorded purchase
Resource object representing Customer