Ledgerize API
Convert bank statement PDFs into structured data. Authenticate with an API key sent in the X-Api-Key header. No upstream vendor details are required or exposed.
Authentication
Header X-Api-Key must be present on every request. Keys are managed in your Ledgerize account.
Quickstart (cURL)
# 1) Upload a PDF curl -s -X POST -H "X-Api-Key: $LEDGERIZE_API_KEY" -F file=@statement.pdf https://ledgerize.ai/api/v1/files # => { "uuid": "c2f...", "pages": 12 } # 2) Convert to JSON curl -s -X POST -H "X-Api-Key: $LEDGERIZE_API_KEY" -H "Content-Type: application/json" -d '{"ids":["c2f..."], "format":"JSON"}' https://ledgerize.ai/api/v1/convert # => { "jobId": "j_123", "accepted": ["c2f..."] } # 3) Poll status curl -s -H "X-Api-Key: $LEDGERIZE_API_KEY" https://ledgerize.ai/api/v1/jobs/j_123 # 4) Fetch result (JSON) curl -s -H "X-Api-Key: $LEDGERIZE_API_KEY" https://ledgerize.ai/api/v1/jobs/j_123/result
Node.js Example
import fs from 'fs/promises'; const key = process.env.LEDGERIZE_API_KEY; const base = 'https://ledgerize.ai'; // Upload const fd = new FormData(); fd.append('file', new Blob([await fs.readFile('statement.pdf')], { type: 'application/pdf' }), 'statement.pdf'); const up = await fetch(base + '/api/v1/files', { method: 'POST', headers: { 'X-Api-Key': key }, body: fd }).then(r=>r.json()); // Convert const job = await fetch(base + '/api/v1/convert', { method: 'POST', headers: { 'X-Api-Key': key, 'Content-Type':'application/json' }, body: JSON.stringify({ ids:[up.uuid], format:'JSON' }) }).then(r=>r.json()); // Poll & result let status; do { status = await fetch(base + '/api/v1/jobs/' + job.jobId, { headers: { 'X-Api-Key': key } }).then(r=>r.json()); } while(status.status!=='completed'); const result = await fetch(base + '/api/v1/jobs/' + job.jobId + '/result', { headers: { 'X-Api-Key': key } }).then(r=>r.json()); console.log(result.normalised.slice(0,3));
Endpoints
POST /api/v1/files
Upload a PDF using multipart/form-data. Response includes a uuid for conversion.
POST /api/v1/files/{uuid}/password
Provide a password for a protected PDF.
POST /api/v1/convert
Start a conversion for one or more uuids. Supports formats JSON, CSV, XLS.
GET /api/v1/jobs/{jobId}
Check job status.
GET /api/v1/jobs/{jobId}/result
Retrieve converted data.
OpenAPI
Download the OpenAPI spec: /openapi/openapi.yaml
Postman
Import the Postman collection: /postman/ledgerize.postman_collection.json
Error Codes
- AUTH_INVALID_KEY: invalid or missing API key (401)
- RATE_LIMITED: exceeded per-key rate limit (429)
- FILE_REQUIRED: missing multipart file field (400)
- PASSWORD_REQUIRED: missing password payload (400)
- UPLOAD_FAILED, CONVERT_FAILED, SET_PASSWORD_FAILED: upstream/processing error (5xx)
Notes
- Rate limit: 60 requests/min per API key by default.
- Credits are debited on conversion based on page count.
- Error responses are normalized with a stable error.code.
- Typical PDF size limit: 25MB. Contact us for higher limits.