# promotion\_code

From **Stripe API**.

A Promotion Code represents a customer-redeemable code for a coupon. It can be used to
create multiple codes for a single coupon.

- Type: `object`

## Properties

### `active`

- Required: true
- Type: `boolean`

Whether the promotion code is currently active. A promotion code is only active if the coupon is also valid.

### `code`

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

The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for each customer.

### `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).

### `created`

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

Time at which the object was created. Measured in seconds since the Unix epoch.

### `customer`

- Required: false
- Nullable: true

The customer that this promotion code can be used by.

### `expires_at`

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

Date at which the promotion code can no longer be redeemed.

### `id`

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

Unique identifier for the object.

### `livemode`

- Required: true
- Type: `boolean`

Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.

### `max_redemptions`

- Required: false
- Type: `integer`
- Nullable: true

Maximum number of times this promotion code can be redeemed.

### `metadata`

- Required: false
- Type: `object`
- Nullable: true

Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.

### `object`

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

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

### `restrictions`

- Required: true
- Type: `object`

### `times_redeemed`

- Required: true
- Type: `integer`

Number of times this promotion code has been used.

## JSON Schema

```json
{"description":"A Promotion Code represents a customer-redeemable code for a coupon. It can be used to\ncreate multiple codes for a single coupon.","properties":{"active":{"description":"Whether the promotion code is currently active. A promotion code is only active if the coupon is also valid.","type":"boolean"},"code":{"description":"The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for each customer.","maxLength":5000,"type":"string"},"coupon":{"$ref":"#/components/schemas/coupon"},"created":{"description":"Time at which the object was created. Measured in seconds since the Unix epoch.","format":"unix-time","type":"integer"},"customer":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/customer"},{"$ref":"#/components/schemas/deleted_customer"}],"description":"The customer that this promotion code can be used by.","nullable":true,"x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/customer"},{"$ref":"#/components/schemas/deleted_customer"}]}},"expires_at":{"description":"Date at which the promotion code can no longer be redeemed.","format":"unix-time","nullable":true,"type":"integer"},"id":{"description":"Unique identifier for the object.","maxLength":5000,"type":"string"},"livemode":{"description":"Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.","type":"boolean"},"max_redemptions":{"description":"Maximum number of times this promotion code can be redeemed.","nullable":true,"type":"integer"},"metadata":{"additionalProperties":{"maxLength":500,"type":"string"},"description":"Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.","nullable":true,"type":"object"},"object":{"description":"String representing the object's type. Objects of the same type share the same value.","enum":["promotion_code"],"type":"string"},"restrictions":{"$ref":"#/components/schemas/promotion_codes_resource_restrictions"},"times_redeemed":{"description":"Number of times this promotion code has been used.","type":"integer"}},"required":["active","code","coupon","created","id","livemode","object","restrictions","times_redeemed"],"title":"PromotionCode","type":"object","x-expandableFields":["coupon","customer","restrictions"],"x-resourceId":"promotion_code"}
```
