Skip to content

Commit d267c34

Browse files
espenclaude
andcommitted
Add orders endpoint documentation
Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 3309de3 commit d267c34

4 files changed

Lines changed: 102 additions & 2 deletions

File tree

_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: 12
3+
nav_order: 13
44
---
55

66
Information and settings for your account.

_endpoints/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ See the [guide](/guide/getting-started/) for general information about authentic
1818
- [Providers](/endpoints/providers/)
1919
- [Categories](/endpoints/categories/)
2020
- [Coupons](/endpoints/coupons/)
21+
- [Orders](/endpoints/orders/)
2122
- [Webhooks](/endpoints/webhooks/)
2223
- [Account](/endpoints/account/)

_endpoints/orders.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
---
2+
title: Orders
3+
nav_order: 11
4+
---
5+
6+
## Attributes
7+
8+
<table>
9+
<tr><th>Name</th><th>Type</th><th>Description</th></tr>
10+
<tr><td>id</td><td>Integer</td><td>Automatically set</td></tr>
11+
<tr><td>created_at</td><td>Datetime</td><td>Automatically set</td></tr>
12+
<tr><td>updated_at</td><td>Datetime</td><td>Automatically set</td></tr>
13+
<tr><td>person_id</td><td>Integer</td><td></td></tr>
14+
<tr><td>state</td><td>String</td><td>pending, confirmed or cancelled</td></tr>
15+
<tr><td>total</td><td>Decimal</td><td>Total amount before discount</td></tr>
16+
<tr><td>discount_amount</td><td>Decimal</td><td>Discount from applied coupon</td></tr>
17+
<tr><td>coupon_id</td><td>Integer</td><td>Applied coupon</td></tr>
18+
<tr><td>paid_amount</td><td>Decimal</td><td>Total amount paid</td></tr>
19+
<tr><td>settled_at</td><td>Datetime</td><td>Set when order is fully paid</td></tr>
20+
<tr><td>balance</td><td>Decimal</td><td>Calculated. payable_amount - paid_amount</td></tr>
21+
<tr><td>payable_amount</td><td>Decimal</td><td>Calculated. total - discount_amount</td></tr>
22+
</table>
23+
24+
The response includes nested `person` and `order_line_items`.
25+
26+
### Person
27+
28+
<table>
29+
<tr><th>Name</th><th>Type</th><th>Description</th></tr>
30+
<tr><td>id</td><td>Integer</td><td></td></tr>
31+
<tr><td>name</td><td>String</td><td></td></tr>
32+
<tr><td>email</td><td>String</td><td></td></tr>
33+
</table>
34+
35+
### Order line items
36+
37+
<table>
38+
<tr><th>Name</th><th>Type</th><th>Description</th></tr>
39+
<tr><td>id</td><td>Integer</td><td></td></tr>
40+
<tr><td>service_id</td><td>Integer</td><td></td></tr>
41+
<tr><td>quantity</td><td>Integer</td><td></td></tr>
42+
<tr><td>amount</td><td>Decimal</td><td>Unit price</td></tr>
43+
<tr><td>gift_card_id</td><td>Integer</td><td>Associated gift card if applicable</td></tr>
44+
<tr><td>booking_id</td><td>Integer</td><td>Associated booking if applicable</td></tr>
45+
</table>
46+
47+
## Listing
48+
49+
`GET /orders` will return all orders.
50+
51+
Response
52+
53+
```json
54+
[
55+
{
56+
"order": {
57+
"id": 1,
58+
"person_id": 38,
59+
"state": "confirmed",
60+
"total": "1000.0",
61+
"discount_amount": "0.0",
62+
"coupon_id": null,
63+
"paid_amount": "0.0",
64+
"settled_at": null,
65+
"created_at": "2026-03-26T10:00:00+02:00",
66+
"updated_at": "2026-03-26T10:00:00+02:00",
67+
"balance": "1000.0",
68+
"payable_amount": "1000.0",
69+
"person": {
70+
"id": 38,
71+
"name": "Espen Antonsen",
72+
"email": "espen@example.com"
73+
},
74+
"order_line_items": [
75+
{
76+
"id": 1,
77+
"service_id": 37,
78+
"quantity": 1,
79+
"amount": "1000.0",
80+
"gift_card_id": null,
81+
"booking_id": null
82+
}
83+
]
84+
}
85+
}
86+
]
87+
```
88+
89+
### Query Parameters
90+
91+
<table>
92+
<tr><th>Name</th><th>Type</th><th>Description</th></tr>
93+
<tr><td>state</td><td>String</td><td>Filter by state: pending, confirmed or cancelled</td></tr>
94+
<tr><td>person_id</td><td>Integer</td><td>Filter by person</td></tr>
95+
</table>
96+
97+
## Get order
98+
99+
`GET /orders/{order_id}` will get an order with id `{order_id}`.

_endpoints/webhooks.md

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

66
## Attributes

0 commit comments

Comments
 (0)