AI-extract draft bills from documents

POST /api/v1/bills/ai-create

Upload pasted text, PDFs, images, Excel files, or a CSV to extract draft bill entities using AI. Returns draft bills in 'received' status format ready for user review before creation.

Operation ID: ai_create_bill_payload_api_v1_bills_ai_create_post · View as markdown · OpenAPI slice

Authentication

Bearer token authentication. Pass your DayZero API token in the Authorization header and the target business UUID in x-business-id.

Request body

pasted_text string

Raw text content to extract a bill from. Limit 1 bill per text input. Mutually exclusive with pasted_text_s3_key.

pasted_text_s3_key string

S3 key of pasted text content. Limit 1 bill per text input. Mutually exclusive with pasted_text.

single_bill_s3_keys array · string

S3 keys of individual bill documents (PDFs, images, Excel). Each file is processed independently.

multi_bill_s3_key string

S3 key of a CSV file containing multiple bills.

Responses

201 Successful Response

items array · DraftBill requiredDraftBill

List of draft bill entities extracted by AI.

17 fields
vendor_name string

Vendor/company name extracted by AI. Use to match or create a vendor.

amount integer

Bill amount in cents extracted by AI.

description string

Description of what the bill is for.

bill_number string

Bill/invoice number from the vendor document.

bill_date string

Date of the bill (YYYY-MM-DD) extracted by AI.

expense_category string

Expense category suggested by AI (e.g., 'Office Supplies', 'Rent').

vendor_id string

Matched vendor UUID (if the vendor was found in the system).

currency string

Currency code (USD, CAD, AUD, EUR, or GBP). Defaults to USD.

type string

Bill type: 'recurring' or 'one_time'. Defaults to 'one_time'.

received_on string

Date bill was received (ISO 8601). Defaults to bill_date if available.

due_on string

Payment due date (ISO 8601). Maps from due_date.

s3_key string

S3 key of the source document for this bill.

ledger_id string

Matched expense ledger UUID (if matched from expense_category).

journal_entry_date string

Date for journal entry (ISO 8601). Defaults to received_on.

confidence number

AI confidence score for this extraction (0.0-1.0).

source string

Source type: 'pasted_text', 'single_file', or 'multi_file'.

source_filename string

Original filename or S3 key of the source document.

errors array · FileProcessingError FileProcessingError

List of per-file errors for files that could not be processed.

3 fields
s3_key string required

S3 key of the file that failed.

filename string

Original filename (if determinable from the S3 key).

error string required

Human-readable error description.

400 Bad Request - Invalid input

401 Unauthorized - Authentication required

403 Forbidden - Insufficient permissions

422 Validation Error

detail array · ValidationError ValidationError
5 fields
loc array · string | integer required
msg string required
type string required
input object
ctx object