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 call Debtor_Create() function ... Key already Exists/integrity exception


Hi experts ,

when i am creating a debtor there is a problem with vatzone,first time created once then its shows error 


error : Notice:

the key already exists,integrity exception ......

 Uncaught SoapFault exception: [soap:Client] Economic.Api.Exceptions.IntegrityException(E06010): The entity cannot be created because the key already exists. (id=c3136ac7-5a92-43df-abe4-0d1a9fd84c64) in xxxxxx




code i use : 



$newDebtorHandle = $this->client->Debtor_Create(array(
'number'            =>  $data['customer_id'],
'debtorGroupHandle' => $firstDebtorGroup,
'name'              => $data['firstname'],
'vatZone'           => 'EU'))->Debtor_CreateResult;
How can i fix this any experts please help me out and drive me.
created May 18, 2013 by sudheerphp
22% Accept Rate

edited May 18, 2013 by sudheerphp
Q 14 A 10 C 0

1 Answer

Best answer

I have checked our logs, and the problem is not with VAT zone. It happens because you are trying to create a debtor by using a number you have used before. In the case above you tried to create debtor 8 even though you already had a debtor 8 on your agreement.
answered May 21, 2013 by Jostein
selected May 29, 2013 by sudheerphp
Visma e-conomic A/S