Create invoice
Create an issued invoice or credit note.
Creates an issued invoice or credit note. invoice_type is always issued. invoiceNumber, invoiceDate, amountExclVat, and amountInclVat are required. sourceId is optional and defaults to invoiceNumber. If no counterpartyId is sent, identity fields are used to look up or create a counterparty. Expected payment is computed from the due date and this customerβs previous paid invoices. If no schedule is sent, Invunion creates a single payment. Issued invoices may auto-apply unused credit notes and unapplied cash.
Body parameters
| Name | Type | Required |
|---|---|---|
invoiceNumberInvoice number. Unique per tenant. This is how you identify the invoice later. Example: INV-2026-0042 | string Max 100 | Required |
invoiceDateInvoice date (YYYY-MM-DD). Example: 2026-09-01 | string No maximum | Required |
amountExclVatAmount excluding VAT, in major currency units unless the tenant stores minor units and sourceType is api. Example: 10000 | number | Required |
amountInclVatAmount including VAT. Example: 12000 | number | Required |
kindinvoice or credit_note. Default invoice. Allowed values invoicecredit_note | string No maximum | Recommended |
sourceTypeOrigin of the record. Use api for integrations. Default manual. Example: api | string Max 50 | Recommended |
recipientNameRecipient display name. Defaults from the resolved counterparty when omitted. Example: Leones Cars | string Max 255 | Recommended |
paymentScheduleCodePayment-schedule template code. If omitted, Invunion creates a single payment unless useDefaultPaymentSchedule is true. Example: NET-30 | string Max 50 | Recommended |
vatAmountVAT amount. If omitted, Invunion stores the difference of the two amounts. Example: 2000 | number | Optional |
currencyISO 4217 currency. Default EUR. Example: EUR | string Max 3 | Recommended |
dueDateDue date (YYYY-MM-DD). When present, paymentTermDays is not stored on the invoice. Example: 2026-10-01 | string No maximum | Recommended |
sourceIdOptional idempotency key from your system. Together with sourceType this is unique per tenant. Defaults to invoiceNumber β you do not need a separate source id. Example: INV-2026-0042 | string Max 255 | Optional |
externalReferenceYour order or billing reference. Example: LC-SO-9081 | string Max 255 | Optional |
descriptionLine description. Example: Fleet maintenance β September 2026 | string Max 1000 | Optional |
paymentMethodExpected payment channel. | string No maximum | Optional |
Allowed values cardtransferdirect_debitcashcheckcryptoother | ||
paymentTermDaysUsed only when dueDate is omitted, to compute due date from the invoice date. Not stored if dueDate is sent. Example: 30 | integer | Optional |
counterpartyIdExisting counterparty code (`account_code`). If omitted, identity fields below are used to look up or create one. Example: CPT-042 | string No maximum | Optional |
counterpartyAccountCodeCounterparty account_code for identity lookup (for example CPT-042). Example: CPT-042 | string Max 50 | Recommended |
counterpartyExternalReferenceCounterparty external reference. Example: ERP-1842 | string Max 255 | Optional |
counterpartyVatNumberCounterparty VAT number. Example: FR12345678901 | string Max 30 | Optional |
counterpartyEmailCounterparty email. Example: carl@leonescars.fr | string Max 255 | Optional |
counterpartyIbanOptional catalog IBAN to attach after the counterparty is resolved. Example: FR7630006000011234567890189 | string Max 64 | Optional |
counterpartyBicBIC for the catalog instrument. Example: BNPAFRPP | string Max 11 | Optional |
paymentMethodIdExisting catalog payment-method code to attach. Example: PM-001 | string No maximum | Optional |
originInvoiceIdFor credit notes, the invoice number of the invoice being credited. Example: INV-2026-0042 | string No maximum | Optional |
useDefaultPaymentScheduleIf true, apply the tenant default schedule. If omitted or false, Invunion creates a single payment. Allowed values truefalse | boolean | Optional |
installmentsExact installment plan. When present, this replaces any template. Each item needs dueDate and amount. | array | Optional |
dueDateInstallment due date (YYYY-MM-DD). Example: 2026-10-01 | string No maximum | Required |
amountInstallment amount, zero or greater. Example: 12000 | number | Required |
sequence1-based sequence. Example: 1 | integer | Optional |
labelOptional label. Example: Balance | string Max 100 | Optional |
analytic1Analytic axis 1. Example: SALES-EU | string Max 100 | Optional |
analytic2Analytic axis 2. Example: CHANNEL-DIRECT | string Max 100 | Optional |
metadataJSON object. At most 32 keys, nested depth 3, 8 KB serialized, and 64-character key names. Keys __proto__, constructor, and prototype are rejected. Example: {"erp_id":"INV-1842"} | object | Optional |
Errors
This operation can return the following errors in addition to generic HTTP failures.
| Error | HTTP code | Description |
|---|---|---|
Missing Bearer token | 401 | The Authorization header is missing or is not a Bearer token. |
Invalid or revoked API key | 401 | The API key is unknown, malformed, expired, or has been revoked. |
API key is missing scope invoices:write | 403 | The key does not include invoices:write. A write scope does not imply the matching read scope. |
Too many requests, please try again later | 429 | Wait and retry. The Retry-After header is the number of seconds to wait. |
Tenant ID required | 400 | The authenticated credential is not bound to a tenant. |
Validation failed | 400 | The body failed schema validation. details lists field and message. |
Unknown or inactive payment schedule. | 400 | paymentScheduleId or paymentScheduleCode did not match an active template. |
duplicate_invoice | 409 | An invoice with this invoice_number already exists. The message includes the number and existing_invoice_id. |
Internal server error | 500 | Unexpected server error. The JSON body includes correlationId. Retry with backoff. |