{"ok":true,"commandType":"update-item-bom","module":"Stock","mode":"write","summary":"Update item BOM definition.","payloadSchema":{"reason":"optional business reason","itemCode":"required finished item code","description":"optional expected existing description; differing values are not supported for BOM persistence","assemblyCost":"optional assembly cost","finishGoodCost":"optional finished-good cost","autoUpdateMethod":"unsupported company-wide setting; omit this field","detailMode":"existing BOM only: update (default for update command) or replace; replace removes omitted lines","validateOnly":"optional boolean; true prevents saving even on create/update and retains their write permission","updateBOMCost":"true required for all lines[] including previews: acknowledges native save sets parent UOM Cost = FinishGoodCost * Rate; false unsupported","lines":"array of {subItemCode?, qty?, lineKey?, seq?, remove?, overheadCost?, fields?, nativeFields?}; new lines need code and qty, keyed update preserves omitted values","subItemCode":"legacy single component code; cannot be mixed with lines","qty":"legacy single component positive quantity, default 1; cannot be mixed with lines","overheadCost":"optional legacy component overhead cost"},"examplePayload":{"reason":"correct BOM","itemCode":"FINISHED-API","updateBOMCost":true,"lines":[{"subItemCode":"RAW-API-1","qty":2},{"subItemCode":"RAW-API-2","qty":3}]},"examples":[],"payloadEnums":{},"requiredPayloadFields":["itemCode"],"conditionalPayloadRules":{},"notes":"Use lines or legacy subItemCode, never both. Update preserves omitted details/values; remove:true requires stable lineKey and permits optional matching subItemCode, never subItemCode alone. Replace supplies the complete desired detail set. Description changes and company-wide autoUpdateMethod changes are unsupported and must be rejected before native mutation. Native costing can change costs during saves; no no-cost-change guarantee is made. Native connector validates references, performs a single Save and reload verification; validate-item-bom never saves. Schema availability alone does not prove native support.","nativePayload":{"commandType":"update-item-bom","title":"Item BOM maintenance","supported":true,"schemaOnly":true,"required":["itemCode"],"fields":{"itemCode":{"type":"string","minLength":1},"subItemCode":{"type":"string","minLength":1},"qty":{"oneOf":[{"type":"number","minimum":0,"exclusiveMinimum":true},{"type":"string","pattern":"^\\s*[+]?(?:\\d+(?:,\\d+)*(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?\\s*$","description":"Invariant decimal string; must evaluate to a positive finite quantity"}]},"detailMode":{"type":"string","enum":["update","replace"]},"validateOnly":{"type":"boolean"},"updateBOMCost":{"type":"boolean","enum":[true]},"lines":{"type":"array","minItems":0,"maxItems":500,"description":"At most 500 entries including removals. Non-empty for create/replace; an update patch may be empty. Native validation rejects any zero-line result before Save; use guarded delete-item-bom instead. New/replacement rows require qty; partial update can omit it.","items":{"type":"object","additionalProperties":false,"oneOf":[{"required":["lineKey","remove"],"properties":{"remove":{"enum":[true]}},"not":{"required":["qty"]}},{"anyOf":[{"required":["subItemCode"]},{"required":["lineKey"]},{"required":["seq"]}],"properties":{"remove":{"enum":[false]}}}],"properties":{"subItemCode":{"type":"string","minLength":1},"qty":{"oneOf":[{"type":"number","minimum":0,"exclusiveMinimum":true},{"type":"string","pattern":"^\\s*[+]?(?:\\d+(?:,\\d+)*(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?\\s*$","description":"Invariant decimal string; must evaluate to a positive finite quantity"}]},"lineKey":{"oneOf":[{"type":"string","minLength":1},{"type":"integer","minimum":1,"maximum":9007199254740991}],"description":"Use native ItemBOMKey returned as a string; do not round Int64 keys through JavaScript numbers"},"seq":{"type":"integer","minimum":0,"maximum":2147483647},"remove":{"type":"boolean"},"overheadCost":{"oneOf":[{"type":"number"},{"type":"string"}],"description":"Finite invariant decimal; native precision applies"},"fields":{"type":"object","description":"Existing native detail-field path; unsupported/blocked fields remain native-validated"},"nativeFields":{"type":"object","description":"Existing native detail-field container; not a promise that arbitrary fields or UDFs are writable"}}}}},"example":{"itemCode":"FINISHED-API","updateBOMCost":true,"lines":[{"subItemCode":"RAW-API-1","qty":2},{"subItemCode":"RAW-API-2","qty":3}]},"notes":["Use lines or legacy subItemCode, never both. Update preserves omitted details/values; remove:true requires stable lineKey and permits optional matching subItemCode, never subItemCode alone. Replace supplies the complete desired detail set. Description changes and company-wide autoUpdateMethod changes are unsupported and must be rejected before native mutation. Native costing can change costs during saves; no no-cost-change guarantee is made. Native connector validates references, performs a single Save and reload verification; validate-item-bom never saves. Schema availability alone does not prove native support.","Static contract only; installed connector support and native Save/reload behavior must be verified separately."]}}