API Reference
Endpoint-by-endpoint documentation for the Creditax.ai API — authentication, parameters, request and response shapes, and error codes.
POST
/v2/tax/calculateAuth RequiredCalculate income tax for an individual or corporate entity based on Nigerian tax law. Supports all 36 states and the FCT with accurate withholding tax calculations.
Authentication
Bearer Token Required
Include your API key in the Authorization header as a Bearer token.
Authorization: Bearer YOUR_API_KEYRequest Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
income | number | Required | Annual gross income in Naira |
tax_year | integer | Required | Year for tax calculation (e.g., 2024) |
state | string | Optional | State code (e.g., Lagos, Abuja). Defaults to federal rates. |
include_reliefs | boolean | Optional | Whether to apply tax reliefs and exemptions. Default: true |
entity_type | enum | Optional | Entity type: individual or corporate |
Request Body
Example Request
{
"income": 12000000,
"tax_year": 2024,
"state": "Lagos",
"include_reliefs": true,
"entity_type": "individual"
}Response
200 OKSuccess
{
"success": true,
"data": {
"tax_year": 2024,
"gross_income": 12000000,
"total_reliefs": 300000,
"taxable_income": 11700000,
"tax_brackets": [
{ "bracket": "0 - 300,000", "rate": "0%", "tax": 0 },
{ "bracket": "300,001 - 600,000", "rate": "7%", "tax": 21000 }
],
"total_tax": 2349000,
"effective_rate": "19.58%",
"take_home": 9651000
},
"request_id": "req_7x9k2m4n6p8",
"processing_time_ms": 142
}Error Codes
| Code | Status | Message | Description |
|---|---|---|---|
| 400 | Bad Request | income is required | Missing required parameter in request body |
| 401 | Unauthorized | Invalid API key | API key is missing, expired, or invalid |
| 422 | Unprocessable Entity | Invalid state value | State parameter must be a valid Nigerian state code |
| 429 | Too Many Requests | Rate limit exceeded | API rate limit reached. Upgrade plan for higher limits. |
| 500 | Internal Server Error | Calculation failed | Unexpected server error. Contact support if persists. |