Skip to main content

Getting Started with Tax Configuration

This guide walks you through configuring tax on the Hii Retail platform. By the end of this guide, you will understand how to set tax regions for Business Units and apply the correct taxable groups to Price Specifications.

Overview

How Tax Works in Hii Retail

Tax configuration in Hii Retail involves two key components:

  1. Tax Region - Set on the Business Unit to specify which country/region's tax rules apply
  2. Taxable Group - Set on each Price Specification to specify the tax category (Standard, Reduced, etc.)

The combination of Tax Region + Taxable Group determines the actual tax rate applied.

┌─────────────────────────────────────────────────────────────────────┐
│ Tax Calculation │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ Business Unit Price Specification Tax Rate │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────┐ │
│ │ taxRegionId: │ + │taxableGroupId│ = │ 25% │ │
│ │ "SE" │ │ "Standard" │ │ (VAT) │ │
│ └──────────────┘ └──────────────┘ └──────────┘ │
│ │
│ Example: Sweden (SE) + Standard rate = 25% VAT │
│ Sweden (SE) + Reduced rate = 12% VAT (food) │
│ │
└─────────────────────────────────────────────────────────────────────┘

Tax Regions

Tax regions are geographic areas with specific tax rules. Examples:

Tax RegionDescription
SESweden (mainland)
NONorway
PTPortugal (mainland)
PT-MAPortugal - Madeira (autonomous region with different rates)
ESSpain (mainland)
ES-CNSpain - Canary Islands

Taxable Groups

Taxable groups represent tax categories that can have different rates depending on the region:

Taxable GroupDescriptionExample Rates
StandardStandard VAT rate25% (SE), 23% (PT), 21% (ES)
ReducedReduced rate for certain goods12% (SE), 13% (PT), 10% (ES)
ReducedLowLower reduced rate6% (SE), 6% (PT), 4% (ES)
SuperReducedSuper reduced rateN/A (SE), N/A (PT), 4% (ES)
ZeroZero-rated goods0%
Tax Rate Lookup

The actual tax rate is determined by the Tax Rules service based on the combination of tax region and taxable group. You don't need to specify the percentage—just the taxable group.

Prerequisites

Before you begin, ensure you have:

  1. Business Units created: At least one Business Unit (see Business Units guide)
  2. Authentication Token: A valid JWT bearer token with appropriate permissions
Authentication

For details on obtaining an access token, see the OAuth2 Authentication documentation.

API Base URLs

APIBase URL
Tax Rules APIhttps://tax-rules.retailsvc.com/api/v1
Business Unit APIhttps://business-unit.retailsvc.com/api/v1
Price Specification APIhttps://price-specification-input.retailsvc.com/api/v2

Step 1: List Available Tax Regions

First, retrieve the list of available tax regions to find the correct taxRegionId for your Business Units.

curl -X GET 'https://tax-rules.retailsvc.com/api/v1/tax-regions' \
-H 'Authorization: Bearer <your-access-token>'

Example Response

{
"taxRegions": [
{ "countryCode": "SE", "taxRegionId": "SE" },
{ "countryCode": "NO", "taxRegionId": "NO" },
{ "countryCode": "PT", "taxRegionId": "PT" },
{ "countryCode": "PT", "taxRegionId": "PT-MA" },
{ "countryCode": "ES", "taxRegionId": "ES" },
{ "countryCode": "ES", "taxRegionId": "ES-CN" }
]
}

Step 2: View Tax Rules for a Region

To see the specific tax rates for a region, query the tax rules endpoint.

curl -X GET 'https://tax-rules.retailsvc.com/api/v1/tax-rules?taxRegionId=SE' \
-H 'Authorization: Bearer <your-access-token>'

Example Response (Sweden)

{
"taxRules": [
{
"id": "SE_Standard",
"countryCode": "SE",
"taxRegionId": "SE",
"taxableGroupId": "Standard",
"rate": 25,
"validFrom": "2024-01-01T00:00:00Z"
},
{
"id": "SE_Reduced",
"countryCode": "SE",
"taxRegionId": "SE",
"taxableGroupId": "Reduced",
"rate": 12,
"validFrom": "2024-01-01T00:00:00Z"
},
{
"id": "SE_ReducedLow",
"countryCode": "SE",
"taxRegionId": "SE",
"taxableGroupId": "ReducedLow",
"rate": 6,
"validFrom": "2024-01-01T00:00:00Z"
},
{
"id": "SE_Zero",
"countryCode": "SE",
"taxRegionId": "SE",
"taxableGroupId": "Zero",
"rate": 0,
"validFrom": "2024-01-01T00:00:00Z"
}
],
"exemptions": []
}

Step 3: Set Tax Region on a Business Unit

When creating or updating a Business Unit, set the taxRegionId to specify which tax rules apply.

When Creating a Business Unit

curl -X PUT 'https://business-unit.retailsvc.com/api/v1/business-units/store-stockholm-001' \
-H 'Authorization: Bearer <your-access-token>' \
-H 'Content-Type: application/json' \
-d '{
"name": "Stockholm City Store",
"status": "Active",
"type": "PHYSICAL_STORE",
"countryCode": "SE",
"taxRegionId": "SE",
"addresses": [
{
"addressType": "Visit",
"street": "Kungsgatan 1",
"city": "Stockholm",
"zipCode": "111 43",
"country": "Sweden"
}
]
}'

Updating Tax Region on an Existing Business Unit

Use PATCH to update only the tax region without affecting other fields.

curl -X PATCH 'https://business-unit.retailsvc.com/api/v1/business-units/store-stockholm-001' \
-H 'Authorization: Bearer <your-access-token>' \
-H 'Content-Type: application/json-patch+json' \
-d '[
{"op": "replace", "path": "/taxRegionId", "value": "SE"}
]'

Step 4: Apply Taxable Group to Prices

When creating Price Specifications, set the taxableGroupId to specify which tax category applies to the item.

Sales Price with Standard Tax

curl -X POST 'https://price-specification-input.retailsvc.com/api/v2/bu-g-price-specifications' \
-H 'Authorization: Bearer <your-access-token>' \
-H 'Content-Type: application/json' \
-d '{
"id": "s-5449000051578",
"itemId": "5449000051578",
"type": "SALES",
"status": "ACTIVE",
"value": 14.99,
"taxableGroupId": "Standard",
"validFrom": "2024-01-01T00:00:00Z",
"currencyId": "SEK",
"businessUnitGroupId": "acme-retail-group"
}'

Food Item with Reduced Tax

For food items, use the Reduced taxable group to apply the lower VAT rate.

curl -X POST 'https://price-specification-input.retailsvc.com/api/v2/bu-g-price-specifications' \
-H 'Authorization: Bearer <your-access-token>' \
-H 'Content-Type: application/json' \
-d '{
"id": "s-bread-001",
"itemId": "bread-001",
"type": "SALES",
"status": "ACTIVE",
"value": 29.90,
"taxableGroupId": "Reduced",
"validFrom": "2024-01-01T00:00:00Z",
"currencyId": "SEK",
"businessUnitGroupId": "acme-retail-group"
}'
Common Taxable Groups by Product Type
Product TypeTaxable Group
Electronics, clothing, general merchandiseStandard
Food, beveragesReduced
Books, newspapers, public transportReducedLow
Medical supplies, exportsZero

Complete Example: Setting Up Tax for a Store

Here's a complete workflow for configuring tax for a new store in Portugal - Madeira:

# 1. Check available tax regions
curl -X GET 'https://tax-rules.retailsvc.com/api/v1/tax-regions' \
-H 'Authorization: Bearer <your-access-token>'

# 2. View tax rates for Madeira
curl -X GET 'https://tax-rules.retailsvc.com/api/v1/tax-rules?taxRegionId=PT-MA' \
-H 'Authorization: Bearer <your-access-token>'

# 3. Create Business Unit with Madeira tax region
curl -X PUT 'https://business-unit.retailsvc.com/api/v1/business-units/store-funchal-001' \
-H 'Authorization: Bearer <your-access-token>' \
-H 'Content-Type: application/json' \
-d '{
"name": "Funchal Store",
"status": "Active",
"type": "PHYSICAL_STORE",
"countryCode": "PT",
"taxRegionId": "PT-MA",
"groups": ["acme-retail-group"],
"addresses": [
{
"addressType": "Visit",
"street": "Avenida do Mar 100",
"city": "Funchal",
"zipCode": "9000-000",
"country": "Portugal"
}
]
}'

# 4. Create price with Standard tax (22% in Madeira)
curl -X POST 'https://price-specification-input.retailsvc.com/api/v2/bu-g-price-specifications' \
-H 'Authorization: Bearer <your-access-token>' \
-H 'Content-Type: application/json' \
-d '{
"id": "s-electronics-001",
"itemId": "electronics-001",
"type": "SALES",
"status": "ACTIVE",
"value": 99.99,
"taxableGroupId": "Standard",
"validFrom": "2024-01-01T00:00:00Z",
"currencyId": "EUR",
"businessUnitGroupId": "acme-retail-group"
}'

# 5. Create price with Reduced tax (12% in Madeira for food)
curl -X POST 'https://price-specification-input.retailsvc.com/api/v2/bu-g-price-specifications' \
-H 'Authorization: Bearer <your-access-token>' \
-H 'Content-Type: application/json' \
-d '{
"id": "s-food-001",
"itemId": "food-001",
"type": "SALES",
"status": "ACTIVE",
"value": 4.99,
"taxableGroupId": "Reduced",
"validFrom": "2024-01-01T00:00:00Z",
"currencyId": "EUR",
"businessUnitGroupId": "acme-retail-group"
}'

Next Steps

Now that you understand tax configuration, you can:

  1. Set up stores in different regions: Configure Business Units with the appropriate tax regions
  2. Apply correct tax categories: Use the right taxable group for each product type
  3. Handle special tax zones: Configure autonomous regions like Madeira, Canary Islands, etc.

Next: Deposits - Learn how to configure deposit and fee rules for returnable containers.