Skip to main content

Updating a Sub-Dealer

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

Description

This service allows updating an existing sub-dealer and its user(s), similar to the Portal interface.

You can send only the fields you want to change in the request body; fields not sent will retain their current values.

Header Information

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

Update Reference Field

FieldTypeRequiredDescription
updateCodestringYesThe user code of the sub-dealer to be updated

Note: In some setups, the field may appear as Updatecode. Pay attention to case sensitivity.

Request Body Fields

Vendor (Sub-Dealer)

FieldTypeRequiredDescription
mainDealerCodestringYesMain dealer user code
addressstringNoAddress information
cityCodestringNoCity code
districtCodestringNoDistrict code
countryCodestringYesCountry code (e.g., "TR")
codestringYesSub-dealer user code (unique)
erpCodestringYesERP code (unique)
isForeignNationalbooleanNoIs foreign national?
isIndividualbooleanYesIndividual (true) / Corporate (false)
namestringYesSub-dealer name
parentTenantIdstringNoMain tenant ID
paymentExCurrencyTypestringNoPayment currency/type
paymentSetDefinitionIdstringNoPayment set ID (single selection; must exist in usablePaymentSetDefinitionIds)
usablePaymentSetDefinitionIdsarrayNoList of available payment set IDs
phonestringNoLandline phone
taxNumberstringConditionalTax number (usually required if isIndividual = false)
taxOfficestringConditionalTax office (usually required if isIndividual = false)
customerRepresentativeIdsarrayNoCustomer representative ID list

Users (Sub-Dealer User) Fields

FieldTypeRequiredDescription
userCodestringYesUser code
namestringYesUser first name
surnamestringYesUser last name
emailstringYesUser email address
gsmstringYesMobile phone
titlestringNoTitle
descriptionstringNoDescription
erpCodestringNoERP code
isActivebooleanNoActive/inactive status
isIndividualbooleanNoIndividual / Corporate
isForeignNationalbooleanNoForeign national?
paymentExCurrencyTypestringNoPayment currency/type
rolesarrayNoList of role IDs
ruleNamearrayNoPermission set names
sendRegisterMailbooleanNoSend email after update?
taxNumberstringNoTax number
taxOfficestringNoTax office
canUseMobilebooleanNoMobile access permission
userTypeintegerNoUser type
{  
"code": "742",
"phone": "5000000000",
"countryCode": "TR",
"cityCode": "10",
"districtCode": 494,
"currencyCode": "TRY",
"erpCode": "742",
"address": "TEST ADDRESS Update11",
"taxNumber": "00000000000",
"customerRepresentativeIds": [
"8fc535a7-3a0c-4994-b19b-0f3c4da748a5"
],
"isForeignNational": false,
"isCompany": false,
"name": "TEST VENDOR SUB-DEALER",
"parentTenantId": "7c394922-d312-4f91-8a9a-31e349d94380",
"paymentExCurrencyType": "string",
"usablePaymentSetDefinitionIds": [
"eb8628f3-f5ee-8785-455c-d2ca1edb8c30",
"9104fd8e-b13f-54ba-004b-a5b6453231bc"
],
"users": [
{
"id":"ee4faa61-55af-4069-a544-e4a6bd24c9b4",
"canUseMobile": false,
"description": "test",
"email": "[email protected]",
"code": "7423",
"gsm": "5000000000",
"isActive": true,
"name": "John",
"surname": "Doe",
"roles": [
"2d37006c-6000-4315-90fe-2dc2fe1fb184"
],
"sendMail": false,
"userType": 8248
}
],
"mainDealerCode": "NT65126658"
}

Note: In previous examples, the message/field names were “Customer / customerId”. We adjusted them to Sub-dealer and subDealerId to match the sub-dealer context.

Notes & Best Practices

  • updateCode: Indicates the record to be updated. If you are changing the code, send both the old code (updateCode) and the new code (code).
  • Payment sets: paymentSetDefinitionId is a single selection, usablePaymentSetDefinitionIds is a multiple selection list. The single selection must exist in the list.
  • Corporate updates: If isIndividual = false, taxNumber and taxOffice may be required according to your business rules.
  • Partial updates: Do not send fields that are not changing; the system retains existing values.
  • Token: Requests with an expired token return 401; obtain a new token and retry.