Skip to main content

Creating a Sub-Customer

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

Description

This service is used to create a new sub-customer under an existing main dealer (mainDealerCode) in the system.

The sub-customer can inherit commercial, payment, and access information from the main dealer they are linked to.

Note: The mainDealerCode (or in older versions mailDealerCode) field indicates which dealer the sub-customer will be associated with.

Header Information

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

Request Body Fields

FieldTypeRequiredDescription
mailDealerCodestringYesMain dealer member code (parent customer code)
codestringYesSub-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
emailstringYesCustomer email address
mobilestringYesMobile phone number
phonestringNoLandline phone number
countryCodestringYesCountry code (e.g., "TR")
cityCodestringNoCity code
districtCodeintegerNoDistrict code
currencyCodeintegerYesCurrency ID
erpCodestringYesERP code (must be unique)
isActivebooleanNoActive/Inactive status
isCompanybooleanYestrue for corporate, false for individual
addressstringNoAddress information
tcknstringYes (isCompany = false)National ID for individual customers
taxNumberstringYes (isCompany = true)Tax number for corporate customers
taxOfficestringYes (isCompany = true)Tax office for corporate customers
sendMailbooleanNoSend email notification after creation
addDefaultCurrentAccountbooleanNoCreate a current account after creation
paymentSetIdstringNoDefined payment set ERP code
canUseMobilebooleanNoAllow mobile access
customerRepresentativeIdsarrayNoCustomer representative IDs
passportNostringNoForeign ID or passport number
isForeignNationalbooleanNoWhether the customer is a foreign national
titlestringNoTitle or additional information
parentCodestringNoMain dealer code (optional)
parentUserEmailstringNoMain dealer user email (optional)
{  
"code": "550",
"countryCode": "TR",
"cityCode": "10",
"districtCode": 494,
"currencyCode": "TRY",
"erpCode": "550",
"address": "test",
"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"
}

Note: customerId is the unique identifier of the created sub-customer in the system.

Usage Notes & Best Practices

  • Main dealer dependency: Every sub-customer must be associated with a mainDealerCode.

  • Mandatory fields

    • isCompany = truecompanyName, taxNumber, taxOffice are required.
    • isCompany = falsefirstName, lastName, tckn are required.
  • Email notification: If sendMail = true, an informational email is automatically sent.

  • Current account: If addDefaultCurrentAccount = true, a current account is created for the customer.

  • Token renewal: If the token has expired, it must be renewed before resending the request.

  • Mobile access: If canUseMobile = true, the user can log in to the mobile application.