Comprehensive instructions for integrators on how to use the Taxly Integrator API to receive incoming invoices through the NRS Exchange system.
This guide provides comprehensive instructions for integrators on how to use the Taxly Integrator API to receive incoming invoices through the NRS Exchange system. The Taxly platform acts as an intermediary: it is notified by NRS Exchange, acknowledges, downloads and decrypts each invoice, and routes the decrypted invoice to the appropriate integrator based on the customer TIN (Tax Identification Number) found inside the invoice.
TRANSMITTING or TRANSMITTED)invoice.transmitted.decryptedBefore integrating, ensure you have:
12345678-0001) must equal the customer TIN on the invoices addressed to youEndpoint: POST
/api/v1/integrators/register
Authentication: None (Public endpoint)
{
"name": "Your Company",
"tin": "12345678-0001",
"brand": "YourBrand",
"domain": "yourcompany.com",
"description": "E-commerce platform integration for invoice processing",
"use_case": "Automated invoice receiving and processing for online marketplace transactions",
"website": "https://yourcompany.com",
"contact_person": "John Doe",
"contact_email": "john@yourcompany.com",
"landlord_id": 1 // optional; defaults to first active landlord if omitted
}
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Tenant/Organization name |
| tin | string | Yes | Tax Identification Number (TIN) - required for invoice routing |
| brand | string | No | Brand name for the organization |
| domain | string | No | Unique domain (e.g., yourcompany.com) |
| description | string | Yes | Description of the integration |
| use_case | string | Yes | Detailed use case description |
| website | string | No | Organization website URL |
| contact_person | string | Yes | Name of contact person |
| contact_email | string | Yes | Contact email address |
| landlord_id | integer | No | Optional: landlord to associate; defaults to first active landlord if omitted |
{
"success": true,
"data": {
"tenant_id": 1,
"tenant": {
"id": 1,
"name": "Your Company",
"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": 1
},
"note": "Use this endpoint to check your approval status. No authentication required."
}
},
"message": "Integrator application submitted successfully"
}
tenant_id is returned in the response - save this for checking your
approval statusstatus_check endpoint to check if you've been approved (no
authentication needed)tenant_id⚠️ Important: Store your API key securely. It will only be shown once.
Your application will be reviewed by Taxly administrators. Once approved, your
integrator_status will change to approved. Use the status check endpoint
to monitor your approval status (see next section).
✅ No Authentication Required for First Key: When generating your first API key, no authentication is required. This is a one-time process allowed only when your tenant is approved and has no existing API keys.
Endpoint: POST
/api/v1/integrators/{tenant}/api-keys
Authentication: None required for first key generation (tenant must be approved and have no existing keys)
Required Header: X-Integrator-Email must match the
contact email used during registration
X-Integrator-Email: john@yourcompany.com
Content-Type: application/json
💡 Alternative: You can also provide the email via query
parameter: ?contact_email=john@yourcompany.com
{
"name": "Production API Key",
"description": "API key for production environment",
"permissions": ["invoices.read", "invoices.write"]
}
curl -X POST "https://api.taxly.com/api/v1/integrators/1/api-keys" \
-H "X-Integrator-Email: john@yourcompany.com" \
-H "Content-Type: application/json" \
-d '{
"name": "Production API Key",
"description": "API key for production environment",
"permissions": ["invoices.read", "invoices.write"]
}'
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Production API Key",
"description": "API key for production environment",
"key": "taxly_abc123xyz789...",
"permissions": ["invoices.read", "invoices.write"],
"tenant_id": 1,
"created_at": "2025-01-27T14:30:00Z"
},
"message": "API key created successfully"
}
⚠️ Important: Store your API key securely. The
key field will only be shown once and cannot be retrieved again. If you lose it,
you'll need to generate a new key.
After generating your first API key, all subsequent API key operations (including regenerating api key) require authentication using your existing API key:
Endpoint: POST
/api/v1/integrators/{tenant}/api-keys/regenerate
Authentication: x-api-key your_existing_api_key
x-api-key: taxly_abc123xyz789...
Content-Type: application/json
🔐 Current API key management flow: once your first key
has been issued, all key management actions are authenticated with the active
x-api-key header. The authenticated API key must belong to the same
{tenant} in the URL.
List API Keys: GET
/api/v1/integrators/{tenant}/api-keys
Regenerate Current API Key: POST
/api/v1/integrators/{tenant}/api-keys/regenerate
Revoke API Key: DELETE
/api/v1/integrators/{tenant}/api-keys/{apiKey}
Authentication: x-api-key: your_current_api_key
x-api-key.
401 Invalid API key provided.curl -X GET "https://api.taxly.com/api/v1/integrators/27/api-keys" \
-H "Accept: application/json" \
-H "x-api-key: taxly_abc123xyz789..."
curl -X POST "https://api.taxly.com/api/v1/integrators/27/api-keys/regenerate" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "x-api-key: taxly_abc123xyz789..." \
-d '{}'
{
"success": true,
"data": {
"api_key": {
"id": 10,
"name": "Production API Key",
"key": "taxly_new_plaintext_key_shown_once",
"masked": "taxly_****c754",
"description": "API key for production environment",
"permissions": ["invoices.read", "invoices.write"],
"active": true,
"created_at": "2026-04-09T10:15:00Z",
"updated_at": "2026-04-09T13:10:00Z"
}
},
"message": "API key regenerated successfully"
}
⚠️ Common cause of authorization errors: if the
tenant in the URL does not match the tenant that owns the supplied x-api-key, the
request will fail with an authorization error.
✅ No Authentication Required: This endpoint is public and can be called without an API key or authentication.
After registering as an integrator, you can check your approval status at any time without authentication. This allows you to monitor when you can start generating API keys.
Endpoint: GET
/api/v1/integrators/status
Authentication: None (Public endpoint)
You must provide at least one of the following parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| tenant_id | integer | Conditional | Your tenant ID (from registration response) |
| string | Conditional | Contact email used during registration |
# Check by tenant ID
curl "https://api.taxly.com/api/v1/integrators/status?tenant_id=123"
# Check by email
curl "https://api.taxly.com/api/v1/integrators/status?email=john@yourcompany.com"
{
"success": true,
"data": {
"tenant_id": 1,
"name": "Your Company",
"integrator_status": "pending",
"status_message": "Your integrator application is pending review. Please check back later.",
"can_generate_api_keys": false,
"can_use_api": false,
"applied_at": "2025-01-27T12:00:00Z",
"next_steps": [
"Wait for admin approval",
"Check this endpoint periodically for status updates",
"You will be able to generate API keys once approved"
]
},
"message": "Integrator status retrieved successfully"
}
{
"success": true,
"data": {
"tenant_id": 1,
"name": "Your Company",
"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": "2025-01-27T12:00:00Z",
"reviewed_at": "2025-01-27T14:00:00Z",
"review_reason": "Application meets all requirements",
"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": 1,
"name": "Your Company",
"integrator_status": "rejected",
"status_message": "Your integrator application has been rejected. Please contact support for more information.",
"can_generate_api_keys": false,
"can_use_api": false,
"applied_at": "2025-01-27T12:00:00Z",
"reviewed_at": "2025-01-27T14:00:00Z",
"review_reason": "Incomplete application details",
"next_steps": [
"Review the rejection reason provided",
"Contact support if you believe this is an error",
"You may reapply with additional information if needed"
]
},
"message": "Integrator status retrieved successfully"
}
integrator_status: Current status (pending,
approved, or rejected)
can_generate_api_keys: Whether you can generate API keys (requires approval)
can_use_api: Whether you can use the API (requires approval)applied_at: When you submitted your applicationreviewed_at: When admin reviewed your application (if applicable)review_reason: Reason for approval/rejection (if applicable)next_steps: Suggested actions based on your status💡 Tip: Save your tenant_id after
registration and use it to periodically check your status. You can also use the email address
you registered with as an alternative.
Your webhook endpoint must:
POST requestsHTTP 200 status for successful processingMethod: POST
Content-Type: application/json
Headers Included:
X-Webhook-Source: TaxlyX-Webhook-Event: exchange_invoice.receivedX-Webhook-Event: invoice.transmitted.decrypted for decrypted transmitted
invoices
If you want to receive the full decrypted invoice payload for transmitted invoices, your webhook
must be subscribed to the invoice.transmitted.decrypted event.
If this event is not subscribed, Taxly may complete post-transmit processing successfully but no decrypted invoice payload will be sent to your endpoint.
Endpoint: POST
/api/v1/webhooks
Authentication: x-api-key taxly_abc123xyz789...
Storage model: Webhook endpoints are now linked directly to your
tenant_id. Older organization-linked records remain supported for backward
compatibility.
{
"url": "https://yourdomain.com/webhooks/taxly/invoices",
"events": ["exchange_invoice.received", "invoice.transmitted.decrypted"],
"secret": "your_webhook_secret_for_security",
"description": "Primary webhook endpoint for receiving exchange invoices",
"name": "Production Webhook"
}
name maps to message in the databaseevents maps to subscribed_events in the databaseirn is a generated placeholder (CONFIG-{tenant_id}-{unique id}) kept
for older recordsforward_status is a legacy field and is always pending for
endpointsdescription is accepted but not stored| Field | Type | Required | Description |
|---|---|---|---|
| url | string | Yes | Your webhook endpoint URL (must be HTTPS) |
| events | array | Yes | Array of events to subscribe to. Supported events:
|
| secret | string | Yes | Secret key for webhook signature validation (minimum 10 characters) |
| description | string | No | Accepted for compatibility but not stored or returned (max 255 characters) |
| name | string | No | Name for the webhook endpoint (max 100 characters) |
curl -X POST "https://api.taxly.com/api/v1/webhooks" \
-H "x-api-key: taxly_abc123xyz789..." \
-H "Content-Type: application/json" \
-d '{
"url": "https://yourdomain.com/webhooks/taxly/invoices",
"events": ["exchange_invoice.received", "invoice.transmitted.decrypted"],
"secret": "your_webhook_secret_for_security",
"description": "Primary webhook endpoint for receiving exchange invoices",
"name": "Production Webhook"
}'
{
"success": true,
"data": {
"endpoint": {
"id": 1,
"tenant_id": 24,
"url": "https://yourdomain.com/webhooks/taxly/invoices",
"secret": "your_webhook_secret_for_security",
"subscribed_events": ["exchange_invoice.received", "invoice.transmitted.decrypted"],
"message": "Production Webhook",
"forward_status": "pending",
"irn": "CONFIG-24-65f1c0a1b2c3d",
"created_at": "2026-04-17T12:00:00Z",
"updated_at": "2026-04-17T12:00:00Z"
}
},
"message": "Webhook endpoint created successfully"
}
irn is automatically generated as
CONFIG-{tenant_id}-{unique id} to ensure uniquenessmessage contains the value from the name field in the requestsubscribed_events contains the value from the events field in the
requestforward_status is a legacy field and is always pending for new webhooksTaxly now stores integrator webhook endpoints directly against the authenticated integrator tenant. This makes webhook lookup and dispatch simpler and more reliable.
tenant_idtenant_id, including older endpoints still linked to one of your
organizations
invoice.transmitted.decrypted
When another system transmits an invoice to your organization through NRS Exchange:
invoice.transmitted.decryptedNRS masks party TINs until an invoice is acknowledged, so Taxly can only identify the customer after decrypting it. If no approved integrator tenant has that customer TIN, nothing is sent to any webhook. Taxly keeps the decrypted invoice and shows it to Taxly administrators as Customer not found, and delivery is retried once a matching tenant exists. If you expect an invoice and have not received it, check that your tenant TIN is registered exactly as it appears on the invoice, then contact support with the IRN.
For invoices transmitted through Taxly (POST /api/v1/invoices/{irn}/transmit), the same
download and decrypt steps run after NRS confirms the transmission. The optional
webhook_url on the transmit request only receives
invoice.transmission.status updates. The decrypted invoice itself is sent to the
customer's registered webhook endpoints, never to that webhook_url.
invoice.transmitted.decrypted
Your webhook endpoint should:
HTTP/1.1 200 OK
Content-Type: application/json
{
"status": "received",
"message": "Invoice processed successfully",
"your_invoice_id": "INV-12345"
}
HTTP/1.1 500 Internal Server Error
Content-Type: application/json
{
"status": "error",
"message": "Failed to process invoice"
}
Any 2xx response counts as delivered. Any other status, or no response within 30
seconds, is recorded as a failed delivery.
When your webhook is subscribed to invoice.transmitted.decrypted, Taxly sends a
POST whose JSON body is exactly the structure below. The envelope fields are added by
Taxly, while invoice_payload contains the decrypted invoice as returned by NRS (a JSON
object when the decrypted content is valid JSON, otherwise a raw string). The request headers are
Content-Type: application/json, X-Webhook-Source: Taxly,
X-Webhook-Event: invoice.transmitted.decrypted and, when your endpoint has a secret,
X-Webhook-Signature (HMAC-SHA256 of the raw request body):
The example below uses dummy/sample data only to illustrate the structure of a transmitted invoice webhook payload.
{
"event": "invoice.transmitted.decrypted",
"source": "taxly",
"irn": "INVDEMOA12B34C5-FAKE6789-20260406",
"status": "TRANSMITTED",
"customer_tin": "20000001-0001",
"supplier_tin": "30000002-0001",
"invoice_payload": {
"business_id": "11111111-2222-3333-4444-555555555555",
"irn": "INVDEMOA12B34C5-FAKE6789-20260406",
"payment_status": "PENDING",
"customization_id": null,
"invoice_kind": "B2B",
"issue_date": "2026-04-06",
"issue_time": "09:15:30",
"due_date": "2026-05-06",
"invoice_type_code": "380",
"document_currency_code": "NGN",
"tax_currency_code": "NGN",
"accounting_supplier_party": {
"id": "aaaa1111-bbbb-2222-cccc-333333333333",
"postal_address_id": "dddd4444-eeee-5555-ffff-666666666666",
"party_name": "Demo Supplier Nigeria Limited",
"tin": "30000002-0001",
"email": "billing@demosupplier.example.com",
"telephone": "+2348000000002",
"business_description": "Sample supplier record for documentation",
"postal_address": {
"id": "12121212-3434-5656-7878-909090909090",
"street_name": "12 Example Crescent",
"city_name": "Abuja",
"postal_zone": "900001",
"lga": null,
"state": "FCT",
"country": "NG"
}
},
"accounting_customer_party": {
"id": "99999999-8888-7777-6666-555555555555",
"postal_address_id": "44444444-3333-2222-1111-000000000000",
"party_name": "Demo Buyer Ventures",
"tin": "20000001-0001",
"email": "accounts@demobuyer.example.com",
"telephone": "+2348000000001",
"business_description": "Sample buyer record for documentation",
"postal_address": {
"id": "abababab-cdcd-efef-1212-343434343434",
"street_name": "45 Sample Avenue",
"city_name": "Lagos",
"postal_zone": "100001",
"lga": null,
"state": "Lagos",
"country": "NG"
}
},
"payment_means": [
{
"payment_means_code": "10",
"payment_due_date": "2026-05-06T00:00:00Z"
}
],
"allowance_charge": [
{
"charge_indicator": true,
"amount": 125
}
],
"tax_total": [
{
"tax_amount": 375,
"tax_subtotal": [
{
"taxable_amount": 5000,
"tax_amount": 375,
"tax_category": {
"id": "VAT",
"percent": 7.5
},
"TaxCategoryPercent": 7.5
}
]
}
],
"legal_monetary_total": {
"line_extension_amount": 5000,
"tax_exclusive_amount": 5125,
"tax_inclusive_amount": 5375,
"payable_amount": 5375
},
"invoice_line": [
{
"invoiced_quantity": 2,
"line_extension_amount": 5000,
"item": {
"name": "Demo Software Subscription",
"description": "Sample transmitted invoice payload for documentation purposes",
"sellers_item_identification": null
},
"price": {
"price_amount": 2500,
"base_quantity": 1,
"price_unit": "XBG"
},
"isic_code": "6201",
"service_category": "Software",
"discount_rate": 0,
"discount_amount": 0,
"fee_rate": 0,
"fee_amount": 0
}
]
},
"is_json_payload": true,
"timestamp": "2026-04-06T09:18:45+00:00"
}
Each invoice_line item must carry exactly one classification group. Mixing fields
from both groups, or omitting both groups entirely, is a validation error.
| Group | Required fields | Use for |
|---|---|---|
| A (product) | hsn_code +
product_category
|
Goods / physical products |
| B (service) | isic_code +
service_category
|
Services (software, consulting, etc.) |
isic_code
but no service_category (or vice-versa) is also rejected." ") are treated as absent, matching the same
trimming rule applied during request normalisation.$integratorPayload = [
"event" => "invoice.transmitted.decrypted",
"source" => "taxly",
"irn" => $irn,
"status" => "TRANSMITTED",
"customer_tin" => $customerTin,
"supplier_tin" => $supplierTin,
"invoice_payload" => $decrypted['json'] ?? $decrypted['raw'],
"is_json_payload" => $decrypted['is_json'] ?? false,
"timestamp" => now()->toIso8601String(),
];
This means invoice_payload is not transformed into a separate Taxly schema.
Taxly forwards the decrypted JSON as-is when available, and falls back to the raw decrypted
string when the content is not JSON.
If you only receive invoice.transmission.status (sent to the
webhook_url of a transmit request) but do not receive the decrypted invoice payload,
verify that you registered a webhook endpoint subscribed to
invoice.transmitted.decrypted for the customer tenant.
invoice.transmitted.decrypted| Field | Type | Description |
|---|---|---|
| event | string | Always invoice.transmitted.decrypted |
| source | string | Always taxly |
| irn | string | Invoice Reference Number - unique identifier |
| status | string | TRANSMITTED |
| customer_tin | string | TIN of the customer (buyer) read from the decrypted invoice. This is the TIN matched to your tenant |
| supplier_tin | string | TIN of the supplier (seller) read from the decrypted invoice |
| invoice_payload | object | string | The decrypted invoice exactly as returned by NRS |
| is_json_payload | boolean | true when invoice_payload is a JSON object, false when it is a raw string |
| timestamp | string | ISO 8601 time Taxly sent the webhook |
exchange_invoice.received
This older event carries NRS exchange details rather than the decrypted invoice. It is only sent
when Taxly can resolve your tenant from the exchange data, which is not always possible because NRS
masks party TINs. Use invoice.transmitted.decrypted to reliably receive invoices.
| Field | Type | Description |
|---|---|---|
| irn | string | Invoice Reference Number - unique identifier |
| direction | string | INCOMING for invoices you receive |
| status | string | Current status: TRANSMITTED |
| buyer_tin | string | Your TIN as the buyer |
| seller_tin | string | Supplier's TIN |
| source | string | Always FIRS_EXCHANGE |
| received_at | string | ISO 8601 timestamp when Taxly received the invoice |
| invoice_data | object | Complete invoice details from NRS |
| invoice_line[].hsn_code | string | Harmonized System Number for goods. Must be paired with
product_category. Mutually exclusive with isic_code /
service_category.
|
| invoice_line[].product_category | string | Product category label. Required when
hsn_code is present.
|
| invoice_line[].isic_code | string | International Standard Industrial Classification code for
services. Must be paired with service_category. Mutually exclusive with
hsn_code / product_category.
|
| invoice_line[].service_category | string | Service category label. Required when
isic_code is present.
|
Endpoint: GET
/api/v1/integrators/status
Authentication: None (public)
Query params: tenant_id or email (one
required)
First key issuance (no Taxly login required): When generating your first API key, no authentication is required. This is allowed only when the tenant is approved and has no API keys yet. Subsequent calls should use the issued API key for authentication.
⚠️ Legacy keys deprecate in 14 days: Legacy (non-tenant) keys continue to work during a 14-day grace period and will then expire. Rotate to tenant-bound API keys promptly.
API key header format: for integrator endpoints, use
x-api-key: your_key_here. Do not send it as a Bearer token. For key rotation, use
POST /api/v1/integrators/{tenant}/api-keys/regenerate with the currently active
key in the header.
Endpoint: GET
/api/v1/invoices/search/{business_id}
Parameters: only the business_id path parameter.
The response is NRS's search result for that business; no filters are applied by
Taxly.
Endpoint: GET
/api/v1/invoices/{irn}/download
Response: JSON from NRS containing the invoice encrypted as
{ iv_hex, pub, data } (not a PDF). It is encrypted with Taxly's NRS credentials,
so to receive the readable invoice use the invoice.transmitted.decrypted
webhook. NRS only allows this download once the invoice has been acknowledged.
Endpoint: GET
/api/v1/invoices/{irn}/confirm
Purpose: Confirms the invoice with NRS and returns its
status (issue date, due date, payment status, transmitted and
delivered flags)
Endpoint: POST
/api/v1/invoices/{irn}/transmit
Body: optional webhook_url. When supplied, Taxly
posts invoice.transmission.status updates for this transmission to it. The
decrypted invoice is sent only to the customer's registered webhook endpoints.
Endpoint: GET
/api/v1/invoices/transmit/health-check
Purpose: Checks that Taxly can reach the NRS transmission service. It does not test your webhook endpoint.
Endpoint: GET
/api/v1/webhooks
Behavior: Returns webhook endpoints connected to the
authenticated tenant_id.
Endpoint: POST
/api/v1/webhooks
Behavior: Creates the webhook endpoint directly under the
authenticated integrator tenant_id.
Endpoint: PUT/PATCH
/api/v1/webhooks/{id}
Behavior: Updates an existing webhook endpoint. Supports partial updates.
Authorization: You can only update webhooks that belong to your authenticated tenant.
Special Feature: You can now update the
tenant_id to transfer webhook ownership between tenants.
| Field | Type | Required | Description |
|---|---|---|---|
| url | string | No | Webhook endpoint URL (must be HTTPS) |
| secret | string | No | Secret key for webhook signature validation (minimum 10 characters) |
| events | array | No | Array of events to subscribe to |
| description | string | No | Description of the webhook endpoint (max 255 characters) |
| name | string | No | Name for the webhook endpoint (max 100 characters) |
| tenant_id | integer | No | NEW: Update the tenant ownership of this webhook |
curl -X PATCH "https://api.taxly.com/api/v1/webhooks/123" \
-H "x-api-key: taxly_abc123xyz789..." \
-H "Content-Type: application/json" \
-d '{
"url": "https://newdomain.com/webhooks/taxly/invoices",
"secret": "new_webhook_secret_12345"
}'
curl -X PATCH "https://api.taxly.com/api/v1/webhooks/123" \
-H "x-api-key: taxly_abc123xyz789..." \
-H "Content-Type: application/json" \
-d '{
"tenant_id": 25,
"description": "Transferred webhook for new tenant"
}'
{
"success": true,
"data": {
"endpoint": {
"id": 123,
"tenant_id": 24,
"url": "https://newdomain.com/webhooks/taxly/invoices",
"secret": "new_webhook_secret_12345",
"subscribed_events": ["exchange_invoice.received", "invoice.transmitted.decrypted"],
"message": "Production Webhook",
"forward_status": "pending",
"irn": "CONFIG-24-65f1c0a1b2c3d",
"created_at": "2026-04-17T12:00:00Z",
"updated_at": "2026-04-17T15:30:00Z"
}
},
"message": "Webhook endpoint updated successfully"
}
tenant_id, the webhook will be transferred to the new
tenantEndpoint: DELETE
/api/v1/webhooks/{id}
Behavior: Deletes a webhook endpoint.
Authorization: You can only delete webhooks that belong to your authenticated tenant.
| HTTP status | Meaning | Resolution |
|---|---|---|
| 401 | Missing or invalid API key | Send x-api-key: your_key and check the key is active |
| 403 | The key does not belong to the tenant in the URL | Use the tenant ID that owns the API key |
| 404 | Tenant, webhook or resource not found | Verify the ID in the URL |
| 409 | A webhook endpoint with this URL already exists for your tenant | Update the existing endpoint instead |
| 422 | Validation failed, or the maximum of 10 webhook endpoints per tenant was reached | Check the data field of the response for the failing fields |
Taxly makes one delivery attempt per endpoint, with a 30 second timeout:
2xx response marks the delivery as successTaxly does not retry automatically. After fixing your endpoint, ask Taxly support to retry the delivery for the IRN. Because a retry can deliver an invoice more than once, make your handler idempotent (see Best Practices).
API errors use this shape; data is only present when there are details:
{
"success": false,
"message": "A webhook endpoint with this URL already exists for your tenant.",
"data": {
"existing_endpoint": { "id": 7, "url": "https://yourdomain.com/webhook" }
}
}
Implement webhook signature validation:
// Example validation
$payload = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_WEBHOOK_SIGNATURE'] ?? '';
$expectedSignature = hash_hmac('sha256', $payload, 'your_webhook_secret');
if (!hash_equals($signature, $expectedSignature)) {
http_response_code(401);
exit('Unauthorized');
}
Always check if you've already processed an invoice by IRN:
$existingInvoice = YourInvoiceModel::where('irn', $webhookData['irn'])->first();
if ($existingInvoice) {
return response()->json(['status' => 'already_processed']);
}
Implement comprehensive error handling:
try {
// Process invoice
$this->processInvoice($webhookData);
return response()->json(['status' => 'success']);
} catch (ValidationException $e) {
Log::error('Invoice validation failed', ['irn' => $webhookData['irn'], 'errors' => $e->errors()]);
return response()->json(['status' => 'validation_failed'], 422);
} catch (Exception $e) {
Log::error('Invoice processing failed', ['irn' => $webhookData['irn'], 'error' => $e->getMessage()]);
return response()->json(['status' => 'processing_failed'], 500);
}
Log all webhook events for debugging:
Log::info('Webhook received', [
'irn' => $webhookData['irn'],
'customer_tin' => $webhookData['customer_tin'],
'supplier_tin' => $webhookData['supplier_tin'],
'timestamp' => now()->toIso8601String()
]);
Keep webhook processing under 30 seconds:
Taxly has no endpoint that sends a test event to your webhook, so test your handler by posting the
sample below to it yourself. When your endpoint has a secret, sign the exact body with HMAC-SHA256
and send it in X-Webhook-Signature:
BODY='{"event":"invoice.transmitted.decrypted","source":"taxly","irn":"TEST-INV-123456","status":"TRANSMITTED","customer_tin":"12345678-0001","supplier_tin":"87654321-0001","invoice_payload":{"irn":"TEST-INV-123456","document_currency_code":"NGN"},"is_json_payload":true,"timestamp":"2026-10-13T12:00:00+00:00"}'
SIGNATURE=$(printf '%s' "$BODY" | openssl dgst -sha256 -hmac "your_webhook_secret" | awk '{print $2}')
curl -X POST https://yourdomain.com/webhook \
-H "Content-Type: application/json" \
-H "X-Webhook-Source: Taxly" \
-H "X-Webhook-Event: invoice.transmitted.decrypted" \
-H "X-Webhook-Signature: $SIGNATURE" \
-d "$BODY"
Use this sample body to test your webhook processing:
{
"event": "invoice.transmitted.decrypted",
"source": "taxly",
"irn": "TEST-INV-123456",
"status": "TRANSMITTED",
"customer_tin": "12345678-0001",
"supplier_tin": "87654321-0001",
"invoice_payload": {
"irn": "TEST-INV-123456",
"invoice_kind": "B2B",
"issue_date": "2026-10-13",
"invoice_type_code": "380",
"document_currency_code": "NGN",
"accounting_supplier_party": {
"party_name": "Test Seller Company",
"tin": "87654321-0001"
},
"accounting_customer_party": {
"party_name": "Test Buyer Company",
"tin": "12345678-0001"
}
},
"is_json_payload": true,
"timestamp": "2026-10-13T12:00:00+00:00"
}
Check:
tenant_id
invoice.transmitted.decryptedDebug:
# Test your webhook endpoint
curl -X POST https://yourdomain.com/webhook \
-H "Content-Type: application/json" \
-H "X-Webhook-Source: Taxly" \
-H "X-Webhook-Event: invoice.transmitted.decrypted" \
-d '{"test": "payload"}'
Resolution:
12345678-0001Check:
x-api-key: your_api_key (not a Bearer token)Common Causes:
For technical support:
Include this information when contacting support:
Taxly now acknowledges each invoice sent to your organization through NRS Exchange automatically,
downloads and decrypts it, and routes it to you by the customer TIN found inside the
decrypted invoice. The invoice.transmitted.decrypted webhook payload has a
new, flat structure.
Action required
12345678-0001. TINs in other formats, such as
123456789, will not match.invoice.transmitted.decrypted. This
event carries the full decrypted invoice. For invoices you transmit through
POST /api/v1/invoices/{irn}/transmit, the optional webhook_url
only receives invoice.transmission.status updates. The decrypted invoice goes
to the customer's registered webhook endpoints.tenant_id, endpoint_id,
webhook_url, headers and a nested payload object)
has been removed. The fields are event, source,
irn, status, customer_tin,
supplier_tin, invoice_payload, is_json_payload and
timestamp. invoice_payload is a JSON object when the decrypted
content is valid JSON, otherwise a raw string, so handle both. It now includes
invoice_kind (for example "B2B").X-Webhook-Signature is an HMAC-SHA256 of the raw request body. Verify it
against the raw bytes, not re-serialized JSON.| Item | Change |
|---|---|
| irn | Now generated as CONFIG-{tenant_id}-{unique id} (previously CONFIG-{tenant_id}). Treat it as an opaque value. |
| forward_status | Legacy field, always pending. Ignore it. |
| description | Still accepted but not stored or returned. |
| Listing | Also includes older endpoints still linked to one of your organizations, not only those matching your tenant_id. |
| Error responses | The "Failed to process invoice" response no longer includes error_code: "VALIDATION_FAILED". Do not depend on that field. |
URLs, HTTP methods, authentication and request payloads for the existing API endpoints are unchanged.
Version: 1.1.0
Last Updated: October 13, 2026
API Version: v1