Batch Analyze Items
Authentication Required
This endpoint requires a valid API key. Include your API key in the x-api-key header of every request. You can generate a test key in your developer dashboard.
The Batch Analyze Items API accepts multiple invoice documents in a single request. Each entry in the documents array is processed independently — Prism reads every line item across every document and returns a consolidated tax analysis per invoice.
Use this endpoint when you need to process a queue of invoices at once — end-of-month reconciliation, bulk vendor payment processing, or multi-tenant invoice ingestion.
Integration Flow
- 1Prepare URLs: Collect the accessible document URLs for all invoices you want analysed. Each entry needs a
documentUrlandinvoiceId. - 2Submit Batch: POST the array under
documents. A single request can contain up to 50 invoices. - 3Receive Per-Invoice Results: One
prism.analysis.completewebhook event fires per invoice as each one finishes processing.
HTTP Request
Request Body
The following parameters are required for this action.
| Parameter | Type | Required | Description |
|---|---|---|---|
| batchId | string | Required | A universally unique identifier (UUID) assigned by you. Used for idempotency to ensure this exact batch is not processed twice if the connection drops. Max 64 characters. |
| payload | array[object] | Required | An array of transaction objects containing the target data. Cannot be empty. Maximum 500 items per batch. Schema mirrors the single payload attributes. |
Response Documentation
A successful invocation of this endpoint returns a 202 Accepted or 200 OK. Since filing operations are processed asynchronously alongside tax gateways, the immediate response acknowledges successful receipt and enqueueing of the schedule payload.
| Field Name | Type | Description |
|---|---|---|
| status | string | The high-level outcome of the request context. Value is typically accepted indicating payload validation passed. |
| message | string | A human-readable confirmation note (e.g. "schedule accepted successfully"). |
| data.id | string | The tracking UUID for this schedule. This precise ID correlates to the filingId in downstream webhook events. |
| data.created_at | string (date-time) | Timestamp marking the instant the schedule safely enqueued, in ISO 8601 format. |
Error Handling
The API applies standard HTTP status codes indicating success or failure. In case of an anomaly, the response body contains an errors array detailing specific field-level validation issues to facilitate rapid integration debugging.
| HTTP Status | Error Key | Cause & Resolution |
|---|---|---|
| 400 | Bad Request | Cause: Missing required fields, invalid attributes (e.g. malformed TIN), or structural JSON anomalies. Resolution: Traverse the errors array in the response to target the invalid field constraints, format properly, and re-submit. |
| 401 | Unauthorized | Cause: The API key credential is missing, malformed, or revoked. Resolution: Ensure your x-api-key is populated in the request header and that you are matching the correct environment bounds (live vs test). |
| 403 | Forbidden | Cause: Properly authenticated, but the key context is lacking specific scope permissions or the merchant account represents restricted access. Resolution: Review integration scopes within the dashboard to assure capability rights correspond to PRISM operations. |
| 429 | Too Many Requests | Cause: Network volume exceeds the rate envelope associated with your tier configuration. Resolution: Gracefully throttle via exponential backoff semantics checking the Retry-After header variable, or upgrade capacity constraints. |
curl -X POST https://api.taxstreem.com/v1/prism/batch-analyze-items \
-H "x-api-key: txsm_test_SK489c..." \
-H "Content-Type: application/json" \
-d '{ "batchId": "prism-batch-001", "documents": [ { "documentUrl": "https://storage.example.com/invoices/inv-00291.pdf", "invoiceId": "INV-00291", "currency": "NGN" }, { "documentUrl": "https://storage.example.com/invoices/inv-00292.xlsx", "invoiceId": "INV-00292", "currency": "NGN" } ] }'
{
"status": "accepted",
"message": "schedule accepted successfully",
"data": {
"id": "xaee2ddf-effvkfes",
"created_at": "2026-02-20T10:00:00Z"
}
}