Invoice Analysis
Authentication Required
Include your API key in the x-api-key header of every request.
The Invoice Analysis API uses Prism to validate, extract, and classify invoice data for tax compliance. Submit a structured invoice and receive a compliance assessment โ including VAT treatment, recommended WHT deductions, and any detected anomalies โ in a single synchronous response.
Integration Flow
- 1Submit Invoice: Send the invoice metadata and line items to Prism.
- 2Receive Analysis: Prism returns a tax compliance assessment with line-level VAT/WHT recommendations.
- 3Act on Results: Route compliant invoices to payment, flag anomalies for review, or trigger Flux filing automatically.
HTTP Request
POSThttps://api.taxstreem.com/v1/prism/invoice/analyze
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| invoiceNumber | string | Required | Your invoice reference number. Used as the idempotency key. |
| vendorName | string | Required | Legal name of the issuing vendor or supplier. |
| vendorTaxId | string | Optional | Vendor's Tax Identification Number. Improves compliance assessment accuracy. |
| invoiceDate | string | Required | ISO 8601 date the invoice was issued (e.g. 2024-03-20). |
| currency | string | Required | ISO 4217 currency code (e.g. NGN). |
| lineItems | array | Required | Invoice line items. Each object requires description, quantity, unitPrice, and optional vatStatus. |
Response
Returns 200 OK with a synchronous compliance report for the invoice.
| Field | Type | Description |
|---|---|---|
| invoiceNumber | string | Echo of the submitted invoice number. |
| complianceStatus | string | COMPLIANT, REVIEW_REQUIRED, or NON_COMPLIANT. |
| totalVat | number | Computed VAT amount across all line items. |
| recommendedWht | number | Recommended WHT deduction amount based on the vendor profile and invoice nature. |
| anomalies | array | List of detected compliance issues. Empty array when fully compliant. |
Example Request
curl -X POST https://api.taxstreem.com/v1/prism/invoice/analyze \ -H "x-api-key: txsm_test_SK489c..." \ -H "Content-Type: application/json" \ -d '{ "invoiceNumber": "INV-2024-00342", "vendorName": "Acme Consulting Ltd", "vendorTaxId": "1234567890123123", "invoiceDate": "2024-03-20", "currency": "NGN", "lineItems": [ { "description": "Professional consultancy services", "quantity": 1, "unitPrice": 250000, "vatStatus": 0 } ] }'
Example Response
200 OK
{
ย ย "invoiceNumber": "INV-2024-00342",
ย ย "complianceStatus": "COMPLIANT",
ย ย "totalVat": 18750,
ย ย "recommendedWht": 12500,
ย ย "anomalies": [
ย ย ]
}