{"ok":true,"commandType":"validate-ap-debit-note","module":"AP","mode":"read","summary":"Validate an AP debit note without saving.","payloadSchema":{"creditorCode":"required AutoCount creditor/supplier code","supplierDebitNoteNo":"supplier debit note number optional","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.","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","description":"optional document description/narration","ref":"optional reference","branchCode":"optional creditor/supplier 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":"required for simple one-line AP payload unless every line has accountNo; use a valid purchase/expense GL account","taxType":"optional tax type/code","lines":"recommended array of AP GL/account rows; each AP line must choose a valid posting account with accountNo / accNo / glAccount / postingAccountNo","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","supplierDebitNoteNo":"SDN-001","amount":100,"docDate":"2026-06-24","dueDate":"2026-07-24","description":"AP document created through API","ref":"API-REF-1001","branchCode":"MAIN","attention":"Accounts Department","contact":"Accounts Department","currencyCode":"MYR","inclusiveTax":false,"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"}],"knockOffs":[{"docType":"PB","docKey":"424508","docNo":"PI-000001","amount":100,"discountAmount":0,"taxAdjustment":0}],"userDefinedFields":{"APITEST":"API"}},"notes":"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":[]}]}}