brc_create_sales_invoice_gen_ref
Creates a sales invoice with an auto-generated reference for companies configured for auto-generated sales references. Requires real products, explicit user confirmation, and valid sales reps.
Instructions
Creates a BRC sales invoice with an auto-generated reference using a raw BRC payload. Use when the company is configured for auto-generated sales references. Draft previews include a Missing or not provided section for blank customer phone or email only — warnings only, do not invent values. In the raw payload, the BRC "Note" field (JSON note) defaults to the customer name (BRC customer "Name" / JSON name) when omitted and must never be set to the product name; the BRC "Delivery To" address (JSON deliveryTo) is only included when explicitly provided. Optional. BRC "Note" field on the sales document (JSON field note). Leave blank to default it to the customer name (BRC customer "Name" / JSON name). Do not use the product name as the note. Only set this when the user explicitly provides a note. Optional. BRC "Delivery To" address (JSON field deliveryTo). Leave blank unless the user explicitly provides a delivery address. Do not invent or default a delivery address (for example "MCP Test"). Requires saleRepId and saleRepCode. Do not use default or demo sales rep values. If missing, list sales reps or ask the user to choose one before creating. Requires analysisCategoryId and accountCode from a Sales Analysis category on each product line. Do not default to CR01/Customer or the first listed category. Set confirmCrAnalysisCategory=true only after the user confirms a CR account code is intentional. When Gross Price Entry is enabled for sales invoicing, this tool requires priceBasis. Use priceBasis "gross" when unit prices are VAT-inclusive/gross, or priceBasis "net" when unit prices are VAT-exclusive/net. Do not tell the user to disable Gross Price Entry if they have provided priceBasis. 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. 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 |
|---|---|---|---|
| payload | Yes | ||
| priceBasis | No | 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 | Set true only after the user confirms a CR sales analysis account code is intentional for this product line. | |
| 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. |