Download the PHP package quineworks/taxlane without Composer
On this page you can find all versions of the php package quineworks/taxlane. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download quineworks/taxlane
More information about quineworks/taxlane
Files in quineworks/taxlane
Package taxlane
Short Description Official PHP SDK for TaxLane's free Nigeria tax calculator API (PAYE, VAT, WHT, CIT, CGT & 9 more).
License MIT
Homepage https://taxlane.ng/developers
Informations about the package taxlane
quineworks/taxlane
Nigeria PAYE, VAT, WHT, CIT, CGT & 9 more tax calculators, as static PHP method calls — no API key, no Guzzle, no account.
- Zero Composer dependencies — only the
ext-curlPHP extension, which ships with essentially every PHP install (shared hosting, Laravel Forge/Vapor, Docker's officialphpimages). No Guzzle. - A single static facade,
TaxLane\TaxLane— onecamelCasemethod per endpoint, each taking the request body as a plain associative array (the real camelCase JSON keys, no translation layer) so a call can never drift from the live API's request shape. - No API key, no account, no rate-limit tiers to configure — the API itself has none.
Every method returns ['data' => ..., 'rateLimit' => ...] — data is the
parsed JSON response as a plain associative array, not a generated class/DTO
(see Response shape below for why), and rateLimit is
the ceiling that request was measured against (see
Rate limits).
Install
Quickstart
Every method throws TaxLane\TaxLaneApiException (a \RuntimeException --
getMessage()/getCode() carry the API's error string/HTTP status) on a
non-200 response, and accepts an optional trailing $baseUrl argument to
point at a local/staging API instead of the production default:
Endpoints
| Method | Calculates |
|---|---|
calculatePaye |
PAYE on an employee's gross annual income |
calculatePayrollBatch |
PAYE for up to 1,000 employees in one call |
calculateVat |
VAT on an amount, inclusive or exclusive |
calculatePresumptive |
Presumptive tax on turnover |
calculateDirectAssessment |
Direct Assessment tax on turnover + expenses |
calculateCit |
Companies Income Tax eligibility + liability |
calculateWht |
Withholding tax on a transaction |
calculateEmployerCost |
Full employer cost of a salary package |
calculateCgt |
Capital Gains Tax on a disposal |
calculateStampDuty |
Stamp duty on an instrument |
calculateImportDuty |
Import duty + landed cost on a shipment |
calculateNhfContribution |
NHF contribution on basic salary |
calculatePensionContribution |
Pension contribution + balance projection |
calculateCapitalAllowances |
Taxable profit from assessable profit, capital allowances & loss relief |
calculatePaye
Only grossAnnualIncome is required — every other field defaults to 0.
calculatePayrollBatch
Calculates PAYE for up to 1,000 employees in one request — results[i] is
exactly what calculatePaye($employees[i]) would return, in the same
order. An invalid item throws with an employees[i].-prefixed message;
there's no partial-success mode.
calculateVat
calculatePresumptive
calculateDirectAssessment
calculateCit
eligibility is always returned. standardRate is included only when
taxableProfit is sent; developmentLevy is included only when
assessableProfit is sent — the three are independently computed.
calculateWht
calculateEmployerCost
calculateCgt
digitalAssetCategory is required when assetType is 'digital-asset',
ignored otherwise.
calculateStampDuty
calculateImportDuty
calculateNhfContribution
calculatePensionContribution
Only annualBasicSalary is required — yearsToProject defaults to 10
(clamped to 50) and every other field defaults to 0/0.07.
calculateCapitalAllowances
Only assessableProfit is required. Unlike every other method above, this
one takes a nested capitalAllowances array (keyed rate10/rate20/
rate25) and flattens it to the API's nine flat wire fields internally,
since POST /v1/capital-allowances has never accepted a nested body.
Response shape
Every method returns ['data' => ..., 'rateLimit' => ...]. data is the
parsed JSON response body as a plain associative array, not a generated
readonly class/DTO. PHP has no structural-typing import across a package
boundary the way the JS/TS SDK's cross-package TS type import does, and
hand-duplicating every response shape in a third, PHP-only schema would be
exactly the kind of extra place to maintain and drift from that SDK avoided
in the first place. A plain array is also the common pattern lightweight
PHP API-wrapper packages use for response bodies when they don't need
strict typing for a stateless, no-auth JSON POST. Each method's PHPDoc
block documents data's top-level keys so an IDE isn't left guessing
without a shape entirely.
Errors
A missing or non-numeric/non-boolean required field, or an invalid enum
value, throws TaxLane\TaxLaneApiException with getCode() of 400 and
a getMessage() describing the offending field. See the full
field-by-field reference at taxlane.ng/developers
or the OpenAPI spec.
Rate limits
Every response's rateLimit key (['limit' => int, 'remaining' => int, 'reset' => int]) is parsed from that response's X-RateLimit-Limit/
X-RateLimit-Remaining/X-RateLimit-Reset headers — present on every
successful and 4xx response. On a 429, TaxLaneApiException:: getRetryAfter() returns the number of seconds to wait before retrying,
parsed from the Retry-After header:
Limits
No API key required, no daily cap. The underlying API is limited to 50 requests/second (100 burst) at the shared Gateway level to keep the service available for everyone — this SDK does no client-side retry/backoff, since there's no rate limit to work around on a per-caller basis.
Distribution
Published to Packagist
as quineworks/taxlane. This README's source of truth is
quineworks/tax-lane's sdk-php/ directory — the code here in
quineworks/taxlane-php is a
public mirror, kept in sync by that repo's sdk-php-publish CI workflow on
every tagged release, so that Packagist (which needs anonymous access to a
public VCS repo, and can't index a subdirectory of a larger repo) has
something to actually publish. Don't edit this copy directly — the next
sync will overwrite it.
License
MIT — see LICENSE.
All versions of taxlane with dependencies
ext-curl Version *
ext-json Version *