Vendor Upload
Authentication Required
Include your API key in the x-api-key header of every request.
The Vendor Upload API allows you to upload vendor documents — such as invoices, receipts, or purchase orders — directly to Prism for automated extraction and tax compliance analysis. Prism parses the document, extracts key fields, and returns structured data that can feed directly into VAT and WHT filing workflows.
Requests to this endpoint must use multipart/form-data encoding. Do not send JSON — the Content-Type header must be multipart/form-data.
Integration Flow
- 1Upload Document: Send the vendor document as a
filefield in a multipart form request. - 2Receive Extracted Data: Prism returns structured fields — vendor name, invoice number, line items, totals, and tax treatment — parsed from the document.
- 3Feed Downstream: Pass the extracted data to the Invoice Analysis or Flux Filing APIs to complete your compliance workflow.
HTTP Request
POSThttps://api.taxstreem.com/v1/prism/vendor/upload
Request — Form Fields
| Field | Type | Required | Description |
|---|---|---|---|
| file | file | Required | The vendor document to analyse. Accepted formats: PDF, PNG, JPG. Maximum file size: 10 MB. |
| documentType | string | Required | Type of document being uploaded. Accepted values: invoice, receipt, purchase_order. |
| vendorId | string | Optional | Your internal vendor identifier. If provided, Prism uses your existing vendor profile to improve extraction accuracy. |
| currency | string | Optional | ISO 4217 hint for the document currency. Helps Prism resolve ambiguous amounts (e.g. NGN). |
Response
Returns 200 OK with structured data extracted from the uploaded document.
| Field | Type | Description |
|---|---|---|
| documentId | string | Unique identifier for the uploaded document. Use this to reference the document in subsequent API calls. |
| vendorName | string | Extracted vendor or supplier name. |
| vendorTaxId | string | null | Extracted Tax ID of the vendor. null if not found in the document. |
| invoiceNumber | string | null | Extracted invoice or receipt reference number. |
| invoiceDate | string | null | ISO 8601 date extracted from the document. |
| totalAmount | number | Total document amount including taxes. |
| currency | string | Detected or provided currency code. |
| lineItems | array | Extracted line items. Each contains description, quantity, unitPrice, and vatStatus. |
| confidence | number | Extraction confidence score between 0 and 1. Scores below 0.75 indicate fields that may need manual verification. |
Error Codes
| HTTP Status | Error Key | Cause & Resolution |
|---|---|---|
| 400 | Bad Request | Missing file or unsupported file format. Ensure you are sending multipart/form-data. |
| 401 | Unauthorized | Missing or invalid x-api-key header. |
| 413 | Payload Too Large | File exceeds the 10 MB limit. Compress or split the document before uploading. |
| 422 | Unprocessable Entity | Prism could not extract meaningful data from the document. Try a higher-resolution scan or a different file. |
Example Request
curl -X POST https://api.taxstreem.com/v1/prism/vendor/upload \ -H "x-api-key: txsm_test_SK489c..." \ -H "Content-Type: multipart/form-data" \ -d '{ "file": "@/path/to/invoice.pdf", "documentType": "invoice", "vendorId": "vendor-acme-001", "currency": "NGN" }'
Example Response
200 OK
{
"documentId": "doc-prism-xaee2ddf",
"vendorName": "Acme Consulting Ltd",
"vendorTaxId": "1234567890123123",
"invoiceNumber": "INV-2024-00342",
"invoiceDate": "2024-03-20",
"totalAmount": 281250,
"currency": "NGN",
"lineItems": [
{
"description": "Professional consultancy services",
"quantity": 1,
"unitPrice": 250000,
"vatStatus": 0
}
],
"confidence": 0.96
}