> 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/retrieve-a-bulk-voucher-code.md).

# Retrieve a bulk voucher code

Returns a single bulk voucher code.

```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/v1/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."}},"schemas":{"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."}}},"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"]},"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"}}}},"BulkVoucherCodeNotFound":{"description":"The requested bulk voucher code does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/bulk_voucher_codes/{id}/":{"get":{"tags":["Bulk Voucher Codes"],"operationId":"retrieveBulkVoucherCode","summary":"Retrieve a bulk voucher code","description":"Returns a single bulk voucher code.","responses":{"200":{"description":"The requested voucher code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkVoucherCode"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/BulkVoucherCodeNotFound"}}}}}}
```


---

# 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/retrieve-a-bulk-voucher-code.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.
