Skip to main content

Updating a Sub-Customer

  • Endpoint: /vendor/subcustomers
  • HTTP Method: PUT
  • Request Content-Type: application/json
  • Authorization: Valid AccessToken is required. (See: 2. Authentication – Obtaining AccessToken)

Description

This service allows updating an existing sub-customer record in the system. Only the relevant main dealer (mainDealerCode) or an authorized user can update their sub-customers.

It is recommended to include only the fields that need to be updated in the JSON request. Fields not sent will retain their current values.

Header Information

HeaderRequiredDescription
AuthorizationYesValid token in Bearer {AccessToken} format
Content-TypeYesapplication/json

Update Reference Field

FieldTypeRequiredDescription
updateCodestringYesMember code of the sub-customer to be updated

Note: Be mindful of case sensitivity in the system if the field appears as Updatecode (e.g., "Updatecode": "SUBCUST001").

Request Body Fields

FieldTypeRequiredDescription
mailDealerCodestringNoMain dealer member code
codestringNoSub-customer member code (must be unique)
companyNamestringYes (isCompany = true)Company name for corporate customers
firstNamestringYes (isCompany = false)First name for individual customers
lastNamestringYes (isCompany = false)Last name for individual customers
emailstringNoCustomer email address
mobilestringNoMobile phone number
phonestringNoLandline phone number
countryCodeISOstringNoCountry code (e.g., "TR")
cityCodestringNoCity code
currencyTypeIdintegerNoCurrency ID
erpCodestringNoERP code (must be unique)
isActivebooleanNoActive/Inactive status (true/false)
isCompanybooleanNotrue for corporate, false for individual
addressstringNoAddress information
tcknstringNoTCKN for individual customers
taxNumberstringNoTax number for corporate customers
taxOfficestringNoTax office for corporate customers
parentCodestringNoMain dealer code if it’s a sub-customer
parentUserEmailstringNoPrimary admin email of the main dealer
sendMailbooleanNoWhether to send notification email after update
addDefaultCurrentAccountbooleanNoWhether to create a current account after update
paymentSetIdstringNoDefined payment set ERP code

Note: Some fields become required depending on the value of isCompany (e.g., taxNumber, taxOffice, or tckn).

{  
"code": "21",
"countryCode": "TR",
"cityCode": "10",
"districtCode": 494,
"currencyCode": "TRY",
"erpCode": "65130asxc",
"address": "test1",
"tckn": "00000000000",
//"taxOffice": "Silifke",
"customerRepresentativeIds": [
"5766d60f-b848-4c6b-8886-e9c087d0002f"
],
"isForeignNational": false,
"isCompany": false,
"firstName": "John",
"lastName": "Doe",
"email": "[email protected]",
"mobile": "5000000000",
"canUseMobile": false,
"sendMail": true,
"isActive": true,
"mainDealerCode": "NT65126658",
"paymentSetId": "15863986-6509-48c9-aaa7-419f90db879d"
}

Notes and Best Practices

  • The updateCode identifies the sub-customer to be updated. If the code is being changed, both the old (updateCode) and new (code) fields should be provided.
  • Partial Update: Send only the fields that need to be updated; other fields retain their current values.
  • sendMail = true: The system will send a notification email according to your configuration. isActive = false: The customer will be set to inactive.
  • Token Expiration: If the token has expired, obtain a new token and resend the request.
  • Field Consistency: The PUT /vendor/subcustomers service uses the same field names as POST /vendor/subcustomers.