Creating a Dealer
- Endpoint:
/vendor/dealer - HTTP Method:
POST - Request Content-Type:
application/json - Response Content-Type:
application/json - Authorization: Valid AccessToken is required. (See: 2. Authentication – Obtaining AccessToken)
Description
This service allows creating a new dealer (vendor) in the system along with its associated dealer user(s). The request contains both the dealer’s basic information and user information together.
For each record, code and erpCode values must be unique in the system. Once the registration is complete, the dealer is created and the user(s) are linked to the respective dealer.
Header Information
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | Valid token in Bearer {AccessToken} format |
| Content-Type | Yes | application/json |
Request Body Fields
Vendor (Dealer) Information
| Field | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | Dealer code (must be unique) |
| erpCode | string | Yes | Dealer code in ERP system (must be unique) |
| name | string | Yes | Dealer name |
| countryCode | string | Yes | Country code (e.g., "TR") |
| cityCode | string | No | City code |
| districtCode | string | No | District code |
| address | string | No | Address information |
| phone | string | No | Landline number |
| taxNumber | string | No | Tax number (for corporate) |
| taxOffice | string | No | Tax office (for corporate) |
| isCompany | boolean | Yes | Corporate (true) / Individual (false) |
| isForeignNational | boolean | No | Is foreign national |
| paymentSetId | string | No | Default payment set definition |
| paymentExCurrencyType | string | No | Payment currency type |
| currencyCode | string | No | Currency code (e.g., "TRY") |
| customerRepresentativeIds | array(string) | No | List of dealer representative IDs |
| usablePaymentSetDefinitionIds | array(string) | No | List of usable payment set IDs |
| parentTenantId | string | No | Parent tenant ID (for dealer hierarchy) |
Note: If isCompany = true, taxNumber and taxOffice fields are required.
Users (Dealer User) Information
| Field | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | User code (must be unique) |
| name | string | Yes | User first name |
| surname | string | Yes | User last name |
| string | Yes | User email address | |
| gsm | string | Yes | Mobile number |
| erpCode | string | No | User ERP code |
| description | string | No | User description |
| isActive | boolean | No | Active / inactive status |
| canUseMobile | boolean | No | Mobile app access permission |
| roles | array(string) | No | List of role IDs for the user |
| ruleName | array(string) | No | Role set names (e.g., "ROLE_ADMIN") |
| userType | integer | No | User type |
| sendRegisterMail | boolean | No | Send registration notification email? |
Note
- If
sendRegisterMail = true, a notification email is sent to the new user in the system. - At least one user (
users) must be defined when creating a dealer.
- Example Request
- Successful Response
{
"code": "600",
"phone": "5000000000",
"erpCode": "600",
"countryCode": "TKM",
"cityCode": "10",
"districtCode": 494,
"currencyCode": "TRY",
"address": "test",
"taxNumber": "00000000000",
"paymentSetId": "00cfced3-c429-444e-8125-fff3a7fb553a",
"customerRepresentativeIds": [
"c0dc9553-4bb7-4611-9e93-1d58c65a3fa6",
"4b80f492-ed80-445d-943f-2125125e3667"
],
"isForeignNational": false,
"isCompany": false,
"name": "test dealer vendor01101",
"parentTenantId": "670683c1-2fe0-4846-87b2-6cba9b793ab2",
"usablePaymentSetDefinitionIds": [
"958949df-0d90-4851-bcb8-1acb62c4dc95",
"79ce2e5f-51cb-4d29-beca-955685e86c50"
],
"users": [
{
"canUseMobile": true,
"description": "test",
"email": "[email protected]",
"gsm": "5000000000",
"isActive": true,
"name": "test",
"surname": "user",
"roles": [
"61002d8f-8fdd-430a-96dd-c5d87f5c9bda"
],
"sendMail": false,
"userType": 8387,
"code": "test000feafasdvagvawerg"
}
]
}
{
"status": "success",
"message": "Dealer created successfully.",
"customerId": "1426472f-15fa-43a5-9930-9f80234594fd"
}
Note
- The
customerIdfield is the unique identifier of the created dealer in the system. - In some systems, this value may be the same as
code.
Notes and Best Practices
-
Both vendor and users fields must be sent together.
-
Uniqueness:
codeanderpCodevalues must be unique across the system. -
Corporate requirement:
isCompany = true→taxNumber,taxOfficeare requiredisCompany = false→taxNumber,taxOfficeare optional
-
Email notification: If
sendRegisterMail = true, a notification email is sent to the user after registration. -
Token renewal: If the token has expired, obtain a new token and retry the request.