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

# Vouchers redeemable only in the app

> Issue a voucher that can only be redeemed in the shop app, and explain the rejection in the web shop in an understandable way.

A voucher that only works in the app is an incentive to install it. It is suitable for campaigns meant to bring customers from the browser into the app, and for promotions you want to reserve exclusively for app users.

This restriction is purely a property of the voucher. Nothing needs to be set up in the shop apart from the corresponding error message.

## How the shop recognizes the app

The shop checks whether the request includes an app version. Only then is the session considered an app session.

> [!WARNING]
>
> A customer who opens the shop in the browser on their phone is therefore **not** an app user, even if the page looks mobile there. The voucher is rejected. Word the advertising for such a promotion unambiguously, otherwise the questions will end up with your support team.

## Prerequisite

The voucher generator must be activated. Contact your WEBSALE representative to arrange this.

> [!NOTE]
>
> If the vouchers come from an external system and are therefore not in WEBSALE format, add the entry `ExternalVouchers-Allow = yes` in the `<Voucher-Txt>` section of the `shop.config`.

Guide: Providing voucher entry · Reference: Voucher-Txt section

## Step 1: Restrict the voucher

When creating the voucher in the voucher generator, enter the following string in the **Kundenspezifische Features** (custom features) field at the very bottom.

```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<g><t>ValidOnlyForApp</t></g>
```

| Bracket | Meaning |
| - | - |
| `<g>…</g>` | encloses the entire function |
| `<t>…</t>` | the type, here `ValidOnlyForApp` |

> [!NOTE]
>
> This function has no further settings. It is either set or not.

## Step 2: Add the error message

If the voucher is entered outside the app, the shop rejects it with reason **24**. Add this reason wherever you have integrated the voucher entry, i.e. on the basket page `ws_basket.htm` or the order overview page `ws_place_order.htm`.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{MSG-Voucher_error(24)}
   Diesen Gutschein können Sie nur in unserer App einlösen.<br>
   Öffnen Sie den Shop in der App und geben Sie den Code dort ein.
{/MSG-Voucher_error(24)}
```

> [!WARNING]
>
> Without this text, the customer sees an empty message. They have a valid code in hand, it is not accepted, and they do not find out why. Of all the rejection reasons, this is the most frustrating one, because the customer did everything right.

> [!NOTE]
>
> A link or a reference to the app store in the message text turns the rejection into an invitation. That is exactly what this type of voucher is intended for.

Reference: MSG-Voucher\_error

## Step 3: Point out the restriction (optional)

If the data of a voucher is available, its restriction can be displayed.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{VOUCHER-SpecialFeatures_ValidOnlyForApp}
   Dieser Gutschein ist nur in unserer App einlösbar.
{/VOUCHER-SpecialFeatures_ValidOnlyForApp}
```

> [!NOTE]
>
> The section refers to the currently loaded voucher data, i.e. to an entered voucher or to one you have loaded with `VOUCHER-LoadData`.

> [!NOTE]
>
> In addition, you can use `WS-AppVersion` to query whether the visitor is using the app at all, and show the reference to the app right away on a promotion page in the browser instead of only at the point of rejection.

Reference: VOUCHER-SpecialFeatures\_ValidOnlyForApp · VOUCHER-LoadData · WS-AppVersion

## Related topics

* Guide: Offering vouchers: Overview
* Guide: Creating or importing vouchers
* Guide: Providing voucher entry


## Related topics

- [VOUCHER- (Voucher)](https://dokumentation.websale.de/en/v8s/referenz/tags/voucher-gutschein.md)
- [Vouchers](https://dokumentation.websale.de/en/admin-interface/marketing/gutscheine.md)
- [Provide voucher entry](https://dokumentation.websale.de/en/v8s/gutscheine-anbieten/gutschein-eingabe-vorsehen.md)
- [Vouchers in the basket](https://dokumentation.websale.de/en/v8s/referenz/tags/basket/gutscheine-im-warenkorb.md)
- [New customer vouchers](https://dokumentation.websale.de/en/v8s/gutscheine-anbieten/neukunden-gutscheine.md)


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