> ## 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.

# Create promotion code

> Create a new promotion code for a coupon

A promotion code is attached to a coupon and can have additional restrictions like partner limits, minimum orders, and expiration dates.

## Endpoint

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

## Request Body

| Parameter                      | Type    | Required | Description                                                                                                            |
| ------------------------------ | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------- |
| `coupon_uuid`                  | string  | Yes      | UUID of the coupon to attach                                                                                           |
| `code`                         | string  | No       | Promotion code (auto-generated if not provided). Allowed characters: `A-Z`, `a-z`, `0-9`, `-`, `_`. Max 100 characters |
| `first_time_order`             | boolean | No       | Valid only for first-time orders                                                                                       |
| `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 }`                                          |
| `limit_to_specific_customer`   | boolean | No       | Restrict to a specific customer                                                                                        |
| `coupon_specific_customers`    | object  | Yes\*    | Required if `limit_to_specific_customer` is `true`. Shape: `{ id, customer_full_name }`                                |
| `limit_to_specific_subscriber` | boolean | No       | Restrict to a specific newsletter subscriber                                                                           |
| `coupon_specific_subscribers`  | object  | Yes\*    | Required if `limit_to_specific_subscriber` is `true`. Shape: `{ id, subscriber_full_name }`                            |
| `minimum_order_status`         | boolean | No       | Enable minimum order requirement                                                                                       |
| `minimum_order_value`          | integer | Yes\*    | Required if `minimum_order_status` is `true`                                                                           |
| `expiration_date_status`       | boolean | No       | Enable expiration date                                                                                                 |
| `expiration_date_value`        | date    | Yes\*    | Required if `expiration_date_status` is `true`                                                                         |
| `redemption_times_status`      | boolean | No       | Enable redemption limit                                                                                                |
| `redemption_times_value`       | integer | Yes\*    | Required if `redemption_times_status` is `true`                                                                        |
| `metadata`                     | object  | No       | Custom key-value pairs                                                                                                 |

## Request

```bash cURL theme={null}
curl --location 'https://api.partnero.com/v1/promotion-codes' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "coupon_uuid": "coupon_123",
    "code": "PROMO123",
    "first_time_order": true,
    "minimum_order_status": true,
    "minimum_order_value": 22
  }'
```

## 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": [],
      "additional_info": [],
      "times_redeemed": 0
    },
    "status": 1,
    "message": "Promotion code created in the app successfully."
  }
  ```
</ResponseExample>
