# discount

From **Stripe API**.

A discount represents the actual application of a coupon to a particular
customer. It contains information about when the discount began and when it
will end.

Related guide: [Applying Discounts to Subscriptions](https://stripe.com/docs/billing/subscriptions/discounts).

- Type: `object`

## Properties

### `checkout_session`

- Required: false
- Type: `string`
- Nullable: true
- maxLength: `5000`

The Checkout session that this coupon is applied to, if it is applied to a particular session in payment mode. Will not be present for subscription mode.

### `coupon`

- Required: true
- Type: `object`

A coupon contains information about a percent-off or amount-off discount you
might want to apply to a customer. Coupons may be applied to [invoices](https://stripe.com/docs/api#invoices) or
[orders](https://stripe.com/docs/api#create_order_legacy-coupon). Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge).

### `customer`

- Required: false
- Nullable: true

The ID of the customer associated with this discount.

### `end`

- Required: false
- Type: `integer`
- Format: `unix-time`
- Nullable: true

If the coupon has a duration of `repeating`, the date that this discount will end. If the coupon has a duration of `once` or `forever`, this attribute will be null.

### `id`

- Required: true
- Type: `string`
- maxLength: `5000`

The ID of the discount object. Discounts cannot be fetched by ID. Use `expand[]=discounts` in API calls to expand discount IDs in an array.

### `invoice`

- Required: false
- Type: `string`
- Nullable: true
- maxLength: `5000`

The invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice.

### `invoice_item`

- Required: false
- Type: `string`
- Nullable: true
- maxLength: `5000`

The invoice item `id` (or invoice line item `id` for invoice line items of type='subscription') that the discount's coupon was applied to, if it was applied directly to a particular invoice item or invoice line item.

### `object`

- Required: true
- Type: `string`
- Allowed values: `"discount"`

String representing the object's type. Objects of the same type share the same value.

### `promotion_code`

- Required: false
- Nullable: true

The promotion code applied to create this discount.

### `start`

- Required: true
- Type: `integer`
- Format: `unix-time`

Date that the coupon was applied.

### `subscription`

- Required: false
- Type: `string`
- Nullable: true
- maxLength: `5000`

The subscription that this coupon is applied to, if it is applied to a particular subscription.

## JSON Schema

```json
{"description":"A discount represents the actual application of a coupon to a particular\ncustomer. It contains information about when the discount began and when it\nwill end.\n\nRelated guide: [Applying Discounts to Subscriptions](https://stripe.com/docs/billing/subscriptions/discounts).","properties":{"checkout_session":{"description":"The Checkout session that this coupon is applied to, if it is applied to a particular session in payment mode. Will not be present for subscription mode.","maxLength":5000,"nullable":true,"type":"string"},"coupon":{"$ref":"#/components/schemas/coupon"},"customer":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/customer"},{"$ref":"#/components/schemas/deleted_customer"}],"description":"The ID of the customer associated with this discount.","nullable":true,"x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/customer"},{"$ref":"#/components/schemas/deleted_customer"}]}},"end":{"description":"If the coupon has a duration of `repeating`, the date that this discount will end. If the coupon has a duration of `once` or `forever`, this attribute will be null.","format":"unix-time","nullable":true,"type":"integer"},"id":{"description":"The ID of the discount object. Discounts cannot be fetched by ID. Use `expand[]=discounts` in API calls to expand discount IDs in an array.","maxLength":5000,"type":"string"},"invoice":{"description":"The invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice.","maxLength":5000,"nullable":true,"type":"string"},"invoice_item":{"description":"The invoice item `id` (or invoice line item `id` for invoice line items of type='subscription') that the discount's coupon was applied to, if it was applied directly to a particular invoice item or invoice line item.","maxLength":5000,"nullable":true,"type":"string"},"object":{"description":"String representing the object's type. Objects of the same type share the same value.","enum":["discount"],"type":"string"},"promotion_code":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/promotion_code"}],"description":"The promotion code applied to create this discount.","nullable":true,"x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/promotion_code"}]}},"start":{"description":"Date that the coupon was applied.","format":"unix-time","type":"integer"},"subscription":{"description":"The subscription that this coupon is applied to, if it is applied to a particular subscription.","maxLength":5000,"nullable":true,"type":"string"}},"required":["coupon","id","object","start"],"title":"Discount","type":"object","x-expandableFields":["coupon","customer","promotion_code"],"x-resourceId":"discount"}
```
