> For the complete documentation index, see [llms.txt](https://developers.airship.co.uk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.airship.co.uk/basics/vouchers/check-voucher-code.md).

# Check voucher code

### Overview

A vouchers current status can be checked within Airship. This will return the following information:&#x20;

* Contact id associated
* Redemption unit (if redeemed)
* Redemption date/time (if redeemed)
* Status;
  * "Active" (not yet redeemed)
  * "Redeemed"

### Example Request

{% tabs %}
{% tab title="GET" %}

```json
https://api.airship.co.uk/v1/unique_code
```

{% endtab %}
{% endtabs %}

### Configuration

#### Headers

| Field                           | Notes                                                                                                                                                                          |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Authentication` (bearer token) | The authentication token is linked to the account that you are searching bookings in. If you are unsure of what your Authentication token is, ask our support team to confirm. |

#### Body

| Field                  | Notes                                                                                                                                                                                                                                                                  |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `account_id`           | The account ID represents the account that you are searching bookings in. If you are unsure of what your account ID is, ask our support team to confirm.                                                                                                               |
| `unique_code`          | The unique voucher code which you are searching for.                                                                                                                                                                                                                   |
| `unique_code_group_id` | The unique voucher code group which the voucher is associated with. As the same voucher code can exist in different code groups (be issued in different campaigns at different points in time) - the ucgid enables us to narrow down which code is being searched for. |

### Basic Payload example

{% tabs %}
{% tab title="Request" %}

```json
{
    "account_id": 2,
    "unique_code": "AB9201E11",
    "unique_code_group_id": 14252
}
```

{% endtab %}

{% tab title="200 Response" %}

1. Code Active

```json
{
    "id": 62123810,
    "unique_code": "AB9201E11",
    "unique_code_group_id": "14252",
    "contact_id": "51626835",
    "redeemed_at_unit_id": "0",
    "redeemed_at_datetime": "0000-00-00 00:00:00",
    "unique_code_status": "Active"
}
```

2\. Code redeemed

```json
{
    "id": 62123810,
    "unique_code": "AB9201E11",
    "unique_code_group_id": "14252",
    "contact_id": "51626835",
    "redeemed_at_unit_id": "14458",
    "redeemed_at_datetime": "2021-11-02 10:12:26",
    "unique_code_status": "Redeemed"
}
```

{% endtab %}

{% tab title="422 Response" %}

1. Invalid Unique Code Group ID

```json
{
    "message": "The given data was invalid.",
    "errors": {
        "unique_code_group_id": [
            "This unique code group id doesn't exist"
        ]
    }
}
```

2\. Invalid Unique Code

```json
{
    "message": "The given data was invalid.",
    "errors": {
        "unique_code": [
            "This unique code doesn't exist"
        ]
    }
}
```

3\. Invalid Account ID

```json
{
    "message": "The given data was invalid.",
    "errors": {
        "account_id": [
            "You do not have access to this account"
        ]
    }
}
```

{% endtab %}
{% endtabs %}


---

# 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:

```
GET https://developers.airship.co.uk/basics/vouchers/check-voucher-code.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
