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

# Generate Incremental Coupon Codes

Generates additional coupon codes, on demand. Available when the coupon campaign is already active.

* Incremental coupons are only available after the campaign's original coupons were fully generated and relevant for active coupon campaigns.
* In order to generate incremental coupon codes, `on_demand_codes_allowed` campaign attribute must be enabled (1) in the [Campaign](Campaigns) object.
* The response to the call provides a list of the coupon codes for use and redemption by the customers. You may choose to add an additional security step that requires activation of the codes prior to redemption. See `coupon_code_requires_activation` in the [Campaign](Campaigns) object.
* The maximal number of codes per generation attempt is 3,000.

## HTTP Request

`POST /campaigns/:campaign/actions/generate_incremental_codes`

## Route (URL) Parameters

| Parameter | Default | Description | Required |
| - | - | - | - |
| campaign | n/a | The id or the vid of the associated coupon campaign | Yes |

## Query Parameters

| Parameter | Type | Description | Required |
| - | - | - | - |
| `number_of_codes` | integer | The number of incremental codes required . Maximal number of codes allowed is 100. | Yes |

## Accepts

None.

## Returns

JSON - A *list* array with a data property that contains an array of up to limit [campaign codes](Campaign_Codes). Each entry in the array is a full campaign code object.

Also:

* `total_count`: Integer count of the number of Campaign Codes in the returned list.

## Example Request

```

curl -X GET  \
-u acaff38d462f9430d5cbcbaf:a575771fc679b9de \
"https://api.staging.us-west.vindicia.com/campaigns/50max587312/actions/generate_incremental_codes?3"
```

## Example Response

The above command returns JSON structured like this:

```
{
   "object": "List",
        "data": [
           {
             "object": "CampaignCode",
              "id": "gNyqjYPHWNqH-RydSetAFsLmD8Q-VKXVTPG53FEMGEMP",
              "vid": "612fc7f83c64c5b61a2554b1b89a2a6a7d21c40f",
              "type": "Coupon",
              "state": "Activated",
              "last_chars": "GEMP",
              "redemption_count": 0
           },
           {
              "object": "CampaignCode",
              "id": "gNyqjYPHWNqH-RydSetAFsLmD8Q-4PF8PEFHJT7XERCP",
              "vid": "148557b6822cf64e3e9efa35d04b82019975dd92",
              "type": "Coupon",
              "state": "Activated",
              "last_chars": "ERCP",
              "redemption_count": 0
           },
           {
              "object": "CampaignCode",
              "id": "gNyqjYPHWNqH-RydSetAFsLmD8Q-99A9BWCTB45BV35W",
              "vid": "5c4caf83858d096f00e6ff4585894bdbb40f31fb",
              "type": "Coupon",
              "state": "Activated",
              "last_chars": "V35W",
              "redemption_count": 0
           }
        ],
        "total_count": 3
     }
```

**Parent topic:**[Campaigns](../topics/Campaigns)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.