Create sales invoice
bukku_create_sales_invoiceWRITE: create a sales invoice for a customer. status defaults to draft (nothing posted to the ledger), status ready finalizes it and affects the books. payment_mode credit needs term_items, cash needs deposit_items. Companies with MyInvois submission switched on must pass myinvois_action when status is ready: NORMAL (not sent), EXTERNAL (already validated elsewhere) or VALIDATE (submits the invoice to LHDN MyInvois, which cannot be taken back). Look up contact, account, term and tax code ids first. POST /sales/invoices.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | Invoice date, yyyy-mm-dd. | |
| items | Yes | Invoice lines. | |
| title | No | ||
| number | No | Invoice number, blank uses the default number format. | |
| status | No | draft (default) or ready. | |
| number2 | No | Reference number. | |
| remarks | No | ||
| tax_mode | Yes | Whether unit prices include tax. | |
| contact_id | Yes | Customer contact id (bukku_list_contacts type customer). | |
| term_items | No | Payment terms, for payment_mode credit. | |
| description | No | ||
| payment_mode | No | credit (needs term_items) or cash (needs deposit_items). | |
| currency_code | Yes | Invoice currency, for example MYR. Use the company's home currency unless invoicing in another one. | |
| deposit_items | No | Payment received, for payment_mode cash. | |
| exchange_rate | Yes | Rate from the home currency to currency_code. Use 1 when currency_code is the home currency. | |
| myinvois_action | No | MyInvois handling, only with status ready. |