← Back to Documentations

VAT Calculator API

Calculate VAT-inclusive totals, VAT-exclusive amounts, and tax bases for Turkish KDV scenarios.

V1

/api/v1

First stable version for VAT amount calculations.

GET /api/v1/vat/calculate Auth Required
Calculate VAT Amounts

Calculates VAT-exclusive, VAT-inclusive, and tax-base amounts for a given operation, amount, and VAT rate.

Authentication
X-Api-Key: your_api_key
Query Parameters
Name Type Required Example Description
operation string required gross_to_net Supported values: gross_to_net, net_to_gross, tax_to_base.
amount number required 3300 Input amount according to the selected operation.
vat_rate_percent number required 20 VAT rate percentage. Common Turkish rates in current practice are 1, 10, and 20. Custom rates are also supported.
Request Example
GET /api/v1/vat/calculate?operation=gross_to_net&amount=3300&vat_rate_percent=20
Response Example
{
    "success": true,
    "message": "VAT calculated successfully.",
    "data": {
        "operation": "gross_to_net",
        "operation_label": "Calculate VAT-exclusive amount from a VAT-inclusive total",
        "input_amount_type": "gross_amount",
        "input_amount": 3300,
        "vat_rate_percent": 20,
        "currency": "TRY",
        "net_amount": 2750,
        "vat_amount": 550,
        "gross_amount": 3300,
        "note": "Common Turkish VAT rates in current practice are 1%, 10%, and 20%, but custom and legacy rates can also be calculated."
    }
}
Error Response
{
    "success": false,
    "message": "The operation field is required.",
    "error_code": "VALIDATION_ERROR"
}