Learn how to integrate SmartBills API into your application and start extracting invoice data.
Learn how to integrate SmartBills API into your application and start extracting invoice data.
Before you begin, make sure you have:
No installation required! You can use cURL to make requests directly:
curl -X POST https://api.smartbills.com/v1/invoices/extract \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: multipart/form-data" \
-F "file=@invoice.pdf"
Install our JavaScript SDK:
npm install @smartbills/sdk
Install our Python SDK:
pip install smartbills-python
Upload an invoice file for processing:
/v1/invoices/extract
Extract data from an invoice file
::code-example{ curlExample="curl -X POST https://api.smartbills.com/v1/invoices/extract \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: multipart/form-data" \ -F "file=@invoice.pdf""
javascriptExample="const SmartBills = require('@smartbills/sdk');
const client = new SmartBills('YOUR_API_KEY');
const result = await client.invoices.extract({ file: fs.createReadStream('invoice.pdf') });
console.log(result);"
pythonExample="import smartbills
client = smartbills.Client('YOUR_API_KEY')
with open('invoice.pdf', 'rb') as file: result = client.invoices.extract(file=file)
print(result)"
responseExample="{ "id": "inv_123456789", "status": "processing", "created_at": "2024-01-15T10:30:00Z", "file_url": "https://files.smartbills.com/inv_123456789.pdf\" }" } ::
Check the status and retrieve the extracted data:
/v1/invoices/{id}
Get invoice extraction results
::code-example{ curlExample="curl -X GET https://api.smartbills.com/v1/invoices/inv_123456789 \ -H "Authorization: Bearer YOUR_API_KEY""
javascriptExample="const result = await client.invoices.get('inv_123456789'); console.log(result.extracted_data);"
pythonExample="result = client.invoices.get('inv_123456789') print(result.extracted_data)"
responseExample="{ "id": "inv_123456789", "status": "completed", "extracted_data": { "invoice_number": "INV-2024-001", "date": "2024-01-15", "total_amount": 1250.00, "currency": "USD", "vendor": { "name": "Acme Corp", "address": "123 Business St, City, State 12345" } } }" }
The SmartBills API has the following rate limits:
Plan | Requests per minute | Requests per hour |
---|---|---|
Free | 10 | 100 |
Pro | 100 | 1,000 |
Enterprise | 1,000 | 10,000 |
Each API response includes rate limit headers to help you track your usage:
X-RateLimit-Limit
: Your rate limit ceilingX-RateLimit-Remaining
: Remaining requests in the current windowX-RateLimit-Reset
: UTC timestamp when the rate limit resetsThe API returns standard HTTP status codes. Here are the most common ones:
Status Code | Description |
---|---|
200 | Success |
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Invalid API key |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal Server Error |