create_invoice
Create invoices in QuickBooks by specifying customer, line items, and optional details. Returns invoice data and a link to view it.
Instructions
Create an invoice. Accepts item/customer/department names (will lookup IDs automatically). Either customer_name or customer_id is REQUIRED — invoices must have a customer. Lines use SalesItemLineDetail (product/service references, not accounts). Returns invoice details and a link to view in QuickBooks.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| txn_date | Yes | Transaction date in YYYY-MM-DD format | |
| customer_name | No | Customer display name (e.g., 'Cash Sales'). Will be looked up to get ID. | |
| customer_id | No | Customer ID (use if you already know it, otherwise use customer_name) | |
| due_date | No | Due date in YYYY-MM-DD format (optional) | |
| department_name | No | Header-level department/location name (e.g., '20358', 'Cotati'). Will be looked up to get ID. | |
| department_id | No | Header-level department/location ID (use if you already know it, otherwise use department_name) | |
| memo | No | Private memo for the invoice (internal, not visible to customer) | |
| customer_memo | No | Customer-facing message visible on the invoice | |
| bill_email | No | Email address to send the invoice to. Required if you want QuickBooks to email the invoice. | |
| sales_term_ref | No | Payment terms name (e.g., 'Net 30', 'Due on receipt'). Will be looked up to get ID. | |
| allow_online_credit_card_payment | No | Allow customer to pay this invoice with a credit card online. Must be explicitly set — company defaults do not apply via API. | |
| allow_online_ach_payment | No | Allow customer to pay this invoice via bank transfer (ACH) online. Must be explicitly set — company defaults do not apply via API. | |
| doc_number | No | Reference number for the invoice (optional) | |
| lines | Yes | Array of line items. Each line references an item (product/service). Provide item_name OR item_id (name preferred). | |
| draft | No | If true, validate and show preview without creating (default: true) |