> For the complete documentation index, see [llms.txt](https://apidocs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.akinon.com/commerce-openapis/admin/bulk-voucher-codes.md).

# Bulk Voucher Codes

Administrative endpoints for **bulk voucher codes** — the individually generated, single-use codes that belong to a basket offer of type `bulk_voucher_code`. Typical integrations include distributing campaign codes to customers and redeeming or managing codes from external systems such as in-store checkout (POS) applications. The parent campaigns themselves are managed with the **Basket Offers** endpoints (`/basket_offers/`).

### Core Capabilities

**1. Code Listing & Filtering**

* Retrieve a paginated list of voucher codes, newest first.
* Filter by the parent basket offer, code value, status, and assigned user — the filters behind the code list of the management panel (e.g. `?basket_offer=35763&status=active&limit=20&page=1`).

**2. Code Lifecycle Management**

* Add a single code manually and optionally assign it to a user.
* Activate or deactivate a code by updating its `status` (used codes are immutable).

**3. Bulk Code Generation**

* Generate any number of random codes for a campaign from a prefix, alphabet, and length; generation runs asynchronously in the background.

### Code Statuses

A voucher code shares the status vocabulary of basket offers.

| Value     | Description                                                                              |
| --------- | ---------------------------------------------------------------------------------------- |
| `active`  | The code can be redeemed. Newly created and generated codes always start in this status. |
| `passive` | The code is disabled and cannot be redeemed.                                             |
| `used`    | The code has been redeemed. A used code can no longer be updated.                        |
| `revoked` | The code has been withdrawn.                                                             |

### Dynamic Settings & Environment Variables

No dynamic settings (`dj_dynamic_settings`) are read by these endpoints: listing, creation, update, bulk generation, and the import/export flows are not influenced by any management-panel setting. Note that whether a code is *redeemable on the storefront* is governed by the parent basket offer (its status, dates, conditions) and by the promotion-application settings documented in the **Basket Offers** section — not by these administrative endpoints.

**Environment variables:** No environment variables affect these endpoints.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://apidocs.akinon.com/commerce-openapis/admin/bulk-voucher-codes.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
