{"ok":true,"commandType":"validate-ap-invoice","module":"AP","mode":"read","summary":"Validate an AP invoice without saving.","payloadSchema":{"creditorCode":"required AutoCount creditor/supplier code","supplierInvoiceNo":"required supplier invoice number","docNo":"optional AutoCount document number; omit to let AutoCount numbering generate it","docDate":"required or optional YYYY-MM-DD document date","dueDate":"optional YYYY-MM-DD due date","ref":"optional reference","currencyCode":"optional currency code such as MYR","inclusiveTax":"optional boolean","project":"optional top-level project fallback for all AP invoice detail lines","projNo":"project code alias","projectNo":"project code alias","department":"optional top-level department fallback","deptNo":"department code alias","lines":"recommended array of AP GL/account rows; each AP line must choose a valid posting account with accountNo / accNo / glAccount / postingAccountNo","accountNo":"required for simple one-line AP payload unless every line has accountNo; use a valid purchase/expense GL account","amount":"optional single-line amount; lines is preferred for multiple lines","_arApRule":"AP = supplier/creditor. Use creditorCode only for AP commands; do not send debtorCode for AP.","description":"optional document description/narration","branchCode":"optional creditor/supplier branch code/name where the customer uses branches","attention":"optional attention/contact person","contact":"optional contact person alias for attention","currencyRate":"optional exchange rate","taxDate":"optional YYYY-MM-DD tax date","taxType":"optional tax type/code","knockOffs":"optional array for credit/debit note knock-off where AutoCount supports it","userDefinedFields":"optional object of AutoCount user-defined fields"},"examplePayload":{"creditorCode":"400-S001","supplierInvoiceNo":"SUP-INV-1001","docDate":"2026-06-24","dueDate":"2026-07-24","ref":"API-REF-1001","currencyCode":"MYR","inclusiveTax":false,"project":"PRJAPI","projNo":"PRJAPI","department":"HQ","lines":[{"accountNo":"610-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":"620-0000","description":"Different posting account line","amount":50,"taxType":"S-0","taxCode":"S-0","project":"PRJAPI","projNo":"PRJAPI","department":"HQ","deptNo":"HQ","classification":"022"}],"description":"AP document created through API","branchCode":"MAIN","attention":"Accounts Department","contact":"Accounts Department","knockOffs":[{"docType":"PB","docKey":"424508","docNo":"PI-000001","amount":100,"discountAmount":0,"taxAdjustment":0}],"userDefinedFields":{"APITEST":"API"}},"notes":"Use validate before create when AI imports many supplier bills. Posting account order is: lines[].accountNo/top-level accountNo, AutoCount default purchase account, then recent AP invoice detail account for the same creditor. If no account is found, connector returns a clear validation error before AutoCount save. Send top-level project/projNo to apply one project to every line, or send line-level project/projNo for different projects per line. AP = supplier/creditor. Use creditorCode only for AP commands; do not send debtorCode for AP. Use read-ap-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":[]}]}}