Get the booking catalog
GET/api/v1/booking/catalog
- Since
- 1.3.0
- Auth
- Bearer key
- operationId
- getBookingCatalog
Active booking services and specialists, with links to the published treatments and team profiles. The ids are the service and resource parameters of /booking/slots and the serviceId and resourceId of /booking/appointments. A treatment points at its service with bookingServiceId, a team profile at its specialist with bookingResourceId. Responses are private to the key: Cache-Control: private, max-age=60, so cache them on your side for up to a minute.
Request
Send the clinic's key in Authorization: Bearer (see API keys).
No parameters and no body.
curl "https://app.pozyskajpacjenta.pl/api/v1/booking/catalog" \
-H "Authorization: Bearer $PP_API_KEY"import { PozyskajPacjentaClient } from "@pozyskajpacjenta/sdk";
const client = new PozyskajPacjentaClient({
apiKey: process.env.PP_API_KEY ?? "",
baseUrl: "https://app.pozyskajpacjenta.pl",
});
const { services, resources } = await client.getBookingCatalog();<?php
$response = wp_remote_get(
'https://app.pozyskajpacjenta.pl/api/v1/booking/catalog',
array(
'headers' => array( 'Authorization' => 'Bearer ' . getenv( 'PP_API_KEY' ) ),
'timeout' => 10,
)
);
if ( is_wp_error( $response ) ) {
error_log( $response->get_error_message() );
return;
}
$status = wp_remote_retrieve_response_code( $response );
$data = json_decode( wp_remote_retrieve_body( $response ), true );Response
200Services and specialists.
- servicesBookingCatalogService[]required
Active booking services.
Fields of each item (7)
- idstringrequired
Service id: the
serviceparameter of /booking/slots. - namestringrequired
Name of the service.
- durationMinintegerrequired
Length of the visit in minutes.
- priceLabelstring | nullrequired
Price of the visit for display: the booking service's own price label (e.g. a consultation at 300 zł), else the
priceFromLabelof the published treatment linked to it (as in /services/{slug}); null when there is neither. - resourceIdsstring[]required
Active specialists who perform the service (ids from
resources). An empty list means nobody can be booked for it. Free slots always come from /booking/slots. - serviceSlugstring | nullrequired
Slug of the published treatment linked to the service (GET /services/{slug}); null when no published treatment points at it.
- nfzbooleansince 1.8.0
true: an NFZ (public health fund) service. Show it for information with a note that booking is by phone and the clinic's phone; it cannot be booked online (/booking/slots and /booking/appointments answer 400 nfz_phone_only). Absent on older servers, which means false.
- resourcesBookingCatalogResource[]required
Active specialists.
Fields of each item (4)
- idstringrequired
Specialist id: the
resourceparameter of /booking/slots. - namestringrequired
Full name.
- titlestring | nullrequired
Professional title, e.g. lek. dent.; null when none.
- doctorSlugstring | nullrequired
Slug of the published team profile (GET /doctors/{slug}); null when no published profile points at the specialist.
Bookable services (trimmed) and specialists, one of them NFZ
{
"services": [
{
"id": "bsvc_konsultacja",
"name": "Konsultacja stomatologiczna",
"durationMin": 30,
"priceLabel": "200 zł",
"resourceIds": [
"bres_anna",
"bres_piotr",
"bres_maria"
],
"serviceSlug": "konsultacja-stomatologiczna",
"nfz": false
},
{
"id": "bsvc_higienizacja",
"name": "Higienizacja (skaling + piaskowanie + fluoryzacja)",
"durationMin": 60,
"priceLabel": "290 zł",
"resourceIds": [
"bres_maria"
],
"serviceSlug": "higienizacja",
"nfz": false
},
{
"id": "bsvc_nfz",
"name": "Leczenie zachowawcze (NFZ)",
"durationMin": 30,
"priceLabel": null,
"resourceIds": [
"bres_piotr"
],
"serviceSlug": null,
"nfz": true
}
],
"resources": [
{
"id": "bres_anna",
"name": "Anna Wzorcowa",
"title": "dr n. med.",
"doctorSlug": "anna-wzorcowa"
},
{
"id": "bres_piotr",
"name": "Piotr Nowicki",
"title": "lek. dent.",
"doctorSlug": "piotr-nowicki"
},
{
"id": "bres_maria",
"name": "Maria Zielińska",
"title": "lek. dent. spec. stomatologii estetycznej",
"doctorSlug": "maria-zielinska"
}
]
}Errors
| Status | When |
|---|---|
| 401 | No Authorization header |
| 401 | Unknown or rotated key |
| 429 | Over 120 requests in this minute |
Branch on the status and code, never on the Polish error text. All statuses in Errors.
{
"error": "missing Authorization: Bearer <klucz z panelu Ustawienia>"
}{
"error": "invalid key"
}{
"error": "przekroczono limit 120 zapytań/min"
}Rate limit
- 120 requests per minute per key, shared by every endpoint.
- Every response to a valid key carries
RateLimit-RemainingandRateLimit-Reset; see Rate limits.
SDK method
client.getBookingCatalog(): Promise<BookingCatalog>
The TypeScript tab above uses it. Install and errors: TypeScript SDK.