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
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | Valid token in Bearer {AccessToken} format |
| Content-Type | Yes | application/json |
Update Reference Field
| Field | Type | Required | Description |
|---|---|---|---|
| updateCode | string | Yes | The 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)
| Field | Type | Required | Description |
|---|---|---|---|
| mainDealerCode | string | Yes | Main dealer user code |
| address | string | No | Address information |
| cityCode | string | No | City code |
| districtCode | string | No | District code |
| countryCode | string | Yes | Country code (e.g., "TR") |
| code | string | Yes | Sub-dealer user code (unique) |
| erpCode | string | Yes | ERP code (unique) |
| isForeignNational | boolean | No | Is foreign national? |
| isIndividual | boolean | Yes | Individual (true) / Corporate (false) |
| name | string | Yes | Sub-dealer name |
| parentTenantId | string | No | Main tenant ID |
| paymentExCurrencyType | string | No | Payment currency/type |
| paymentSetDefinitionId | string | No | Payment set ID (single selection; must exist in usablePaymentSetDefinitionIds) |
| usablePaymentSetDefinitionIds | array | No | List of available payment set IDs |
| phone | string | No | Landline phone |
| taxNumber | string | Conditional | Tax number (usually required if isIndividual = false) |
| taxOffice | string | Conditional | Tax office (usually required if isIndividual = false) |
| customerRepresentativeIds | array | No | Customer representative ID list |
Users (Sub-Dealer User) Fields
| Field | Type | Required | Description |
|---|---|---|---|
| userCode | string | Yes | User code |
| name | string | Yes | User first name |
| surname | string | Yes | User last name |
| string | Yes | User email address | |
| gsm | string | Yes | Mobile phone |
| title | string | No | Title |
| description | string | No | Description |
| erpCode | string | No | ERP code |
| isActive | boolean | No | Active/inactive status |
| isIndividual | boolean | No | Individual / Corporate |
| isForeignNational | boolean | No | Foreign national? |
| paymentExCurrencyType | string | No | Payment currency/type |
| roles | array | No | List of role IDs |
| ruleName | array | No | Permission set names |
| sendRegisterMail | boolean | No | Send email after update? |
| taxNumber | string | No | Tax number |
| taxOffice | string | No | Tax office |
| canUseMobile | boolean | No | Mobile access permission |
| userType | integer | No | User type |
- Example Request
- Successful Response
{
"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"
}
{
"status": "success",
"message": "Sub-dealer successfully updated.",
"subDealerId": 1024
}
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:
paymentSetDefinitionIdis a single selection,usablePaymentSetDefinitionIdsis a multiple selection list. The single selection must exist in the list. - Corporate updates: If
isIndividual = false,taxNumberandtaxOfficemay 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.