Skip to content

Search by customer history

Request

Displays the client’s visit history.This method returns the client’s appointment and product purchase history, grouped by visit. Data is filtered based on visit status and paid status. The client is identified using either the client_id or client_phone parameter. All other parameters are optional. Results are sorted by visit date and paginated in batches of 25 items. If multiple visits share the same date as the last item on the page, they will be included on the current page to ensure complete grouping. To retrieve the next page, use the from and to values provided in the meta field of the current response.

Security
BearerPartnerUser
Path
location_idnumberrequired

ID of a location.

Example:123
Headers
Acceptstringrequired

Required B2B v2 response media type. Use application/vnd.api.v2+json. A charset parameter is also accepted.

Default:"application/vnd.api.v2+json"
Example:application/vnd.api.v2+json
Content-Typestringrequired

Should be equal to application/json

Example:application/json
Bodyapplication/json
client_idnumber or nullrequired

Client ID.

Example:123
client_phonestring or nullrequired

Customer phone number.

Example:13155550184
fromstring or null, (date)required

Period start date.

Example:"2022-01-31"
tostring or null, (date)required

Period end date.

Example:"2022-02-01"
payment_statusesArray of stringsrequired

Visit payment status:
not_paid - the visit is not paid, no payments were made for the visit;
paid_not_full - the visit is partially paid;
paid_full - the visit is paid in full, there is no overpayment;
paid_over - there is an overpayment for the visit.
If the filter by payment status is not required, then an empty array [] must be passed.

Items Enum:"not_paid""paid_not_full""paid_full""paid_over"
attendancenumber or nullrequired

Visit status: -1: - the client did not come; 0: - waiting for the client; 1: - the client has arrived; 2: - the client has confirmed the appointment.

Enum:-1012
curl -i -X POST \
  https://developer.alteg.io/_mock/en/b2b-v1/openapi/locations/123/clients/visits/search \
  -H 'Accept: application/vnd.api.v2+json' \
  -H 'Authorization: Bearer <YOUR_Bearer {PartnerToken}, User {UserToken}_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "client_id": 123,
    "client_phone": 13155550184,
    "from": "2022-01-31",
    "to": "2022-02-01",
    "payment_statuses": [
      "not_paid"
    ],
    "attendance": -1
  }'

Responses

OK

Bodyapplication/json
successboolean(Successful response status)

Response status.

Example:true
dataobject(Customer History Model Object)

Data on customer visits, including appointments and product sales.

Example:
{ "goods_transactions": [ { … } ], "records": [ { … } ] }
metaobject(An object of date-based pagination information.)

Page navigation information containing information about the current, next, and previous pages. The data is sorted and paginated by date in descending order.

Example:
{ "dateCursor": { "previous": { … }, "current": { … }, "next": { … } } }
Response
{ "success": true, "data": { "goods_transactions": [ … ], "records": [ … ] }, "meta": { "dateCursor": { … } } }