Introducing the Chargebee CLI

Purchases

The purchase resource represents a collection of item prices bought together. A purchase can contain one or more of the following:

  • subscriptions (a subscription resource consists of item prices such that at least one of the item prices belongs to an item of type plan.)
  • group of one-time charges (aka charge item prices)

Prerequisite

Purchases must be enabled explicitly for the site. If not already enabled, contact eap@chargebee.com. Purchases require the following features to work so they're automatically enabled along with them:

Note

Once created, Chargebee never modifies a purchase resource; it cannot be modified via API either. Change the subscriptions it created with the subscription operations.

Sample PurchaseJSON

Purchases attributes

id
optional, string, max chars=100

The unique identifier of the purchase resource. This is always autogenerated.

customer_id
required, string, max chars=50

The unique identifier of the customer that made this purchase.

created_at
optional, timestamp(UTC) in seconds

The time at which this purchase was created.

modified_at
optional, timestamp(UTC) in seconds

The time at which the purchase was modified.

subscription_ids
optional, string, max chars=50

The unique identifiers of the subscriptions that are created as part of this purchase. These IDs remain even when the associated subscriptions have been deleted.

invoice_ids
optional, string, max chars=50

The unique identifiers of the invoices created immediately as part of this purchase. This list is empty when the purchase raises no invoiceable charges, such as a trial-only purchase. When consolidated invoicing is enabled for the customer, charges are consolidated where the subscriptions allow it. Subscription differences can still leave more than one invoice in this list. When consolidated invoicing is disabled, each subscription with invoiceable charges has its own invoice.