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

## 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)   |
| `first_time_order`           | boolean | No       | Valid only for first-time orders                  |
| `limit_to_specific_partner`  | boolean | No       | Restrict to specific partner                      |
| `coupon_specific_partners`   | array   | Yes\*    | Required if limit\_to\_specific\_partner is true  |
| `limit_to_specific_customer` | boolean | No       | Restrict to specific customer                     |
| `coupon_specific_customers`  | array   | Yes\*    | Required if limit\_to\_specific\_customer is true |
| `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-code' \
  --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": []
    },
    "status": 1,
    "message": "Promotion code created in the app successfully."
  }
  ```
</ResponseExample>
