API Forum

This forum is in read-only mode.
Please refer to our API support in case you have any questions.
We can be reached at api@e-conomic.com
e-conomic API developer forum

Error when updating product with SOAP

0

Hi, I receive this error when updating product with SOAP api: 

Economic.Api.Exceptions.IntegrityException(E06000): The product '' does not exist.

I'm pretty sure I give the right numbers for the handle and product number, here is the code:

--------

$id = get_the_ID();

        $orderdata = array( 'Handle' => array('Id'=>$id),
            'Number' => $id,
            'ProductGroupHandle'=> array('Number'=>1),
            'Name'=> $product->get_title(),
            'Description'=>get_the_excerpt(),
            'BarCode'=>$product->get_sku(),
            'SalesPrice'=>$product->get_price(),
            'CostPrice'=>'10',
            'RecommendedPrice'=>$product->get_price(),
            'IsAccessible' => true,
            'Volume'=>$product->get_price(),
            );   
             
            //$result = $client->Product_CreateFromData(array( "data"=>$orderdata ) )->Product_CreateFromData->Id;
            $result = $client->Product_UpdateFromData(array( "data"=>$orderdata ) )->Product_UpdateFromData->Id;
-------
 
The main thing is that Product_CreateFromData work like a charm, but Product_UpdateFromData give this error, I can't understand why, because both methods use same parameters.
 
Thanks,
OO
created Mar 5, 2015 by openocean
0% Accept Rate
Q 1 A 0 C 0

1 Answer

0
Hi OO

The main difference between the two is that Product_UpdateFromData needs the handle of the product you want to update as a parameter. CreateFromData returns a handle.

You should use Product_FindByNumber to get the handle for a product where you don't know the handle but do know the number.

Number can be anything and is synonymous to SKU. Handle is an object with a unique number.
answered Mar 13, 2015 by olej

Network

Find all the documentation and resources you need to build great apps.
Go to Developer site

Newsletter

Get the latest news and important info from the e-conomic developer world.
Sign up now

Visma e-conomic A/S
...