Playbook
Bulk-uploading expense documents
Recording several incoming invoices at once — for example a month-end batch upload after a bank sync.
This playbook walks you through uploading several expense documents at once through the QUiCK Public API. The POST /2/expenses/create/ endpoint accepts at most 5 files per call; split larger batches.
Prerequisites
- An active QUiCK account and a Public API token
- PDF/JPG documents available on your machine
1. Set up the token
Configure authentication for every call:
export QUICK_TOKEN="..."
curl -H "Authorization: Token $QUICK_TOKEN" https://api.quick.riport.co.hu/1/pulse/Every request sends the Authorization: Token <token> header.
2. Base64-encode the files
The content field is Base64-encoded binary, not a raw file. Example (Node.js):
import { readFileSync } from 'node:fs';
const content = readFileSync('invoice.pdf').toString('base64');3. Batch upload
Send them in groups of at most 5 to POST /2/expenses/create/:
curl -X POST https://api.quick.riport.co.hu/2/expenses/create/ \
-H "Authorization: Token $QUICK_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"source": "public_api",
"expenses": [
{ "filename": "invoice-001.pdf", "content": "JVBERi0xLjQK..." },
{ "filename": "invoice-002.pdf", "content": "JVBERi0xLjQK..." }
]
}'The processed array in the response holds the ids of the created documents.
4. Store the processed ids
Iterate over the processed array and store the ids locally so you can follow the processing state.
5. Read the details
The state of an individual document comes from GET /2/expenses/{expenseId}/:
curl -H "Authorization: Token $QUICK_TOKEN" \
https://api.quick.riport.co.hu/2/expenses/42/Related endpoints
- POST/2/expenses/create/
- GET/2/expenses/{expenseId}/
Common pitfalls
More than 5 files in one request
`POST /2/expenses/create/` accepts at most 5 items in the `expenses` array per call. Split larger batches across several calls.
The content field is not Base64
`content` must be Base64-encoded binary. Raw bytes or a data-URL prefix (`data:application/pdf;base64,...`) will fail — send the plain Base64 string only.