> ## 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 promotion code

> Update an existing promotion code

## Endpoint

```
PUT https://api.partnero.com/v1/promotion-codes
```

## Request Body

| Parameter                   | Type    | Required | Description                                                                                                                                                                                                                                                                                                                                                                  |
| --------------------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `code`                      | string  | Yes      | Promotion code to update. Allowed characters: `A-Z`, `a-z`, `0-9`, `-`, `_`. Max 100 characters                                                                                                                                                                                                                                                                              |
| `limit_to_specific_partner` | boolean | No       | Restrict to a specific partner                                                                                                                                                                                                                                                                                                                                               |
| `coupon_specific_partners`  | object  | Yes\*    | Required if `limit_to_specific_partner` is `true`. Shape: `{ id, full_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 code, or no transaction with that key exists, the request is a silent no-op |

## Request

```bash cURL theme={null}
curl --location --request PUT 'https://api.partnero.com/v1/promotion-codes' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "code": "PROMO123",
    "metadata": {
      "campaign": "summer_sale"
    }
  }'
```

### Record a redemption

Use `redeem` to record that a customer applied this promotion code, for cases where the checkout doesn't run through a connected payment integration. Pass a `transaction_key` to deduplicate retries.

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

## Response

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "data": {
      "code": "PROMO123",
      "first_time_order": true,
      "limit_to_specific_partner": false,
      "coupon_specific_partners": [],
      "limit_to_specific_customer": false,
      "coupon_specific_customers": [],
      "minimum_order_status": true,
      "minimum_order_value": 22,
      "expiration_date_status": false,
      "expiration_date_value": null,
      "redemption_times_status": false,
      "redemption_times_value": null,
      "metadata": {
        "campaign": "summer_sale"
      },
      "additional_info": {
        "redemptions": [
          {
            "redeemed_at": "2025-05-09T07:11:04.000000Z",
            "transaction_key": "order_4561"
          }
        ]
      },
      "times_redeemed": 2
    },
    "status": 1,
    "message": "Promotion code updated in the app successfully."
  }
  ```
</ResponseExample>
