---
search:
  tags:
    - Coupons
    - PUT
seo:
  description: >-
    Admin or branch manager only. Patches the active flag, expiry, use cap, or…
    Reference for the PUT /api/v1/coupons/{couponId} endpoint in the PharmaFlow
    API.
sidebar:
  label: Update a coupon
  badge: PUT
title: Update a coupon
type: openapi-operation
---
Admin or branch manager only. Patches the active flag, expiry, use cap, or description. An empty patch answers 400 and an unknown coupon 404; deactivating a coupon is a soft delete.

`PUT /api/v1/coupons/{couponId}`

**Request body** (`application/json`, required)

- `is_active` (boolean | null)
- `valid_until` (string | null)
- `max_uses` (integer | null)
- `description` (string | null)

Request body example:

```json
{
  "is_active": true,
  "valid_until": "string",
  "max_uses": -9007199254740991,
  "description": "string"
}
```

**Responses**

- `200` — Coupon updated
- `400` — Nothing to update
- `401` — Not authenticated
- `403` — Caller is not an admin or branch manager
- `404` — Coupon not found

Response example, 200:

```json
{
  "id": "string",
  "updated": true
}
```
