API Version
Product Catalog
Library

Important:

These APIs operate asynchronously. When you receive a successful response code from an API call, it indicates only the successful submission of your request, not the completion of the operation.

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.

Sample non subscription [ JSON ]

{ "invoice_id": "consumable_1000000807994664", "customer_id": "customer-123", "charge_id": "consumable-app_store_charge_id-USD" }

API Index URL GET

https://{site}.chargebee.com/api/v2/non_subscriptions

Model Class

invoice_id
string, max chars=100

The unique immutable identifier of the invoice imported in Chargebee for which the receipt was sent.


customer_id
optional, string, max chars=100

The unique immutable identifier of the customer object to which the invoice belongs.


charge_id
string, max chars=100

The subscription_item.item_price_id where the item_type is charge.


invoice_id invoice_id
string, max chars=100

The unique immutable identifier of the invoice imported in Chargebee for which the receipt was sent.


customer_id customer_id
optional, string, max chars=100

The unique immutable identifier of the customer object to which the invoice belongs.


charge_id charge_id
string, max chars=100

The subscription_item.item_price_id where the item_type is charge.


This API is used to sync consumable, non-consumable, and non-renewing product payments in Chargebee.

Notes

Sample Request
# Record an One Time Purchase for Apple App Store
curl  https://{site}.chargebee.com/api/v2/non_subscriptions/cb-pjp7hcmrcbfmtjhle3smlwicu4/one_time_purchase \
     -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"
copy
Click to Copy

Sample Response [ JSON ]

Show more...
{
    "non_subscription": {
        "invoice_id": "consumable_1000000807994664",
        "customer_id": "customer-123",
        "charge_id": "consumable-app_store_charge_id-USD"
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/non_subscriptions/{non-subscription-app-id}/one_time_purchase

Method

receipt[]
required, string, max chars=65k
Google Play Store: The purchase token taken from the Android device after successful creation of the in-app purchase.

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.
product[id]
required, string, max chars=96
product[currency_code]
required, string, max chars=3
product[price]
required, in cents, min=0
product[type]
required, enumerated string
Possible values are
consumable

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_consumable

The 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_subscription

The 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.

Show all values[+]
product[name]
optional, string, max chars=96
product[price_in_decimal]
optional, string, max chars=39
customer[id]
optional, string, max chars=50
customer[email]
optional, string, max chars=70
customer[first_name]
optional, string, max chars=150
customer[last_name]
optional, string, max chars=150
non_subscription non_subscription
always returned
Resource object representing non_subscription

Sample admin console URL

https://{site}.chargebee.com/admin-console/non_subscriptions/123x