This endpoint handles everything concerning the customers. It can read customer info, but is also capable of creating new customers or update an existing customer. The info regarding this call, is also the invoice info of the customer. It is not possible to have multiple invoice addresses for one customer. All the invoice info is directly set on the customer.
When returning the info of a customer there are 3 important variables in FoodMaster that determine if a customer should be deactivated or not. These variables are: active, e-commerce customer and sales stop. If one of these 3 factors determine that the customer should not be active on de e-commerce side, deactivate will be TRUE. Whether a customer should be deleted on the web side when his account is deactivated in FoodMaster or not, is up to the web developers and the company owner to decide.
POST /customer
GET /customer
PUT /customer
GET /customer/all
GET /customer/incremental
GET /customer/count
Provide the call with a json like this example:
xxxxxxxxxx{ "dsCustomer":{ "ttCustomerInfo":[ { "dossiernr": 1, // company within FoodMaster "btw-nr" : "BE0000000001", // VAT number "naam" : "Foo inc", // comapany name "voornaam" : "John", // campany name or person name "achternaam" : "Doo", // person lastname "e-mail" : "foo@bar.com", "straat" : "Chestnut street", // street "huisnummer" : "52", // house number "busnummer" : "A", // address compliment "postnr" : "1000", // postal number "woonpl" : "Brussels", // city "land" : "BE" // country } ] }}If the answer of this call is a 200 response and the klant-nr variable is set, the customer is created, or it already exists. FoodMaster checks the btw-nr and e-mail variables. If there is a match in the Database the crud variable will be set to R in the output, and the call will be handled as a read. (So no info will be created or updated.)
The klant-nr variable should be 0 when using POST and should be correct when using PUT.
dossiernr = company within FoodMaster
klant-nr = customer ID
The same json object provided with create. Only now, make sure to add the klant-nr variable. Always provide this endpoint with all adjustable info. If you leave an adjustable field blanc, it we put as blanc in FoodMaster. So do not only provide the changes, but all the info.
dossiernr = company within FoodMaster
pag = page number
lim = page size
dossiernr = company within FoodMaster
since = changes since 1900-01-01T00:00:00 for ‘since last call’
dossiernr = company within FoodMaster
There are more fields in the return json than there are in the POST or PUT json. Notice the voornaam and achternaam variable where put together in the voornaam variable. Also all address variables are put together in straat.
The prijscode variable indicates what's the standard price is for this customer. It is linked with the price codes call and the article calls.
The klgroep variable indicates the 'category' or group the customer is in. This variable too can have influence on the price the customer might pay. It has influence on the special prices call.
The transport variable indicates whether the customer should pay transport costs or not. transpTariefCode indicates in which class of cost the customer is in.
See following example:
xxxxxxxxxx{ "dsCustomer": { "ttCustomerInfo": [ { "dossiernr": 1, // company within FoodMaster "klant-nr": 8, // customer id "btw-nr": "BE0000000001", // vat number "naam": "Company name", // company name "voornaam": "Campany name or person name. person lastname", // first name "achternaam": "", // last name "e-mail": "foo@bar.com", //e-mail "straat": "Chestnut street 52 A", // street "huisnummer": "", // house number "busnummer": "", // address compliment "postnr": "1000", // postal number "woonpl": "Brussels", // city "land": "BE", // country "klgroep": "GROOT", // customer group "prijscode": 3, // price code "deactivate": false, // deactivate "taal": "NL", // language "franco": "", // post-paid "transport": true, // apply transport costs "transpTariefCode": "1", // transport costs code "vertegenw_cd":"001", "vertegenw":"John Doe", "gl_korting1":"5", // Global discount "tp_glkorting1":"1", // Global discount type: 1=Percent; 2=Bedrag/St; 3=Bedrag/Kg; "bdatum_glkorting1":"", // Start date global discount "edatum_glkorting1":"", // End date global discount "omschr_glkorting1":"", // Description global discount "gl_korting2":"", // Second global discount "tp_glkorting2":"", // Second global discount type: 1=Percent; 2=Bedrag/St; 3=Bedrag/Kg; "bdatum_glkorting2":"", // Styart date second global discount "edatum_glkorting2":"", // End date second global discount "omschr_glkorting2":"", // Description second global discount "toeslag":"", // Addition "toeslag_type":"", // Addition type: 0=Percent; 1=Bedrag; "bdatum_toeslag":"", // Start date addition "edatum_toeslag":"", // Stop date addition "ej_korting_pct":"", // End of year discount "kw_korting":"", // Quarter of a year discount "om_korting":"", // Revenue discount "ej_korting_bdr":"", // End of year discount value "kg_korting":"", // Discount weight "budget_prom_wa":"", // Budget promotion value "budget_prom_kg":"", // Budget promotion weight "rec-id": 66213, // record id "crud": "R" // Create Read Update Delete } ] }}