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

# INSTANTVOUCHER- (Printable purchase vouchers)

> Output the amount, number, currency and validity of a purchased voucher in the PDF template, with clean handling of vouchers without an expiry date.

Printable purchase vouchers are vouchers that the customer orders as a product and then receives as a PDF. You determine the appearance of this PDF via a separate template, and the `INSTANTVOUCHER-` tags fill it with the data of the purchased voucher.

All seven tags apply exclusively in this template. You specify which template it is in the shop configuration `shop.config` in the `<Templates>` section with the `InstantVoucherPDF` parameter. Outside this template, the tags remain empty because the voucher data is not available there.

The tags always describe exactly one voucher, namely the one just created. If a customer orders several, a separate PDF is created for each from the same template.

Guide: Printable purchase vouchers · Reference: Templates section

## The values of the voucher

| Tag | Returns |
| - | - |
| `INSTANTVOUCHER-Amount` | the value of the voucher, in the shop's price format |
| `INSTANTVOUCHER-CurrencyCode` | the currency code, for example EUR |
| `INSTANTVOUCHER-CurrencySymbol` | the currency symbol, for example € |
| `INSTANTVOUCHER-VoucherNumber` | the voucher number |
| `INSTANTVOUCHER-ValidUntil_day` | the day until which the voucher is valid |
| `INSTANTVOUCHER-ValidUntil_month` | the corresponding month |
| `INSTANTVOUCHER-ValidUntil_year` | the corresponding year |

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<div class="gutschein">
   <p class="betrag">~INSTANTVOUCHER-Amount~ ~INSTANTVOUCHER-CurrencySymbol~</p>
   <p class="nummer">Gutscheinnummer: ~INSTANTVOUCHER-VoucherNumber~</p>
</div>
```

> [!NOTE]
>
> `INSTANTVOUCHER-Amount` is already formatted in the shop's price format, that is, with the configured decimal and thousands separators. You don't need to reformat anything, and you also cannot call the tag with a different number of digits.

> [!NOTE]
>
> Currency code and currency symbol are two different tags because both have their place. The symbol reads more naturally next to the amount, while the code is unambiguous and suits the footer or vouchers going abroad.

## Outputting the validity

The three date components are separate tags so that you can assemble the date in the notation of the respective country.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
Gültig bis ~INSTANTVOUCHER-ValidUntil_day~.~INSTANTVOUCHER-ValidUntil_month~.~INSTANTVOUCHER-ValidUntil_year~
```

> [!WARNING]
>
> Not every voucher has an expiry date. If no validity date is stored, all three tags output nothing, and the line above turns into a bare "Gültig bis .." on the printed voucher. Therefore, wrap the line in an area tag.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{INSTANTVOUCHER-ValidUntil_year}
   <p>Gültig bis ~INSTANTVOUCHER-ValidUntil_day~.~INSTANTVOUCHER-ValidUntil_month~.~INSTANTVOUCHER-ValidUntil_year~</p>
{/INSTANTVOUCHER-ValidUntil_year}

{!INSTANTVOUCHER-ValidUntil_year}
   <p>Dieser Gutschein ist unbefristet gültig.</p>
{/!INSTANTVOUCHER-ValidUntil_year}
```

> [!NOTE]
>
> Check the year for this. The shop system only outputs the day if it is between 1 and 31, the month only between 1 and 12, and the year only from 2015 onward. If the date is missing, all three are empty. The year is the most meaningful of the three, because a valid date always has one.

## Checking for a specific value

Each of the seven tags can be used as an area tag with a comparison value in the argument. The area then takes effect if the value matches exactly.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{INSTANTVOUCHER-CurrencyCode(EUR)}
   <p class="hinweis">Einlösbar in allen deutschen Filialen.</p>
{/INSTANTVOUCHER-CurrencyCode(EUR)}

{INSTANTVOUCHER-CurrencyCode(CHF)}
   <p class="hinweis">Einlösbar in allen Schweizer Filialen.</p>
{/INSTANTVOUCHER-CurrencyCode(CHF)}
```

> [!NOTE]
>
> The capitalization of the comparison value doesn't matter. This option is not described in the previous documentation, but it works with all tags on this page.

> [!WARNING]
>
> For the amount, you compare against the **formatted** value, that is, against the string that the tag would also output. `{INSTANTVOUCHER-Amount(50)}` therefore does not take effect for a fifty-euro voucher, because the tag returns "50,00". This method is unsuitable for case distinctions by amount.

## The tags at a glance

| Tag | Single tag | Area tag | Negative area tag | Loop tag |
| - | - | - | - | - |
| `INSTANTVOUCHER-Amount` | yes | yes | yes | – |
| `INSTANTVOUCHER-CurrencyCode` | yes | yes | yes | – |
| `INSTANTVOUCHER-CurrencySymbol` | yes | yes | yes | – |
| `INSTANTVOUCHER-VoucherNumber` | yes | yes | yes | – |
| `INSTANTVOUCHER-ValidUntil_day` | yes | yes | yes | – |
| `INSTANTVOUCHER-ValidUntil_month` | yes | yes | yes | – |
| `INSTANTVOUCHER-ValidUntil_year` | yes | yes | yes | – |

All seven tags behave the same. They only apply in the template entered under `InstantVoucherPDF`. The capitalization of the tag name doesn't matter.

## Related topics

* Guide: Printable purchase vouchers
* Reference: VOUCHER- (Vouchers)
* Reference: Templates section


## Related topics

- [Purchase vouchers for printing](https://dokumentation.websale.de/en/v8s/gutscheine-anbieten/kaufgutscheine-zum-ausdrucken.md)
- [Vouchers](https://dokumentation.websale.de/en/admin-interface/marketing/gutscheine.md)
- [VOUCHER- (Voucher)](https://dokumentation.websale.de/en/v8s/referenz/tags/voucher-gutschein.md)
- [Creating a purchase voucher product](https://dokumentation.websale.de/en/admin-interface/katalog/produkte/kaufgutschein-produkt.md)
- [Vouchers in the basket](https://dokumentation.websale.de/en/v8s/referenz/tags/basket/gutscheine-im-warenkorb.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.