Updating a Sub-Customer
- Endpoint:
/vendor/subcustomers - HTTP Method:
PUT - Request Content-Type:
application/json - Authorization: Valid AccessToken is required. (See: 2. Authentication – Obtaining AccessToken)
Description
This service allows updating an existing sub-customer record in the system. Only the relevant main dealer (mainDealerCode) or an authorized user can update their sub-customers.
It is recommended to include only the fields that need to be updated in the JSON request. 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 | Member code of the sub-customer to be updated |
Note: Be mindful of case sensitivity in the system if the field appears as Updatecode (e.g., "Updatecode": "SUBCUST001").
Request Body Fields
| Field | Type | Required | Description |
|---|---|---|---|
| mailDealerCode | string | No | Main dealer member code |
| code | string | No | 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 | No | Customer email address | |
| mobile | string | No | Mobile phone number |
| phone | string | No | Landline phone number |
| countryCodeISO | string | No | Country code (e.g., "TR") |
| cityCode | string | No | City code |
| currencyTypeId | integer | No | Currency ID |
| erpCode | string | No | ERP code (must be unique) |
| isActive | boolean | No | Active/Inactive status (true/false) |
| isCompany | boolean | No | true for corporate, false for individual |
| address | string | No | Address information |
| tckn | string | No | TCKN for individual customers |
| taxNumber | string | No | Tax number for corporate customers |
| taxOffice | string | No | Tax office for corporate customers |
| parentCode | string | No | Main dealer code if it’s a sub-customer |
| parentUserEmail | string | No | Primary admin email of the main dealer |
| sendMail | boolean | No | Whether to send notification email after update |
| addDefaultCurrentAccount | boolean | No | Whether to create a current account after update |
| paymentSetId | string | No | Defined payment set ERP code |
Note: Some fields become required depending on the value of isCompany (e.g., taxNumber, taxOffice, or tckn).
- Example Request
- Successful Response
{
"code": "21",
"countryCode": "TR",
"cityCode": "10",
"districtCode": 494,
"currencyCode": "TRY",
"erpCode": "65130asxc",
"address": "test1",
"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 updated successfully.",
"customerId": null
}
Notes and Best Practices
- The updateCode identifies the sub-customer to be updated.
If the
codeis being changed, both the old (updateCode) and new (code) fields should be provided. - Partial Update: Send only the fields that need to be updated; other fields retain their current values.
- sendMail = true: The system will send a notification email according to your configuration. isActive = false: The customer will be set to inactive.
- Token Expiration: If the token has expired, obtain a new token and resend the request.
- Field Consistency: The
PUT /vendor/subcustomersservice uses the same field names asPOST /vendor/subcustomers.