qb_create_invoice
Creates a QuickBooks invoice from customer and line items using a preview and confirm code, and validates the subtotal before booking to prevent incorrect totals or duplicate reference numbers.
Instructions
Creates an invoice.
lines, in invoice order: item line {"item": exact item full name, "description", "quantity", "rate"} (or "amount" instead of quantity x rate), optional "sales_tax_code" per line; text-only line (e.g. a product-group heading) {"description": "..."} without item. sales_tax_code: default SalesTaxCodeRef for item lines (e.g. "Non"). currency: optional check -- refused if the customer's currency differs (the invoice currency is always the customer's currency). exchange_rate: home-currency units per 1 unit of invoice currency. expected_total: the invoice SUBTOTAL, i.e. the sum of the lines excluding sales tax. Refused before booking if the lines add up to something else; checked again after booking against QuickBooks' own Subtotal, and an invoice that differs is removed again immediately. Without expected_total the same check is made against the subtotal of the preview. Sales tax is computed by QuickBooks on top and returned as sales_tax_total / total. Refuses a ref_number that already exists, unknown customer or items. Two steps (preview + confirm_code).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"customer": "<customer>",
"txn_date": "<txn_date>",
"ref_number": "<ref_number>",
"lines": "<lines>"
},
"name": "qb_create_invoice"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| memo | No | ||
| lines | Yes | ||
| terms | No | ||
| run_id | No | ||
| currency | No | ||
| customer | Yes | ||
| due_date | No | ||
| template | No | ||
| txn_date | Yes | ||
| po_number | No | ||
| ar_account | No | ||
| ref_number | Yes | ||
| confirm_code | No | ||
| exchange_rate | No | ||
| expected_total | No | ||
| sales_tax_code | No | ||
| expected_company_file | No |