# `PolarExpress.Schemas.DiscountUpdate`
[🔗](https://github.com/jeffhuen/polar_express/blob/main/lib/polar_express/schemas/discount_update.ex#L2)

DiscountUpdate

Schema to update a discount.

# `t`

```elixir
@type t() :: %PolarExpress.Schemas.DiscountUpdate{
  amount: term(),
  amounts: term(),
  basis_points: term(),
  code: term(),
  currency: term(),
  duration: term(),
  duration_in_months: term(),
  ends_at: term(),
  max_redemptions: term(),
  metadata: term(),
  name: term(),
  products: term(),
  starts_at: term(),
  type: term()
}
```

* `amount` - Nullable. **Deprecated.**
* `amounts` - Nullable.
* `basis_points` - Nullable.
* `code` - Code customers can use to apply the discount during checkout. Must be between 3 and 256 characters long and contain only alphanumeric characters.If not provided, the discount can only be applied via the API. Nullable.
* `currency` - Nullable. **Deprecated.**
* `duration` - Nullable.
* `duration_in_months` - Nullable.
* `ends_at` - Optional timestamp after which the discount is no longer redeemable. Nullable.
* `max_redemptions` - Optional maximum number of times the discount can be redeemed. Nullable.
* `metadata` - Key-value object allowing you to store additional information.

The key must be a string with a maximum length of **40 characters**.
The value must be either:

* A string with a maximum length of **500 characters**
* An integer
* A floating-point number
* A boolean

You can store up to **50 key-value pairs**.
* `name` - Nullable.
* `products` - Nullable.
* `starts_at` - Optional timestamp after which the discount is redeemable. Nullable.
* `type` - Nullable.

# `schema_name`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
