> For the complete documentation index, see [llms.txt](https://help.openloyalty.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.openloyalty.io/implementation-guide/integrations-and-data-exchange/imports-exports/exports/ui-exports/campaign-codes.md).

# Campaign Codes

Export the redemption codes tied to a specific campaign as a CSV file — useful for auditing code usage or reconciling stock of codes issued outside Open Loyalty.

**File format:** CSV

#### Sample CSV file

{% file src="/files/RhexpqzL5OlwLmTEKqsy" %}

```csv
codeId,code,status,createdAt,usedByMemberId,usedAt
6f29398a-f49d-4d3e-92a8-20118dbe4773,CNDG3W5D65AS,unused,2026-03-10T04:32:08+01:00,,
735aa96d-65fc-46a1-8dd2-d43c6235c52b,5ZMFNF7QFJ3Z,unused,2026-03-10T04:32:08+01:00,,
```

#### Field reference

<table><thead><tr><th width="196">Field</th><th>Description</th></tr></thead><tbody><tr><td><code>codeId</code></td><td>Open Loyalty UUID for the code</td></tr><tr><td><code>code</code></td><td>The redemption code string</td></tr><tr><td><code>status</code></td><td><code>unused</code> once generated/uploaded; changes once a member redeems the code</td></tr><tr><td><code>createdAt</code></td><td>Timestamp the code was generated or uploaded (ISO 8601, with offset)</td></tr><tr><td><code>usedByMemberId</code></td><td>UUID of the member who redeemed the code — empty while <code>unused</code></td></tr><tr><td><code>usedAt</code></td><td>Timestamp the code was redeemed — empty while <code>unused</code></td></tr></tbody></table>

{% hint style="info" %}
The sample above only shows the `unused` state. `usedByMemberId` and `usedAt` populate once a member redeems the code — confirm the exact `status` value used for redeemed codes against your own export if you're building automation around this field.
{% endhint %}

#### How to export

Codes are exported per campaign, from the campaign's redemption codes list. Once scheduled, the export appears in **Imports & Exports → Exports** for download, like other report exports.


---

# 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 following URL with the `ask` and `goal` query parameters:

```
GET https://help.openloyalty.io/implementation-guide/integrations-and-data-exchange/imports-exports/exports/ui-exports/campaign-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 `build a script that syncs our docs to a CMS` 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.
