Skip to content
APILast updated

Pagination and Filtering ​

List format ​

List endpoints return:

json
{
  "object": "list",
  "data": [ { "…": "resource" } ],
  "has_more": true,
  "next_cursor": "eyJ…"
}
FieldTypeDescription
objectstringAlways list
dataarrayThe resources on this page. See Resources and Fields
has_morebooleanWhether more data follows
next_cursorstring or nullThe cursor for the next page. null when has_more is false

Pagination parameters ​

ParameterDescription
limitItems per page, an integer from 1 to 100. Default 25
cursorThe next_cursor from the previous page
  • To get the next page, pass the previous page's next_cursor as cursor.
  • cursor accepts only a next_cursor returned by this API. If the cursor cannot be decoded, has been modified, or sort differs from when the cursor was created, the request returns 400 with param set to cursor.
  • Single-resource endpoints (/{id}) and GET /merchant accept no query parameters; limit or cursor also returns 400.
bash
curl -G https://api.dolyu.com/v1/customers \
  -H "Authorization: Bearer dolyu_sk_..." \
  -d limit=100 \
  --data-urlencode "cursor=eyJ…"

Sorting ​

Lists are sorted by the sort field in ascending order, then by id in ascending order.

Endpointsort valuesDefault
GET /appointmentsstart_at, updated_atstart_at
GET /customerscreated_at, updated_atcreated_at
GET /servicessort not acceptedBy created_at, id
GET /staffsort not acceptedBy id
GET /payments, GET /refundssort not acceptedBy created_at, id
GET /eventssort not acceptedBy created_at, id

Filters ​

Appointments ​

GET /appointments

ParameterDescription
statusOnly this status: pending, confirmed, completed, cancelled, no_show
start_at[gte]Start time is at or after this time
start_at[lt]Start time is before this time
updated_at[gte]Last updated at or after this time
customer_idAppointments of this customer. The value is a UUID
staff_idAppointments where any item's staff member is this staff member. The value is a UUID
referenceAppointment reference number, case-insensitive. A series' main reference also matches appointments numbered "main reference-sequence"
  • If customer_id or staff_id belongs to another merchant, the list is empty.
  • If reference does not match the reference number format, the list is empty.

Customers ​

GET /customers

ParameterDescription
emailExact email match, case-insensitive
phonePhone number match. Different ways of writing the same number are treated as the same; customers who share the number are listed together
updated_at[gte]Last updated at or after this time

Payments and refunds ​

GET /payments and GET /refunds

ParameterDescription
appointment_idPayments or refunds recorded on this appointment. The value is a UUID
created_at[gte]Recorded at or after this time
created_at[lt]Recorded before this time
  • If appointment_id belongs to another merchant, the list is empty.

Services and staff ​

GET /services and GET /staff accept only limit and cursor.

Events ​

For GET /events parameters, see Events.

Time parameters ​

  • The format is ISO 8601 and must include Z or an offset, e.g. 2026-11-20T00:00:00Z, 2026-11-20T08:00:00+08:00. A date only, or a time with no time zone, returns 400.
  • An unencoded + in a URL becomes a space; a space before the offset is treated as +.
  • gte includes the given time; lt does not.
bash
curl -G https://api.dolyu.com/v1/appointments \
  -H "Authorization: Bearer dolyu_sk_..." \
  --data-urlencode "start_at[gte]=2026-11-20T00:00:00+08:00" \
  --data-urlencode "start_at[lt]=2026-11-21T00:00:00+08:00" \
  -d status=confirmed \
  -d limit=50

Parameter errors ​

These cases return 400 parameter_invalid, with param set to the parameter name. Nested parameters are written as start_at[gte]:

  • A parameter the endpoint does not accept.
  • An invalid value, such as an unknown status, a customer_id that is not a UUID, a blank reference, or a limit out of range.
  • An unsupported operator, such as start_at[lte] or updated_at[lt].
  • A single-value parameter sent as an array, such as status[]=confirmed.
  • A list request sent with a JSON body.
json
{
  "error": {
    "type": "invalid_request",
    "code": "parameter_invalid",
    "message": "A request parameter is invalid.",
    "param": "start_at[gte]",
    "request_id": "req_..."
  }
}