{"ok":true,"commandType":"update-purchase-return","module":"Purchase","mode":"write","summary":"Update purchase return header/contact fields and supported detail rows.","payloadSchema":{"docNo":"required existing document number (selector)","reason":"required business reason","docDate":"optional Document date. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","creditorCode":"optional Supplier/creditor code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","creditorName":"optional Supplier display name. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","purchaseAgent":"optional Purchase agent. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","agent":"optional Purchase agent. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","purchaseLocation":"optional Purchase stock location. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","location":"optional Purchase stock location. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","ref":"optional Reference. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","description":"optional Header description. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","displayTerm":"optional Credit term. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","term":"optional Credit term. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","address1":"optional Invoice address line 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","invAddr1":"optional Invoice address line 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","phone1":"optional Phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","phone":"optional Phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","attention":"optional Attention/contact. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","contact":"optional Attention/contact. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","branchCode":"optional Branch code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","currencyCode":"optional Currency code. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","currencyRate":"optional Currency rate. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","note":"optional Rich-text Note is stored as canonical RTF; verification compares visible text semantics, not raw bytes. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","remark1":"optional Remark 1. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","remark2":"optional Remark 2. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","remark3":"optional Remark 3. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","remark4":"optional Remark 4. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","refDocNo":"optional Reference document number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","shipVia":"optional Shipping method. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","shipInfo":"optional Shipping info. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","supplierDONo":"optional Supplier delivery order number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","supplierInvoiceNo":"optional Supplier invoice number; distinct from SupplierCNNo on purchase returns. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","dueDate":"optional Due date where writable and nullable in the installed SDK. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","address2":"optional Invoice address line 2. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","invAddr2":"optional Invoice address line 2. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","address3":"optional Invoice address line 3. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","invAddr3":"optional Invoice address line 3. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","address4":"optional Invoice address line 4. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","invAddr4":"optional Invoice address line 4. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","phone2":"optional Secondary phone. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","fax1":"optional Fax number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","fax":"optional Fax number. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","inclusiveTax":"optional Tax-inclusive pricing where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","taxDate":"optional Tax date where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","taxEntityID":"optional Tax entity ID where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","project":"optional Header project where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","projNo":"optional Header project where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","department":"optional Header department where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","deptNo":"optional Header department where writable. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","supplierCreditNoteNo":"optional Purchase-return SupplierCNNo (supplier credit note number); not SupplierInvoiceNo. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","supplierCNNo":"optional Purchase-return SupplierCNNo (supplier credit note number); not SupplierInvoiceNo. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","userDefinedFields":"optional Existing defined UDF values via userDefinedFields require native save/readback verification; native UDF acceptance unproven: no suitable existing fixtures. No new UDF definitions are created. Omitted stays unchanged; null or empty clears only optional string/nullable fields.","Master":"optional header object of public SDK scalar fields","nativeFields":"optional native header container: { Master: { SDKField: value } }","validateOnly":"optional boolean; true runs native preflight without Save, returning saved:false; no persistence proof","detailMode":"explicit update | append | replace | delete when editing lines; omit lines and detailMode for header-only updates","lines":"optional detail array; update/delete select existing rows by dtlKey; append adds rows; replace replaces the detail set"},"examplePayload":{"docNo":"PR-000001","reason":"Correct supplier reference","description":"Updated purchase header"},"examples":[],"payloadEnums":{},"requiredPayloadFields":["docNo","reason"],"conditionalPayloadRules":{},"notes":"Install local-mvp-2026.09.30.01 or later on the selected connector before using this update contract; cloud publication does not install or upgrade customer connectors. Check installed capabilities first; never trial writes against an older or unconfirmed build. Strict purchase update contract: friendly top-level fields, header Master or nativeFields.Master, and lines[].nativeFields map to public SDK scalar fields. Actual writable fields vary by document and installed SDK; this is not blanket all-field certification. Unknown or nonwritable requested fields are rejected before Save. Omitted fields stay unchanged; explicit null or empty values clear only optional string/nullable fields. Header-only updates do not require lines. Send explicit detailMode update, append, replace or delete for line edits; use dtlKey as a selector for existing rows. Calculated header totals, system keys, linkage and eInvoice lifecycle fields are protected. Existing eInvoice, linked-document and payment rules remain in force. validateOnly:true performs native preflight without Save and returns saved:false; preflight success is not persistence proof. After Save, a fresh SDK View reload compares requested persisted values: writeVerification.matched must be true for verified save success. A mismatch returns ok=false even when saved=true; never treat Save alone as persistence proof or blindly retry. Returned fields and lines contain the reloaded available document data; inspect fields.readErrors for public SDK getter failures, not silent omissions. Rich-text Note is stored as canonical RTF; compare visible text semantics, not raw bytes. Existing userDefinedFields are supported when defined and require explicit native save/readback verification; native UDF acceptance unproven: no suitable existing fixtures. No new UDF definitions are created. SupplierInvoiceNo is distinct from purchase-return SupplierCNNo; supplierCreditNoteNo and supplierCNNo map only to SupplierCNNo on purchase returns. RFQ uses native InvAddr1-InvAddr4 (friendly address1-address4) and DeliverAddr1 (friendly deliverAddress1), not native Address1; PI-specific supplier references are not advertised. Only get-request-quotation and update-request-quotation are published, not create. See docs/purchase-update-fields.md.","nativePayload":{"supported":true,"sections":[{"name":"Master","fields":[{"name":"DocNo","type":"string","description":"Existing document selector, not a writable system key.","aliases":["docNo"]},{"name":"DocDate","type":"date","description":"Document date.","aliases":["docDate"]},{"name":"CreditorCode","type":"string","description":"Supplier/creditor code.","aliases":["creditorCode"]},{"name":"CreditorName","type":"string","description":"Supplier display name.","aliases":["creditorName"]},{"name":"Agent","type":"string","description":"Purchase agent.","aliases":["purchaseAgent","agent"]},{"name":"PurchaseLocation","type":"string","description":"Purchase stock location.","aliases":["purchaseLocation","location"]},{"name":"Ref","type":"string","description":"Reference.","aliases":["ref"]},{"name":"Description","type":"string","description":"Header description.","aliases":["description"]},{"name":"DisplayTerm","type":"string","description":"Credit term.","aliases":["displayTerm","term"]},{"name":"InvAddr1","type":"string","description":"Invoice address line 1.","aliases":["address1","invAddr1"]},{"name":"Phone1","type":"string","description":"Phone.","aliases":["phone1","phone"]},{"name":"Attention","type":"string","description":"Attention/contact.","aliases":["attention","contact"]},{"name":"BranchCode","type":"string","description":"Branch code.","aliases":["branchCode"]},{"name":"CurrencyCode","type":"string","description":"Currency code.","aliases":["currencyCode"]},{"name":"CurrencyRate","type":"number","description":"Currency rate.","aliases":["currencyRate"]},{"name":"Note","type":"string","description":"Rich-text Note is stored as canonical RTF; verification compares visible text semantics, not raw bytes.","aliases":["note"]},{"name":"Remark1","type":"string","description":"Remark 1.","aliases":["remark1"]},{"name":"Remark2","type":"string","description":"Remark 2.","aliases":["remark2"]},{"name":"Remark3","type":"string","description":"Remark 3.","aliases":["remark3"]},{"name":"Remark4","type":"string","description":"Remark 4.","aliases":["remark4"]},{"name":"RefDocNo","type":"string","description":"Reference document number.","aliases":["refDocNo"]},{"name":"ShipVia","type":"string","description":"Shipping method.","aliases":["shipVia"]},{"name":"ShipInfo","type":"string","description":"Shipping info.","aliases":["shipInfo"]},{"name":"SupplierDONo","type":"string","description":"Supplier delivery order number.","aliases":["supplierDONo"]},{"name":"SupplierInvoiceNo","type":"string","description":"Supplier invoice number; distinct from SupplierCNNo on purchase returns.","aliases":["supplierInvoiceNo"]},{"name":"DueDate","type":"date","description":"Due date where writable and nullable in the installed SDK.","aliases":["dueDate"]},{"name":"InvAddr2","type":"string","description":"Invoice address line 2.","aliases":["address2","invAddr2"]},{"name":"InvAddr3","type":"string","description":"Invoice address line 3.","aliases":["address3","invAddr3"]},{"name":"InvAddr4","type":"string","description":"Invoice address line 4.","aliases":["address4","invAddr4"]},{"name":"Phone2","type":"string","description":"Secondary phone.","aliases":["phone2"]},{"name":"Fax1","type":"string","description":"Fax number.","aliases":["fax1","fax"]},{"name":"InclusiveTax","type":"boolean","description":"Tax-inclusive pricing where writable.","aliases":["inclusiveTax"]},{"name":"TaxDate","type":"date","description":"Tax date where writable.","aliases":["taxDate"]},{"name":"TaxEntityID","type":"number","description":"Tax entity ID where writable.","aliases":["taxEntityID"]},{"name":"ProjNo","type":"string","description":"Header project where writable.","aliases":["project","projNo"]},{"name":"DeptNo","type":"string","description":"Header department where writable.","aliases":["department","deptNo"]},{"name":"SupplierCNNo","type":"string","description":"Purchase-return SupplierCNNo (supplier credit note number); not SupplierInvoiceNo.","aliases":["supplierCreditNoteNo","supplierCNNo"]},{"name":"UserDefinedFields","type":"object","description":"Existing defined UDF values via userDefinedFields require native save/readback verification; native UDF acceptance unproven: no suitable existing fixtures. No new UDF definitions are created.","aliases":["userDefinedFields"]}]},{"name":"Details","fields":[{"name":"DtlKey","type":"number","description":"Existing detail selector for update/delete; never a writable system key.","aliases":["dtlKey"]},{"name":"AccNo","type":"string","description":"Posting GL account.","aliases":["accNo","accountNo"]},{"name":"ItemCode","type":"string","description":"Stock item code.","aliases":["itemCode"]},{"name":"UOM","type":"string","description":"Unit of measure.","aliases":["uom"]},{"name":"Location","type":"string","description":"Stock location.","aliases":["location"]},{"name":"Description","type":"string","description":"Line description.","aliases":["description"]},{"name":"Desc2","type":"string","description":"Line description 2.","aliases":["desc2"]},{"name":"FurtherDescription","type":"string","description":"Further description.","aliases":["furtherDescription"]},{"name":"ProjNo","type":"string","description":"Project code.","aliases":["projNo","project"]},{"name":"DeptNo","type":"string","description":"Department code.","aliases":["deptNo","department"]},{"name":"Qty","type":"number","description":"Quantity.","aliases":["qty"]},{"name":"FOCQty","type":"number","description":"FOC quantity.","aliases":["focQty"]},{"name":"UnitPrice","type":"number","description":"Unit price.","aliases":["unitPrice"]},{"name":"Discount","type":"string","description":"Discount.","aliases":["discount"]},{"name":"TaxCode","type":"string","description":"Tax code.","aliases":["taxCode"]},{"name":"TaxRate","type":"number","description":"Tax rate.","aliases":["taxRate"]},{"name":"TaxAdjustment","type":"number","description":"Tax adjustment.","aliases":["taxAdjustment"]},{"name":"BatchNo","type":"string","description":"Batch number.","aliases":["batchNo"]},{"name":"SerialNo","type":"string","description":"Serial number where supported.","aliases":["serialNo"]},{"name":"DeliveryDate","type":"date","description":"Delivery date.","aliases":["deliveryDate"]},{"name":"SalesExemptionNo","type":"string","description":"Sales exemption number.","aliases":["salesExemptionNo"]},{"name":"UserDefinedFields","type":"object","description":"Existing defined UDF values via userDefinedFields require native save/readback verification; native UDF acceptance unproven: no suitable existing fixtures. No new UDF definitions are created.","aliases":["userDefinedFields"]}]},{"name":"KnockOffDetails","fields":[]},{"name":"TransferDetails","fields":[]},{"name":"PaymentDetails","fields":[]},{"name":"Options","fields":[]}],"schemaOnly":true,"notes":["Update field discovery only. Actual public SDK scalar field support varies by document and installed SDK; this is not blanket all-field certification. Unknown or nonwritable requested fields are rejected before Save."]}}