Skip to main content

Create Invoice

POST /public/action/invoices/create

Creates and optionally sends a new invoice. Two request shapes are accepted (see below).

Authentication: X-API-KEY header (see Authentication).

Request body

FieldTypeDescription
invoiceNumberstringOptional explicit invoice number.
clientNamestringClient to bill.
templateNamestringInvoice template to apply.
descriptionstringInvoice description.
dueDatedateDue date.
taxRatenumberTax rate applied.
discountPercentnumberDiscount percentage.
paymentInstructionsstringPayment instructions text.
items[]LineItem[]Line items: description, quantity, rate, taxable, projectName.
sendToobjectsend 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.