v1
latestOpenAPI 3.0.32026-07-26362271803.3 KBCreate Invoice
Creates a new accounting invoice with line items and automatic journal entry generation.
This endpoint allows for comprehensive invoice creation with:
- Multiple line items with different products, rates, quantities, and tax handling
- Automatic accounts receivable journal entry creation
- Tax calculations and tax account handling
- Multi-currency support with exchange rate handling
- Product-based taxation rules
- Service date tracking for revenue recognition
- Contract and purchase order integration
- Stripe payment integration support
Key features:
- Credits revenue accounts for each line item amount
- Debits accounts receivable for the total amount
- Handles tax calculations with appropriate tax accounts
- Supports entity-specific currency conversions
- Creates proper double-entry accounting transactions
- Validates client, entity, and product relationships
- Integrates with Stripe for payment processing
Requirements:
- All referenced products, clients, and entities must exist and be active
- Client must be of type 'customer'
- Line items must have valid amounts, quantities, and rates
- Currency must be valid for the entity
- Tax calculations must comply with configured tax rules
Request body
Withholding context for the invoice's entity.
estimated_withholding_amount covers only the remaining amount due (null once fully paid); withheld_to_date is the signed sum of posted withholding, so actuals replace the estimate as receipts come in. Certificate-based schemes estimate from the entity certificate's rate (falling back to the scheme default); rules-based schemes sum each line's selected rate over the line amount, scaled by the remaining-due proportion.
ID of the transaction in Anrok (set when transaction is created)
Discount amount for the invoice
Discount amount applied based on payment term early payment discount
True for invoices imported via opening balance migration (no finalization JE).
Accounts Receivable account for this invoice. Populated for single-AR and migrated invoices. NULL for multi-AR invoices (aging uses ChartTransactions instead).
Response
Withholding context for the invoice's entity.
estimated_withholding_amount covers only the remaining amount due (null once fully paid); withheld_to_date is the signed sum of posted withholding, so actuals replace the estimate as receipts come in. Certificate-based schemes estimate from the entity certificate's rate (falling back to the scheme default); rules-based schemes sum each line's selected rate over the line amount, scaled by the remaining-due proportion.
ID of the transaction in Anrok (set when transaction is created)
Discount amount for the invoice
Discount amount applied based on payment term early payment discount
True for invoices imported via opening balance migration (no finalization JE).
Accounts Receivable account for this invoice. Populated for single-AR and migrated invoices. NULL for multi-AR invoices (aging uses ChartTransactions instead).