# Vouchers: Use Case

### **Displaying a discount**

For this example, we access the  `Summer Sale` voucher pool. This example voucher pool is valid from `01.07.2018` until `30.08.2018` and offers `EUR 30.00` discounts to all shop visitors that make orders over `EUR 200.00` in the category **Summer Sale**.&#x20;

{% hint style="info" %}
To display the voucher pool's validity dates in our preferred `dd/mm/yyyy` format, we will use the [date formatting function](/data-and-engagement-platform/messages/personalization/formatting-functions.md#computedate-function).
{% endhint %}

```jsx
{{#voucherPool '{"name": "Summer Sale Discount"}'}}

Use {{code}} to save {{value}} {{currency}} on your next order! 
(valid {{computeDate '{"dateTrait": "validFrom", "outputFormat": "dd/MM/yyyy"}'}}
until {{computeDate '{"dateTrait": "validTo", "outputFormat": "dd/MM/yyyy"}'}})
*Only valid for purchases over {{minBasket}} {{currency}}. 
Terms and conditions apply: {{conditions}}

{{/voucherPool}}
```

Once the function is evaluated, it displays the following text in the section where it is used in the message:

```
Use SD30Sdjat77 to save 30.0 EUR on your next order! 
(valid from 01/07/2018 until 30/08/2018)
*Only valid for purchases over 200.0 EUR.

Terms and conditions apply:
- This voucher is only valid for purchases made in our Summer Sale category.
- A voucher can only be used once. 
- The voucher is non-transferable.
- This voucher must be redeemed on our website, applying it during the checkout process.
```


---

# 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/vouchers-use-case.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.
