Skip to main content

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

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

Request Body Fields

Vendor (Dealer) Information

FieldTypeRequiredDescription
codestringYesDealer code (must be unique)
erpCodestringYesDealer code in ERP system (must be unique)
namestringYesDealer name
countryCodestringYesCountry code (e.g., "TR")
cityCodestringNoCity code
districtCodestringNoDistrict code
addressstringNoAddress information
phonestringNoLandline number
taxNumberstringNoTax number (for corporate)
taxOfficestringNoTax office (for corporate)
isCompanybooleanYesCorporate (true) / Individual (false)
isForeignNationalbooleanNoIs foreign national
paymentSetIdstringNoDefault payment set definition
paymentExCurrencyTypestringNoPayment currency type
currencyCodestringNoCurrency code (e.g., "TRY")
customerRepresentativeIdsarray(string)NoList of dealer representative IDs
usablePaymentSetDefinitionIdsarray(string)NoList of usable payment set IDs
parentTenantIdstringNoParent tenant ID (for dealer hierarchy)

Note: If isCompany = true, taxNumber and taxOffice fields are required.

Users (Dealer User) Information

FieldTypeRequiredDescription
codestringYesUser code (must be unique)
namestringYesUser first name
surnamestringYesUser last name
emailstringYesUser email address
gsmstringYesMobile number
erpCodestringNoUser ERP code
descriptionstringNoUser description
isActivebooleanNoActive / inactive status
canUseMobilebooleanNoMobile app access permission
rolesarray(string)NoList of role IDs for the user
ruleNamearray(string)NoRole set names (e.g., "ROLE_ADMIN")
userTypeintegerNoUser type
sendRegisterMailbooleanNoSend 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.
{  
"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"
}
]
}

Note

  • The customerId field 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: code and erpCode values must be unique across the system.

  • Corporate requirement:

    • isCompany = truetaxNumber, taxOffice are required
    • isCompany = falsetaxNumber, taxOffice are 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.