Tax NigeriaTax Nigeria Docs
    Tax NigeriaTax Nigeria Docs
    Tax AssistantAPI ReferenceIntroductionQuickstartAuthenticationEmbeddable AI WidgetNigerian Tax Laws & 2026 ReformsErrors & Rate Limits

    Partner API

    Errors & Rate Limits

    Understand error envelopes, standard HTTP status codes, error recovery, and rate limiting policies.

    Errors & Rate Limits

    The Tax Nigeria Partner API follows consistent RESTful conventions for error handling and request throttling.


    Standard Error Response

    When an error occurs, the API returns a descriptive JSON payload alongside the corresponding HTTP status code:

    {
      "ok": false,
      "error": {
        "code": "INVALID_INPUT",
        "message": "Field 'annualGrossSalary' must be a positive number.",
        "details": [
          {
            "field": "annualGrossSalary",
            "issue": "Expected number >= 0, received -500000"
          }
        ]
      }
    }

    HTTP Status Codes

    Status CodeDescriptionTypical Cause
    200 OKRequest completed successfully.Valid calculation or retrieval.
    400 Bad RequestInput validation failed (INVALID_INPUT).Malformed JSON body, negative salary, invalid tax year, or missing fields.
    401 UnauthorizedAuthentication failed (UNAUTHORIZED).Missing Authorization header, invalid bearer token, or revoked API key.
    403 ForbiddenInsufficient permissions (FORBIDDEN_SCOPE).API key lacks the required scope (e.g., calling /api/v1/tax/calculate without tax:calculate).
    404 Not FoundResource not found (NOT_FOUND).Unknown endpoint path or tax rule version.
    429 Too Many RequestsRate limit or credit exhaustion (RATE_LIMITED / INSUFFICIENT_CREDITS).Request quota exceeded or organization out of API credits.
    500 Internal ErrorServer error (INTERNAL_SERVER_ERROR).Unexpected execution failure. Contact developer support.

    Rate Limits & Headers

    Every API response includes HTTP headers detailing your current usage quota:

    X-RateLimit-Limit: 300
    X-RateLimit-Remaining: 284
    X-RateLimit-Reset: 1719576000

    Rate Limit Tiers

    • Standard / Free Tier: 60 requests per minute.
    • Pro / Business Tier: 300 requests per minute.
    • Enterprise Tier: Custom burst limits, dedicated compute, and 99.99% uptime SLA.

    Handling 429 & Retry Strategy

    When receiving a 429 Too Many Requests, inspect the Retry-After header or implement exponential backoff with jitter:

    async function fetchWithRetry(url: string, options: RequestInit, retries = 3): Promise<Response> {
      for (let attempt = 0; attempt < retries; attempt++) {
        const res = await fetch(url, options);
        if (res.status !== 429) return res;
    
        const retryAfter = res.headers.get("Retry-After");
        const delay = retryAfter ? parseInt(retryAfter, 10) * 1000 : Math.pow(2, attempt) * 1000 + Math.random() * 200;
        
        console.warn(`Rate limited. Backing off for ${Math.round(delay)}ms...`);
        await new Promise((resolve) => setTimeout(resolve, delay));
      }
      throw new Error("Tax Nigeria Partner API: Exceeded maximum retry attempts due to rate limiting.");
    }

    Nigerian Tax Laws & 2026 Reforms

    Comprehensive statutory overview of the Nigeria Tax Act 2025 (NTA) and Nigeria Tax Administration Act 2025 (NTAA), effective 1 January 2026.

    Partner API Overview

    Complete RESTful API documentation for automated Nigerian tax calculation, compliance deadlines, and AI intelligence.

    On this page

    Errors & Rate LimitsStandard Error ResponseHTTP Status CodesRate Limits & HeadersRate Limit TiersHandling 429 & Retry Strategy