Using the Non-Subscription resource, you can track one-time payments made for consumable, non-consumable, and non-renewing products in Chargebee. Call this API to notify Chargebee of non-subscription purchases made at stores.
{
"invoice_id": "consumable_1000000807994664",
"customer_id": "customer-123",
"charge_id": "consumable-app_store_charge_id-USD"
}
The unique immutable identifier of the invoice imported in Chargebee for which the receipt was sent.
The unique immutable identifier of the customer object to which the invoice belongs.
This API is used to sync consumable, non-consumable, and non-renewing product payments in Chargebee.
# Record an One Time Purchase for Apple App Store curl https://{site}.chargebee.com/api/v2/non_subscriptions/cb-pjp7hcmrcbfmtjhle3smlwicu4/one_time_purchase \ -X POST \ -u {site_api_key}:\ -d receipt="Apple Based64 Encoded Receipt" \ -d product[id]="app_store_charge_id" \ -d product[price]=3399 \ -d product[price_in_decimal]="33.99" \ -d product[currency_code]="USD" \ -d product[type]="consumable" \ -d customer[id]="customer-123"
# Record an One Time Purchase for Apple App Store curl https://{site}.chargebee.com/api/v2/non_subscriptions/cb-pjp7hcmrcbfmtjhle3smlwicu4/one_time_purchase \ -X POST \ -u {site_api_key}:\ -d receipt="Apple Based64 Encoded Receipt" \ -d product[id]="app_store_charge_id" \ -d product[price]=3399 \ -d product[price_in_decimal]="33.99" \ -d product[currency_code]="USD" \ -d product[type]="consumable" \ -d customer[id]="customer-123"
token
taken from the Android device after successful creation of the in-app purchase. productId
or sku
received from the Google Play Store
. product[price_in_decimal]
.
The type of product for one time purchase.
This value represents a type of one-time purchase that provides users with in-app benefits or effects that can be consumed or depleted over time, such as lives, gems, boosts, or digital tips. Once consumed, the purchased item is no longer available and must be repurchased to obtain its benefits again.
non_consumableThe value represents a type of in-app purchase that provides a permanent benefit to the user and can be purchased once without expiration. This type of purchase is typically used to offer premium features or content that enhance the user experience of the app, such as additional filters or cosmetic items in a game.
non_renewing_subscriptionThe value represents a type of subscription that grants access to services or content for a limited period of time, such as a season pass to in-game content. Unlike other subscription models, this type of subscription does not renew automatically and requires people to purchase a new subscription once it concludes to continue accessing the content or services.
product[id]
will be considered as the value of product[name]
. product[price]
.
id
in Chargebee for the customer who made this purchase via Google Play Store. If not provided, a random unique ID generated for the purchase token will be the customer[id]
. If the customer record is not found in Chargebee, it is created. id
in Chargebee for the customer who made this purchase. If not provided, the value is considered to be original_transaction_id
(the transaction identifier at Apple, of the original purchase). If the customer record is not found in Chargebee, it is created.