The API charges the customer. The storefront and mobile app only display the amounts, so keep the values equal in all three places:
| App | Tax | Shipping |
|---|---|---|
API (apps/api/.env) |
TAX_RATE=0.05 (a fraction) |
SHIPPING_COST=4.99 |
Storefront (apps/web/.env) |
NEXT_PUBLIC_VAT_PERCENTAGE=5 (a percentage) |
NEXT_PUBLIC_SHIPPING_COST=4.99 |
Mobile (apps/mobile/.env) |
EXPO_PUBLIC_VAT_PERCENTAGE=5 |
EXPO_PUBLIC_SHIPPING_COST=4.99 |
FREE_DELIVERY_THRESHOLD in the API sets the order total above which shipping is free.
Note
The API always recalculates the order total from the database prices, so a wrong value in a front-end can never undercharge a customer. pnpm check:setup warns when the apps disagree.
