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

# Create redemption codes (CDKs) in batch

Prefix the paths below with your service URL. Obtain an access token first, then send it in the `Authorization` header when calling other endpoints. Keep your credentials and token secure. Obtaining a new token invalidates the previous one.

`POST /wapi/cdk/create/`

```http theme={null}
Content-Type: application/json
Authorization: Bearer YOUR_TOKEN
```

<table>
  <colgroup>
    <col width="100" />

    <col width="563" />
  </colgroup>

  <thead>
    <tr>
      <td>**Field**</td>
      <td>**Description**</td>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>`cdk_type`</td>
      <td>Required: `1` Dynamic traffic, `2` IP count, `3` Mobile traffic</td>
    </tr>

    <tr>
      <td>`flow`</td>
      <td>Required for types 1 and 3; traffic per code in GB, from 1 to 10000</td>
    </tr>

    <tr>
      <td>`ip`</td>
      <td>Required for type 2; IP count per code, from 1 to 10000</td>
    </tr>

    <tr>
      <td>`day`</td>
      <td>Validity period in days for types 1 and 3</td>
    </tr>

    <tr>
      <td>`num`</td>
      <td>Required; number of codes to create, from 1 to 10000</td>
    </tr>
  </tbody>
</table>

**Example for Dynamic traffic codes:**

```json theme={null}
{
  "cdk_type": 1,
  "flow": 10,
  "day": 30,
  "num": 2
}
```

On success, `results` lists the generated codes. `Cdk` is the redemption code, `Type` is its type, `Flow` is in bytes, `Ip` is the IP count, and `Days` is the validity period:

```json theme={null}
{
  "code": 200,
  "results": [
    { "Cdk": "EXAMPLE1", "Type": 1, "Flow": 10000000000, "Ip": 0, "Days": 30 }
  ]
}
```

> [!TIP]
>
> Ensure your account has enough of the corresponding resource. If it does not, the entire batch fails. Do not submit identical creation requests concurrently. This endpoint is rate-limited; retry later if you receive HTTP 429.


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