---
title: "Update discount"
method: PATCH
path: "/discounts/{id}"
tags: ["Discounts"]
---

# Update discount

`PATCH /discounts/{id}`

## Request

- Base URL: `https://api.crevio.co/v1`
- URL: `https://api.crevio.co/v1/discounts/{id}`
- Auth: API key in header `Authorization`

Updates an existing discount

## Path parameters

- `id` string, required

## Request body

- DiscountRequest
  - `code` string
  - `discount_type` 'percentage' | 'fixed'
  - `amount_off` integer, nullable
  - `percent_off` number, nullable
  - `currency` string, nullable
  - `duration` 'forever' | 'once' | 'repeating'
  - `duration_in_months` integer, nullable
  - `starts_at` string, date-time, nullable: When the code becomes usable. Checkout rejects it before this time; omit it to make the code usable right away. For a sale that starts later, create the discount now with `starts_at` set rather than scheduling its creation.
  - `redeem_by` string, date-time, nullable: When the code stops being usable. Must be in the future and after `starts_at`.
  - `max_redemptions` integer, nullable
  - `price_variants` string[]

## Response `200`

Discount updated

- Discount
  - `id` string, required
  - `object` string, required
  - `status` 'active' | 'inactive', required
  - `discount_type` 'percentage' | 'fixed', required
  - `code` string, required
  - `amount_off` integer, nullable, required
  - `duration` 'forever' | 'once' | 'repeating', required
  - `duration_in_months` integer, nullable, required
  - `max_redemptions` integer, nullable, required
  - `times_redeemed` integer, required
  - `starts_at` string, date-time, nullable, required
  - `redeem_by` string, date-time, nullable, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `percent_off` number, double, nullable, required
  - `currency` string, nullable, required

## Other responses

- `400`: Bad request
- `401`: Authentication required
- `403`: Forbidden
- `404`: Resource not found
- `422`: Validation error
- `429`: Rate limit exceeded — 600 requests per minute per credential. Retry after the number of seconds in `Retry-After`.
- `500`: Internal server error

---

[API](https://skmtc.dev/crevio/apis/crevio-api-v1.md) · [All operations](https://skmtc.dev/crevio/apis/crevio-api-v1/llms.txt) · [OpenAPI document](https://skmtc.dev/crevio/apis/crevio-api-v1/revisions/2219f18ad651?raw)
