Create invoice
Create a sales invoice for a customer with one or more lines.
POST https://cotlet.dev/api/v1/myob/customers/{customer_id}/invoices
Creates an open sales invoice and returns its number, tax, total and balance due. Layout service takes free-text lines, item takes item codes from your Items List and professional also records the dates the work was done. Due date follows the customer terms unless you pass due_date. The invoice is not emailed until you call send_invoice. By default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| customer_id string required | string | Customer card ID from list_customers, e.g. CUS000012. |
| date date | date | Invoice date. Default: today. |
| due_date date | date | Due date. Default: from the customer payment terms. |
| layout enum | enum | service, item or professional. Default: service. |
| lines array required | array | Objects with description or item_code, quantity, unit_price and tax_code, e.g. GST. |
| tax_inclusive boolean | boolean | true if unit prices include tax. Default: false. |
| comment string | string | Text shown on the invoice. |
Request
curl -X POST https://cotlet.dev/api/v1/myob/customers/CUS000012/invoices \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"date":"2026-10-14","layout":"service","lines":[{"description":"Bookkeeping, October","quantity":1,"unit_price":1000,"tax_code":"GST"}]}' result = client.call("myob", "create_invoice", {"customer_id":"CUS000012","date":"2026-10-14","layout":"service","lines":[{"description":"Bookkeeping, October","quantity":1,"unit_price":1000,"tax_code":"GST"}]}) const result = await cotlet.call('myob', 'create_invoice', {"customer_id":"CUS000012","date":"2026-10-14","layout":"service","lines":[{"description":"Bookkeeping, October","quantity":1,"unit_price":1000,"tax_code":"GST"}]}); cotlet call myob create_invoice --data '{"customer_id":"CUS000012","date":"2026-10-14","layout":"service","lines":[{"description":"Bookkeeping, October","quantity":1,"unit_price":1000,"tax_code":"GST"}]}' Example response
{
"invoice_number": "00000142",
"customer_id": "CUS000012",
"customer": "Harbour Cafe Pty Ltd",
"status": "open",
"date": "2026-10-14",
"due_date": "2026-10-28",
"subtotal": 1000,
"tax": 100,
"total": 1100,
"balance_due": 1100
}