calculate_vat_amount_latam
Compute tax amounts from net or gross inputs using country-specific VAT rates and labels for Latin American markets. Supports building invoice calculators and checkout flows.
Instructions
Calculates tax amounts from either a net (excluding tax) or gross (including tax) amount for a given tax rate, with country context for currency and tax label. Returns { country, net_amount, tax_amount, gross_amount, tax_rate, tax_label, currency }. Use when building pricing tools, invoice calculators, or checkout flows across LatAm markets that need to split gross prices into net + tax components.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| country_code | Yes | Two-letter ISO country code for currency and context. Example: 'BR', 'MX', 'CL' | |
| amount | Yes | The amount to calculate tax for | |
| tax_rate | Yes | Tax rate as a percentage. Example: 16 for 16% IVA (Mexico) or 19 for 19% IVA (Chile) | |
| amount_type | Yes | Whether the input amount is net (excluding tax) or gross (including tax) | |
| currency | No | Override currency. Defaults to country currency. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| country | Yes | ||
| net_amount | Yes | ||
| tax_amount | Yes | ||
| gross_amount | Yes | ||
| tax_rate | Yes | ||
| tax_label | Yes | ||
| currency | Yes |