brc_batch_sales_invoices
Process a batch of up to 5 sales invoices with built-in validation: blocks placeholder product IDs, checks VAT categories, confirms CR analysis categories, and verifies counterparty. User confirmation required before posting.
Instructions
Processes a batch of sales invoices. Batch sales invoices apply the same safety checks as single sales invoices: productId 0/1 placeholder blocking before draft and posting; Sales VAT category validation before draft and posting; Gross Price Entry priceBasis handling; CR analysis category confirmation; and counterparty confirmation covering all listed customers. If the batch includes multiple customers, confirming means confirming all listed customers, not just one. Set confirmCrAnalysisCategory=true at batch level only after the user confirms CR sales analysis account codes are intentional. Per item, the BRC "Note" field (JSON note) defaults to the customer name when omitted (never the product name), and the BRC "Delivery To" address (JSON deliveryTo) is only included when explicitly provided. Do not invent productId values and do not use productId 0 or 1 as placeholders. productId 0 and 1 are treated as placeholders and are blocked at runtime before the draft preview and before posting. If a product line is needed, first call brc_list_products and use a real product from the connected company. If no suitable product exists, ask the user whether to create/select a product, or use a service/non-product line only if the endpoint supports it. Sales invoices must use Sales VAT rates. Purchase/non-Sales VAT rates are blocked before draft and before posting, even if the VAT percentage matches. Maximum 5 items per batch request. First call without confirmWrite: true returns confirmation_required and a payload preview — show a plain-English draft in chat, then retry with confirmWrite: true only after explicit user confirmation in a later message. Passing preflight is not confirmation. Also requires confirmCounterpartyExplicit: true once the user has explicitly named or confirmed the customer/supplier in the current conversation. Do not reuse a counterparty from an earlier draft without that confirmation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | Batch items to process. Maximum 5 items per request. | |
| priceBasis | No | Applies to every sales invoice/credit note item in this batch. Required when Gross Price Entry is enabled. Use `gross` when unit prices are VAT-inclusive/gross. Use `net` when unit prices are VAT-exclusive/net. | |
| companyName | Yes | Company context name, for example YOUR-COMPANY-NAME. | |
| confirmWrite | No | Must be true only after a plain-English draft has been shown in the current conversation and the user explicitly confirmed posting (for example yes, create it / post it now / confirm). Never set true on the first call or because the user initially asked to create something. | |
| confirmCrAnalysisCategory | No | Applies to every sales document item in this batch. Set true only after the user confirms a CR (customer) sales analysis account code is intentional for these product lines. | |
| confirmCounterpartyExplicit | No | Must be true only after the user explicitly named or confirmed the customer, supplier, or other counterparty in the current conversation. Never set true because a customer or supplier appeared in an earlier draft, was inferred from context, or was filled in without the user's explicit choice in this conversation. |