Tax & compliance
INTRASTAT (EU Trade Declaration)
Indicative price, not an offer: €34/mo; per-country obligation: INTRASTAT data export, filing format
Generated from docs/plan/paid/intrastat/PLAN.md in the AstroBaaS repository. Nothing described below is implemented — it is the written plan for it.
A paid service for EU merchants shipping to other EU countries (intra-community trade). Auto-generates INTRASTAT statistical reports (item-level trade data: product code, weight, value, country) in each country’s filing format, and reminds merchants of quarterly/monthly filing deadlines.
The problem
A German merchant ships 500 packages per month to 18 EU countries. She’s legally required to file INTRASTAT (item-level trade statistics) quarterly with German customs. She has no data export, no product classification system, and no deadline tracking. She’s filed late twice and paid €300 in penalties.
What it does
- Product classification: Harmonized System (HS) code field on products (e.g., 6204.62 for women’s trousers)
- INTRASTAT item-level data: product code (HS), weight, value (EUR), destination country, quantity
- Country-specific export formats: Germany (IDBAG XML), France (Douanes), Spain (Aduanas), etc.
- Quarterly/monthly filing status: calendar showing deadlines per country, filing progress (not filed/filed/accepted)
- Export trigger: merchant selects date range, country, system auto-generates filing-ready file
- Threshold alerts: if shipments to a country exceed value threshold (e.g., €1M), alert merchant
- Weight tracking: products must include weight for customs; validation warns if missing
- Audit trail: which exports were generated, when, file hash for verification
- Error handling: if product has no HS code, exclude from export and alert merchant
What it deliberately does NOT do
Each boundary carries its reason. A boundary without a reason gets crossed by the next person who reads this.
- Shipping integration (tracking, label generation)—separate feature
- Customs duty calculation—out of scope (that’s post-INTRASTAT, for import)
- Preferential origin claims (goods marked ‘Made in EU’)—merchant responsibility
- Digital goods or services (different rules)—tangible goods only
- Countries outside EU (different reporting rules per country)
Data model
Extend Product: hs_code (string, validated against TARIC database), weight_kg. New: IntrastatExport(id, shopId, period, country, format_type, export_date, file_hash, status). Product schema migration required.
API
- GET /products/:id/hs-info — return HS code, weight, tariff rate
- POST /products/validate-hs-codes — bulk check which products are missing HS codes
- POST /intrastat/export/:country/:period — generate filing-ready file
- GET /intrastat/deadlines — list filing deadlines per country
- GET /intrastat/status/:country/:period — filing status and transmission ID
- GET /intrastat/exports — history of all exports with file hashes
Every route added here must also appear in src/pages/openapi.json.ts — a test
fails the build if it does not.
Admin
INTRASTAT dashboard: product list with HS code coverage (% complete), calendar showing filing deadlines, export generator (select country/period, download file), filing status tracker, error log (products missing HS codes), threshold alerts
The seam — why this is paid
Core owns: product schema (HS code, weight fields), export file generation. Paid pack owns: TARIC HS code database (EU Customs), country-specific filing formats, deadline tracking, threshold intelligence.
Per-country obligation: EU INTRASTAT rules, we generate filing-ready reports
Dependencies
- product schema (hs_code, weight_kg fields must be added)
- order shipment data (must include destination country for each item)
Acceptance checks
Each of these must be able to fail. Before claiming this is done, break the code deliberately and watch each one go red.
- A product with HS code ‘6204.62’ and weight 0.5 kg is included in a German INTRASTAT export
- A product with no HS code is excluded from export; alert shows ‘Product XYZ has no HS code’
- Germany filing deadline (April 15 for Q1) appears in calendar; clicking shows ‘not filed’ status
- Generating a German INTRASTAT export produces XML in valid IDBAG format (can be pasted into German customs portal)
- If Q1 shipments to France total €1.5M (above threshold), merchant receives alert ‘INTRASTAT threshold exceeded’
- Export file includes: HS code, weight, value (EUR), destination country, quantity for each line item
- Two exports of the same data generate identical file hashes (deterministic export)
- Audit log shows: export generated 2025-09-02, country=Germany, period=Q1 2025, status=generated (not filed)
Risks
HS code database is complex and changes frequently—must sync with EU Customs regularly. Merchants use wrong HS codes (e.g., 6204 vs 6205), export is wrong, customs rejects filing. Weight validation: if products have no weight, export is incomplete. Export format changes per country/year—must maintain multiple versions and auto-detect merchant’s country.
Commercial context
| Suggested price | €34/mo; per-country obligation: INTRASTAT data export, filing format |
| Rival anchor | Magento: ~€60 extension; custom: €2000+ |
The anchor is what the nearest equivalent charges on Shopify or Magento today. It is context for a pricing decision, not the decision.
Generated from the commerce plan. See docs/COMMERCE-PLAN.md for the full
catalogue and ../../AI-GUIDE.md for how to work on this repository.