API Rest : Product modify does not update price

Hi,
It update fine label, description, etc… but not the price.

I’ve started to analyse and tI propose this code for solving :

    function put($id, $request_data = NULL)
    {
        if(! DolibarrApiAccess::$user->rights->produit->creer) {
			throw new RestException(401);
		}
        
        $result = $this->product->fetch($id);
        if( ! $result ) {
            throw new RestException(404, 'Product not found');
        }
		
		if( ! DolibarrApi::_checkAccessToResource('product',$this->product->id)) {
			throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
		}

        foreach($request_data as $field => $value) {
            if ($field == 'id') continue;
            $this->product->$field = $value;
        }
        
        if($this->product->update($id, DolibarrApiAccess::$user,1,'update')) {
	    $this->product->updatePrice($this->product->price, $this->product->price_base_type, DolibarrApiAccess::$user, $this->product->tva_tx,'', 0, 0, 0, 0, array(), '');
            return $this->get ($id);
			}
		
        return false;
    }

Hi,
I had the same problem and fixed it with your code, thanks !
Any chance this would be added to the core ?? This is a major issue !

For ones information, the code must be added in /htdocs/product/class/api_products.class.php
and could be applied to both put() and post() methods…

Fix/patch should be available into v7

Today, I installed v7.0.2 and the fix is not yet available. Any chance to get the fix in the next version? Thank you.

What is your setup or product price (one price per product, one per segment or one per customer) ?

One price per product.