taxes-api
Taxes API
- Get calculated taxes for an arbitrary amount
- POST
/api/v1/products/taxes - Body:
\{ "amount": 123.45 \} - Auth: required
- Uses the caller's
address.countryinternally; nocountryparam needed. - Response:
\{ deductable: number, calculatedTaxes: [\{ key: string, type: 'PERCENT'|'FLAT', value: number, calculatedTax: number \}], finalPrice: number, country: string|null \}
- POST
How taxes are computed
- Taxes are dynamic per country and come from Tax Rules (managed in Admin > Taxes).
- Keys commonly used:
platform_fee,gst,tds,processing_fee. - Types:
PERCENT:valueis a percentage. Forgst, it applies onplatform_feeamount. Fortds, it applies on product price.FLAT:valueis a flat currency amount.
Admin setup
- Use Admin Panel > Taxes to add and edit rules.
- Backend endpoints:
GET /api/admin/tax-rules?country=INPOST /api/admin/tax-rulesbody:\{ country, key, type, value, active, label \}DELETE /api/admin/tax-rules/:id