Build on Taxly
Integrate your ERP, POS or accounting software with the Nigerian NRS e-invoicing platform. Register as an integrator, issue and transmit invoices, and receive your suppliers’ invoices by webhook — every endpoint below, plus step-by-step guides for the common workflows.
| Environment | Base URL |
|---|---|
| Production | https://taxly.ng/api/v1 |
| Sandbox | https://dev.taxly.ng/api/v1 |
Authentication
Two mechanisms are supported. Most invoice, webhook and integrator endpoints accept either; each endpoint below shows what it needs.
| Mode | Header | Use for |
|---|---|---|
| API key | X-API-KEY | Server-to-server integrations |
| Bearer token | Authorization | User-facing apps, after /auth/login |
X-API-KEY: txl_live_xxxxxxxxxxxxxxxx Authorization: Bearer 1|your-token
An invalid or revoked key returns 401; a key whose tenant is not an approved integrator returns 403. If an X-API-KEY header is present it is used even when a Bearer token is also sent. Always send Accept: application/json.
Response format
Taxly-owned endpoints wrap results like this:
{
"success": true,
"data": { ... },
"message": "..."
}
{
"success": false,
"message": "...",
"data": { ... }
}
message plus fields at the top level. Invoice endpoints that proxy NRS return NRS’s own code, data and message, and on failure pass NRS’s status code through. Laravel validation errors use {"message","errors"}. Each endpoint’s examples show its exact shape.Rate limits
The public NRS callback endpoints are limited to 60 requests per minute. Other limits may vary by deployment. On 429, retry with exponential backoff.
Errors
| Code | Meaning |
|---|---|
| 400 | Bad request, or a callback payload missing required fields. |
| 401 | Missing, invalid or revoked credentials — or NRS rejected the credentials you supplied. |
| 403 | Authenticated but not allowed (tenant not an approved integrator, or resource belongs to another tenant). |
| 404 | Resource not found. |
| 405 | Wrong HTTP method (typically a POST redirected from HTTP and retried as GET). |
| 409 | Conflict, e.g. a webhook URL that is already registered. |
| 422 | Validation failed. Field errors are under errors or data. |
| 429 | Rate limit exceeded. |
| 502 | NRS was unreachable or rate limiting during an authentication call. Safe to retry. |
{
"message": "The given data was invalid.",
"errors": {
"email": ["The email field is required."]
}
}
Use cases
Follow these in order. Each step links to the endpoint it uses.
Onboard as an integrator and get your API key
Do this once per product. You finish with an API key for every later call.
-
Register your integrator application
Submit your company details. Keep the returned
POSTtenant_idand thecontact_emailyou used./integrators/register -
Wait for approval
Taxly reviews the application. Poll the public status endpoint until
GETintegrator_statusisapprovedandcan_generate_api_keysistrue./integrators/status -
Generate your first API key
Call the endpoint with
POSTX-Integrator-Emailset to your registered contact email - no key is needed for this first call. Copy thekeyfrom the response now; it is never shown again./integrators/{tenant}/api-keys -
Use the key on every request
Send it as
GETX-API-KEY. Verify it works by listing your keys./integrators/{tenant}/api-keys
Issue an invoice end to end
From an invoice in your ERP to an invoice delivered to your customer through NRS.
-
Look up valid codes
Fetch the values your invoice needs: HS or ISIC codes for each line, currency, tax categories, states and countries. Cache them - they rarely change.
GET/resources/hs-codes -
Verify the buyer (optional)
Confirm the customer's TIN is valid before you invoice them.
GET/resources/tin/{tin_number} -
Validate the IRN
Build the IRN as
POST{invoice_reference}-{service_id}-{YYYYMMDD}and check it with NRS./invoices/irn/validate -
Dry-run the invoice
Send the full payload to
POSTvalidate. Fix any errors it reports - the submit step runs the same checks./invoices/validate -
Submit (sign) the invoice
Send the same payload. A
POST200means NRS has signed it. Remember: every line uses either HS (goods) or ISIC (services) classification, never both./invoices/submit -
Transmit to the buyer
Queue transmission, optionally passing a
POSTwebhook_urlfor status updates. This is asynchronous./invoices/{irn}/transmit -
Track the result
Confirm the invoice state, or look up the transmission record for the IRN.
GET/invoices/{irn}/confirm -
Record payment later
When the buyer pays, update the payment status at NRS.
PATCH/invoices/{irn}/update
Receive invoices from your suppliers
Get supplier invoices delivered, decrypted, straight into your system.
-
Expose an HTTPS endpoint
Create a
POSTroute that accepts JSON and returns2xxquickly. Do the heavy work asynchronously. -
Register it as a webhook
Choose a strong secret and subscribe to
POSTinvoice.transmitted.decrypted./webhooks -
Verify every delivery
Compute HMAC-SHA256 of the raw body with your secret and compare it to
X-Webhook-Signatureusing a constant-time comparison. See Webhook events for code. -
Process idempotently
Key your records on
irn. The same invoice can be delivered more than once if a delivery is retried. -
Catch up on anything missed
If your endpoint was down, pull transmitted invoices and acknowledge each one to trigger delivery again.
GET/invoices/transmit/pull -
Acknowledge receipt
NRS releases the invoice only after acknowledgement. Taxly then downloads, decrypts and delivers it to your webhook.
PATCH/invoices/transmit/{irn}/confirmation
Rotate or revoke an API key
Do this on a schedule, or immediately if a key may have leaked.
-
Create a replacement key
Generate a second key so you can switch without downtime.
POST/integrators/{tenant}/api-keys -
Deploy the new key
Update your servers' configuration and confirm calls succeed.
-
Revoke the old key
Find its
DELETEidin the key list and revoke it. It stops working at once./integrators/{tenant}/api-keys/{apiKey} -
Or rotate in place
If you only have one key, regenerate it. Send the key being rotated in
POSTX-API-KEYand save the new one from the response immediately./integrators/{tenant}/api-keys/regenerate
Auth
Create an account, sign in with your NRS e-invoice credentials and manage Bearer tokens. Bearer tokens are for user-facing apps; server-to-server integrations should use an API key (see Integrators).
/auth/register
No auth
Creates a tenant, its organization and the first user in one call, and returns a Bearer token. Your credentials are verified against NRS first; the NRS entity_id, TIN, trade name and business id are then fetched and stored for you.
Body parameters
| Field | Description |
|---|---|
| email stringrequired |
Your NRS e-invoice login email. Must be unique among Taxly users. |
| password stringrequired |
Your NRS e-invoice password. Minimum 8 characters. |
| password_confirmation stringrequired |
Must match password. |
| tenant_name stringoptional |
Display name for the tenant (max 255). Generated if omitted. |
| brand stringoptional |
Brand name (max 255). |
| domain stringoptional |
Tenant domain (max 255). |
401 (or 502 if NRS is unreachable / rate limiting) and nothing is created.curl -X POST https://taxly.ng/api/v1/auth/register \ -H "Content-Type: application/json" \ -d '{ "tenant_name": "Acme Corp", "email": "dev@acme.com", "password": "your-nrs-password", "password_confirmation": "your-nrs-password" }'
{
"message": "Tenant, organization, and user created successfully",
"tenant": {
"id": 3,
"name": "Acme Corp",
"brand": "Acme",
"domain": "acme.com",
"email": "dev@acme.com",
"entity_id": "********-b06e-****-a89d-***********"
},
"organization": { "id": 1, "tin": "30000002-0001", "trade_name": "Acme Corp", "email": "dev@acme.com" },
"user": { "id": 1, "name": "Acme Corp", "email": "dev@acme.com" },
"token": "1|XyzExampleToken…"
}
/auth/login
No auth
Signs in an existing Taxly user and returns a Bearer token for Authorization: Bearer ….
Body parameters
| Field | Description |
|---|---|
| email stringrequired |
Account email. |
| password stringrequired |
Account password. |
curl -X POST https://taxly.ng/api/v1/auth/login \ -H "Content-Type: application/json" \ -d '{ "email": "dev@acme.com", "password": "your-password" }'
{
"message": "User logged in successfully",
"user": { "id": 1, "name": "Acme Corp", "email": "dev@acme.com" },
"token": "1|XyzExampleToken…"
}
{ "message": "Invalid credentials" }
/auth/tax-payer-login
No auth
Verifies NRS e-invoice credentials and returns the NRS login response, including the entity_id. Nothing is stored in Taxly and no token is issued - use it to check credentials before registering.
Body parameters
| Field | Description |
|---|---|
| email stringrequired |
NRS e-invoice login email. |
| password stringrequired |
NRS e-invoice password. |
curl -X POST https://taxly.ng/api/v1/auth/tax-payer-login \ -H "Content-Type: application/json" \ -d '{ "email": "dev@acme.com", "password": "your-nrs-password" }'
{
"message": "User logged in",
"id": "********-323c-****-9061-***********",
"status": "200 OK",
"received_at": "2026-04-06T16:01:56.517426199+01:00",
"entity_id": "********-b06e-****-a89d-***********"
}
/auth/me
Bearer token only
Returns the authenticated user with their organization and tenant.
curl https://taxly.ng/api/v1/auth/me \ -H "Authorization: Bearer $TOKEN"
{
"success": true,
"data": {
"id": 1,
"name": "Acme Corp",
"email": "dev@acme.com",
"organization": {
"id": 1,
"tin": "30000002-0001",
"tenant": { "id": 3, "name": "Acme Corp" }
}
},
"message": "User retrieved successfully"
}
/auth/logout
Bearer token only
Revokes the Bearer token used for this request.
curl -X POST https://taxly.ng/api/v1/auth/logout \ -H "Authorization: Bearer $TOKEN"
{
"success": true,
"data": { "message": "Logged out successfully" },
"message": "Operation successful"
}
Integrators & API Keys
ERPs, POS and accounting vendors register as an integrator, wait for approval, then generate API keys for server-to-server calls. Registration and status checks are public.
/integrators/register
No auth
Submits an integrator application. A tenant is created with status pending and must be approved before API keys can be issued.
Body parameters
| Field | Description |
|---|---|
| name stringrequired |
Company name (max 255). |
| tin stringrequired |
Tax Identification Number. Unique (max 20). |
| description stringrequired |
What your product does (max 500). |
| use_case stringrequired |
How you will use the API (max 1000). |
| contact_person stringrequired |
Technical contact name (max 255). |
| contact_email stringrequired |
Technical contact email. |
| brand stringoptional |
Brand name (max 255). |
| domain stringoptional |
Unique domain (max 255). |
| website stringoptional |
Valid URL (max 255). |
| landlord_id integeroptional |
Existing active landlord. Defaults to the first active landlord. |
contact_email you register with is later used as proof of identity when generating your first API key (see Generate API key).POST is redirected from HTTP to HTTPS and retried as GET, the API answers 405 asking you to use POST.curl -X POST https://taxly.ng/api/v1/integrators/register \ -H "Content-Type: application/json" \ -d '{ "name": "Acme ERP Ltd", "tin": "30000002-0001", "description": "Cloud ERP for SMEs", "use_case": "Issue and receive NRS e-invoices from our ERP", "contact_person": "Ada Obi", "contact_email": "dev@acme.com", "website": "https://acme.com" }'
{
"success": true,
"data": {
"tenant_id": 3,
"tenant": { "id": 3, "name": "Acme ERP Ltd", "is_integrator": true, "integrator_status": "pending" },
"message": "Integrator application submitted successfully. Please wait for approval.",
"status_check": {
"endpoint": "/api/v1/integrators/status",
"method": "GET",
"parameters": { "tenant_id": 3 },
"note": "Use this endpoint to check your approval status. No authentication required."
}
},
"message": "Integrator application submitted successfully"
}
/integrators/status
No auth
Checks the review status of an integrator application. Pass tenant_id, email (the contact email) or both.
Query parameters
| Field | Description |
|---|---|
| tenant_id integeroptional |
Tenant id returned at registration. |
| email stringoptional |
Contact email used at registration. At least one of the two is required. |
curl "https://taxly.ng/api/v1/integrators/status?tenant_id=3"
{
"success": true,
"data": {
"tenant_id": 3,
"name": "Acme ERP Ltd",
"integrator_status": "approved",
"status_message": "Your integrator application has been approved. You can now generate API keys and use the API.",
"can_generate_api_keys": true,
"can_use_api": true,
"applied_at": "2026-04-01T08:00:00.000Z",
"reviewed_at": "2026-04-02T10:30:00.000Z",
"review_reason": null,
"next_steps": [
"Generate API keys using POST /api/v1/integrators/{tenant}/api-keys",
"Use your API key to authenticate requests",
"Start integrating with the invoice API"
]
},
"message": "Integrator status retrieved successfully"
}
{
"success": true,
"data": {
"tenant_id": 3,
"integrator_status": "pending",
"status_message": "Your integrator application is pending review. Please check back later.",
"can_generate_api_keys": false,
"can_use_api": false
},
"message": "Integrator status retrieved successfully"
}
/integrators/{tenant}/api-keys
X-API-KEY or Bearer
Issues a new API key for an approved integrator. The plaintext key is returned once - store it securely.
Body parameters
| Field | Description |
|---|---|
| name stringrequired |
Label for the key (max 255). |
| description stringoptional |
Free text (max 500). |
| permissions string[]optional |
Permission strings to attach. |
| active booleanoptional |
Defaults to true. |
| contact_email stringoptional |
Alternative to the X-Integrator-Email header for the bootstrap call. |
X-Integrator-Email header (or a contact_email body field) set to your registered contact email. No API key is needed for this very first call.X-API-KEY (or use a Bearer token). The tenant in the URL must be your own tenant.curl -X POST https://taxly.ng/api/v1/integrators/{tenant}/api-keys \ -H "X-API-KEY: $API_KEY" \ -H "X-Integrator-Email: dev@acme.com" \ -H "Content-Type: application/json" \ -d '{ "name": "Production ERP", "description": "Key for the production ERP" }'
{
"success": true,
"data": {
"api_key": {
"id": 7,
"name": "Production ERP",
"key": "txl_live_9f8e7d6c5b4a3210…",
"masked": "txl_****3210",
"description": "Key for the production ERP",
"permissions": ["invoices:write"],
"created_at": "2026-04-06T09:00:00.000000Z"
},
"message": "API key generated successfully"
},
"message": "API key generated successfully"
}
/integrators/{tenant}/api-keys
X-API-KEY or Bearer
Lists the API keys of your tenant. Plaintext keys are never returned again.
curl https://taxly.ng/api/v1/integrators/{tenant}/api-keys \ -H "X-API-KEY: $API_KEY"
{
"success": true,
"data": {
"api_keys": [
{ "id": 7, "name": "Production ERP", "description": null, "active": true, "last_used_at": "2026-04-06T09:00:00.000000Z", "created_at": "2026-04-01T08:00:00.000000Z" }
],
"tenant": { "id": 3, "name": "Acme ERP Ltd", "is_integrator": true, "integrator_status": "approved" }
},
"message": "API keys retrieved successfully"
}
/integrators/{tenant}/api-keys/{apiKey}
X-API-KEY or Bearer
Revokes (deactivates) an API key. Requests using it fail immediately with 401.
curl -X DELETE https://taxly.ng/api/v1/integrators/{tenant}/api-keys/{apiKey} \ -H "X-API-KEY: $API_KEY"
{
"success": true,
"data": { "message": "API key revoked successfully" },
"message": "Operation successful"
}
/integrators/{tenant}/api-keys/regenerate
X-API-KEY or Bearer
Rotates the key used to authenticate this request and returns a new plaintext key.
X-API-KEY, even if you also send a Bearer token. Update your systems with the new key straight away.curl -X POST https://taxly.ng/api/v1/integrators/{tenant}/api-keys/regenerate \ -H "X-API-KEY: $API_KEY"
{
"success": true,
"data": {
"api_key": {
"id": 7,
"name": "Production ERP",
"key": "txl_live_new1234…",
"masked": "txl_****1234",
"active": true,
"updated_at": "2026-04-06T09:30:00.000000Z"
}
},
"message": "API key regenerated successfully"
}
/integrators/{tenant}
X-API-KEY or Bearer
Returns the integrator tenant with its landlord, API keys and sub-tenants.
curl https://taxly.ng/api/v1/integrators/{tenant} \ -H "X-API-KEY: $API_KEY"
{
"success": true,
"data": {
"integrator": {
"id": 3,
"name": "Acme ERP Ltd",
"is_integrator": true,
"integrator_status": "approved",
"landlord": { "id": 1 },
"api_keys": [],
"sub_tenants": []
}
},
"message": "Integrator details retrieved successfully"
}
Invoices
Validate, submit, transmit and track e-invoices with NRS. These endpoints accept either X-API-KEY or a Bearer token. Responses proxy the NRS result: code, data and message.
/invoices/irn/validate
X-API-KEY or Bearer
Checks with NRS that an IRN is well-formed and unused before you build the invoice.
Body parameters
| Field | Description |
|---|---|
| business_id stringrequired |
NRS business id of the supplier. |
| invoice_reference stringrequired |
Your own invoice number. |
| irn stringrequired |
The IRN to validate. |
{invoice_reference}-{service_id}-{YYYYMMDD}, e.g. INV001-94ND90NR-20260406.curl -X POST https://taxly.ng/api/v1/invoices/irn/validate \ -H "X-API-KEY: $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "business_id": "11111111-2222-3333-4444-555555555555", "invoice_reference": "INV001", "irn": "INV001-94ND90NR-20260406" }'
{ "message": "IRN validated successfully" }
{
"success": false,
"message": "NRS IRN validation failed",
"data": {
"code": 400,
"message": "<reason returned by NRS>",
"errors": []
}
}
/invoices/validate
X-API-KEY or Bearer
Validates a full invoice payload with NRS without submitting it. Use it as a dry run. Same body as Submit invoice.
curl -X POST https://taxly.ng/api/v1/invoices/validate \ -H "X-API-KEY: $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "channel": "api", "business_id": "11111111-2222-3333-4444-555555555555", "invoice_reference": "INV001", "irn": "INV001-94ND90NR-20260406", "issue_date": "2026-04-06", "due_date": "2026-05-06", "invoice_kind": "B2B", "invoice_type_code": "380", "document_currency_code": "NGN", "tax_currency_code": "NGN", "payment_status": "PENDING", "accounting_supplier_party": { "party_name": "Demo Supplier Nigeria Limited", "tin": "30000002-0001", "email": "billing@demosupplier.example.com", "telephone": "+2348000000002", "postal_address": { "street_name": "12 Example Crescent", "city_name": "Abuja", "postal_zone": "900001", "state": "FCT", "country": "NG" } }, "accounting_customer_party": { "party_name": "Demo Buyer Ventures", "tin": "20000001-0001", "email": "accounts@demobuyer.example.com", "telephone": "+2348000000001", "postal_address": { "street_name": "45 Sample Avenue", "city_name": "Lagos", "postal_zone": "100001", "state": "Lagos", "country": "NG" } }, "payment_means": [ { "payment_means_code": "10", "payment_due_date": "2026-05-06" } ], "tax_total": [ { "tax_amount": 375, "tax_subtotal": [ { "taxable_amount": 5000, "tax_amount": 375, "tax_category": { "id": "VAT", "percent": 7.5 } } ] } ], "legal_monetary_total": { "line_extension_amount": 5000, "tax_exclusive_amount": 5000, "tax_inclusive_amount": 5375, "payable_amount": 5375 }, "invoice_line": [ { "isic_code": "6201", "service_category": "Software", "invoiced_quantity": 2, "line_extension_amount": 5000, "item": { "name": "Software Subscription", "description": "Monthly SaaS subscription" }, "price": { "price_amount": 2500, "base_quantity": 1, "price_unit": "XBG" } } ] }'
{
"code": 200,
"data": { "ok": true },
"message": "Invoice validated successfully"
}
{
"success": false,
"message": "NRS Invoice validation failed",
"data": {
"code": 400,
"message": "<reason returned by NRS>",
"errors": []
}
}
/invoices/submit
X-API-KEY or Bearer
Validates the IRN, validates the invoice, then signs it with NRS. On success the invoice exists at NRS and can be transmitted.
Body parameters
| Field | Description |
|---|---|
| channel stringrequired |
api, portal or batch. |
| business_id stringrequired |
NRS business id of the supplier. |
| invoice_reference stringrequired |
Your invoice number. |
| irn stringrequired |
Invoice Reference Number. |
| issue_date daterequired |
YYYY-MM-DD. |
| invoice_kind stringrequired |
Transaction class: B2B, B2C, B2G. |
| invoice_type_code stringrequired |
Three digits (UNCL1001): 380 commercial, 381 credit note, 383 debit note, 384 corrected, 396 factored. |
| document_currency_code stringrequired |
e.g. NGN. |
| accounting_supplier_party objectrequired |
party_name, tin, email and postal_address are required. |
| accounting_customer_party objectoptional |
Same shape as the supplier. |
| legal_monetary_total objectrequired |
Numeric line_extension_amount, tax_exclusive_amount, tax_inclusive_amount, payable_amount. |
| invoice_line object[]required |
At least one line. Each needs invoiced_quantity, line_extension_amount, item.name, item.description, price.price_amount, price.price_unit plus a classification group. |
| invoice_line[].hsn_code stringoptional |
Group A. Pattern \d{2,4}(.\d{2}){0,3}, e.g. 2710.12. |
| tax_total / payment_means / allowance_charge arrayoptional |
Passed through to NRS. |
invoice_line must use exactly one group: Group A (goods) hsn_code + product_category, or Group B (services) isic_code + service_category. Mixing groups, or giving a code without its category, is rejected with 422. Look codes up under Resources.accounting_customer_party may be omitted (e.g. B2C). When omitted it is not sent to NRS.curl -X POST https://taxly.ng/api/v1/invoices/submit \ -H "X-API-KEY: $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "channel": "api", "business_id": "11111111-2222-3333-4444-555555555555", "invoice_reference": "INV001", "irn": "INV001-94ND90NR-20260406", "issue_date": "2026-04-06", "due_date": "2026-05-06", "invoice_kind": "B2B", "invoice_type_code": "380", "document_currency_code": "NGN", "tax_currency_code": "NGN", "payment_status": "PENDING", "accounting_supplier_party": { "party_name": "Demo Supplier Nigeria Limited", "tin": "30000002-0001", "email": "billing@demosupplier.example.com", "telephone": "+2348000000002", "postal_address": { "street_name": "12 Example Crescent", "city_name": "Abuja", "postal_zone": "900001", "state": "FCT", "country": "NG" } }, "accounting_customer_party": { "party_name": "Demo Buyer Ventures", "tin": "20000001-0001", "email": "accounts@demobuyer.example.com", "telephone": "+2348000000001", "postal_address": { "street_name": "45 Sample Avenue", "city_name": "Lagos", "postal_zone": "100001", "state": "Lagos", "country": "NG" } }, "payment_means": [ { "payment_means_code": "10", "payment_due_date": "2026-05-06" } ], "tax_total": [ { "tax_amount": 375, "tax_subtotal": [ { "taxable_amount": 5000, "tax_amount": 375, "tax_category": { "id": "VAT", "percent": 7.5 } } ] } ], "legal_monetary_total": { "line_extension_amount": 5000, "tax_exclusive_amount": 5000, "tax_inclusive_amount": 5375, "payable_amount": 5375 }, "invoice_line": [ { "isic_code": "6201", "service_category": "Software", "invoiced_quantity": 2, "line_extension_amount": 5000, "item": { "name": "Software Subscription", "description": "Monthly SaaS subscription" }, "price": { "price_amount": 2500, "base_quantity": 1, "price_unit": "XBG" } } ] }'
{
"code": 200,
"data": { "ok": true },
"message": "Invoice submission initiated successfully"
}
{
"success": false,
"message": "NRS Invoice signing failed",
"data": {
"code": 400,
"message": "<reason returned by NRS>",
"errors": []
}
}
/invoices/{irn}/transmit
X-API-KEY or Bearer
Queues transmission of a signed invoice to the buyer through NRS. Transmission is asynchronous - track it with the lookup endpoint or your webhook.
Body parameters
| Field | Description |
|---|---|
| webhook_url stringoptional |
URL that receives status updates for this transmission. |
curl -X POST https://taxly.ng/api/v1/invoices/{irn}/transmit \ -H "X-API-KEY: $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "webhook_url": "https://erp.acme.com/hooks/taxly" }'
{
"code": 200,
"data": { "ok": true },
"message": "Invoice transmission queued successfully.",
"irn": "INV001-94ND90NR-20260406",
"webhook_url": "https://erp.acme.com/hooks/taxly"
}
/invoices/{irn}/confirm
X-API-KEY or Bearer
Returns the current confirmation state of an invoice at NRS.
curl https://taxly.ng/api/v1/invoices/{irn}/confirm \ -H "X-API-KEY: $API_KEY"
{
"code": 200,
"data": { "irn": "INV001-94ND90NR-20260406", "status": "…" },
"message": "Invoice confirmation state from NRS"
}
/invoices/{irn}/update
X-API-KEY or Bearer
Updates the payment status of an invoice at NRS.
Body parameters
| Field | Description |
|---|---|
| payment_status stringrequired |
e.g. PAID, PENDING. |
| reference stringoptional |
Payment reference. |
curl -X PATCH https://taxly.ng/api/v1/invoices/{irn}/update \ -H "X-API-KEY: $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "payment_status": "PAID", "reference": "PAY-2026-0042" }'
{
"code": 200,
"data": { "ok": true },
"message": "Invoice updated successfully in NRS"
}
/invoices/{irn}/download
X-API-KEY or Bearer
Downloads an invoice from NRS by IRN.
curl https://taxly.ng/api/v1/invoices/{irn}/download \ -H "X-API-KEY: $API_KEY"
{
"code": 200,
"data": { "…": "invoice as returned by NRS" },
"message": "Invoice download from NRS is successful"
}
/invoices/search/{business_id}
X-API-KEY or Bearer
Lists invoices of a business from NRS.
curl https://taxly.ng/api/v1/invoices/search/{business_id} \ -H "X-API-KEY: $API_KEY"
{
"code": 200,
"data": [ { "irn": "…", "…": "…" } ],
"message": "Invoices loaded successfully"
}
/invoices/transmit/health-check
X-API-KEY or Bearer
Checks that the NRS transmission service is reachable.
curl https://taxly.ng/api/v1/invoices/transmit/health-check \ -H "X-API-KEY: $API_KEY"
{
"code": 200,
"data": { "status": "ok" },
"message": "Health check succeeded."
}
/invoices/transmit/{irn}/lookup
X-API-KEY or Bearer
Looks up the transmission record for an IRN.
curl https://taxly.ng/api/v1/invoices/transmit/{irn}/lookup \ -H "X-API-KEY: $API_KEY"
{
"code": 200,
"data": { "…": "transmission parties" },
"message": "Transmission parties loaded successfully."
}
/invoices/transmit/tin/{tin}/lookup
X-API-KEY or Bearer
Looks up transmitted invoices by party TIN.
curl https://taxly.ng/api/v1/invoices/transmit/tin/{tin}/lookup \ -H "X-API-KEY: $API_KEY"
{
"code": 200,
"data": [ { "irn": "…" } ],
"message": "Transmission parties loaded successfully."
}
/invoices/transmit/pull
X-API-KEY or Bearer
Pulls invoices that have been transmitted to you through NRS. Use it to catch up if a webhook was missed.
curl https://taxly.ng/api/v1/invoices/transmit/pull \ -H "X-API-KEY: $API_KEY"
{
"code": 200,
"data": [ { "irn": "…" } ],
"message": "Transmitted Invoices pulled successfully."
}
/invoices/transmit/{irn}/confirmation
X-API-KEY or Bearer
Acknowledges receipt of a transmitted invoice with NRS. For an invoice you did not send yourself, Taxly then downloads, decrypts and delivers it to your webhook.
Body parameters
| Field | Description |
|---|---|
| irn stringrequired |
Must match the IRN in the URL. |
| agent_tin / beneficiary_tin stringoptional |
Parties for tax reporting. |
| base_amount / total_amount / other_taxes numberoptional |
Amounts. |
| currency stringoptional |
3-letter ISO code. |
| item_description stringoptional |
Free text. |
| transaction_date dateoptional |
Date of the transaction. |
| integrator_service_id stringoptional |
Your NRS service id. |
| vat_calculated / vat_rate / vat_status mixedoptional |
VAT details. |
PATCH /api/v1/invoice/transmit/{irn} (no auth middleware) for backwards compatibility.curl -X PATCH https://taxly.ng/api/v1/invoices/transmit/{irn}/confirmation \ -H "X-API-KEY: $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "irn": "INV001-94ND90NR-20260406", "currency": "NGN", "total_amount": 5375, "vat_rate": 7.5 }'
{
"code": 200,
"data": { "status": "acknowledged", "irn": "INV001-94ND90NR-20260406" },
"message": "Invoice acknowledgment sent to NRS successfully."
}
Webhook Endpoints
Register the URL where Taxly delivers events such as decrypted incoming invoices. A tenant can hold up to 10 endpoints. Accepts X-API-KEY or a Bearer token.
/webhooks
X-API-KEY or Bearer
Lists your tenant's webhook endpoints.
curl https://taxly.ng/api/v1/webhooks \ -H "X-API-KEY: $API_KEY"
{
"data": [
{
"id": 12,
"tenant_id": 3,
"url": "https://erp.acme.com/hooks/taxly",
"subscribed_events": ["invoice.transmitted.decrypted"],
"description": "Receives incoming invoices",
"message": "Production receiver",
"forward_status": "pending",
"created_at": "2026-04-06T09:00:00.000000Z",
"updated_at": "2026-04-06T09:00:00.000000Z"
}
],
"message": "Webhook endpoints retrieved successfully"
}
/webhooks
X-API-KEY or Bearer
Registers a webhook endpoint.
Body parameters
| Field | Description |
|---|---|
| url stringrequired |
Public HTTPS URL. Must be unique per tenant. |
| secret stringrequired |
Signing secret, minimum 10 characters. Used for the X-Webhook-Signature HMAC. |
| events string[]required |
Any of exchange_invoice.received, invoice.transmitted.decrypted, invoice.transmission.status, webhook.delivered, webhook.failed. |
| name stringoptional |
Label (max 100). |
| description stringoptional |
Description (max 255). |
invoice.transmitted.decrypted. Without it, processing still completes but nothing is delivered to your endpoint.curl -X POST https://taxly.ng/api/v1/webhooks \ -H "X-API-KEY: $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://erp.acme.com/hooks/taxly", "secret": "a-long-random-secret", "events": ["invoice.transmitted.decrypted"], "name": "Production receiver" }'
{
"success": true,
"data": {
"endpoint": {
"id": 12,
"tenant_id": 3,
"url": "https://erp.acme.com/hooks/taxly",
"subscribed_events": ["invoice.transmitted.decrypted"],
"description": "Receives incoming invoices",
"message": "Production receiver",
"forward_status": "pending",
"created_at": "2026-04-06T09:00:00.000000Z",
"updated_at": "2026-04-06T09:00:00.000000Z"
}
},
"message": "Webhook endpoint created successfully"
}
{
"success": false,
"message": "A webhook endpoint with this URL already exists for your tenant.",
"data": { "existing_endpoint": { "id": 12 } }
}
/webhooks/{id}
X-API-KEY or Bearer
Updates an endpoint you own. PATCH behaves identically. Send only the fields you want to change.
Body parameters
| Field | Description |
|---|---|
| url stringoptional |
New URL (still unique per tenant). |
| secret stringoptional |
New secret (min 10). |
| events string[]optional |
Replaces the subscribed events. |
| name / description stringoptional |
Labels. |
curl -X PUT https://taxly.ng/api/v1/webhooks/{id} \ -H "X-API-KEY: $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "events": ["invoice.transmitted.decrypted", "invoice.transmission.status"] }'
{
"success": true,
"data": { "endpoint": { "id": 12, "…": "…" } },
"message": "Webhook endpoint updated successfully"
}
/webhooks/{id}
X-API-KEY or Bearer
Deletes an endpoint you own.
curl -X DELETE https://taxly.ng/api/v1/webhooks/{id} \ -H "X-API-KEY: $API_KEY"
{
"success": true,
"message": "Webhook endpoint deleted successfully"
}
Resources
Public reference data from NRS - code lists, geography and TIN/entity lookups. Use them to populate dropdowns and to find valid values for invoice fields. No authentication required.
/resources/invoice-types
No auth
Invoice type codes for invoice_type_code.
curl https://taxly.ng/api/v1/resources/invoice-types
{
"code": 200,
"data": [
{ "code": "…", "description": "…" }
],
"message": "…"
}
/resources/payment-means
No auth
Payment means codes for payment_means.
curl https://taxly.ng/api/v1/resources/payment-means
{
"code": 200,
"data": [
{ "code": "…", "description": "…" }
],
"message": "…"
}
/resources/tax-categories
No auth
Tax categories for tax_category.id (e.g. VAT).
curl https://taxly.ng/api/v1/resources/tax-categories
{
"code": 200,
"data": [
{ "code": "…", "description": "…" }
],
"message": "…"
}
/resources/currencies
No auth
ISO currency codes for document_currency_code.
curl https://taxly.ng/api/v1/resources/currencies
{
"code": 200,
"data": [
{ "code": "…", "description": "…" }
],
"message": "…"
}
/resources/quantity-codes
No auth
Unit-of-quantity codes. Results are paginated, 20 per page - pass ?page=2 for more.
curl https://taxly.ng/api/v1/resources/quantity-codes
{
"code": 200,
"data": {
"current_page": 1,
"data": [
{ "code": "…", "description": "…" }
],
"per_page": 20,
"total": 1432,
"last_page": 72,
"next_page_url": "https://taxly.ng/api/v1/resources/hs-codes?page=2"
},
"message": "…"
}
/resources/hs-codes
No auth
Harmonised System codes for goods lines (hsn_code + product_category). Results are paginated, 20 per page - pass ?page=2 for more.
curl https://taxly.ng/api/v1/resources/hs-codes
{
"code": 200,
"data": {
"current_page": 1,
"data": [
{ "code": "…", "description": "…" }
],
"per_page": 20,
"total": 1432,
"last_page": 72,
"next_page_url": "https://taxly.ng/api/v1/resources/hs-codes?page=2"
},
"message": "…"
}
/resources/services-codes
No auth
ISIC service codes for service lines (isic_code + service_category). Results are paginated, 20 per page - pass ?page=2 for more.
curl https://taxly.ng/api/v1/resources/services-codes
{
"code": 200,
"data": {
"current_page": 1,
"data": [
{ "code": "…", "description": "…" }
],
"per_page": 20,
"total": 1432,
"last_page": 72,
"next_page_url": "https://taxly.ng/api/v1/resources/hs-codes?page=2"
},
"message": "…"
}
/resources/countries
No auth
Country codes for postal_address.country.
curl https://taxly.ng/api/v1/resources/countries
{
"code": 200,
"data": [
{ "code": "…", "description": "…" }
],
"message": "…"
}
/resources/states
No auth
State codes for postal_address.state.
curl https://taxly.ng/api/v1/resources/states
{
"code": 200,
"data": [
{ "code": "…", "description": "…" }
],
"message": "…"
}
/resources/lgas
No auth
Local government areas.
curl https://taxly.ng/api/v1/resources/lgas
{
"code": 200,
"data": [
{ "code": "…", "description": "…" }
],
"message": "…"
}
/resources/tin/{tin_number}
No auth
Looks up a Tax Identification Number with NRS - handy for verifying a buyer before invoicing.
curl https://taxly.ng/api/v1/resources/tin/{tin_number}
{
"code": 200,
"data": { "tin": "20000001-0001", "…": "…" },
"message": "…"
}
/resources/entity/{entity_id}
No auth
Fetches NRS entity details, including its businesses, by entity_id.
curl https://taxly.ng/api/v1/resources/entity/{entity_id}
{
"code": 200,
"data": { "businesses": [ { "id": "…", "tin": "…", "name": "…" } ] },
"message": "…"
}
Tenants
Read and create tenants. Bearer token only - API keys are not accepted on these routes.
/tenants
Bearer token only
Super admins receive all tenants; other users receive only their own organization's tenant.
curl https://taxly.ng/api/v1/tenants \ -H "Authorization: Bearer $TOKEN"
{ "success": true, "data": [ { "id": 3, "name": "Acme Corp", "brand": "Acme", "domain": "acme.com", "email": "dev@acme.com", "entity_id": "********-b06e-****-a89d-***********" } ], "message": "Tenants retrieved successfully" }
/tenants
Bearer token only
Creates a tenant.
Body parameters
| Field | Description |
|---|---|
| name stringrequired |
Max 255. |
| brand stringoptional |
Max 255. |
| domain stringoptional |
Unique. |
| feature_flags objectoptional |
Feature toggles. |
| retention_policy stringoptional |
Max 255. |
curl -X POST https://taxly.ng/api/v1/tenants \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Acme Corp", "brand": "Acme", "domain": "acme.com" }'
{ "success": true, "data": { "tenant": { "id": 4, "name": "Acme Corp" } }, "message": "Tenant created successfully" }
/tenants/{tenant}
Bearer token only
Returns one tenant. Non-super-admins can only read their own.
curl https://taxly.ng/api/v1/tenants/{tenant} \ -H "Authorization: Bearer $TOKEN"
{ "success": true, "data": { "id": 3, "name": "Acme Corp", "brand": "Acme", "domain": "acme.com", "email": "dev@acme.com", "entity_id": "********-b06e-****-a89d-***********" }, "message": "Tenant retrieved successfully" }
Draft Invoices
Taxly-managed invoice records for portal-style workflows. Bearer token only. For ERP integrations, prefer the Invoices endpoints above.
/invoices
Bearer token only
Creates a draft invoice for your organization.
Body parameters
| Field | Description |
|---|---|
| buyer_organization_ref stringrequired |
Buyer TIN / reference. |
| total_amount numberrequired |
Minimum 0. |
| tax_breakdown arrayrequired |
Tax lines. |
| vat_treatment stringrequired |
standard, zero-rated or exempt. |
curl -X POST https://taxly.ng/api/v1/invoices \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "buyer_organization_ref": "20000001-0001", "total_amount": 5375, "tax_breakdown": [ { "type": "VAT", "rate": 7.5, "amount": 375 } ], "vat_treatment": "standard" }'
{
"data": { "invoice": { "id": 15, "status": "draft", "total_amount": 5375 } },
"message": "Invoice created successfully"
}
/invoices/{invoice}/validate
Bearer token only
Validates a draft and marks it validated. Requires permission to update the invoice.
curl -X POST https://taxly.ng/api/v1/invoices/{invoice}/validate \ -H "Authorization: Bearer $TOKEN"
{ "data": { "invoice": { "id": 15, "status": "validated" } }, "message": "Invoice validated successfully" }
{ "data": { "invoice": {} }, "errors": { "field": ["…"] }, "message": "Invoice validation failed" }
/invoices/{invoice}/submit
Bearer token only
Submits a validated draft. Returns 202 as processing continues in the background.
Body parameters
| Field | Description |
|---|---|
| channel stringrequired |
api, web or manual. |
curl -X POST https://taxly.ng/api/v1/invoices/{invoice}/submit \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "channel": "api" }'
{ "data": { "result": { "submission_id": "…", "txn_id": "…" } }, "message": "Invoice submitted successfully" }
Admin
Landlord operations for reviewing integrator applications. Bearer token only; intended for Taxly administrators.
/admin/integrators
Bearer token only
Lists integrators, paginated.
Query parameters
| Field | Description |
|---|---|
| status stringoptional |
pending, approved or rejected. |
| per_page integeroptional |
Default 15. |
curl "https://taxly.ng/api/v1/admin/integrators?status=pending" \ -H "Authorization: Bearer $TOKEN"
{ "success": true, "data": { "integrators": { "current_page": 1, "data": [ { "id": 3, "integrator_status": "pending" } ], "per_page": 15 } }, "message": "Integrators retrieved successfully" }
/admin/integrators/{tenant}/review
Bearer token only
Approves or rejects an application. Approved integrators can then generate API keys.
Body parameters
| Field | Description |
|---|---|
| status stringrequired |
approved or rejected. |
| reason stringoptional |
Shown to the applicant on the status endpoint (max 1000). |
curl -X PATCH https://taxly.ng/api/v1/admin/integrators/{tenant}/review \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "status": "approved" }'
{ "success": true, "data": { "tenant": { "id": 3, "integrator_status": "approved" }, "message": "Integrator application approved successfully" }, "message": "Integrator application approved successfully" }
NRS Callbacks
Endpoints that NRS calls on Taxly when an invoice is transmitted. Integrators do not call these - they are documented so you understand how incoming invoices reach your webhook.
/firs-exchange/webhook
Called by NRS
Receives NRS exchange events. TRANSMITTING and TRANSMITTED trigger a background pull of the invoice.
Body parameters
| Field | Description |
|---|---|
| irn stringrequired |
Invoice Reference Number. |
| message stringrequired |
TRANSMITTING, TRANSMITTED, ACKNOWLEDGED or FAILED. |
200 even if internal processing fails, so NRS does not retry immediately.curl -X POST https://taxly.ng/api/firs-exchange/webhook \ -H "Content-Type: application/json" \ -d '{ "irn": "INV001-94ND90NR-20260406", "message": "TRANSMITTED" }'
{ "message": "Webhook received successfully", "event_id": 481 }
{ "error": "Invalid payload", "message": "IRN and message are required" }
/webhooks/firs
Called by NRS
Receives NRS transmission status callbacks. Duplicates are detected and ignored. For TRANSMITTING/TRANSMITTED messages for invoices addressed to you, Taxly starts the incoming flow: look up, confirm, acknowledge, download, decrypt and deliver to your webhook.
Body parameters
| Field | Description |
|---|---|
| irn stringrequired |
Invoice Reference Number. |
| message stringrequired |
Status message. |
| webhook_url stringoptional |
Optional URL to forward the status to. |
curl -X POST https://taxly.ng/api/webhooks/firs \ -H "Content-Type: application/json" \ -d '{ "irn": "INV001-94ND90NR-20260406", "message": "TRANSMITTED" }'
{ "status": "received", "message": "Webhook received and processed successfully" }
{ "status": "duplicate", "message": "Webhook already received and processed" }
Webhook events
Events Taxly sends to the endpoints you registered. Each delivery is a POST with a JSON body. Respond with any 2xx quickly and process asynchronously.
Request headers
| Header | Value |
|---|---|
| Content-Type | application/json |
| X-Webhook-Source | Taxly |
| X-Webhook-Event | The event name, e.g. invoice.transmitted.decrypted |
| X-Webhook-Signature | HMAC-SHA256 hex of the raw request body, keyed with your endpoint secret (sent when the endpoint has a secret) |
Events
| Event | When |
|---|---|
| invoice.transmitted.decrypted | Recommended. A supplier invoice addressed to you was received, downloaded and decrypted. Contains the full invoice. |
| exchange_invoice.received | Older event carrying NRS exchange details. Only sent when Taxly can resolve your tenant from the exchange data — NRS masks party TINs, so prefer the decrypted event. |
| invoice.transmission.status | Status updates for invoices you transmitted. |
| webhook.delivered | A webhook delivery succeeded. |
| webhook.failed | A webhook delivery failed. |
invoice.transmitted.decrypted, Taxly completes processing but sends no decrypted invoice payload.{
"event": "invoice.transmitted.decrypted",
"source": "taxly",
"irn": "INV001-94ND90NR-20260406",
"status": "TRANSMITTED",
"customer_tin": "20000001-0001",
"supplier_tin": "30000002-0001",
"invoice_payload": {
"business_id": "11111111-2222-3333-4444-555555555555",
"irn": "INV001-94ND90NR-20260406",
"payment_status": "PENDING",
"invoice_kind": "B2B",
"issue_date": "2026-04-06",
"invoice_type_code": "380",
"document_currency_code": "NGN",
"accounting_supplier_party": {
"party_name": "Demo Supplier Nigeria Limited",
"tin": "30000002-0001",
"email": "billing@demosupplier.example.com",
"telephone": "+2348000000002",
"postal_address": {
"street_name": "12 Example Crescent",
"city_name": "Abuja",
"postal_zone": "900001",
"state": "FCT",
"country": "NG"
}
},
"accounting_customer_party": {
"party_name": "Demo Buyer Ventures",
"tin": "20000001-0001",
"email": "accounts@demobuyer.example.com",
"telephone": "+2348000000001",
"postal_address": {
"street_name": "45 Sample Avenue",
"city_name": "Lagos",
"postal_zone": "100001",
"state": "Lagos",
"country": "NG"
}
},
"legal_monetary_total": {
"line_extension_amount": 5000,
"tax_exclusive_amount": 5000,
"tax_inclusive_amount": 5375,
"payable_amount": 5375
},
"invoice_line": [
{
"isic_code": "6201",
"service_category": "Software",
"invoiced_quantity": 2,
"line_extension_amount": 5000,
"item": {
"name": "Software Subscription",
"description": "Monthly SaaS subscription"
},
"price": {
"price_amount": 2500,
"base_quantity": 1,
"price_unit": "XBG"
}
}
]
},
"is_json_payload": true,
"timestamp": "2026-04-06T09:18:45+00:00"
}
{
"irn": "INV001-94ND90NR-20260406",
"direction": "INCOMING",
"status": "TRANSMITTED",
"buyer_tin": "20000001-0001",
"seller_tin": "30000002-0001",
"source": "FIRS_EXCHANGE",
"received_at": "2026-04-06T09:18:45+00:00",
"invoice_data": { "…": "complete invoice details from NRS" }
}
$payload = file_get_contents('php://input'); // raw body - do not re-encode
$signature = $_SERVER['HTTP_X_WEBHOOK_SIGNATURE'] ?? '';
$expected = hash_hmac('sha256', $payload, getenv('TAXLY_WEBHOOK_SECRET'));
if (! hash_equals($expected, $signature)) {
http_response_code(401);
exit;
}
http_response_code(200); // acknowledge fast, process asynchronously
const crypto = require('crypto');
app.post('/hooks/taxly', express.raw({ type: 'application/json' }), (req, res) => {
const expected = crypto
.createHmac('sha256', process.env.TAXLY_WEBHOOK_SECRET)
.update(req.body) // raw Buffer
.digest('hex');
const received = req.get('X-Webhook-Signature') || '';
if (expected.length !== received.length ||
!crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(received))) {
return res.sendStatus(401);
}
res.sendStatus(200); // acknowledge fast, process asynchronously
});