Creates or updates an inventory item and returns its Internal ID.Looks up an existing item by external ID, or by item code and item type when no external ID is provided. If a match is found, updates it; otherwise creates a new item, which requires an item type and a code. Only the fields provided are changed; omitted fields remain unchanged.