Skip to content
APILast updated

API Overview and Authentication ​

The public API reads a merchant's services, staff, appointments, customers, payments, and refunds. For fields, see Resources and Fields. For list parameters, see Pagination and Filtering. For the error format, see Errors and Rate Limits.

Request format ​

ItemValue
Base URLhttps://api.dolyu.com/v1
MethodGET
Authentication headerAuthorization: Bearer <API key>
ResponseJSON
Response headerX-Request-Id: the ID of this request, the same as request_id in an error body

Other methods return 405 method_not_allowed.

API keys ​

  • Keys start with dolyu_sk_.
  • Owners and admins create and revoke keys in the dashboard. Each merchant can have up to 5 keys. For the steps, permissions, and expiration, see API Keys.
  • The full key is shown only once, when it is created.
  • You can set an expiration date when creating a key. A revoked or expired key returns 401 invalid_api_key.
  • Send the key only in the Authorization header. If a key appears in the URL or in any other header (except Cookie and Proxy-Authorization) of a GET request, it is revoked immediately and the request returns 401 api_key_exposed.
  • A key can only read data of the merchant that created it.

Permissions ​

Select at least one permission when creating a key.

PermissionEndpoints
No permission neededGET /merchant
catalog:readGET /services, GET /services/{id}, GET /staff, GET /staff/{id}
appointments:readGET /appointments, GET /appointments/{id}
customers:readGET /customers, GET /customers/{id}
payments:readGET /payments, GET /payments/{id}, GET /refunds, GET /refunds/{id}
Any one of the four permissions aboveGET /events, GET /events/{id}
  • If a key lacks the permission an endpoint requires, the request returns 403 insufficient_permission.
  • The event types the event endpoints return depend on the key's permissions. See Events.
  • If a key lacks customers:read, the customer in an appointment contains only id and object. See Resources and Fields.

Endpoints ​

Method and pathReturns
GET /merchantThe merchant the key belongs to
GET /servicesList of services
GET /services/{id}A service
GET /staffList of staff members
GET /staff/{id}A staff member
GET /appointmentsList of appointments
GET /appointments/{id}An appointment
GET /customersList of customers
GET /customers/{id}A customer
GET /paymentsList of payments
GET /payments/{id}A payment
GET /refundsList of refunds
GET /refunds/{id}A refund
GET /eventsList of events. See Events
GET /events/{id}An event

OpenAPI ​

An OpenAPI 3.1 description of the endpoints, response fields, and webhook events: https://docs.dolyu.com/openapi/v1.json

Example ​

bash
curl https://api.dolyu.com/v1/merchant \
  -H "Authorization: Bearer dolyu_sk_..."
json
{
  "id": "0198c5f0-0000-7000-8000-000000000001",
  "object": "merchant",
  "name": "Sample Studio",
  "slug": "example-studio",
  "timezone": "Asia/Taipei",
  "currency": "TWD",
  "locale": "zh_TW"
}

Implementation checklist ​

  • Skip response fields you don't recognize.
  • Read lists page by page with next_cursor until has_more is false. See Pagination and Filtering.
  • On 429, wait the number of seconds in Retry-After, then retry. See Errors and Rate Limits.
  • When polling for changed appointments or customers with updated_at[gte], start from a time earlier than when your previous query began, and overwrite records you already have by id.