# Voucher Helper Function

### voucherPool Function

The voucherPool Helper Function allows you to add Voucher codes in Outgoing messages. Only Vouchers that are uploaded to your CrossEngage Platform can be used. For more information on Vouchers, please refer to the [Vouchers ](/data-and-engagement-platform/messages/vouchers.md)section.

The syntax of this helper function is:

```jsx
{{#voucherPool '{"name": [Voucher pool name]}'}}
   {{[Voucher pool attribute]}} 
{{/voucherPool}}
```

| **Property** | **Type** | **Description**                                                     |
| ------------ | -------- | ------------------------------------------------------------------- |
| `name`       | string   | **Required**. The name of the of the voucher pool that is accessed. |

The voucher pool attributes that may be displayed within a message are the following:

| **Attribute** | **Description**                                                                                                                                                   |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name`        | **Optional**. The name of the of the voucher pool that is accessed.                                                                                               |
| `code`        | **Required**. The voucher code extracted from the voucher pool.                                                                                                   |
| `validFrom`   | **Optional**. The date the voucher is valid from. e.g. `2018-07-14T00:00:00+0000`To format this date, please use the **date formatting function**.                |
| `validTo`     | **Optional**. The date the voucher is valid to e.g.`2018-08-25T00:00:00+0000`. To format this date, please use the **date formatting function**.                  |
| `value`       | **Optional**. The value or % amount of the voucher. e.g. `10.0`.                                                                                                  |
| `type`        | **Optional**. The type of voucher. The types can be either`percentage` or the same value as the `value` attribute, depending on how your voucher pool was set up. |
| `currency`    | **Optional**. The currency of the voucher pool.                                                                                                                   |
| `minBasket`   | **Optional**. The minimum basket value that a user must have to be eligible for using a voucher.                                                                  |
| `conditions`  | **Optional**. The usage conditions for this voucher.                                                                                                              |
| `created`     | **Optional**. The date the voucher pool was created.                                                                                                              |
| `modified`    | **Optional**. The date the voucher pool was last modified.                                                                                                        |


---

# Agent Instructions: 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://documentation.crossengage.io/data-and-engagement-platform/messages/personalization/misc.-helper-functions/voucher-helper-function.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.
