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

Debtor_Create

0

Hi,

What is the argument "number" actually used for in below request? is it the customer ID from the external system? I don't see any impact on the debtor created with random "number" value.

$debtorHandle = $client->Debtor_Create(array(
'nubmer' => customer_id
'debtorGroupHandle' => $debtor_grouphandle,
'name' => customer_name
'vatZone' => 'HomeCountry'
 ))->Debtor_CreateResult;
 
In case of product handle "Product_Create" request the "number" is actually the "number" of the product created/added at e-conomic. If I add the product ID from the external system then it is actually replaced/added at e-conomic.
 
$product_handle = $client->Product_Create(array(
'number' => product_id,
'productGroupHandle' => $productGroupHandle,
'name' => product_title))->Product_CreateResult;
 
Note: above examples are for PHP language and the parameters used are examples like customer_id, product_id etc...
 
 
Thanks in advance for anyone who can help me with the questions.
 
BR
Alvin Rosario
created Jan 21, 2015 by alvinrosario
73% Accept Rate
Q 11 A 0 C 14

2 Answers

0

Hi Alvin,

This "number" is used for future update,delete operation on entity such as customer, product.

Although you can create random numbers for these, make sure these are unique.

 

Hope this help

 

answered Jan 25, 2015 by avt
Thank you avt,

I can understand the purpose of the "Number", when I sync a product from my ERP (for example, assume xyz) to e-conomic, I used a prefix ex: "xyz" to product's SKU, so all the products number synced from this ERP would carry a unique SKU along with prefix "xyz" as the product Number at e-conomic, this works as I expected.

But in-case of customer, I tried the same technique for the Number, but this is not working as expected or how it is working for products.

Customer Number are created automatically and it is sequential not random.

Thank you again if you can understand what I mean and get back to me with more information.

--
Alvin
0

Hi Alvin

 

CustomerNumber is the number that is assigned to the Debtor and displayed in the UI.

You can use Debtor_GetNextAvailableNumber to find next available number.

 
It doesn't make sense to randomize but you might like to number debtors the same across solutions.
 
 
ProductNumber is used for the product SKU.
 
 
To perform actions on a product or Customer through API you use the Handle ID.
If you have the product number you can use Product_FindByNumber to resolve the Handle
 
Same goes for debtor: Debtor_FindByNumber
 
Have a look at https://api.e-conomic.com/secure/api1/EconomicWebService.asmx for a list of functions available.
answered Jan 26, 2015 by olej
Thank you olej for your response,

I can understand the purpose of ProductNumber (Number in the SOAP request sent to e-conomic)

See: https://api.e-conomic.com/secure/api1/EconomicWebService.asmx?op=Product_Create

I use a combination of Product SKU along with a prefix of my ERP system name, so I can identify, from which specific system are the products synced. It worked as expected.

for example, assume XYZ is my ERP name and product SKU is 100, then I set the "number" string in "Product_Create" SOAP request to "xyz-100" and this is visible in the e-conomic UI as product number.

but using the same technique for "Debtor_Create" the customer/debtor number is created automatically and it is sequential, then I wonder what would be the "number" string in the SOAP request "Debtor_Create".

Thank you once again to get back to me with additional information.

BR
Alvin
Visma e-conomic A/S
...