API Reference
Integrate Unlockbill into your systems. All endpoints are JSON, authenticated via JWT (Bearer token).
🔐 Authentification
Get a JWT token via POST /api/v1/auth/login and pass it in the header Authorization: Bearer <token>.
curl -X POST https://api.unlockbill.com/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"vous@entreprise.rw","password":"votre_mdp"}'
# Response
{ "access_token":"eyJ...", "refresh_token":"eyJ...", "user":{...} }
📄 Document Extraction
/api/v1/extract/auto/scan
Automatically extracts an invoice (PDF or image). Detects document type, runs AI extraction, and auto-syncs with QuickBooks if EBM.
Required Headers
Authorization: Bearer <token>
Body (multipart/form-data)
file— PDF, PNG ou JPEG (max 10 Mo)
Response (201)
{
"success": true,
"document_type": "ebm_invoice",
"confidence": 0.95,
"scan_id": 42,
"filename": "facture.pdf",
"quickbooks_invoice_id": "QB-789"
}
/api/v1/extract/auto/
Lists and searches extracted invoices for the authenticated user.
Parameters
q— partial search by invoice number or client namedocument_type— filter by type (ebm_invoice, non_ebm_invoice, bank_card...)skip,limit— pagination (default 0, 20)
💼 QuickBooks
/api/v1/quickbooks/connect
Starts the QuickBooks OAuth 2.0 flow. Redirects to Intuit for authorization.
/api/v1/quickbooks/invoice/{scan_id}
Syncs an extracted invoice to QuickBooks. Returns the created QuickBooks ID.
📧 Ingestion par email (webhook)
/api/v1/email-ingestion/inbound
Receives an email with attachments, resolves the user via the ingestion address (invoices+<token>@domaine), and processes each attachment as an invoice import.
Security
HMAC-SHA256 signature required dans le header X-Webhook-Signature, computed with the shared secret key.
⏱ Rate Limiting
Upload endpoints are limited to 100 requests/minute and 1,000 requests/hour per user (per IP for email webhook). Beyond that, the API returns 429 Too Many Requests.