# 08 - International Shipping

**Status: NOT STARTED**

## Summary

Fix VAT handling for EU shipments where certain product combinations cause issues, and prepare for potential EU warehouse fulfillment changes.

## Current State

The system has extensive international shipping support:
- VAT rates defined for 29 EU countries in `ShippingAdminApi.ts`
- Customs declarations with tariff numbers per product
- Multiple distribution centers (LA, Australia, Japan, Netherlands)
- DHL Express integration for international shipments

### Known Issues

1. **VAT Combination Problem**: When an order contains a mix of certain product types, the VAT calculation fails or produces incorrect values
2. **Warehouse Space Decision**: Pending decision about EU warehouse may change international fulfillment flow

## Requirements

1. Fix VAT calculation for mixed product orders
2. Update `createCustomsDeclaration` to handle product combinations correctly
3. Either split into separate customs declarations or calculate combined VAT correctly
4. Consider customs value overrides already in place (`customsValueOverrides`)

## Files to Modify

| File | Change |
|------|--------|
| `api/src/fabricator/ShippingAdminApi.ts` | Fix VAT calculation for mixed product orders (lines 2289-2320) |
| `api/src/fabricator/ShippingAdminApi.ts` | Update `createCustomsDeclaration` to handle product combinations |
| `api/src/fabricator/FabricatorSchemas.ts` | Add new distribution center if EU warehouse is approved |

## Key Code Locations

- VAT rates: `ShippingAdminApi.ts` lines 2289-2320 (`EuroCountryTaxRates`)
- Customs declaration: `createCustomsDeclaration` function in `ShippingAdminApi.ts`

## Pending Decisions

These block full implementation:
- EU warehouse location and setup timeline
- Whether to route EU orders through Netherlands Flexport facility
- Carrier selection for EU-to-EU shipments (currently using DHL Express)

## Implementation Notes

- The `createCustomsDeclaration` function needs to detect problematic product combinations
- This feature is partially blocked by business decisions about EU warehouse
- VAT fix can proceed independently of warehouse decisions
