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
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | Valid token in Bearer {AccessToken} format |
| Content-Type | Yes | application/json |
Request Body Fields
| Field | Type | Required | Description |
|---|---|---|---|
| mailDealerCode | string | Yes | Main dealer member code (parent customer code) |
| code | string | Yes | Sub-customer member code (must be unique) |
| companyName | string | Yes (isCompany = true) | Company name for corporate customers |
| firstName | string | Yes (isCompany = false) | First name for individual customers |
| lastName | string | Yes (isCompany = false) | Last name for individual customers |
| string | Yes | Customer email address | |
| mobile | string | Yes | Mobile phone number |
| phone | string | No | Landline phone number |
| countryCode | string | Yes | Country code (e.g., "TR") |
| cityCode | string | No | City code |
| districtCode | integer | No | District code |
| currencyCode | integer | Yes | Currency ID |
| erpCode | string | Yes | ERP code (must be unique) |
| isActive | boolean | No | Active/Inactive status |
| isCompany | boolean | Yes | true for corporate, false for individual |
| address | string | No | Address information |
| tckn | string | Yes (isCompany = false) | National ID for individual customers |
| taxNumber | string | Yes (isCompany = true) | Tax number for corporate customers |
| taxOffice | string | Yes (isCompany = true) | Tax office for corporate customers |
| sendMail | boolean | No | Send email notification after creation |
| addDefaultCurrentAccount | boolean | No | Create a current account after creation |
| paymentSetId | string | No | Defined payment set ERP code |
| canUseMobile | boolean | No | Allow mobile access |
| customerRepresentativeIds | array | No | Customer representative IDs |
| passportNo | string | No | Foreign ID or passport number |
| isForeignNational | boolean | No | Whether the customer is a foreign national |
| title | string | No | Title or additional information |
| parentCode | string | No | Main dealer code (optional) |
| parentUserEmail | string | No | Main dealer user email (optional) |
- Example Request
- Successful Response
{
"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"
}
{
"status": "success",
"message": "Customer has been successfully created.",
"customerId": "aac398d1-0e54-411c-92b1-c2ead39ca0a2"
}
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 = true→companyName,taxNumber,taxOfficeare required.isCompany = false→firstName,lastName,tcknare 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.