8.3 customer (adding and updating customers)

The customer is looked up by distributorCode and code. If not found, it is added; if found, only the fields sent are updated. The customer code cannot be changed with this method.

FieldTypeRequiredDescription
distributorCodetextYesDistributor code
codetextYesCustomer code
nametextFor new customersLegal name
shortNametextFor new customersShort name
customerTypetextFor new customersCustomer type name (same as the name defined in the system)
creditCodetextFor new customersAdvance = prepaid, Cash = cash, Deferred = on credit terms
paymentTypetextFor new customersCash, Credit Card, Bank Transfer, Check, Bond, Open Account
creditStatustextNoUnlimited, Warning, Error
creditLimit, dueDaysnumberNoCredit limit, payment term in days
mainCustomerCodetextNoHead office customer it belongs to
integrationCode, integrationCode2textNoIntegration codes
sellerDistributorCode, sellerCodetextNoSales representative of the card
taxOffice, taxNo, idNo, taxTypeNametextNoTax office, tax number, national ID number, tax class
countryName, cityName, townNametextNoAddress, using the names defined in the system
address1, address2, postCodetextNoAddress
workTel1, mobileTel1, email etc.textNoContact details
gpsCoordX, gpsCoordYnumberNoLongitude, latitude
passive, dontSell, disabledtrue/falseNoPassive, do not sell, disabled

Values must be written exactly, including case and spaces; an unrecognized value falls back to the default (Cash, Advance, Unlimited). For a new customer, date fields that are not sent take today's date.

{ "distributorCode": "194", "code": "C-1001", "name": "Örnek Gıda Ltd.", "shortName": "Örnek Gıda", "customerType": "Bakkal", "creditCode": "Deferred", "paymentType": "Open Account", "creditLimit": 50000, "dueDays": 30, "cityName": "İstanbul", "townName": "Kadıköy", "sellerDistributorCode": "194", "sellerCode": "001" }

The response returns the record that was sent. For a new customer with a missing field, 400 is returned with You must send Credit Code, You must send Payment Type, You must send Customer Type, You must send Name for Customer or You must send Short Name for Customer.