> ## Documentation Index
> Fetch the complete documentation index at: https://docs.voyantcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Lookup Voucher

> Look up a voucher by its code

This is a public endpoint for booking engines to look up voucher details by code.

<ParamField header="Authorization" type="string" required>
  Bearer token with `marketing:read` scope
</ParamField>

<ParamField query="code" type="string" required>
  The voucher code to look up
</ParamField>

## Response

Returns whether the voucher is valid and its details.

<ResponseField name="valid" type="boolean">
  Whether the voucher is valid for use
</ResponseField>

<ResponseField name="error" type="string">
  Error code if invalid
</ResponseField>

<ResponseField name="message" type="string">
  Human-readable error message if invalid
</ResponseField>

<ResponseField name="voucher" type="object">
  Voucher details
</ResponseField>

## Error codes

| Error               | Description                      |
| ------------------- | -------------------------------- |
| `voucher_not_found` | No voucher with this code exists |
| `voucher_inactive`  | Voucher is not active            |
| `voucher_expired`   | Voucher has expired              |
| `voucher_depleted`  | Voucher has no remaining balance |

```bash Request theme={null}
curl -X GET "https://api.voyantcloud.com/v1/vouchers/lookup?code=GC1A2B3C4D" \
  -H "Authorization: Bearer $API_KEY"
```

```json Response (Valid) theme={null}
{
  "valid": true,
  "voucher": {
    "id": "voucher_abc123",
    "code": "GC1A2B3C4D",
    "type": "gift_card",
    "status": "active",
    "current_balance_minor": 7500,
    "initial_balance_minor": 10000,
    "currency": "EUR",
    "expires_at": "2025-12-31T23:59:59Z",
    "is_transferable": true
  }
}
```

```json Response (Invalid) theme={null}
{
  "valid": false,
  "error": "voucher_depleted",
  "message": "Voucher has no remaining balance",
  "voucher": {
    "code": "GC1A2B3C4D",
    "status": "depleted",
    "current_balance_minor": 0,
    "currency": "EUR"
  }
}
```
