Listing and Retrieving Sub-Customers
Endpoints
| Purpose | Endpoint | Description |
|---|---|---|
| List all sub-customers | GET /vendor/subcustomers | Lists all sub-customer records with pagination. |
| Single sub-customer (by code) | GET /vendor/subcustomers/{code} | Retrieves a sub-customer by their code. |
| Single sub-customer (by erpCode) | GET /vendor/subcustomers/{erpCode} | Returns sub-customer details by ERP code. |
| Sub-customers under a main dealer (by parentCode) | GET /vendor/subcustomers/{parentCode} | Lists all sub-customers associated with the specified main dealer. |
HTTP Information
- HTTP Method:
GET - Request Content-Type:
application/json(optional) - Response Content-Type:
application/json - Authorization: Valid AccessToken is required. (See 2. Authentication – Obtaining AccessToken)
Description
This service allows you to list sub-customer records in the system or retrieve details of a single sub-customer.
- Only one of the parameters
code,erpCode, orparentCodeshould be provided. - If no parameter is given, the system returns all sub-customers with pagination.
- Requests with multiple parameters simultaneously are rejected.
Header Information
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | Valid token in Bearer {AccessToken} format |
| Content-Type | Yes | application/json |
Route Parameters - Single Record Retrieval
| Parameter | Type | Required | Description |
|---|---|---|---|
code | string | One of the three required | Sub-customer code |
erpCode | string | One of the three required | Sub-customer ERP code |
ParentCode | string | One of the three required | Main dealer code (returns sub-customers under this dealer) |
Note
- Only one parameter should be used.
- If none is provided, the system returns all sub-customer records.
Query Parameters (Pagination – Listing)
| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | No | Page number to retrieve (default: 1) |
pageSize | integer | No | Number of records per page (default: 10, max: 100) |
- Example Response (Single Record)
- Example Response – Listing (Paginated)
{
"status": "success",
"customer": {
"code": "21",
"companyName": null,
"firstName": "John",
"lastName": "Doe",
"email": "[email protected]",
"mobile": "5000000000",
"phone": null,
"countryCode": null,
"cityCode": "10",
"currenyCode": "TRY",
"erpCode": "65130asxc",
"address": "test1",
"isActive": true,
"isCompany": false,
"tckn": null,
"taxNumber": null,
"taxOffice": null,
"paymentSetId": "15863986-6509-48c9-aaa7-419f90db879d"
}
}
{
"data": [
{
"code": "NT39102312",
"companyName": null,
"firstName": "John",
"lastName": "Doe",
"email": "[email protected]",
"mobile": "5000000000",
"phone": null,
"countryCode": null,
"cityCode": "06",
"currenyCode": "TRY",
"erpCode": "111",
"address": null,
"isActive": true,
"isCompany": false,
"tckn": null,
"taxNumber": null,
"taxOffice": null,
"paymentSetId": "bfcad216-f41c-4743-b570-7b49fb7c7e9c"
},
{
"code": "NT93598442",
"companyName": null,
"firstName": "John",
"lastName": "Doe",
"email": "[email protected]",
"mobile": "5000000000",
"phone": null,
"countryCode": null,
"cityCode": null,
"currenyCode": "TRY",
"erpCode": "",
"address": null,
"isActive": true,
"isCompany": false,
"tckn": null,
"taxNumber": null,
"taxOffice": null,
"paymentSetId": "00cfced3-c429-444e-8125-fff3a7fb553a"
}
]
}
Notes and Best Practices
- ParentCode usage: If
parentCodeis provided, only sub-customers under that main dealer are returned. - Pagination: If
pageandpageSizeare not provided, the first 10 records are returned by default. - Performance: For large datasets, it is recommended to use the
pageparameter to make paginated requests. - Authorization: This endpoint can only be called by users with the appropriate main dealer or sub-dealer permissions.
- Field consistency: This endpoint returns the same data fields as the
POST /vendor/subcustomersandPUT /vendor/subcustomersservices.