createInvoice
Create a draft invoice for a customer. Returns the created draft, which is not sent to the customer until issueInvoice. Name the customer with the id of a getCustomers match: as invoice.companyRef when its type is company, or as invoice.membershipRef when its type is user; pass invoice.subscriptionRef instead to invoice a subscription. Pass exactly one of the three. The invoice is created in the customer's location and currency. items are custom lines: product.title, a whole quantity, and unitAmount, the price of one unit in major units (12.5 is 12.50), plus tax.rate only to override the location tax rate. Give every item the same companyRef, membershipRef or subscriptionRef as the invoice, and leave invoiceRef, type and discounts out. includeUpcomingItems also adds the customer's pending invoice items. The due date follows the location default unless dueType is date with dueDate or days with dueDays. Call getCustomers to list valid customerRef values. The route is not idempotent: after a failure or timeout, check the result with the list tool before calling again, or a second record is created. Never invent UUIDs; only use values from prior tool responses.
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": {
"invoice": "<invoice>"
},
"name": "createInvoice"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | No | Invoice items to add on creation. | |
| invoice | Yes | Invoice to create. | |
| includeUpcomingItems | No | Whether to include upcoming items from active subscriptions. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| invoice | Yes |