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

# Granting subsidies

> Credit individual customers with a balance on a subsidy account that the shop deducts from the final total and carries forward across multiple orders.

A subsidy is a balance that you store for an individual customer in the customer database. The shop deducts it from the final total in the basket. Whatever is not used remains available for the next order.

This lets you map rewards, credits, bonuses and similar benefits without issuing a voucher for each case. The difference from a voucher: the subsidy is tied to the customer account, not to a code, and the customer does not have to enter anything.

## How the subsidy is offset

| Step | What happens |
| - | - |
| The customer puts products in the basket | The shop reads the subsidy balance from the customer account |
| The balance is less than the final total | The entire balance is deducted, and the customer pays the difference |
| The balance is greater than the final total | Only as much is deducted as the order costs |
| After the order | The amount used goes into the order data, and the rest remains on the account |

> [!NOTE]
>
> The shop never deducts more than the order costs. An order total below zero cannot occur as a result.

> [!WARNING]
>
> Offsetting and updating the account are two different things. The shop credits the subsidy in the order and writes the amount used and the remaining amount into the order data. You maintain the account balance itself via the customer import. So check that your merchandise management system actually writes the values from the order data back, otherwise the customer keeps their full balance.

## Prerequisite

The subsidy comes from the customer import module. Talk to your WEBSALE representative if you are not using it yet.

## Step 1: Activate the function in the shop configuration

Add the `CustomerSubvention` section to the `shop.config`.

```ini theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<CustomerSubvention>
   Allow         = yes
   Name-Txt      = Zuschuss
   Remainder-Txt = Verfügbarer Zuschuss für Ihre nächste Bestellung:
   VATType       = static
</CustomerSubvention>
```

| Parameter | Meaning |
| - | - |
| `Allow` | with `yes`, the function is active |
| `Name-Txt` | label of the offset subsidy in the order data |
| `Remainder-Txt` | label of the remaining balance in the order data |
| `VATType` | `static` or `dynamic`. Controls whether the VAT of the subsidy is calculated statically or dynamically. If not specified, `static` applies |

> [!NOTE]
>
> `Name-Txt` and `Remainder-Txt` are not template texts. The shop writes them as labels into the order data, next to the respective amount. Your merchandise management system and your order confirmation access them. You write the texts in the template yourself in step 2.

Reference: CustomerSubvention section

## Step 2: Display the account balance in the template

Two tags provide information about the balance.

| Tag | Content |
| - | - |
| `WS-SubventionAccount` | the customer's entire balance before this order |
| `WS-SubventionRemainder` | the balance that remains after this order |
| `BASKET-SubventionRest` | also the remaining balance, but as a bracket it only applies if something actually remains |

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{WS-SubventionAccount}
   Ihr Zuschussguthaben: ~WS-SubventionAccount~ ~WS-Currency~
{/WS-SubventionAccount}

{BASKET-SubventionRest}
   Für Ihre nächste Bestellung bleiben: ~BASKET-SubventionRest~ ~WS-Currency~
{/BASKET-SubventionRest}
```

> [!WARNING]
>
> Use `BASKET-SubventionRest` for the remaining amount, not `WS-SubventionRemainder`. As a bracket, `WS-SubventionRemainder` checks whether the customer has a balance **at all**, not whether anything is left after this order. A customer who uses up their entire balance then reads "Für Ihre nächste Bestellung bleiben: 0,00 EUR". `BASKET-SubventionRest` only applies if there is a real remainder.

> [!NOTE]
>
> As a single tag, both tags return the same amount. The difference lies solely in their behavior as a bracket. If you want to output the amount unconditionally anyway, `WS-SubventionRemainder` is unproblematic.

> [!NOTE]
>
> Both tags trigger the total calculation if required. You can therefore also use them on pages where the basket has not yet been calculated.

Reference: WS-SubventionAccount · WS-SubventionRemainder · BASKET-SubventionRest

## Step 3: Store subsidies per customer

The balance is stored in the customer account in the `Subvention` field and is set via the customer import. You can find the name of the import parameter in the customer import documentation.

> [!NOTE]
>
> A subsidy applies exactly to the customer in whose account it is stored. Guest customers have no account and therefore cannot receive a subsidy.

## What arrives in the order data

If the function is active, the shop writes these fields for each order.

| Field | Content |
| - | - |
| `CustomerSubvention` | the amount offset in this order |
| `CustomerSubventionVATRate` | the associated VAT rate |
| `CustomerSubventionVATIndex` | the associated tax rate index |
| `CustomerSubvention_DName` | the text from `Name-Txt` |
| `CustomerSubvention_DValue` | the offset amount, formatted and with a minus sign |
| `CustomerSubventionRemainder` | the remaining balance |
| `CustomerSubventionRemainder_DName` | the text from `Remainder-Txt` |
| `CustomerSubventionRemainder_DValue` | the remaining balance, formatted |

> [!NOTE]
>
> The four fields with `_DName` and `_DValue` only appear if the respective amount is not zero. A customer without a remaining balance therefore does not generate a `CustomerSubventionRemainder_DName`. If your merchandise management system evaluates these fields, it must be able to handle their absence.

> [!NOTE]
>
> The three numeric fields without a name suffix, on the other hand, are always written, even with the value 0.00.

## Related topics

* Guide: Bonus points
* Guide: Offering vouchers: Overview


## Related topics

- [Basket totals](https://dokumentation.websale.de/en/v8s/referenz/tags/basket/warenkorbsummen.md)
- [Shopping cart, prices, currency and bonus](https://dokumentation.websale.de/en/v8s/referenz/tags/ws/warenkorb-preise-waehrung-und-bonus.md)
- [Prices, taxes, and currency](https://dokumentation.websale.de/en/v8s/referenz/konfigurationen/shopkonfiguration-shop-config/preise-steuern-und-waehrung.md)
- [Order data overview](https://dokumentation.websale.de/en/v8s/materialien/uebersicht-bestelldaten.md)
- [Notice for outdated browser version](https://dokumentation.websale.de/en/v8s/einstellungen/hinweis-auf-veraltete-browserversion.md)


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