[POST] .../v1/retailcustomer/get
Returns array retail customers. Use this method to retrieve active retail customers for customer lookup, card assignment, POS workflows, segmentation and CRM-style customer lists. The request supports body filters by ids, group_ids, region_ids, refer_ids, gender, search and main_phone, supports filters for standard and custom fields, supports sort_orders, limit and offset and returns result with next_offset and total. The method checks the current request user and requires retail customer select permission; missing body, invalid phone format, invalid filters or sort_orders, denied permission and storage errors are returned as HTTP 200 ErrorResult business errors.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| filters | Array of Filter | Optional | Optional filters by fields available for this API method. |
| limit | Int32 | Optional | Maximum number of records to return. |
| offset | Int32 | Optional | Offset from the beginning of the result set. |
| search | String | Optional | Search string for fields: first_name, middle_name, last_name, main_phone, phones and region_name. |
| sort_orders | Array of RetailCustomer_SortOrder | Optional | Output parameter sorting. |
Filterable Fields
| Field | Type | Description |
|---|---|---|
| date_of_birth | string | |
| debt | decimal | |
| string | ||
| last_purchase | int | |
| main_phone | string | Customer primary phone. |
Sortable Fields
| Field |
|---|
| address |
| date_of_birth |
| first_name |
| group.name |
| id |
| last_name |
| last_update |
| main_phone |
| middle_name |
| phones |
| refer_id |
| region.name |
| sex |
Request Example
{
"filters": [
{
"Field": "date_of_birth",
"Operator": "Equal",
"Value": "string"
}
],
"limit": 1,
"offset": 1,
"search": "string",
"sort_orders": [
{
"column": "id",
"direction": "ASC"
}
]
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| next_offset | Int32 | Offset for the next data page. |
| ok | Boolean | Indicates whether the request completed successfully. |
| result | Array of RetailCustomer | Result array. |
| total | Int64 | Total number of result items. |
Response Example
{
"next_offset": 1,
"ok": true,
"result": [
{
"address": "string",
"date_of_birth": "string",
"debt": 1.0,
"deleted_mark": true,
"description": "string",
"email": "string",
"fields": [
{
"data_type": "string",
"is_custom": true,
"key": "string",
"metadata": "string",
"name": "string",
"required": true,
"value": "string"
}
],
"first_name": "string",
"full_name": "string",
"group": {
"child_count": 1,
"id": 1,
"last_update": 1,
"name": "string",
"parent_id": 1
},
"id": 1,
"last_name": "string",
"last_purchase": 1,
"last_update": 1,
"main_phone": "string",
"middle_name": "string",
"phones": "string",
"refer_id": 1,
"region": {
"id": 1,
"last_update": 1,
"name": "string",
"parent_id": 1
},
"sex": "none"
}
],
"total": 1
}