Get Local Seller Metrics
Method: GET
/api/v1/local-sellers/metrics
Description
This endpoint retrieves metrics for local sellers (e.g., farmers or merchants) based on the specified filters. It allows grouping and filtering by various criteria, such as date range, seller type, and user details.
🔑 Authentication
This endpoint requires authentication via headers.
| Param | Value | Type |
|---|---|---|
tenantId | {{tenantId}} | string |
userId | {{userId}} | string |
countryCode | {{countryCode}} | string (optional) |
Query Parameters
| Name | Type | Description |
|---|---|---|
localSellerSearch | string | Search for sellers by name or keyword. |
groupBy | string | Group metrics by specific fields (comma-separated). Available values: CREATED_BY, UPDATED_BY. |
metricDateRange | string | Filter metrics by date range (e.g., 2020-11-12,2022-11-15). |
byValueType | string | Time-based grouping (e.g., HOUR, DAY, MONTH). |
byValue | number | A numeric value to filter based on byValueType. |
localSellerDateRange | string | Filter sellers by date range (e.g., 2020-11-12,2022-11-15). |
localSellerByTypes | string | Filter by seller type (FARMER, MINER). |
localSellerByPhone | string | Search sellers by phone number. |
localSellerByLastName | string | Search sellers by last name. |
localSellerByFirstname | string | Search sellers by first name. |
localSellerByEmail | string | Search sellers by email address. |
byTenantIds | string | Filter metrics by tenant IDs (comma-separated). |
byUserIds | string | Filter metrics by user IDs (comma-separated). |
byBusinessIds | string | Filter metrics by business IDs (comma-separated). |
Response: 200 OK
A successful response returns a set of metrics based on the provided filters.
Example Response:
{
"metrics": [
{
"metricName": "Total Sellers",
"metricValue": 100,
"groupBy": "FARMER",
"dateRange": "2020-11-12,2022-11-15"
},
{
"metricName": "New Sellers",
"metricValue": 20,
"groupBy": "MINER",
"dateRange": "2020-11-12,2022-11-15"
}
]
}
LANGUAGE
CURL REQUEST
curl --request GET \
--url /api/v1/local-sellers/metrics \
--header 'accept: application/json' \
--header 'content-type: application/json'
RESPONSE
Click Try It! to start a request and see the response here!