> ## Documentation Index
> Fetch the complete documentation index at: https://docs.partnero.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update coupon

> Update an existing coupon

## Endpoint

```
PUT https://api.partnero.com/v1/coupons
```

## Request Body

| Parameter         | Type    | Required | Description                                                                                                                                                                                                                                                                                                                                                                    |
| ----------------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `uuid_code`       | string  | Yes      | Coupon's unique identifier                                                                                                                                                                                                                                                                                                                                                     |
| `name`            | string  | No       | Updated customer-facing name                                                                                                                                                                                                                                                                                                                                                   |
| `metadata`        | object  | No       | Custom key-value pairs (merged into existing metadata)                                                                                                                                                                                                                                                                                                                         |
| `redeem`          | boolean | No       | When `true`, records a redemption: increments `times_redeemed` and appends an entry to `additional_info.redemptions`                                                                                                                                                                                                                                                           |
| `transaction_key` | string  | No       | Optional transaction identifier paired with `redeem`. Must match the `key` of an existing transaction in this program (created via [`POST /v1/transactions`](/api-reference/transactions/create)). Used to deduplicate redemptions — if the same `transaction_key` was already recorded for this coupon, or no transaction with that key exists, the request is a silent no-op |
| `sync`            | object  | No       | Optional object to assign a sync provider to a coupon that doesn't have one yet. See [Assigning a sync provider on update](#assigning-a-sync-provider-on-update)                                                                                                                                                                                                               |
| `sync.provider`   | string  | No       | One of `stripe`, `shopify`, `woocommerce`, `paddle`. Must be currently connected. Can only be set when the coupon currently has no sync provider                                                                                                                                                                                                                               |

<Note>
  Promotion codes cannot be updated through this endpoint. Use the [promotion code update](/api-reference/promotion-codes/update) endpoint instead.
</Note>

## Request

```bash cURL theme={null}
curl --location --request PUT 'https://api.partnero.com/v1/coupons' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "uuid_code": "coupon_123",
    "name": "PARTNERO25_UPDATED"
  }'
```

## Assigning a sync provider on update

You can attach a sync provider to a coupon that was created without one. This is a one-way assignment: once a coupon has a sync provider, it cannot be changed or removed via the API.

```bash cURL theme={null}
curl --location --request PUT 'https://api.partnero.com/v1/coupons' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "uuid_code": "coupon_123",
    "sync": { "provider": "stripe" }
  }'
```

When you assign a provider this way, Partnero creates the coupon in that provider during this request (not just for subsequent updates).

Validation errors:

* `422` if the provider is not connected to the program:

  ```json theme={null}
  { "errors": { "sync.provider": ["stripe is not connected for this program."] } }
  ```

* `422` if the coupon already has a different `sync.provider`:

  ```json theme={null}
  { "errors": { "sync.provider": ["sync.provider is already set on this coupon and cannot be changed."] } }
  ```

### Record a redemption

To record a redemption against an existing coupon — useful when your checkout doesn't run through a connected payment integration — set `redeem` to `true` and (optionally) pass the originating `transaction_key` so the redemption is not double-counted on retries.

```bash cURL theme={null}
curl --location --request PUT 'https://api.partnero.com/v1/coupons' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "uuid_code": "coupon_123",
    "redeem": true,
    "transaction_key": "order_4561"
  }'
```

## Response

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "data": {
      "name": "PARTNERO25_UPDATED",
      "uuid_code": "coupon_123",
      "active": true,
      "coupon_discount_type": "percent",
      "coupon_discount_amount": 25,
      "coupon_duration_type": "months",
      "coupon_duration_value": 11,
      "redemption_specific_date_status": false,
      "redemption_specific_date_value": null,
      "redemption_times_status": true,
      "redemption_times_value": 24,
      "metadata": [],
      "additional_info": {
        "redemptions": [
          {
            "redeemed_at": "2025-05-07T17:53:32.000000Z",
            "transaction_key": "order_4561"
          }
        ]
      },
      "times_redeemed": 4,
      "created_at": "2025-05-07T17:43:26.000000Z",
      "updated_at": "2025-05-07T17:53:32.000000Z",
      "deleted_at": null
    },
    "status": 1,
    "message": "Coupon updated in the app successfully.",
    "synchronization_enabled": false,
    "synchronization_successful": false,
    "synchronization_message": ""
  }
  ```
</ResponseExample>
