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

Problem with costprice on OrderLines

0
I use the api call OrderLine_CreateFromData to create an orderline. I set the following data.

$data = array(
            "Handle"            => a handle,
            'Id'                =>  and id,
            'Number'            =>  a number,
            'OrderHandle'       =>  a handle,
            'Description'       => "abc",
            'DeliveryDate'      => a date,
            'ProductHandle'     => a handle,
            'Quantity'          => 1,
            'UnitNetPrice'      => 1000,
            'DiscountAsPercent' => 0,
            'UnitCostPrice'     => 100.50,
            'TotalNetAmount'    => 1000,
            'TotalMargin'       => 0,
            'MarginAsPercent'   => 0
        );

 

The orderline is created but the costprice is always 0.

I have read in other posts that stock management causes the costprice to be locked. But this account does not use this. I can with no problem open the interface and change the costprice. But what am I doing wrong in the API call?
created Apr 16, 2014 by fbanke
0% Accept Rate
Q 5 A 0 C 1

Visma e-conomic A/S
...