> 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/list-bulk-voucher-codes.md).

# List bulk voucher codes

Returns a paginated list of bulk voucher codes, newest first (descending identifier).

The most commonly used filters are documented below. Beyond these, a filter is automatically available for most other fields of the code record: text fields match on a case-insensitive partial match, while the remaining fields match exactly.

Results are returned inside a pagination envelope that reports the total count and links to the next and previous pages.

```json
{"openapi":"3.1.0","info":{"title":"Admin API","version":"1.0.0"},"tags":[{"name":"Bulk Voucher Codes","description":"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/`).\n\n## Core Capabilities\n\n**1. Code Listing & Filtering**\n* Retrieve a paginated list of voucher codes, newest first.\n* 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`).\n\n**2. Code Lifecycle Management**\n* Add a single code manually and optionally assign it to a user.\n* Activate or deactivate a code by updating its `status` (used codes are immutable).\n\n**3. Bulk Code Generation**\n* Generate any number of random codes for a campaign from a prefix, alphabet, and length; generation runs asynchronously in the background.\n\n## Code Statuses\n\nA voucher code shares the status vocabulary of basket offers.\n\n| Value | Description |\n|-------|-------------|\n| `active` | The code can be redeemed. Newly created and generated codes always start in this status. |\n| `passive` | The code is disabled and cannot be redeemed. |\n| `used` | The code has been redeemed. A used code can no longer be updated. |\n| `revoked` | The code has been withdrawn. |\n\n## Dynamic Settings & Environment Variables\n\nNo 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.\n\n**Environment variables:** No environment variables affect these endpoints."}],"servers":[{"description":"Omnitron Remote Proxy (external access — recommended)","url":"https://{omnitron_url}/api/remote/{channel_id}","variables":{"omnitron_url":{"default":"sandbox.akinon.com","description":"Omnitron server URL (e.g., {omnitron.akinon.com})"},"channel_id":{"default":"1","description":"The channel identifier the remote request is routed through"}}},{"description":"Commerce API Server (internal / direct access only)","url":"https://{commerce_url}/api/v1","variables":{"commerce_url":{"default":"sandbox.akinon.com","description":"Internal commerce server URL, reachable only from within the Omnitron network"}}}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token credential sent in the Authorization header, in the form: `Token <your-token>`. Requires a staff (admin) account."}},"parameters":{"page":{"name":"page","in":"query","required":false,"description":"The page number to return.","schema":{"type":"integer","default":1}},"limit":{"name":"limit","in":"query","required":false,"description":"The number of items to return per page.","schema":{"type":"integer","default":10}},"sort":{"name":"sort","in":"query","required":false,"description":"Orders the results by one or more fields. Separate multiple fields with commas. Prefix a field with a hyphen (`-`) for descending order.","schema":{"type":"string"}}},"schemas":{"VoucherCodeStatus":{"type":"string","description":"The lifecycle status of a voucher code.\n* `active` — the code can be redeemed; new codes always start here\n* `passive` — the code is disabled\n* `used` — the code has been redeemed and can no longer be updated\n* `revoked` — the code has been withdrawn","enum":["active","passive","used","revoked"]},"PaginatedBulkVoucherCodeList":{"type":"object","description":"A page of bulk voucher code results.","properties":{"count":{"type":"integer","description":"The total number of voucher codes matching the query."},"next":{"type":["string","null"],"format":"uri","description":"The URL of the next page of results, when available."},"previous":{"type":["string","null"],"format":"uri","description":"The URL of the previous page of results, when available."},"results":{"type":"array","description":"The voucher codes on the current page.","items":{"$ref":"#/components/schemas/BulkVoucherCode"}}}},"BulkVoucherCode":{"type":"object","description":"A bulk voucher code as returned by the API.","properties":{"pk":{"type":"integer","description":"Unique voucher code identifier."},"code":{"type":"string","description":"The voucher code value."},"basket_offer":{"type":"integer","description":"Identifier of the parent basket offer."},"status":{"$ref":"#/components/schemas/VoucherCodeStatus"},"user":{"type":["integer","null"],"description":"Identifier of the user the code is assigned to, when any."},"user_email":{"type":["string","null"],"description":"Email address of the assigned user, when any."}}},"Error":{"type":"object","description":"An error response.","properties":{"detail":{"type":"string","description":"A human-readable description of the error."}},"additionalProperties":true}},"responses":{"Unauthorized":{"description":"Authentication credentials were not provided or are invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The authenticated user does not have administrator privileges.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/bulk_voucher_codes/":{"get":{"tags":["Bulk Voucher Codes"],"operationId":"listBulkVoucherCodes","summary":"List bulk voucher codes","description":"Returns a paginated list of bulk voucher codes, newest first (descending identifier).\n\nThe most commonly used filters are documented below. Beyond these, a filter is automatically available for most other fields of the code record: text fields match on a case-insensitive partial match, while the remaining fields match exactly.\n\nResults are returned inside a pagination envelope that reports the total count and links to the next and previous pages.","parameters":[{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/sort"},{"name":"basket_offer","in":"query","description":"Filter by the identifier of the parent basket offer. This is the primary filter for listing the codes of a single campaign.","required":false,"schema":{"type":"integer"}},{"name":"code","in":"query","description":"Filter by code value, case-insensitive partial match.","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","description":"Filter by code status. May be repeated to match any of several statuses.","required":false,"explode":true,"schema":{"type":"array","items":{"$ref":"#/components/schemas/VoucherCodeStatus"}}},{"name":"user","in":"query","description":"Filter by the identifier of the user the code is assigned to.","required":false,"schema":{"type":"integer"}},{"name":"user__email","in":"query","description":"Filter by the email address of the user the code is assigned to.","required":false,"schema":{"type":"string"}},{"name":"order","in":"query","description":"Filter by the identifier of the order the code was redeemed on.","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"A page of bulk voucher codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedBulkVoucherCodeList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}}}}
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
