{"ok":true,"commandType":"create-ar-invoice","module":"AR","mode":"write","summary":"Create an AR invoice.","payloadSchema":{"debtorCode":"required AutoCount debtor/customer code","docDate":"required or optional YYYY-MM-DD document date","amount":"optional single-line amount; lines is preferred for multiple lines","_arApRule":"AR = customer/debtor. Use debtorCode only for AR commands; do not send creditorCode for AR.","docNo":"optional AutoCount document number; omit to let AutoCount numbering generate it","dueDate":"optional YYYY-MM-DD due date","description":"optional document description/narration","ref":"optional reference","branchCode":"optional debtor/customer branch code/name where the customer uses branches","attention":"optional attention/contact person","contact":"optional contact person alias for attention","currencyCode":"optional currency code such as MYR","currencyRate":"optional exchange rate","inclusiveTax":"optional boolean","taxDate":"optional YYYY-MM-DD tax date","accountNo":"optional user-selected GL posting account for simple one-line payload; overrides the connector/default account","taxType":"optional tax type/code","lines":"optional array of GL/account rows for multi-line AR invoice, credit note, or debit note; each line can choose posting account with accountNo / accNo / glAccount","knockOffs":"optional array for credit/debit note knock-off where AutoCount supports it","userDefinedFields":"optional object of AutoCount user-defined fields"},"examplePayload":{"debtorCode":"300-A001","docDate":"2026-06-24","amount":100,"dueDate":"2026-07-24","description":"AR document created through API","ref":"API-REF-1001","branchCode":"MAIN","attention":"Accounts Department","contact":"Accounts Department","currencyCode":"MYR","inclusiveTax":false,"lines":[{"accountNo":"500-0000","description":"Service line 1","amount":100,"taxType":"S-0","taxCode":"S-0","taxAmount":0,"project":"PRJAPI","projNo":"PRJAPI","department":"HQ","deptNo":"HQ","classification":"022","userDefinedFields":{"APITEST":"API-LINE"}},{"accountNo":"501-0000","description":"Different posting account line","amount":50,"taxType":"S-0","taxCode":"S-0","project":"PRJAPI","projNo":"PRJAPI","department":"HQ","deptNo":"HQ","classification":"022"}],"knockOffs":[{"docType":"RI","docKey":"424508","docNo":"IV-000001","amount":100,"discountAmount":0,"taxAdjustment":0}],"userDefinedFields":{"APITEST":"API"}},"notes":"Requires write access permission. AR = customer/debtor. Use debtorCode only for AR commands; do not send creditorCode for AR. Use read-ar-outstanding-documents first when a knock-off needs docKey. For simple invoices, amount/accountNo still works. For multiple posting accounts, send lines and put accountNo on each line. AR/AP invoice/note posting account order is: lines[].accountNo/top-level accountNo, AutoCount default account only when needed, then safe recent same-party history where the connector has a proven read path.","nativePayload":{"supported":false,"sections":[{"name":"Master","fields":[]},{"name":"Details","fields":[]},{"name":"KnockOffDetails","fields":[]},{"name":"TransferDetails","fields":[]},{"name":"PaymentDetails","fields":[]},{"name":"Options","fields":[]}]}}