{"ok":true,"commandType":"create-ap-refund","module":"AP","mode":"write","summary":"Create an AP refund. Refund knocks off AP credit notes, not supplier invoices. Use docType PC or friendly CN alias; docKey is recommended.","payloadSchema":{"creditorCode":"required AutoCount creditor/supplier code","docDate":"required or optional YYYY-MM-DD document date","amount":"required total payment/refund amount","knockOffs":"optional array of documents to allocate this payment/refund against; docKey is recommended","_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","paymentMethod":"required or optional AutoCount Payment Method code such as CASH or MAYBANK","paymentBy":"optional payment type such as Cash, Cheque, Bank Transfer, Credit Card","chequeNo":"optional cheque/reference number","bankCharge":"optional bank charge amount","paymentAccountNo":"optional GL bank/cash account number","bankChargeAccountNo":"optional GL bank charge account number","creditCardApprovalCode":"optional credit-card approval code/reference","description":"optional payment/refund narration","userDefinedFields":"optional object of AutoCount user-defined fields"},"examplePayload":{"creditorCode":"400-S001","docDate":"2026-06-24","amount":100,"knockOffs":[{"docType":"PB","docKey":"424508","docNo":"PI-000001","amount":100,"discountAmount":0,"taxAdjustment":0,"gainLossAmount":0,"withholdingTaxAmount":0}],"paymentMethod":"CASH","paymentBy":"Cash","chequeNo":"API-PAY-1001","bankCharge":0,"paymentAccountNo":"110-0010","bankChargeAccountNo":"810-0000","creditCardApprovalCode":"","description":"AP payment/refund created through API","userDefinedFields":{"APITEST":"API"}},"notes":"Requires write access permission. Real AP refund knock-off save is proven against AP credit notes; CN aliases are normalized to PC. AP = supplier/creditor. Use creditorCode only for AP commands; do not send debtorCode for AP. For payment against invoices use RI for AR and PB for AP. For refund against credit notes use RC/ARCN for AR and PC/APCN for AP. Friendly aliases are normalized by the connector where supported.","nativePayload":{"supported":false,"sections":[{"name":"Master","fields":[]},{"name":"Details","fields":[]},{"name":"KnockOffDetails","fields":[]},{"name":"TransferDetails","fields":[]},{"name":"PaymentDetails","fields":[]},{"name":"Options","fields":[]}]}}