Create invoice header and line items
Creates an invoice along with its line items. The invoice header and items are created in separate transactions.
Features
- Create invoice header fields (date, amount, vendor, notes, etc.)
- Create new line items.
- Attach custom metadata fields to invoice header and line items (requires account-level custom field spec configuration).
Use Cases
- Programmatic invoice creation from external systems.
Authentication
Headers
API version to use (optional, defaults to latest). Supported values: 1.0.0, 1.1.0.
Client-generated unique key (UUID/ULID recommended). JSON requests: the first 2xx response is cached for 24h and replayed on a same-key retry with a matching body; a different body returns 422. Non-JSON requests (e.g. file uploads): the key is single-use — any same-key retry returns 422 regardless of body. See Idempotency for full details.
Request
Header-level dimension mappings. Keys are dimension types (e.g., ‘DEPARTMENT’, ‘CLASS’) and values are erp_dimension_id strings from the GET /dimensions endpoint. If omitted, no dimensions are set. Invalid dimension types or IDs return a 400 error.
Header-level custom metadata fields for this invoice. Keys and value types are validated against the custom field spec configured for your account in Ottimate.
Requirements: Custom fields must be configured for your account before use. Sending custom_fields when no spec is configured returns a 400 error. Unrecognised keys return a 400 error.
Behaviour: Omitted keys are filled with their configured default values
List of HTTPS image URLs to download and attach to the invoice. Supported formats: PDF, JPG, JPEG, PNG.
List of base64-encoded images to attach to the invoice. Supported formats: PDF, JPG, JPEG, PNG.
Optional, write-only. Marks an already-processed invoice as approved + exported, skipping Ottimate’s approval workflow. archived: already paid — filed as historical/inactive, excluded from billpay/autopay. verified: not paid — stays active and payable via billpay/autopay. Choose carefully: sending verified for an already-paid invoice risks double payment. Distinct from the status field returned in the response.
Response
The status of the created invoice (e.g., ‘incomplete’, ‘processing’).
Attached invoice images. Only present if image_urls or raw_images were provided.

