Create Invoice
Creates and optionally sends a new invoice. Two request shapes are accepted (see below).
Authentication: X-API-KEY header (see Authentication).
Request body
| Field | Type | Description |
|---|---|---|
| invoiceNumber | string | Optional explicit invoice number. |
| clientName | string | Client to bill. |
| templateName | string | Invoice template to apply. |
| description | string | Invoice description. |
| dueDate | date | Due date. |
| taxRate | number | Tax rate applied. |
| discountPercent | number | Discount percentage. |
| paymentInstructions | string | Payment instructions text. |
| items[] | LineItem[] | Line items: description, quantity, rate, taxable, projectName. |
| sendTo | object | send flag, contacts list, emailTemplateName. |
Request
curl -X POST https://api.withmoxie.com/public/action/invoices/create \
-H "X-API-KEY: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"clientName": "Acme Kft.", "dueDate": "2026-08-01", "items": [{"description": "Website design", "quantity": 1, "rate": 1000, "taxable": true}], "sendTo": {"send": true}}'
Response
Returns an InvoiceMini including id, invoiceNumber, invoiceNumberFormatted, totals, currency, viewOnlineUrl, and the lineItems array (see Search Payable Invoices for the line-item shape).
{
"id": "66b0f2a1c3a9e40012ab34cd",
"invoiceNumber": 1042,
"invoiceNumberFormatted": "E-2026-042",
"clientId": "66b0f2a1c3a9e40012ab3400",
"status": "DRAFT",
"invoiceType": "STANDARD",
"currency": "HUF",
"subTotal": 1000.00,
"tax": 270.00,
"total": 1270.00,
"amountDue": 1270.00,
"viewOnlineUrl": "https://pay.withmoxie.com/i/...",
"payments": [],
"lineItems": [
{
"id": "line_1",
"description": "Website design",
"quantity": 1,
"unitPrice": 1000.00,
"taxable": true,
"lineTotal": 1000.00,
"type": "ADHOC",
"visible": true
}
]
}
note
A simpler shape (clientId, amount, dateDue, description, notes, sendTo) is also accepted and returns the full Invoice object.