# Purchases

> For the complete machine-readable documentation index, see [llms.txt](https://apidocs.chargebee.com/llms.txt).


**Deprecated** The `purchase` resource and its associated operations on this page are deprecated. Avoid using them in your integrations. The ability to purchase multiple plans in a single subscription will be supported through the [Subscriptions API](/docs/api/subscriptions) in the future.

The `purchase` resource represents a collection of [item prices](/docs/api/item_prices) bought together. A purchase can contain one or more of the following:

-   subscriptions (a `[subscription](/docs/api/subscriptions)` resource consists of item prices such that at least one of the item prices belongs to an `[item](/docs/api/items)` of `type` `plan`.)
-   group of one-time charges (aka [charge item prices](/docs/api/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:

-   [Consolidated Invoicing](https://www.chargebee.com/docs/2.0/consolidated-invoicing.html)
-   [Manual discounts](https://www.chargebee.com/docs/2.0/subscription-manual-discounts.html)
-   [Multiple coupon support](https://www.chargebee.com/docs/2.0/coupons.html#applying-multiple-coupons-to-a-subscription)
-   [Multi-decimal pricing and quantities](https://www.chargebee.com/docs/2.0/multi-decimal-support.html)

**Note**

Once created, Chargebee never modifies a `purchase` resource; it cannot be modified via API either.

## Sample Purchase

```json
{
  "created_at": 1651662622,
  "customer_id": "__test__rHsiT4rY1zmz",
  "id": "__test__rHsiT4rY2hC1A",
  "invoice_ids": [
    "__demo_inv__1",
    {..}
  ],
  "object": "purchase",
  "subscription_ids": [
    "__test__rHsiT4rY2Lr12",
    {..}
  ]
}
```

## Purchases attributes

## Input Parameters

- `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](/docs/api/customers) 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](/docs/api/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 identifier of the [invoice(s)](/docs/api/invoices) created immediately as part of this purchase.

