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 while creating order

0

I am having hard time solving this bug. 

I am using PHP - SOAP to integrate wordpress with economic.

When I am tring to create Order in economic using the function Order_CreateFromData, it is showing following error : 

Economic.Api.Exceptions.IntegrityException(E06300): The debtor contact does not belong to the debtor of this order. (id=0909e573-3cd8-41a4-9036-c0a68d8532a0) at row index:0

 

I cant understand what is wrong. My entire code is here 

$orderdata = array( 'Handle' => array('Id'=>$id),
'Id' => $id,
'DebtorHandle'=> array('Number'=> '160'),
//'ProjectHandle'=> array('Number'=>1),
'Number'=>array('Id'=>$id),
'DebtorName'=> '',
'DebtorAddress'=>'',
'DebtorPostalCode'=>'',
'DebtorCity'=>'',
'DebtorCountry'=>'',
'DebtorCounty' => '',
'DeliveryCounty' =>'',
// 'DebtorEan'=>'123',
'AttentionHandle'=> array('Id'=>1),
'YourReferenceHandle'=> array('Id'=>1),
'Date' => $dateTime ,
'TermOfPaymentHandle' => array('Id'=>$order_payment_id),
'CurrencyHandle'=> array('Code'=>$currency),
'IsVatIncluded'=> 'true',
'IsArchived'=>'true',
'IsSent'=>'true',
'ExchangeRate' =>  '10',
'NetAmount'=>'300',
'VatAmount'=>'100',
'GrossAmount'=>'150',
'Margin' => '20',
'MarginAsPercent' =>'2',
'RoundingAmount' => '350'
);   
 
$result = $client->Order_CreateFromData(array( "data"=>$orderdata ) )->Order_CreateFromDataResult->Id;
 
Please somebody help. 
created Oct 30, 2014 by Wisdmlabs
100% Accept Rate

retagged Oct 30, 2014 by Wisdmlabs
Q 4 A 9 C 1

1 Answer

0
 
Best answer
I found answer my self

I need to create DebtorContact and assign its id to Attention Handle while creating Order.
answered Oct 30, 2014 by Wisdmlabs
selected Nov 3, 2014 by Christian Estrup
Visma e-conomic A/S
...