Skip to main content

Listing and Retrieving Sub-Customers

Endpoints

PurposeEndpointDescription
List all sub-customersGET /vendor/subcustomersLists 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, or parentCode should be provided.
  • If no parameter is given, the system returns all sub-customers with pagination.
  • Requests with multiple parameters simultaneously are rejected.

Header Information

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

Route Parameters - Single Record Retrieval

ParameterTypeRequiredDescription
codestringOne of the three requiredSub-customer code
erpCodestringOne of the three requiredSub-customer ERP code
ParentCodestringOne of the three requiredMain 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)

ParameterTypeRequiredDescription
pageintegerNoPage number to retrieve (default: 1)
pageSizeintegerNoNumber of records per page (default: 10, max: 100)
{  
"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"
}
}

Notes and Best Practices

  • ParentCode usage: If parentCode is provided, only sub-customers under that main dealer are returned.
  • Pagination: If page and pageSize are not provided, the first 10 records are returned by default.
  • Performance: For large datasets, it is recommended to use the page parameter 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/subcustomers and PUT /vendor/subcustomers services.