API overview
The programmatic API is authenticated with tenant API keys and lives under/api/v1.
Authenticate every request with:
Typical integration flow
1
Check balance
GET /api/v1/credits/balance — if balance is below creditCostPerInvoice, top up first.2
Top up (when needed)
List packages → start checkout → open the Stripe URL → confirm with
sessionId.3
Upload
One-step
POST /api/v1/invoices/upload, or init + attach for large files.4
Poll
GET /api/v1/invoices/:id until ready is true, then read data.Upload returns 202 Accepted immediately. Credits are deducted when the upload is accepted
(before OCR finishes). If the extraction queue is unavailable, credits are refunded and the
API returns 503.
statusUrl in upload responses is a relative path (for example /api/v1/invoices/{id}).
Prepend your API host (https://api.trysnapit.com in production).openapi/programmatic.json.
