BillExtractor API Documentation

Complete API reference for integrating with BillExtractor through Zapier and custom applications. Extract key information from invoices, receipts, and financial documents.

Authentication

All API requests require authentication using an API key in the request headers.

Getting Your API Key: Users can generate their API key from the BillExtractor Dashboard → Data Sync → Connect Zapier. Copy the generated key and use it in all API requests.

Request Headers

Header Value Description
X-API-Key your_api_key_here Your unique API key for authentication
Content-Type application/json Required for POST requests with JSON body

Example Request

curl -X GET "https://billextractor.com/api/zapier/test-connection" \
  -H "X-API-Key: your_api_key_here"

Example Response (Success)

{
  "status": "connected",
  "user": {
    "email": "user@example.com",
    "credits": 29
  }
}

Example Response (Error - 401)

{
  "error": "Invalid or inactive API key"
}

API Endpoints

The following endpoints are used by the Zapier integration and can also be called directly from custom applications.

GET/api/zapier/test-connection

Purpose: Verify API key validity and test connection to the BillExtractor API.

Parameters

This endpoint has no query parameters or request body.

Response (Success - 200)

{
  "status": "connected",
  "user": {
    "email": "user@example.com",
    "credits": 29
  }
}

Response (Error - 401)

{
  "error": "Invalid or inactive API key"
}

GET/api/zapier/key-info

Purpose: List recently extracted key information from invoices and receipts. This is the primary trigger endpoint for Zapier workflows.

Query Parameters

Parameter Type Required Description
since string Optional ISO 8601 timestamp (e.g., 2024-01-01T00:00:00). Only return extractions after this time.
limit integer Optional Number of results to return. Default: 100, Max: 1000

Example Request

curl -X GET "https://billextractor.com/api/zapier/key-info?since=2026-09-01T00:00:00&limit=20" \
  -H "X-API-Key: your_api_key_here"

Response (Success - 200)

[
  {
    "id": 456,
    "fileName": "invoice.pdf",
    "createdAt": "2026-09-14T10:30:00+08:00",
    "invoice_number": "INV-2026-001",
    "invoice_date": "2026-09-14",
    "date_of_issue": "2026-09-14",
    "date_due": "2026-10-14",
    "total": "1,234.56",
    "subtotal": "1,000.00",
    "subtotal_less_discount": "",
    "tax_rate": "23.456%",
    "total_tax": "234.56",
    "discount": "",
    "shipping_handling": ""
  },
  ...
]
Note: The response includes both standard fields (id, fileName, createdAt) and dynamic fields extracted from the document (invoice_number, total, etc.). The dynamic fields vary based on the document type and content.

POST/api/zapier/extract-key-info

Purpose: Extract structured key information from invoices, receipts, and financial documents using AI.

Request Body

{
  "pdfUrl": "https://example.com/invoice.pdf",
  "fileName": "invoice.pdf"
}

Parameters

Field Type Required Description
pdfUrl string Required Publicly accessible URL to the PDF file. The URL must not require authentication.
fileName string Optional Name of the file for identification. Default: "invoice.pdf"

Example Request

curl -X POST "https://billextractor.com/api/zapier/extract-key-info" \
  -H "X-API-Key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "pdfUrl": "https://drive.google.com/uc?export=download&id=FILE_ID",
    "fileName": "vendor_invoice.pdf"
  }'

Response (Success - 200)

{
  "status": "completed",
  "fileName": "vendor_invoice.pdf",
  "invoice_number": "INV-2026-001",
  "invoice_date": "2026-09-14",
  "date_of_issue": "2026-09-14",
  "date_due": "2026-10-14",
  "total": "1,234.56",
  "subtotal": "1,000.00",
  "subtotal_less_discount": "",
  "tax_rate": "23.456%",
  "total_tax": "234.56",
  "discount": "",
  "shipping_handling": ""
}

Response (Error - 400)

{
  "error": "Failed to download PDF from URL. Please ensure the URL is publicly accessible and points to a valid PDF file."
}

Response (Error - 500)

{
  "error": "Extraction failed: Unable to parse document structure"
}
Credits: This operation consumes 1 credit from your account.

Extracted Fields: The response includes all successfully extracted fields. Fields that could not be extracted will be omitted from the response. Common fields include: invoice_number, invoice_date, date_of_issue, date_due, total, subtotal, tax_rate, total_tax, discount, shipping_handling, vendor_name, customer_name, etc.

Error Responses

The API uses standard HTTP status codes to indicate success or failure of requests.

HTTP Status Description Common Causes
200 OK Request completed successfully N/A
400 Bad Request Invalid request parameters Missing required fields, invalid URL format, non-PDF file
401 Unauthorized Authentication failed Invalid or missing API key, inactive integration
403 Forbidden Access denied Insufficient credits, account restrictions
404 Not Found Resource not found Extraction ID does not exist
500 Internal Server Error Server-side error Processing failure, timeout, unexpected error

Error Response Format

{
  "error": "Descriptive error message explaining what went wrong"
}

Rate Limits & Credits

BillExtractor uses a credit-based system to track API usage. Each extraction operation consumes credits from your account.

Credit Allowances

Plan Credits Period
Anonymous (no login) 3 Per day (rolling window)
Registered (free) 30 Per day (rolling window)
Starter 400 Per month
Growth 1,000 Per month
Business 4,000 Per month

Credit Consumption

Checking Credits

You can check your remaining credits by calling the test-connection endpoint:

curl -X GET "https://billextractor.com/api/zapier/test-connection" \
  -H "X-API-Key: your_api_key_here"

# Response:
{
  "status": "connected",
  "user": {
    "email": "user@example.com",
    "credits": 29  // Remaining credits
  }
}

Best Practices

Support

For questions, issues, or feedback about the API:

Response Time: We typically respond to support inquiries within 24 hours during business days.