Skip to main content

Product Swiss Tax

Applies Swiss VAT rates to product prices. Only activates for deliveries to Switzerland (CH) or Liechtenstein (LI).

Included in All Preset

Registered automatically by registerAllPlugins() (via registerSwissTaxPlugins() from @unchainedshop/plugins/presets/countries/ch).

Registration​

import { pluginRegistry } from '@unchainedshop/core';
import { ProductSwissTaxPlugin } from '@unchainedshop/plugins/pricing/product-swiss-tax';

pluginRegistry.register(ProductSwissTaxPlugin);

How It Works​

  1. Checks if the delivery address is in Switzerland or Liechtenstein
  2. Determines the tax category from:
    • Product tags (e.g., swiss-tax-category:reduced)
    • Delivery provider configuration
    • Falls back to DEFAULT (8.1%)
  3. Calculates and adds tax amounts to the pricing sheet

Tax Categories​

Category2024+2018–20232011–20172001–2010Use Case
DEFAULT8.1%7.7%8.0%7.6%Standard goods and services
REDUCED2.6%2.5%2.5%2.4%Food, books, newspapers, medicines
SPECIAL3.8%3.7%3.8%3.6%Accommodation services

The rate is selected by the order date (supply date), so historical recalculations stay era-accurate.

Rate Data​

Rates are bundled in ch-tax-rates.json as era lists ({ validFrom, rate }), verified against the ESTV. Rates are never fetched at runtime — updates land as reviewed diffs via the repository's update-tax-rates skill.

Configuration​

Via Product Tags​

Add a tag to the product:

swiss-tax-category:reduced
swiss-tax-category:special

Via Delivery Provider​

Configure the delivery provider:

mutation CreateDeliveryProvider {
createDeliveryProvider(
deliveryProvider: {
type: SHIPPING
adapterKey: "shop.unchained.post"
}
) {
_id
}
}

mutation ConfigureDeliveryProvider {
updateDeliveryProvider(
deliveryProviderId: "provider-id"
deliveryProvider: {
configuration: [
{ key: "swiss-tax-category", value: "reduced" }
]
}
) {
_id
}
}

Net vs Gross Prices​

The adapter handles both net and gross prices:

  • Net prices: Tax is added on top (amount * taxRate)
  • Gross prices: Tax is extracted from the total (amount - amount / (1 + taxRate))

Adapter Details​

PropertyValue
Keyshop.unchained.pricing.product-swiss-tax
Version1.0.0
Order Index80
Sourcepricing/product-swiss-tax/adapter.ts