Skip to content

Commit cef5879

Browse files
espenclaude
andcommitted
Add message templates endpoint and document missing endpoints/attributes
Addresses API documentation audit findings: - New message templates endpoint with full CRUD - Missing endpoints for bookings, services, resources, and people - Missing attributes across bookings, services, events, people, resources, providers, and categories - Remove stale google_order_number from bookings - Update service types to include product and gift_card - Fix nav_order collisions in sidebar Co-Authored-By: Claude <noreply@anthropic.com>
1 parent d97413d commit cef5879

12 files changed

Lines changed: 199 additions & 5 deletions

_endpoints/account.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Account
3-
nav_order: 14
3+
nav_order: 15
44
---
55

66
Information and settings for your account.

_endpoints/bookings.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,16 @@ nav_order: 2
2323
<tr><td>reminded_at</td><td>Datetime</td><td>Not required</td></tr>
2424
<tr><td>paid_at</td><td>Datetime</td><td>Not required</td></tr>
2525
<tr><td>external_id</td><td>String</td><td>Not required</td></tr>
26-
<tr><td>google_order_number</td><td>String</td><td>Not required</td></tr>
26+
<tr><td>paid_amount</td><td>Decimal</td><td>Not required</td></tr>
27+
<tr><td>revision_count</td><td>Integer</td><td>Automatically set</td></tr>
28+
<tr><td>created_by</td><td>String</td><td>Automatically set</td></tr>
29+
<tr><td>updated_by</td><td>String</td><td>Automatically set</td></tr>
30+
<tr><td>external_url</td><td>String</td><td>Not required</td></tr>
31+
<tr><td>external_host_url</td><td>String</td><td>Not required</td></tr>
32+
<tr><td>booked_by_person_id</td><td>Integer</td><td>Not required. Person who made the booking (e.g. parent booking for child).</td></tr>
33+
<tr><td>verification_method</td><td>String</td><td>Only for output.</td></tr>
34+
<tr><td>location_url</td><td>String</td><td>Only for output.</td></tr>
35+
<tr><td>location_host_url</td><td>String</td><td>Only for output.</td></tr>
2736
<tr><td>custom_data</td><td>Array</td><td>Not required</td></tr>
2837
<tr><td>state</td><td>String</td><td>Automatically set. See states</td></tr>
2938
<tr><td>active</td><td>Boolean</td><td>Automatically set</td></tr>
@@ -85,6 +94,8 @@ See query parameters for filtering the output beyond the default outputs.
8594

8695
`GET /bookings/visible` will return all active bookings as well as those declined or cancelled. This is the preferred output if you want to provide a list of all bookings for visual presentation.
8796

97+
`GET /bookings/no_status` will return all active bookings with no status set.
98+
8899
Response
89100

90101
```json
@@ -218,6 +229,10 @@ You should always specify COUNT or UNTIL with RRULE. The max number of occurrenc
218229

219230
`GET /bookings/recurring/{collection_id}` will return all occurrences for a collection.
220231

232+
### Cancel all occurrences
233+
234+
`PUT /bookings/recurring/{collection_id}/cancel` will cancel *all* occurrences for a collection.
235+
221236
### Delete all occurrences
222237

223238
`DELETE /bookings/recurring/{collection_id}` will delete *all* occurrences for a collection.

_endpoints/categories.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Services can be listed in a category. Categories can be presented like a tree. R
1515
<tr><td>title</td><td>String</td><td>Required</td></tr>
1616
<tr><td>parent_id</td><td>Integer</td><td></td></tr>
1717
<tr><td>custom_data</td><td>Array</td><td>Not required.</td></tr>
18+
<tr><td>priority_value</td><td>Integer</td><td>Not required. Priority value for ordering.</td></tr>
1819
</table>
1920

2021
## Listing

_endpoints/events.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ While events are connected to a resource bookings or capacity of an event are no
2323
<tr><td>custom_data</td><td>Array</td><td>Not required</td></tr>
2424
<tr><td>title</td><td>String</td><td></td></tr>
2525
<tr><td>description</td><td>Text</td><td></td></tr>
26+
<tr><td>first_booking_at</td><td>Datetime</td><td>Not required. Earliest allowed booking time.</td></tr>
27+
<tr><td>last_booking_at</td><td>Datetime</td><td>Not required. Latest allowed booking time.</td></tr>
28+
<tr><td>availability</td><td>Integer</td><td>Only for output. Current available capacity.</td></tr>
29+
<tr><td>nr_of_attendances</td><td>Integer</td><td>Only for output. Number of current attendees.</td></tr>
2630
</table>
2731

2832
## Listing

_endpoints/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@ See the [guide](/guide/getting-started/) for general information about authentic
2020
- [Coupons](/endpoints/coupons/)
2121
- [Orders](/endpoints/orders/)
2222
- [Gift Cards](/endpoints/gift-cards/)
23+
- [Message Templates](/endpoints/message-templates/)
2324
- [Webhooks](/endpoints/webhooks/)
2425
- [Account](/endpoints/account/)

_endpoints/message-templates.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
title: Message Templates
3+
nav_order: 13
4+
---
5+
6+
Message templates define the content of messages sent to customers for booking events such as confirmation, reminder, and follow-up.
7+
8+
## Attributes
9+
10+
<table>
11+
<tr><th>Name</th><th>Type</th><th>Description</th></tr>
12+
<tr><td>id</td><td>Integer</td><td>Automatically set</td></tr>
13+
<tr><td>created_at</td><td>Datetime</td><td>Automatically set</td></tr>
14+
<tr><td>updated_at</td><td>Datetime</td><td>Automatically set</td></tr>
15+
<tr><td>message_type</td><td>String</td><td>Values: confirmation, reminder, follow_up. See message types.</td></tr>
16+
<tr><td>delivery_type</td><td>String</td><td>Values: email, sms.</td></tr>
17+
<tr><td>subject</td><td>String</td><td>Message subject line. Only applicable for email.</td></tr>
18+
<tr><td>template</td><td>Liquid-Text</td><td>Message body template.</td></tr>
19+
<tr><td>delivery_timing</td><td>String</td><td>When the message should be delivered. See delivery timing.</td></tr>
20+
<tr><td>active</td><td>Boolean</td><td>Whether the template is active.</td></tr>
21+
<tr><td>services</td><td>Array</td><td>Service IDs this template applies to.</td></tr>
22+
<tr><td>custom_data</td><td>Array</td><td>Not required</td></tr>
23+
</table>
24+
25+
## Message types
26+
27+
* `confirmation` — sent when a booking is created.
28+
* `reminder` — sent before a booking starts.
29+
* `follow_up` — sent after a booking ends.
30+
31+
## Delivery timing
32+
33+
The `delivery_timing` value is a natural language time expression parsed relative to a base time that depends on `message_type`:
34+
35+
<table>
36+
<tr><th>message_type</th><th>Base time</th><th>Example delivery_timing</th><th>Result</th></tr>
37+
<tr><td>confirmation</td><td>created_at (booking creation)</td><td>in 5 minutes</td><td>5 min after booking is created</td></tr>
38+
<tr><td>reminder</td><td>starts_at (booking start)</td><td>3 hours ago</td><td>3 hours before booking starts</td></tr>
39+
<tr><td>reminder</td><td>starts_at</td><td>1 day ago</td><td>1 day before booking starts</td></tr>
40+
<tr><td>follow_up</td><td>ends_at (booking end)</td><td>in 2 hours</td><td>2 hours after booking ends</td></tr>
41+
<tr><td>follow_up</td><td>ends_at</td><td>in 1 day</td><td>1 day after booking ends</td></tr>
42+
</table>
43+
44+
The expression is parsed relative to the base time. So `3 hours ago` relative to `starts_at` means 3 hours *before* the booking starts, and `in 2 hours` relative to `ends_at` means 2 hours *after* the booking ends.
45+
46+
## Listing
47+
48+
`GET /message_templates` will return all message templates.
49+
50+
Response
51+
52+
```json
53+
[
54+
{
55+
"message_template": {
56+
"id": 1,
57+
"created_at": "2012-09-20T15:34:16+02:00",
58+
"updated_at": "2012-09-20T15:34:16+02:00",
59+
"message_type": "confirmation",
60+
"delivery_type": "email",
61+
"subject": "Your booking is confirmed",
62+
"template": "Hi {{ person.name }}, your booking is confirmed.",
63+
"delivery_timing": "in 5 minutes",
64+
"active": true,
65+
"services": [1, 2],
66+
"custom_data": null
67+
}
68+
}
69+
]
70+
```
71+
72+
## Get message template
73+
74+
`GET /message_templates/{message_template_id}` will get a message template with id `{message_template_id}`.
75+
76+
## Add new message template
77+
78+
`POST /message_templates` will create a new message template.
79+
80+
## Update message template
81+
82+
`PUT /message_templates/{message_template_id}` will update existing message template with id `{message_template_id}`.
83+
84+
## Delete message template
85+
86+
`DELETE /message_templates/{message_template_id}` will delete existing message template with id `{message_template_id}`.

_endpoints/people.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ It is possible to give a person ability to book on behalf of other people. This
2929
<tr><td>country_code</td><td>String</td><td>Not required. ISO 3166-1 alpha-2.</td></tr>
3030
<tr><td>notes</td><td>Text</td><td>Not required.</td></tr>
3131
<tr><td>parent_id</td><td>Integer</td><td>Id of parent.</td></tr>
32+
<tr><td>blocked</td><td>Boolean</td><td>Whether the person is blocked from booking.</td></tr>
33+
<tr><td>locale</td><td>String</td><td>Person's preferred locale.</td></tr>
34+
<tr><td>opt_in_marketing</td><td>Boolean</td><td>Only for output. Whether person has opted in to marketing.</td></tr>
3235
</table>
3336

3437
## Listing
@@ -99,6 +102,18 @@ You can search multiple columns at once, for example `email` and `phone_number`,
99102

100103
`DELETE /people/{person_id}` will delete existing person with id `{person_id}`.
101104

105+
## Block person
106+
107+
`PUT /people/{person_id}/block` will block person with id `{person_id}` from making bookings.
108+
109+
## Unblock person
110+
111+
`PUT /people/{person_id}/unblock` will unblock person with id `{person_id}`.
112+
113+
## Authenticate person
114+
115+
`POST /people/authenticate` will authenticate a person. Specify credentials using `person[email]` or `person[phone_number]` and `person[password]`.
116+
102117
## Undelete person
103118

104119
`PUT /people/{person_id}/undelete` will undelete existing person with id `{person_id}`.

_endpoints/providers.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Resources provides services. This link is called a provider.
2222
<tr><td>opening_hours_fri</td><td>Array</td><td>Opening hours for Friday. Fallback to resource availability.</td></tr>
2323
<tr><td>opening_hours_sat</td><td>Array</td><td>Opening hours for Saturday. Fallback to resource availability.</td></tr>
2424
<tr><td>opening_hours_sun</td><td>Array</td><td>Opening hours for Sunday. Fallback to resource availability.</td></tr>
25+
<tr><td>priority_value</td><td>Integer</td><td>Not required. Priority value for ordering.</td></tr>
2526
</table>
2627

2728
Opening hours for a provider works in the same way as availability is defined on [resource exception date](/endpoints/resource-exception-dates/).

_endpoints/resources.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ nav_order: 6
1313
<tr><td>title</td><td>String</td><td>Required</td></tr>
1414
<tr><td>active</td><td>Boolean</td><td>Automatically set</td></tr>
1515
<tr><td>capacity</td><td>Integer</td><td></td></tr>
16+
<tr><td>custom_data</td><td>Array</td><td>Not required</td></tr>
1617
<tr><td>opening_hours_mon</td><td>Array</td><td>Default opening hours for Monday.</td></tr>
1718
<tr><td>opening_hours_tue</td><td>Array</td><td>Default opening hours for Tuesday.</td></tr>
1819
<tr><td>opening_hours_wed</td><td>Array</td><td>Default opening hours for Wednesday.</td></tr>
@@ -91,6 +92,18 @@ Response
9192

9293
`DELETE /resources/{resource_id}` will delete existing resource with id `{resource_id}`. Deleting a resource will set it to active=false and will not be returned in any listings.
9394

95+
## Get opening hours for all resources
96+
97+
`GET /resources/opening_hours` will return opening hours for all resources on specific dates.
98+
99+
### Query Parameters
100+
101+
<table>
102+
<tr><th>Name</th><th>Type</th><th>Description</th></tr>
103+
<tr><td>from</td><td>Date</td><td>Default: today</td></tr>
104+
<tr><td>to</td><td>Date</td><td>Default: today</td></tr>
105+
</table>
106+
94107
## Get opening hours for specific dates
95108

96109
Opening hours for specific dates is based on the standard opening hours that are specified on the resource but can be overridden with entries in [resource exception dates](/endpoints/resource-exception-dates/).

_endpoints/services.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ title: Services
33
nav_order: 4
44
---
55

6-
There are two types of services:
6+
There are four types of services:
77

88
* Appointment
99
* Attendance
10+
* Product
11+
* Gift card
1012

1113
Appointments can be booked within fixed opening hours as specified on the Resource and with exceptions specified in ResourceExceptionDate.
1214

@@ -31,14 +33,28 @@ Attendance at an event is also a booking but the individual booking datetime or
3133
<tr><td>same_day</td><td>Boolean</td><td>Not required (default false)</td></tr>
3234
<tr><td>template</td><td>String</td><td>Component template (calendar view)</td></tr>
3335
<tr><td>interval_rounding</td><td>Integer</td><td>Overrides account default (see info on account object)</td></tr>
34-
<tr><td>booking_type</td><td>String</td><td>Required. Values: appointment (default) or attendance</td></tr>
36+
<tr><td>booking_type</td><td>String</td><td>Required. Values: appointment (default), attendance, product, gift_card</td></tr>
3537
<tr><td>custom_data</td><td>Array</td><td>Not required</td></tr>
3638
<tr><td>booking_form</td><td>Liquid-Text</td><td>Custom booking form</td></tr>
3739
<tr><td>mail_verification</td><td>Liquid-Text</td><td></td></tr>
3840
<tr><td>mail_confirmation</td><td>Liquid-Text</td><td></td></tr>
3941
<tr><td>sms_verification</td><td>Liquid-Text</td><td></td></tr>
4042
<tr><td>sms_confirmation</td><td>Liquid-Text</td><td></td></tr>
4143
<tr><td>sms_reminder</td><td>Liquid-Text</td><td></td></tr>
44+
<tr><td>mail_modification</td><td>Liquid-Text</td><td></td></tr>
45+
<tr><td>mail_awaiting_confirmation</td><td>Liquid-Text</td><td></td></tr>
46+
<tr><td>mail_cancellation</td><td>Liquid-Text</td><td></td></tr>
47+
<tr><td>sms_modification</td><td>Liquid-Text</td><td></td></tr>
48+
<tr><td>sms_awaiting_confirmation</td><td>Liquid-Text</td><td></td></tr>
49+
<tr><td>sms_cancellation</td><td>Liquid-Text</td><td></td></tr>
50+
<tr><td>next_interval</td><td>Integer</td><td>Not required</td></tr>
51+
<tr><td>payment_required</td><td>Boolean</td><td>Not required</td></tr>
52+
<tr><td>allow_invoice</td><td>Boolean</td><td>Not required</td></tr>
53+
<tr><td>booking_minimum</td><td>Integer</td><td>Not required</td></tr>
54+
<tr><td>terms</td><td>Text</td><td>Not required</td></tr>
55+
<tr><td>priority_strategy</td><td>String</td><td>Not required. Strategy for resource priority assignment.</td></tr>
56+
<tr><td>availability_type</td><td>String</td><td>Not required. Type of availability calculation.</td></tr>
57+
<tr><td>priority_value</td><td>Integer</td><td>Not required. Priority value for ordering.</td></tr>
4258
</table>
4359

4460
### Deprecated attributes
@@ -52,6 +68,14 @@ Attendance at an event is also a booking but the individual booking datetime or
5268

5369
`GET /services` will return all services.
5470

71+
`GET /services/appointments` will return all services with booking_type=appointment.
72+
73+
`GET /services/attendances` will return all services with booking_type=attendance.
74+
75+
`GET /services/products` will return all services with booking_type=product.
76+
77+
`GET /services/gift_cards` will return all services with booking_type=gift_card.
78+
5579
Response
5680

5781
```json
@@ -92,6 +116,10 @@ Response
92116

93117
`PUT /services/{service_id}` will update existing service with id `{service_id}`.
94118

119+
## Get availability
120+
121+
`GET /services/{service_id}/availability` will return available resources for a service with id `{service_id}`.
122+
95123
## Delete service
96124

97125
`DELETE /services/{service_id}` will delete existing service with id `{service_id}`. Deleting a service will set it to active=false and will not be returned in any listings.

0 commit comments

Comments
 (0)