Merit Write Sales
merit_write_salesPreview an unsent sales invoice for Merit, returning operation details and a confirmation code; confirming writes a real accounting invoice.
Instructions
Preview-only write tool. Does not execute changes; returns intended operation details and a confirmation_code for merit_write_sales_confirm. Create unsent accounting invoices, not unposted drafts. Delivery (email/e-invoice), deletion, and credit invoices are handled manually in Merit and are not exposed by this server. Actions: sales_invoice_create: Create an unsent accounting invoice through Merit v1 /sendinvoice, NOT an unposted draft. Restricted schema: Customer={Id: customer GUID}; DocDate, TransactionDate, DueDate as YYYYMMDD; InvoiceNo (string), CurrencyCode='EUR', PriceInclVat=false, singular InvoiceRow list, TaxAmount, TotalAmount (VAT-exclusive). Optional FComment and HComment text. Each row requires Item={Code, Description, UOMName}, Quantity>0, Price>=0, TaxId GUID, Account. Read items_list first; Code must exactly match an existing non-stock item. The server verifies items again at confirmation and refuses missing, stock, or unrecognized items. Do not supply Item.Type. Use InvoiceRow (singular), not InvoiceRows; UOMName belongs inside Item, not on the row. Resolve company-specific TaxId GUIDs via taxes_list; never invent them. TaxAmount entries are {TaxId, Amount>=0} and must cover exactly the row TaxIds. TotalAmount must be positive and match the sum of row Quantity × Price, rounded per row to cents. Unknown fields are rejected at every level, including Payment, AccountingDoc, DelivNote, discounts, rounding adjustments, and item-creation fields. Negative quantities/prices are not supported. Choose InvoiceNo using the company's numbering convention; no automatic allocation is provided. Confirmation creates a real, unsent accounting invoice in Merit. It can affect the ledger and reports before delivery; this is NOT an unposted draft. Only the preview is non-writing. Review before confirming; send manually in Merit.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | ||
| action | Yes | ||
| bank_id | No | ||
| filters | No | ||
| payload | No | ||
| confirmed | No | ||
| delivnote | No | ||
| add_attachment | No | ||
| confirmation_code | No |