get_around_owner 1.0.0 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Owner API v1.json +2938 -0
- data/README.md +338 -181
- data/Rakefile +0 -2
- data/docs/Car.md +12 -0
- data/docs/CarId.md +6 -0
- data/docs/CarIdUnavailabilitiesJsonBody.md +9 -0
- data/docs/CarsApi.md +38 -79
- data/docs/CarsIndex.md +6 -0
- data/docs/Checkin.md +10 -0
- data/docs/CheckinsApi.md +76 -33
- data/docs/CheckinsIndex.md +6 -0
- data/docs/Checkout.md +11 -0
- data/docs/CheckoutsApi.md +76 -33
- data/docs/CheckoutsIndex.md +6 -0
- data/docs/EndsAt.md +6 -0
- data/docs/Invoice.md +15 -0
- data/docs/InvoicesApi.md +62 -124
- data/docs/InvoicesIndex.md +6 -0
- data/docs/Message.md +11 -0
- data/docs/MessagesApi.md +122 -31
- data/docs/MessagesSent.md +6 -0
- data/docs/Payout.md +12 -0
- data/docs/PayoutsApi.md +42 -83
- data/docs/PayoutsIndex.md +6 -0
- data/docs/Rental.md +14 -0
- data/docs/RentalIdMessagesJsonBody.md +7 -0
- data/docs/RentalInvoicesIndex.md +6 -0
- data/docs/RentalMessagesIndex.md +6 -0
- data/docs/RentalsApi.md +54 -203
- data/docs/RentalsBooked.md +6 -0
- data/docs/RentalsCanceled.md +6 -0
- data/docs/RentalsCarCheckedIn.md +6 -0
- data/docs/RentalsCarCheckedOut.md +6 -0
- data/docs/RentalsCarSwitched.md +6 -0
- data/docs/RentalsIndex.md +6 -0
- data/docs/RentalsTimesChanged.md +6 -0
- data/docs/StartsAt.md +6 -0
- data/docs/UnavailabilitiesApi.md +100 -68
- data/docs/UnavailabilitiesCreated.md +6 -0
- data/docs/UnavailabilitiesDeleted.md +6 -0
- data/docs/UnavailabilitiesIndex.md +6 -0
- data/docs/Unavailability.md +10 -0
- data/docs/User.md +19 -0
- data/docs/UsersApi.md +27 -41
- data/docs/UsersUpdated.md +6 -0
- data/docs/Webhook.md +9 -0
- data/get_around_owner-1.0.0.gem +0 -0
- data/get_around_owner-1.0.1.gem +0 -0
- data/get_around_owner.gemspec +16 -3
- data/getaround-api.gemspec +38 -0
- data/git_push.sh +9 -11
- data/lib/{get_around_owner → getaround-api}/api/cars_api.rb +25 -41
- data/lib/getaround-api/api/checkins_api.rb +146 -0
- data/lib/getaround-api/api/checkouts_api.rb +146 -0
- data/lib/{get_around_owner → getaround-api}/api/invoices_api.rb +43 -66
- data/lib/getaround-api/api/messages_api.rb +198 -0
- data/lib/{get_around_owner → getaround-api}/api/payouts_api.rb +29 -45
- data/lib/getaround-api/api/rentals_api.rb +146 -0
- data/lib/getaround-api/api/unavailabilities_api.rb +208 -0
- data/lib/{get_around_owner/api/messages_api.rb → getaround-api/api/users_api.rb} +31 -37
- data/lib/{get_around_owner → getaround-api}/api_client.rb +71 -77
- data/lib/{get_around_owner → getaround-api}/api_error.rb +5 -6
- data/lib/{get_around_owner → getaround-api}/configuration.rb +13 -106
- data/lib/{get_around_owner/models/getaround_car.rb → getaround-api/models/car.rb} +36 -56
- data/lib/{get_around_owner/models/getaround_users_updated_all_of_data.rb → getaround-api/models/car_id.rb} +33 -50
- data/lib/{get_around_owner/models/getaround_destroy_unavailability_request.rb → getaround-api/models/car_id_unavailabilities_json_body.rb} +45 -47
- data/lib/{get_around_owner/models/getaround_rentals_booked_all_of_data.rb → getaround-api/models/cars_index.rb} +33 -50
- data/lib/{get_around_owner/models/getaround_checkin.rb → getaround-api/models/checkin.rb} +34 -65
- data/lib/{get_around_owner/models/getaround_rentals_index_inner.rb → getaround-api/models/checkins_index.rb} +32 -58
- data/lib/{get_around_owner/models/getaround_checkout.rb → getaround-api/models/checkout.rb} +35 -70
- data/lib/getaround-api/models/checkouts_index.rb +197 -0
- data/lib/getaround-api/models/ends_at.rb +198 -0
- data/lib/{get_around_owner/models/getaround_invoice.rb → getaround-api/models/invoice.rb} +45 -113
- data/lib/getaround-api/models/invoices_index.rb +198 -0
- data/lib/{get_around_owner/models/getaround_message.rb → getaround-api/models/message.rb} +35 -53
- data/lib/getaround-api/models/messages_sent.rb +197 -0
- data/lib/{get_around_owner/models/getaround_payout.rb → getaround-api/models/payout.rb} +37 -101
- data/lib/getaround-api/models/payouts_index.rb +198 -0
- data/lib/{get_around_owner/models/getaround_rental.rb → getaround-api/models/rental.rb} +38 -100
- data/lib/{get_around_owner/models/getaround_create_messages_request.rb → getaround-api/models/rental_id_messages_json_body.rb} +31 -41
- data/lib/getaround-api/models/rental_invoices_index.rb +198 -0
- data/lib/getaround-api/models/rental_messages_index.rb +198 -0
- data/lib/getaround-api/models/rentals_booked.rb +197 -0
- data/lib/getaround-api/models/rentals_canceled.rb +197 -0
- data/lib/getaround-api/models/rentals_car_checked_in.rb +197 -0
- data/lib/getaround-api/models/rentals_car_checked_out.rb +197 -0
- data/lib/getaround-api/models/rentals_car_switched.rb +197 -0
- data/lib/getaround-api/models/rentals_index.rb +198 -0
- data/lib/getaround-api/models/rentals_times_changed.rb +197 -0
- data/lib/getaround-api/models/starts_at.rb +198 -0
- data/lib/{get_around_owner/models/getaround_cars_index_inner.rb → getaround-api/models/unavailabilities_created.rb} +32 -58
- data/lib/getaround-api/models/unavailabilities_deleted.rb +197 -0
- data/lib/getaround-api/models/unavailabilities_index.rb +198 -0
- data/lib/{get_around_owner/models/getaround_unavailabilities_created_all_of_data.rb → getaround-api/models/unavailability.rb} +51 -65
- data/lib/{get_around_owner/models/getaround_user.rb → getaround-api/models/user.rb} +43 -75
- data/lib/getaround-api/models/users_updated.rb +197 -0
- data/lib/{get_around_owner/models/getaround_webhook.rb → getaround-api/models/webhook.rb} +38 -47
- data/lib/{get_around_owner → getaround-api}/version.rb +5 -6
- data/lib/getaround-api.rb +81 -0
- data/openapi.yml +2298 -0
- data/spec/api/cars_api_spec.rb +13 -14
- data/spec/api/checkins_api_spec.rb +13 -14
- data/spec/api/checkouts_api_spec.rb +13 -14
- data/spec/api/invoices_api_spec.rb +19 -20
- data/spec/api/messages_api_spec.rb +14 -15
- data/spec/api/payouts_api_spec.rb +13 -14
- data/spec/api/rentals_api_spec.rb +13 -14
- data/spec/api/unavailabilities_api_spec.rb +14 -16
- data/spec/api/users_api_spec.rb +9 -10
- data/spec/api_client_spec.rb +225 -0
- data/spec/base_object_spec.rb +109 -0
- data/spec/{models/getaround_checkins_index_inner_spec.rb → configuration_spec.rb} +26 -21
- data/spec/models/{getaround_reason_spec.rb → car_id_spec.rb} +18 -14
- data/spec/models/{getaround_unavailabilities_deleted_all_of_data_spec.rb → car_id_unavailabilities_json_body_spec.rb} +24 -20
- data/spec/models/{getaround_car_spec.rb → car_spec.rb} +24 -20
- data/spec/models/cars_index_spec.rb +34 -0
- data/spec/models/{getaround_checkin_spec.rb → checkin_spec.rb} +22 -18
- data/spec/models/checkins_index_spec.rb +34 -0
- data/spec/models/{getaround_checkout_spec.rb → checkout_spec.rb} +23 -19
- data/spec/models/checkouts_index_spec.rb +34 -0
- data/spec/models/ends_at_spec.rb +34 -0
- data/spec/models/{getaround_invoice_spec.rb → invoice_spec.rb} +27 -31
- data/spec/models/invoices_index_spec.rb +34 -0
- data/spec/models/{getaround_message_spec.rb → message_spec.rb} +23 -19
- data/spec/models/messages_sent_spec.rb +34 -0
- data/spec/models/{getaround_payout_spec.rb → payout_spec.rb} +24 -24
- data/spec/models/payouts_index_spec.rb +34 -0
- data/spec/models/{getaround_create_messages_request_spec.rb → rental_id_messages_json_body_spec.rb} +19 -15
- data/spec/models/{getaround_rentals_index_inner_spec.rb → rental_invoices_index_spec.rb} +16 -18
- data/spec/models/rental_messages_index_spec.rb +34 -0
- data/spec/models/{getaround_rental_spec.rb → rental_spec.rb} +26 -22
- data/spec/models/rentals_booked_spec.rb +34 -0
- data/spec/models/rentals_canceled_spec.rb +34 -0
- data/spec/models/rentals_car_checked_in_spec.rb +34 -0
- data/spec/models/rentals_car_checked_out_spec.rb +34 -0
- data/spec/models/rentals_car_switched_spec.rb +34 -0
- data/spec/models/rentals_index_spec.rb +34 -0
- data/spec/models/rentals_times_changed_spec.rb +34 -0
- data/spec/models/starts_at_spec.rb +34 -0
- data/spec/models/{getaround_cars_index_inner_spec.rb → unavailabilities_created_spec.rb} +16 -18
- data/spec/models/{getaround_payouts_index_inner_spec.rb → unavailabilities_deleted_spec.rb} +16 -18
- data/spec/models/unavailabilities_index_spec.rb +34 -0
- data/spec/models/{getaround_unavailabilities_created_all_of_data_spec.rb → unavailability_spec.rb} +22 -18
- data/spec/models/{getaround_user_spec.rb → user_spec.rb} +31 -27
- data/spec/models/users_updated_spec.rb +34 -0
- data/spec/models/{getaround_webhook_spec.rb → webhook_spec.rb} +21 -17
- data/spec/spec_helper.rb +5 -6
- metadata +237 -132
- data/lib/get_around_owner/api/checkins_api.rb +0 -82
- data/lib/get_around_owner/api/checkouts_api.rb +0 -82
- data/lib/get_around_owner/api/rentals_api.rb +0 -262
- data/lib/get_around_owner/api/unavailabilities_api.rb +0 -142
- data/lib/get_around_owner/api/users_api.rb +0 -82
- data/lib/get_around_owner/models/getaround_checkins_index_inner.rb +0 -222
- data/lib/get_around_owner/models/getaround_create_unavailabilities_request.rb +0 -283
- data/lib/get_around_owner/models/getaround_invoice_charges_inner.rb +0 -225
- data/lib/get_around_owner/models/getaround_invoices_index_inner.rb +0 -223
- data/lib/get_around_owner/models/getaround_messages_sent.rb +0 -257
- data/lib/get_around_owner/models/getaround_messages_sent_all_of_data.rb +0 -225
- data/lib/get_around_owner/models/getaround_payout_invoices_inner.rb +0 -223
- data/lib/get_around_owner/models/getaround_payouts_index_inner.rb +0 -223
- data/lib/get_around_owner/models/getaround_reason.rb +0 -45
- data/lib/get_around_owner/models/getaround_rental_invoices_index_inner.rb +0 -223
- data/lib/get_around_owner/models/getaround_rental_messages_index_inner.rb +0 -223
- data/lib/get_around_owner/models/getaround_rentals_booked.rb +0 -257
- data/lib/get_around_owner/models/getaround_rentals_canceled.rb +0 -257
- data/lib/get_around_owner/models/getaround_rentals_car_checked_in.rb +0 -257
- data/lib/get_around_owner/models/getaround_rentals_car_checked_out.rb +0 -257
- data/lib/get_around_owner/models/getaround_rentals_car_switched.rb +0 -257
- data/lib/get_around_owner/models/getaround_rentals_times_changed.rb +0 -257
- data/lib/get_around_owner/models/getaround_unavailabilities_created.rb +0 -257
- data/lib/get_around_owner/models/getaround_unavailabilities_deleted.rb +0 -257
- data/lib/get_around_owner/models/getaround_unavailabilities_deleted_all_of_data.rb +0 -235
- data/lib/get_around_owner/models/getaround_unavailability.rb +0 -302
- data/lib/get_around_owner/models/getaround_users_updated.rb +0 -257
- data/lib/get_around_owner.rb +0 -86
- data/spec/models/getaround_create_unavailabilities_request_spec.rb +0 -52
- data/spec/models/getaround_destroy_unavailability_request_spec.rb +0 -42
- data/spec/models/getaround_invoice_charges_inner_spec.rb +0 -42
- data/spec/models/getaround_invoices_index_inner_spec.rb +0 -36
- data/spec/models/getaround_messages_sent_all_of_data_spec.rb +0 -42
- data/spec/models/getaround_messages_sent_spec.rb +0 -48
- data/spec/models/getaround_payout_invoices_inner_spec.rb +0 -36
- data/spec/models/getaround_rental_invoices_index_inner_spec.rb +0 -36
- data/spec/models/getaround_rental_messages_index_inner_spec.rb +0 -36
- data/spec/models/getaround_rentals_booked_all_of_data_spec.rb +0 -36
- data/spec/models/getaround_rentals_booked_spec.rb +0 -48
- data/spec/models/getaround_rentals_canceled_spec.rb +0 -48
- data/spec/models/getaround_rentals_car_checked_in_spec.rb +0 -48
- data/spec/models/getaround_rentals_car_checked_out_spec.rb +0 -48
- data/spec/models/getaround_rentals_car_switched_spec.rb +0 -48
- data/spec/models/getaround_rentals_times_changed_spec.rb +0 -48
- data/spec/models/getaround_unavailabilities_created_spec.rb +0 -48
- data/spec/models/getaround_unavailabilities_deleted_spec.rb +0 -48
- data/spec/models/getaround_unavailability_spec.rb +0 -58
- data/spec/models/getaround_users_updated_all_of_data_spec.rb +0 -36
- data/spec/models/getaround_users_updated_spec.rb +0 -48
data/openapi.yml
ADDED
@@ -0,0 +1,2298 @@
|
|
1
|
+
openapi: 3.1.0
|
2
|
+
info:
|
3
|
+
version: 1.0.0
|
4
|
+
title: Getaround Owner API
|
5
|
+
x-logo:
|
6
|
+
url: https://getaround-assets.gumlet.io/logos/logo-getaround.png
|
7
|
+
altText: Getaround logo
|
8
|
+
contact:
|
9
|
+
name: Getaround EU Owner API Support
|
10
|
+
email: owner-api@getaround.com
|
11
|
+
description: >
|
12
|
+
# Quick Start
|
13
|
+
|
14
|
+
|
15
|
+
The Owner API uses the JSON format, and must be accessed over a [secure
|
16
|
+
connection](https://en.wikipedia.org/wiki/HTTPS).
|
17
|
+
|
18
|
+
|
19
|
+
Let’s assume that the access token provided by your account manager is
|
20
|
+
“TOKEN”.
|
21
|
+
|
22
|
+
|
23
|
+
Here’s how to get the list of ids of all your invoices from the first week
|
24
|
+
of August with a shell script:
|
25
|
+
|
26
|
+
|
27
|
+
```bash
|
28
|
+
|
29
|
+
query="end_date=2018-08-08T00%3A00%3A00%2B00%3A00&start_date=2018-08-01T00%3A00%3A00%2B00%3A00"
|
30
|
+
|
31
|
+
|
32
|
+
curl -i "https://api-eu.getaround.com/owner/v1/invoices?${query}" \
|
33
|
+
-H "Authorization: Bearer TOKEN" \
|
34
|
+
-H "Accept:application/json" \
|
35
|
+
-H "Content-Type:application/json"
|
36
|
+
```
|
37
|
+
|
38
|
+
|
39
|
+
And here’s how to get the invoice with the id 12345:
|
40
|
+
|
41
|
+
|
42
|
+
```bash
|
43
|
+
|
44
|
+
curl -i "https://api-eu.getaround.com/owner/v1/invoices/12345" \
|
45
|
+
-H "Authorization: Bearer TOKEN" \
|
46
|
+
-H "Accept: application/json" \
|
47
|
+
-H "Content-Type: application/json""
|
48
|
+
```
|
49
|
+
|
50
|
+
|
51
|
+
See the [endpoints section](#tag/Invoices) of this guide for details about
|
52
|
+
the response format.
|
53
|
+
|
54
|
+
|
55
|
+
Dates in request params should follow the ISO 8601 standard.
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
# Authentication
|
60
|
+
|
61
|
+
|
62
|
+
All requests must be authenticated with a [bearer token
|
63
|
+
header](https://tools.ietf.org/html/rfc6750#section-2.1). You token will be
|
64
|
+
sent to you by your account manager.
|
65
|
+
|
66
|
+
|
67
|
+
Unauthenticated requests will return a 401 status.
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
# Pagination
|
72
|
+
|
73
|
+
|
74
|
+
The page number and the number of items per page can be set with the “page”
|
75
|
+
and “per_page” params.
|
76
|
+
|
77
|
+
|
78
|
+
For example, this request will return the second page of invoices, and 50
|
79
|
+
invoices per page:
|
80
|
+
|
81
|
+
|
82
|
+
`https://api-eu.getaround.com/owner/v1/invoices?page=2&per_page=50`
|
83
|
+
|
84
|
+
|
85
|
+
Both of these params are optional. The default page size is 30 items.
|
86
|
+
|
87
|
+
|
88
|
+
The Getaround Owner API follows the [RFC 8288
|
89
|
+
convention](https://datatracker.ietf.org/doc/html/rfc8288) of using the
|
90
|
+
`Link` header to provide the `next` page URL. Please don't build the
|
91
|
+
pagination URLs yourself.
|
92
|
+
|
93
|
+
The `next` page will be missing when you are requesting the last available
|
94
|
+
page.
|
95
|
+
|
96
|
+
|
97
|
+
Here's an example response header from requesting the second page of
|
98
|
+
invoices `https://api-eu.getaround.com/owner/v1/invoices?page=2&per_page=50`
|
99
|
+
|
100
|
+
```
|
101
|
+
|
102
|
+
Link: <https://api-eu.getaround.com/owner/v1/invoices?page=3&per_page=50>;
|
103
|
+
rel="next"
|
104
|
+
|
105
|
+
```
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
# Throttling policy and Date range limitation
|
110
|
+
|
111
|
+
|
112
|
+
We have throttling policy that prevents you to perform more than 100
|
113
|
+
requests per min from the same IP.
|
114
|
+
|
115
|
+
|
116
|
+
Also, there is a limitation on the size of the range of dates given in
|
117
|
+
params in some requests.
|
118
|
+
|
119
|
+
|
120
|
+
All requests that need start_date and end_date, do not accept a range bigger
|
121
|
+
than 30 days.
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
# Webhooks
|
126
|
+
|
127
|
+
|
128
|
+
Getaround can send webhook events that notify your application when certain
|
129
|
+
events happen on your account. This is especially useful to follow the
|
130
|
+
lifecycle of rentals, tracking for example bookings or cancellations.
|
131
|
+
|
132
|
+
|
133
|
+
### Setup
|
134
|
+
|
135
|
+
|
136
|
+
To set up an endpoint, you need to define a route on your server for
|
137
|
+
receiving events, and then <a href="mailto:owner-api@getaround.com">ask
|
138
|
+
Getaround</a> to add this URL to your account.
|
139
|
+
|
140
|
+
|
141
|
+
To acknowledge receipt of a event, your endpoint must:
|
142
|
+
|
143
|
+
|
144
|
+
- Return a `2xx` HTTP status code.
|
145
|
+
|
146
|
+
- Be a secure `https` endpoint with a valid SSL certificate.
|
147
|
+
|
148
|
+
|
149
|
+
### Testing
|
150
|
+
|
151
|
+
|
152
|
+
Once Getaround has set up the endpoint, and it is properly configured as
|
153
|
+
described above, a test `ping` event can be sent by clicking the button
|
154
|
+
below:
|
155
|
+
|
156
|
+
|
157
|
+
<form action="/docs/api/owner/fire_ping_webhook" method="post"><input
|
158
|
+
type="submit" value="Send Ping Event"></form>
|
159
|
+
|
160
|
+
|
161
|
+
You should receive the following JSON payload:
|
162
|
+
|
163
|
+
|
164
|
+
```json
|
165
|
+
|
166
|
+
{
|
167
|
+
"data": {
|
168
|
+
"ping": "pong"
|
169
|
+
},
|
170
|
+
"type": "ping",
|
171
|
+
"occurred_at": "2019-04-18T08:30:05Z"
|
172
|
+
}
|
173
|
+
|
174
|
+
```
|
175
|
+
|
176
|
+
|
177
|
+
### Retries
|
178
|
+
|
179
|
+
|
180
|
+
Webhook deliveries will be attempted for up to three days with an
|
181
|
+
exponential back off. After that point the delivery will be abandoned.
|
182
|
+
|
183
|
+
|
184
|
+
### Verifying Signatures
|
185
|
+
|
186
|
+
|
187
|
+
Getaround will also provide you with a secret token, which is used to create
|
188
|
+
a hash signature with each payload.
|
189
|
+
|
190
|
+
|
191
|
+
This hash signature is passed along with each request in the headers as
|
192
|
+
`X-Drivy-Signature`. Suppose you have a basic server listening to webhooks
|
193
|
+
that looks like this:
|
194
|
+
|
195
|
+
|
196
|
+
```ruby
|
197
|
+
|
198
|
+
require 'sinatra'
|
199
|
+
|
200
|
+
require 'json'
|
201
|
+
|
202
|
+
|
203
|
+
post '/payload' do
|
204
|
+
push = JSON.parse(params[:payload])
|
205
|
+
"I got some JSON: #{push.inspect}"
|
206
|
+
end
|
207
|
+
|
208
|
+
```
|
209
|
+
|
210
|
+
|
211
|
+
The goal is to compute a hash using your secret token, and ensure that the
|
212
|
+
hash from Getaround matches. Getaround uses an HMAC hexdigest to compute the
|
213
|
+
hash, so you could change your server to look a little like this:
|
214
|
+
|
215
|
+
|
216
|
+
```ruby
|
217
|
+
|
218
|
+
post '/payload' do
|
219
|
+
request.body.rewind
|
220
|
+
payload_body = request.body.read
|
221
|
+
verify_signature(payload_body)
|
222
|
+
push = JSON.parse(params[:payload])
|
223
|
+
"I got some JSON: #{push.inspect}"
|
224
|
+
end
|
225
|
+
|
226
|
+
|
227
|
+
def verify_signature(payload_body)
|
228
|
+
signature = 'sha1=' + OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha1'), ENV['SECRET_TOKEN'], payload_body)
|
229
|
+
return halt 500, "Signatures didn't match!" unless Rack::Utils.secure_compare(signature, request.env['HTTP_X_DRIVY_SIGNATURE'])
|
230
|
+
end
|
231
|
+
|
232
|
+
```
|
233
|
+
|
234
|
+
|
235
|
+
Obviously, your language and server implementations may differ from this
|
236
|
+
code. There are a couple of important things to point out, however:
|
237
|
+
|
238
|
+
|
239
|
+
No matter which implementation you use, the hash signature starts with
|
240
|
+
`sha1=`, using the key of your secret token and your payload body.
|
241
|
+
|
242
|
+
|
243
|
+
Using a plain `==` operator is not advised. A method like secure_compare
|
244
|
+
performs a "constant time" string comparison, which renders it safe from
|
245
|
+
certain timing attacks against regular equality operators.
|
246
|
+
|
247
|
+
|
248
|
+
### Best Practices
|
249
|
+
|
250
|
+
|
251
|
+
- **Acknowledge events immediately**. If your webhook script performs
|
252
|
+
complex logic, or makes network calls, it’s possible that the script would
|
253
|
+
time out before Getaround sees its complete execution. Ideally, your webhook
|
254
|
+
handler code (acknowledging receipt of an event by returning a `2xx` status
|
255
|
+
code) is separate of any other logic you do for that event.
|
256
|
+
|
257
|
+
- **Handle duplicate events**. Webhook endpoints might occasionally receive
|
258
|
+
the same event more than once. We advise you to guard against duplicated
|
259
|
+
event receipts by making your event processing idempotent. One way of doing
|
260
|
+
this is logging the events you’ve processed, and then not processing
|
261
|
+
already-logged events.
|
262
|
+
|
263
|
+
- **Do not expect events in order**. Getaround does not guarantee delivery
|
264
|
+
of events in the order in which they are generated. Your endpoint should
|
265
|
+
therefore handle this accordingly. We do provide an `occurred_at` timestamp
|
266
|
+
for each event, though, to help reconcile ordering.
|
267
|
+
servers:
|
268
|
+
- url: https://api-eu.getaround.com/owner/v1
|
269
|
+
description: Production server
|
270
|
+
tags:
|
271
|
+
- name: Cars
|
272
|
+
description: Cars
|
273
|
+
- name: Messages
|
274
|
+
description: The messages endpoints will allow you to send and read rentals messages
|
275
|
+
- name: Checkins
|
276
|
+
description: Checkin - data from the start of the rental
|
277
|
+
- name: Checkouts
|
278
|
+
description: Checkout - data from the end of the rental
|
279
|
+
- name: Invoices
|
280
|
+
description: Invoices
|
281
|
+
- name: Payouts
|
282
|
+
description: Payouts received on your bank account
|
283
|
+
- name: Rentals
|
284
|
+
description: Car rentals
|
285
|
+
- name: Unavailabilities
|
286
|
+
description: Car unavailabilities
|
287
|
+
- name: Users
|
288
|
+
description: User operations
|
289
|
+
x-tagGroups:
|
290
|
+
- name: Accounting
|
291
|
+
tags:
|
292
|
+
- Invoices
|
293
|
+
- Payouts
|
294
|
+
- name: Rentals
|
295
|
+
tags:
|
296
|
+
- Rentals
|
297
|
+
- Checkins
|
298
|
+
- Checkouts
|
299
|
+
- Users
|
300
|
+
- name: Calendar
|
301
|
+
tags:
|
302
|
+
- Unavailabilities
|
303
|
+
- name: ""
|
304
|
+
tags:
|
305
|
+
- Cars
|
306
|
+
- name: Messages
|
307
|
+
tags:
|
308
|
+
- Messages
|
309
|
+
paths:
|
310
|
+
/invoices.json:
|
311
|
+
get:
|
312
|
+
operationId: getInvoices
|
313
|
+
tags:
|
314
|
+
- Invoices
|
315
|
+
summary: Find invoices emitted between dates
|
316
|
+
description: Find invoices emitted between dates
|
317
|
+
parameters:
|
318
|
+
- name: start_date
|
319
|
+
in: query
|
320
|
+
description: >-
|
321
|
+
Start date and time in [ISO8601
|
322
|
+
format](https://www.iso.org/iso-8601-date-and-time-format.html)
|
323
|
+
required: false
|
324
|
+
schema:
|
325
|
+
type: string
|
326
|
+
format: date-time
|
327
|
+
- name: end_date
|
328
|
+
in: query
|
329
|
+
description: >-
|
330
|
+
End date and time in [ISO8601
|
331
|
+
format](https://www.iso.org/iso-8601-date-and-time-format.html)
|
332
|
+
required: false
|
333
|
+
schema:
|
334
|
+
type: string
|
335
|
+
format: date-time
|
336
|
+
- name: page
|
337
|
+
description: Page number
|
338
|
+
in: query
|
339
|
+
required: false
|
340
|
+
schema:
|
341
|
+
type: string
|
342
|
+
- name: per_page
|
343
|
+
description: Page size
|
344
|
+
in: query
|
345
|
+
required: false
|
346
|
+
schema:
|
347
|
+
type: string
|
348
|
+
default: "30"
|
349
|
+
responses:
|
350
|
+
"200":
|
351
|
+
description: Successful operation
|
352
|
+
content:
|
353
|
+
application/json:
|
354
|
+
schema:
|
355
|
+
$ref: "#/components/schemas/invoices_index"
|
356
|
+
example:
|
357
|
+
- id: 1
|
358
|
+
- id: 2
|
359
|
+
4XX:
|
360
|
+
$ref: "#/components/responses/4XX"
|
361
|
+
5XX:
|
362
|
+
$ref: "#/components/responses/5XX"
|
363
|
+
/invoices/{id}.json:
|
364
|
+
get:
|
365
|
+
operationId: getInvoiceById
|
366
|
+
tags:
|
367
|
+
- Invoices
|
368
|
+
summary: Find an invoice by ID
|
369
|
+
description: Find an invoice by ID
|
370
|
+
parameters:
|
371
|
+
- name: id
|
372
|
+
in: path
|
373
|
+
description: ID of invoice to return
|
374
|
+
required: true
|
375
|
+
schema:
|
376
|
+
type: string
|
377
|
+
examples: ["1"]
|
378
|
+
responses:
|
379
|
+
"200":
|
380
|
+
description: Successful operation
|
381
|
+
content:
|
382
|
+
application/json:
|
383
|
+
schema:
|
384
|
+
$ref: "#/components/schemas/invoice"
|
385
|
+
example:
|
386
|
+
id: 29
|
387
|
+
pdf_url: https://bit.ly/2wuJPAS
|
388
|
+
product_type: Rental
|
389
|
+
product_id: 87
|
390
|
+
emitted_at: "2015-12-30T11:00:00.000Z"
|
391
|
+
total_price: 999
|
392
|
+
currency: EUR
|
393
|
+
entity_type: User
|
394
|
+
charges:
|
395
|
+
- type: driver_rental_payment
|
396
|
+
amount: 18745
|
397
|
+
- type: self_insurance_payment
|
398
|
+
amount: 2000
|
399
|
+
- type: additional_self_insurance_payment
|
400
|
+
amount: 500
|
401
|
+
- type: mileage_package
|
402
|
+
amount: 1000
|
403
|
+
- type: mileage_package_insurance
|
404
|
+
amount: 4200
|
405
|
+
- type: extra_distance_payment
|
406
|
+
amount: 1200
|
407
|
+
- type: driver_compensation
|
408
|
+
amount: -800
|
409
|
+
- type: driver_cancellation_fee
|
410
|
+
amount: 5000
|
411
|
+
- type: driver_late_return_fee
|
412
|
+
amount: 1500
|
413
|
+
- type: driver_gas_refill_fee
|
414
|
+
amount: 700
|
415
|
+
- type: driver_recharging_fee
|
416
|
+
amount: 100
|
417
|
+
- type: driver_mess_fee
|
418
|
+
amount: 1620
|
419
|
+
- type: driver_infraction_fee
|
420
|
+
amount: 1050
|
421
|
+
- type: repatriation_fee
|
422
|
+
amount: 10000
|
423
|
+
- type: claims_owner_fee_cg
|
424
|
+
amount: 200
|
425
|
+
- type: drivy_cancellation_fee
|
426
|
+
amount: 400
|
427
|
+
- type: drivy_late_return_fee
|
428
|
+
amount: 600
|
429
|
+
- type: drivy_mess_fee
|
430
|
+
amount: 480
|
431
|
+
- type: insurance_fee
|
432
|
+
amount: -1053
|
433
|
+
- type: assistance_fee
|
434
|
+
amount: -261
|
435
|
+
- type: drivy_service_fee
|
436
|
+
amount: -2686
|
437
|
+
- type: drivy_unfulfillment_fee
|
438
|
+
amount: -5000
|
439
|
+
- type: drivy_breakdown_management_fee
|
440
|
+
amount: -500
|
441
|
+
- type: driver_gas_compensation
|
442
|
+
amount: 1500
|
443
|
+
- type: driver_toll_compensation
|
444
|
+
amount: 1500
|
445
|
+
- type: driver_compensation_for_offsite_payment
|
446
|
+
amount: -4460
|
447
|
+
- type: owner_infraction_compensation
|
448
|
+
amount: 430
|
449
|
+
- type: drivy_gas_compensation
|
450
|
+
amount: 200
|
451
|
+
- type: exceptional_event_compensation
|
452
|
+
amount: 1800
|
453
|
+
- type: damage_compensation
|
454
|
+
amount: 480
|
455
|
+
- type: other_compensation
|
456
|
+
amount: -2515
|
457
|
+
- type: guarantee_earning
|
458
|
+
amount: 200
|
459
|
+
4XX:
|
460
|
+
$ref: "#/components/responses/4XX"
|
461
|
+
5XX:
|
462
|
+
$ref: "#/components/responses/5XX"
|
463
|
+
/payouts.json:
|
464
|
+
get:
|
465
|
+
operationId: getPayouts
|
466
|
+
tags:
|
467
|
+
- Payouts
|
468
|
+
summary: Find payouts paid between dates
|
469
|
+
description: Find payouts paid between dates
|
470
|
+
parameters:
|
471
|
+
- name: start_date
|
472
|
+
in: query
|
473
|
+
description: >-
|
474
|
+
Start date and time in [ISO8601
|
475
|
+
format](https://www.iso.org/iso-8601-date-and-time-format.html)
|
476
|
+
required: true
|
477
|
+
schema:
|
478
|
+
type: string
|
479
|
+
format: date-time
|
480
|
+
- name: end_date
|
481
|
+
in: query
|
482
|
+
description: >-
|
483
|
+
End date and time in [ISO8601
|
484
|
+
format](https://www.iso.org/iso-8601-date-and-time-format.html)
|
485
|
+
required: true
|
486
|
+
schema:
|
487
|
+
type: string
|
488
|
+
format: date-time
|
489
|
+
- name: page
|
490
|
+
description: Page number
|
491
|
+
in: query
|
492
|
+
required: false
|
493
|
+
schema:
|
494
|
+
type: string
|
495
|
+
- name: per_page
|
496
|
+
description: Page size
|
497
|
+
in: query
|
498
|
+
required: false
|
499
|
+
schema:
|
500
|
+
type: string
|
501
|
+
default: "30"
|
502
|
+
responses:
|
503
|
+
"200":
|
504
|
+
description: Successful operation
|
505
|
+
content:
|
506
|
+
application/json:
|
507
|
+
schema:
|
508
|
+
$ref: "#/components/schemas/payouts_index"
|
509
|
+
example:
|
510
|
+
- id: 1
|
511
|
+
- id: 2
|
512
|
+
4XX:
|
513
|
+
$ref: "#/components/responses/4XX"
|
514
|
+
5XX:
|
515
|
+
$ref: "#/components/responses/5XX"
|
516
|
+
/payouts/{id}.json:
|
517
|
+
get:
|
518
|
+
operationId: getPayoutById
|
519
|
+
tags:
|
520
|
+
- Payouts
|
521
|
+
summary: Find a payout by ID
|
522
|
+
description: Find a payout by ID
|
523
|
+
parameters:
|
524
|
+
- name: id
|
525
|
+
in: path
|
526
|
+
description: ID of payout to return
|
527
|
+
required: true
|
528
|
+
schema:
|
529
|
+
type: string
|
530
|
+
examples: ["1"]
|
531
|
+
responses:
|
532
|
+
"200":
|
533
|
+
description: Successful operation
|
534
|
+
content:
|
535
|
+
application/json:
|
536
|
+
schema:
|
537
|
+
$ref: "#/components/schemas/payout"
|
538
|
+
example:
|
539
|
+
id: 12
|
540
|
+
amount: 10000
|
541
|
+
currency: EUR
|
542
|
+
completed_at: "2019-04-02T12:00:00+01:00"
|
543
|
+
entity_type: User
|
544
|
+
invoices:
|
545
|
+
- id: 1
|
546
|
+
- id: 2
|
547
|
+
4XX:
|
548
|
+
$ref: "#/components/responses/4XX"
|
549
|
+
5XX:
|
550
|
+
$ref: "#/components/responses/5XX"
|
551
|
+
/rentals.json:
|
552
|
+
get:
|
553
|
+
operationId: getRentals
|
554
|
+
tags:
|
555
|
+
- Rentals
|
556
|
+
summary: Find rentals booked between dates
|
557
|
+
description: Find rentals booked between dates
|
558
|
+
parameters:
|
559
|
+
- name: start_date
|
560
|
+
in: query
|
561
|
+
description: >-
|
562
|
+
Start date and time in [ISO8601
|
563
|
+
format](https://www.iso.org/iso-8601-date-and-time-format.html)
|
564
|
+
required: true
|
565
|
+
schema:
|
566
|
+
type: string
|
567
|
+
format: date-time
|
568
|
+
- name: end_date
|
569
|
+
in: query
|
570
|
+
description: >-
|
571
|
+
End date and time in [ISO8601
|
572
|
+
format](https://www.iso.org/iso-8601-date-and-time-format.html)
|
573
|
+
required: true
|
574
|
+
schema:
|
575
|
+
type: string
|
576
|
+
format: date-time
|
577
|
+
- name: page
|
578
|
+
description: Page number
|
579
|
+
in: query
|
580
|
+
required: false
|
581
|
+
schema:
|
582
|
+
type: string
|
583
|
+
- name: per_page
|
584
|
+
description: Page size
|
585
|
+
in: query
|
586
|
+
required: false
|
587
|
+
schema:
|
588
|
+
type: string
|
589
|
+
default: "30"
|
590
|
+
responses:
|
591
|
+
"200":
|
592
|
+
description: Successful operation
|
593
|
+
content:
|
594
|
+
application/json:
|
595
|
+
schema:
|
596
|
+
$ref: "#/components/schemas/rentals_index"
|
597
|
+
example:
|
598
|
+
- id: 1
|
599
|
+
- id: 2
|
600
|
+
4XX:
|
601
|
+
$ref: "#/components/responses/4XX"
|
602
|
+
5XX:
|
603
|
+
$ref: "#/components/responses/5XX"
|
604
|
+
/rentals/{id}.json:
|
605
|
+
get:
|
606
|
+
operationId: getRentalById
|
607
|
+
tags:
|
608
|
+
- Rentals
|
609
|
+
summary: Find a rental by ID
|
610
|
+
description: Find a rental by ID
|
611
|
+
parameters:
|
612
|
+
- name: id
|
613
|
+
in: path
|
614
|
+
description: ID of rental to return
|
615
|
+
required: true
|
616
|
+
schema:
|
617
|
+
type: string
|
618
|
+
examples: ["1"]
|
619
|
+
responses:
|
620
|
+
"200":
|
621
|
+
description: Successful operation
|
622
|
+
content:
|
623
|
+
application/json:
|
624
|
+
schema:
|
625
|
+
$ref: "#/components/schemas/rental"
|
626
|
+
example:
|
627
|
+
id: 1
|
628
|
+
car_id: 1
|
629
|
+
user_id: 933838
|
630
|
+
starts_at: "2018-08-14T07:30:00.000+02:00"
|
631
|
+
ends_at: "2018-08-16T07:30:00.000+02:00"
|
632
|
+
booked_at: "2018-08-27T09:54:25.000+02:00"
|
633
|
+
price: 3500
|
634
|
+
insurance_fee: 800
|
635
|
+
4XX:
|
636
|
+
$ref: "#/components/responses/4XX"
|
637
|
+
5XX:
|
638
|
+
$ref: "#/components/responses/5XX"
|
639
|
+
/rentals/{rental_id}/invoices.json:
|
640
|
+
get:
|
641
|
+
operationId: getInvoicesForRental
|
642
|
+
tags:
|
643
|
+
- Invoices
|
644
|
+
summary: Find invoices associated to a rental
|
645
|
+
description: Find invoices associated to a rental
|
646
|
+
parameters:
|
647
|
+
- name: rental_id
|
648
|
+
in: path
|
649
|
+
description: ID of rental
|
650
|
+
required: true
|
651
|
+
schema:
|
652
|
+
type: string
|
653
|
+
examples: ["1"]
|
654
|
+
- name: page
|
655
|
+
description: Page number
|
656
|
+
in: query
|
657
|
+
required: false
|
658
|
+
schema:
|
659
|
+
type: string
|
660
|
+
- name: per_page
|
661
|
+
description: Page size
|
662
|
+
in: query
|
663
|
+
required: false
|
664
|
+
schema:
|
665
|
+
type: string
|
666
|
+
default: "30"
|
667
|
+
responses:
|
668
|
+
"200":
|
669
|
+
description: Successful operation
|
670
|
+
content:
|
671
|
+
application/json:
|
672
|
+
schema:
|
673
|
+
$ref: "#/components/schemas/rental_invoices_index"
|
674
|
+
example:
|
675
|
+
- id: 1
|
676
|
+
- id: 2
|
677
|
+
4XX:
|
678
|
+
$ref: "#/components/responses/4XX"
|
679
|
+
5XX:
|
680
|
+
$ref: "#/components/responses/5XX"
|
681
|
+
/rentals/{rental_id}/messages.json:
|
682
|
+
get:
|
683
|
+
operationId: getMessagesForRental
|
684
|
+
tags:
|
685
|
+
- Messages
|
686
|
+
summary: Find messages associated to a rental
|
687
|
+
description: Find messages associated to a rental
|
688
|
+
parameters:
|
689
|
+
- name: rental_id
|
690
|
+
in: path
|
691
|
+
description: ID of rental
|
692
|
+
required: true
|
693
|
+
schema:
|
694
|
+
type: string
|
695
|
+
examples: ["1"]
|
696
|
+
responses:
|
697
|
+
"200":
|
698
|
+
description: Successful operation
|
699
|
+
content:
|
700
|
+
application/json:
|
701
|
+
schema:
|
702
|
+
$ref: "#/components/schemas/rental_messages_index"
|
703
|
+
example:
|
704
|
+
- id: 1
|
705
|
+
- id: 2
|
706
|
+
4XX:
|
707
|
+
$ref: "#/components/responses/4XX"
|
708
|
+
5XX:
|
709
|
+
$ref: "#/components/responses/5XX"
|
710
|
+
post:
|
711
|
+
operationId: createMessages
|
712
|
+
tags:
|
713
|
+
- Messages
|
714
|
+
summary: Create Message associated to a rental
|
715
|
+
description: Create Message associated to a rental
|
716
|
+
parameters:
|
717
|
+
- name: rental_id
|
718
|
+
in: path
|
719
|
+
description: ID of rental
|
720
|
+
required: true
|
721
|
+
schema:
|
722
|
+
type: string
|
723
|
+
examples: ["1"]
|
724
|
+
requestBody:
|
725
|
+
description: Message to create
|
726
|
+
content:
|
727
|
+
application/json:
|
728
|
+
schema:
|
729
|
+
type: object
|
730
|
+
required:
|
731
|
+
- content
|
732
|
+
properties:
|
733
|
+
content:
|
734
|
+
description: Content of the message (2000 characters max)
|
735
|
+
type: string
|
736
|
+
examples:
|
737
|
+
foo:
|
738
|
+
summary: Message attributes
|
739
|
+
value:
|
740
|
+
content: >-
|
741
|
+
Hello, I hope the vehicle rental met all your expectations.
|
742
|
+
Thank you for your respect and trust. Please do not hesitate
|
743
|
+
to tell me how I can improve my service. Have a nice day!
|
744
|
+
responses:
|
745
|
+
"200":
|
746
|
+
description: Successful operation
|
747
|
+
content:
|
748
|
+
application/json:
|
749
|
+
schema:
|
750
|
+
$ref: "#/components/schemas/message"
|
751
|
+
example:
|
752
|
+
id: 1
|
753
|
+
rental_id: 23
|
754
|
+
sending_user_id: 123432
|
755
|
+
sent_at: "2016-01-02T12:00:00+01:00"
|
756
|
+
content: >-
|
757
|
+
Hello, I hope the vehicle rental met all your expectations.
|
758
|
+
Thank you for your respect and trust. Please do not hesitate
|
759
|
+
to tell me how I can improve my service. Have a nice day!
|
760
|
+
4XX:
|
761
|
+
$ref: "#/components/responses/4XX"
|
762
|
+
5XX:
|
763
|
+
$ref: "#/components/responses/5XX"
|
764
|
+
/rentals/{rental_id}/messages/{id}.json:
|
765
|
+
get:
|
766
|
+
operationId: getMessageById
|
767
|
+
tags:
|
768
|
+
- Messages
|
769
|
+
summary: Find a message by ID associated to a rental
|
770
|
+
description: Find a message by ID associated to a rental
|
771
|
+
parameters:
|
772
|
+
- name: rental_id
|
773
|
+
in: path
|
774
|
+
description: ID of rental
|
775
|
+
required: true
|
776
|
+
schema:
|
777
|
+
type: string
|
778
|
+
examples: ["1"]
|
779
|
+
- name: id
|
780
|
+
in: path
|
781
|
+
description: ID of message to return
|
782
|
+
required: true
|
783
|
+
schema:
|
784
|
+
type: string
|
785
|
+
examples: ["1"]
|
786
|
+
responses:
|
787
|
+
"200":
|
788
|
+
description: Successful operation
|
789
|
+
content:
|
790
|
+
application/json:
|
791
|
+
schema:
|
792
|
+
$ref: "#/components/schemas/message"
|
793
|
+
example:
|
794
|
+
id: 1
|
795
|
+
rental_id: 23
|
796
|
+
sending_user_id: 123432
|
797
|
+
sent_at: "2016-01-02T12:00:00+01:00"
|
798
|
+
content: >-
|
799
|
+
Hello, I hope the vehicle rental met all your expectations.
|
800
|
+
Thank you for your respect and trust. Please do not hesitate
|
801
|
+
to tell me how I can improve my service. Have a nice day!
|
802
|
+
4XX:
|
803
|
+
$ref: "#/components/responses/4XX"
|
804
|
+
5XX:
|
805
|
+
$ref: "#/components/responses/5XX"
|
806
|
+
/rentals/{rental_id}/checkin.json:
|
807
|
+
get:
|
808
|
+
operationId: getCheckinByRentalId
|
809
|
+
tags:
|
810
|
+
- Checkins
|
811
|
+
summary: Find a checkin by rental ID
|
812
|
+
description: Find a checkin by rental ID
|
813
|
+
parameters:
|
814
|
+
- name: rental_id
|
815
|
+
in: path
|
816
|
+
description: ID of the rental related to the checkin to return
|
817
|
+
required: true
|
818
|
+
schema:
|
819
|
+
type: string
|
820
|
+
examples: ["1"]
|
821
|
+
responses:
|
822
|
+
"200":
|
823
|
+
description: Successful operation
|
824
|
+
content:
|
825
|
+
application/json:
|
826
|
+
schema:
|
827
|
+
$ref: "#/components/schemas/checkin"
|
828
|
+
example:
|
829
|
+
rental_id: 4
|
830
|
+
mileage: 104132
|
831
|
+
fuel_level: 70
|
832
|
+
occurred_at: "2018-08-27T09:54:25.000+02:00"
|
833
|
+
4XX:
|
834
|
+
$ref: "#/components/responses/4XX"
|
835
|
+
5XX:
|
836
|
+
$ref: "#/components/responses/5XX"
|
837
|
+
/rentals/{rental_id}/checkout.json:
|
838
|
+
get:
|
839
|
+
operationId: getCheckoutByRentalId
|
840
|
+
tags:
|
841
|
+
- Checkouts
|
842
|
+
summary: Find a checkout by rental ID
|
843
|
+
description: Find a checkout by rental ID
|
844
|
+
parameters:
|
845
|
+
- name: rental_id
|
846
|
+
in: path
|
847
|
+
description: ID of the rental related to the checkout to return
|
848
|
+
required: true
|
849
|
+
schema:
|
850
|
+
type: string
|
851
|
+
examples: ["1"]
|
852
|
+
responses:
|
853
|
+
"200":
|
854
|
+
description: Successful operation
|
855
|
+
content:
|
856
|
+
application/json:
|
857
|
+
schema:
|
858
|
+
$ref: "#/components/schemas/checkout"
|
859
|
+
example:
|
860
|
+
rental_id: 4
|
861
|
+
mileage: 104132
|
862
|
+
fuel_level: 70
|
863
|
+
distance_driven: 120
|
864
|
+
occurred_at: "2018-08-27T09:54:25.000+02:00"
|
865
|
+
4XX:
|
866
|
+
$ref: "#/components/responses/4XX"
|
867
|
+
5XX:
|
868
|
+
$ref: "#/components/responses/5XX"
|
869
|
+
/cars.json:
|
870
|
+
get:
|
871
|
+
operationId: getCars
|
872
|
+
tags:
|
873
|
+
- Cars
|
874
|
+
summary: Find all cars
|
875
|
+
description: Find all cars
|
876
|
+
parameters:
|
877
|
+
- name: page
|
878
|
+
description: Page number
|
879
|
+
in: query
|
880
|
+
required: false
|
881
|
+
schema:
|
882
|
+
type: string
|
883
|
+
- name: per_page
|
884
|
+
description: Page size
|
885
|
+
in: query
|
886
|
+
required: false
|
887
|
+
schema:
|
888
|
+
type: string
|
889
|
+
default: "30"
|
890
|
+
responses:
|
891
|
+
"200":
|
892
|
+
description: Successful operation
|
893
|
+
content:
|
894
|
+
application/json:
|
895
|
+
schema:
|
896
|
+
$ref: "#/components/schemas/cars_index"
|
897
|
+
example:
|
898
|
+
- id: 1
|
899
|
+
- id: 2
|
900
|
+
4XX:
|
901
|
+
$ref: "#/components/responses/4XX"
|
902
|
+
5XX:
|
903
|
+
$ref: "#/components/responses/5XX"
|
904
|
+
/cars/{id}.json:
|
905
|
+
get:
|
906
|
+
operationId: getCarById
|
907
|
+
tags:
|
908
|
+
- Cars
|
909
|
+
summary: Find a car by ID
|
910
|
+
description: Find a car by ID
|
911
|
+
parameters:
|
912
|
+
- name: id
|
913
|
+
in: path
|
914
|
+
description: ID of car to return
|
915
|
+
required: true
|
916
|
+
schema:
|
917
|
+
type: string
|
918
|
+
examples: ["1"]
|
919
|
+
responses:
|
920
|
+
"200":
|
921
|
+
description: Successful operation
|
922
|
+
content:
|
923
|
+
application/json:
|
924
|
+
schema:
|
925
|
+
$ref: "#/components/schemas/car"
|
926
|
+
example:
|
927
|
+
id: 1
|
928
|
+
state: active
|
929
|
+
plate_number: 555FDK95
|
930
|
+
brand: Ford
|
931
|
+
model: Focus
|
932
|
+
display_address: Corentin Celton, Issy-les-Moulineaux, France
|
933
|
+
4XX:
|
934
|
+
$ref: "#/components/responses/4XX"
|
935
|
+
5XX:
|
936
|
+
$ref: "#/components/responses/5XX"
|
937
|
+
/users/{id}.json:
|
938
|
+
get:
|
939
|
+
operationId: getUserById
|
940
|
+
tags:
|
941
|
+
- Users
|
942
|
+
summary: Find a user by ID (Users are customers who rent one of your cars)
|
943
|
+
description: Find a user by ID (Users are customers who rent one of your cars)
|
944
|
+
parameters:
|
945
|
+
- name: id
|
946
|
+
in: path
|
947
|
+
description: ID of user to return
|
948
|
+
required: true
|
949
|
+
schema:
|
950
|
+
type: string
|
951
|
+
examples: ["1"]
|
952
|
+
responses:
|
953
|
+
"200":
|
954
|
+
description: Successful operation
|
955
|
+
content:
|
956
|
+
application/json:
|
957
|
+
schema:
|
958
|
+
$ref: "#/components/schemas/user"
|
959
|
+
example:
|
960
|
+
id: 1
|
961
|
+
first_name: Thibauld
|
962
|
+
last_name: Busso
|
963
|
+
phone_number: +33 7 83 43 45 75
|
964
|
+
address_line1: 112 rue de charonne
|
965
|
+
address_line2: Batiment D9
|
966
|
+
postal_code: "75011"
|
967
|
+
city: Paris
|
968
|
+
country: FR
|
969
|
+
birth_date: "1960-08-25"
|
970
|
+
license_country: FR
|
971
|
+
license_first_issue_date: "1986-03-14"
|
972
|
+
license_number: "869175121164"
|
973
|
+
4XX:
|
974
|
+
$ref: "#/components/responses/4XX"
|
975
|
+
5XX:
|
976
|
+
$ref: "#/components/responses/5XX"
|
977
|
+
/checkins.json:
|
978
|
+
get:
|
979
|
+
operationId: getCheckins
|
980
|
+
tags:
|
981
|
+
- Checkins
|
982
|
+
summary: List of checkins that occurred between two dates
|
983
|
+
description: List of checkins that occurred between two dates
|
984
|
+
parameters:
|
985
|
+
- name: start_date
|
986
|
+
in: query
|
987
|
+
description: >-
|
988
|
+
Start date and time in [ISO8601
|
989
|
+
format](https://www.iso.org/iso-8601-date-and-time-format.html)
|
990
|
+
required: true
|
991
|
+
schema:
|
992
|
+
type: string
|
993
|
+
format: date-time
|
994
|
+
- name: end_date
|
995
|
+
in: query
|
996
|
+
description: >-
|
997
|
+
End date and time in [ISO8601
|
998
|
+
format](https://www.iso.org/iso-8601-date-and-time-format.html)
|
999
|
+
required: true
|
1000
|
+
schema:
|
1001
|
+
type: string
|
1002
|
+
format: date-time
|
1003
|
+
- name: page
|
1004
|
+
description: Page number
|
1005
|
+
in: query
|
1006
|
+
required: false
|
1007
|
+
schema:
|
1008
|
+
type: string
|
1009
|
+
- name: per_page
|
1010
|
+
description: Page size
|
1011
|
+
in: query
|
1012
|
+
required: false
|
1013
|
+
schema:
|
1014
|
+
type: string
|
1015
|
+
default: "30"
|
1016
|
+
responses:
|
1017
|
+
"200":
|
1018
|
+
description: Successful operation
|
1019
|
+
content:
|
1020
|
+
application/json:
|
1021
|
+
schema:
|
1022
|
+
$ref: "#/components/schemas/checkins_index"
|
1023
|
+
example:
|
1024
|
+
- rental_id: 1
|
1025
|
+
- rental_id: 2
|
1026
|
+
4XX:
|
1027
|
+
$ref: "#/components/responses/4XX"
|
1028
|
+
5XX:
|
1029
|
+
$ref: "#/components/responses/5XX"
|
1030
|
+
/checkouts.json:
|
1031
|
+
get:
|
1032
|
+
operationId: getCheckouts
|
1033
|
+
tags:
|
1034
|
+
- Checkouts
|
1035
|
+
summary: List of checkouts that occurred between two dates
|
1036
|
+
description: List of checkouts that occurred between two dates
|
1037
|
+
parameters:
|
1038
|
+
- name: start_date
|
1039
|
+
in: query
|
1040
|
+
description: >-
|
1041
|
+
Start date and time in [ISO8601
|
1042
|
+
format](https://www.iso.org/iso-8601-date-and-time-format.html)
|
1043
|
+
required: true
|
1044
|
+
schema:
|
1045
|
+
type: string
|
1046
|
+
format: date-time
|
1047
|
+
- name: end_date
|
1048
|
+
in: query
|
1049
|
+
description: >-
|
1050
|
+
End date and time in [ISO8601
|
1051
|
+
format](https://www.iso.org/iso-8601-date-and-time-format.html)
|
1052
|
+
required: true
|
1053
|
+
schema:
|
1054
|
+
type: string
|
1055
|
+
format: date-time
|
1056
|
+
- name: page
|
1057
|
+
description: Page number
|
1058
|
+
in: query
|
1059
|
+
required: false
|
1060
|
+
schema:
|
1061
|
+
type: string
|
1062
|
+
- name: per_page
|
1063
|
+
description: Page size
|
1064
|
+
in: query
|
1065
|
+
required: false
|
1066
|
+
schema:
|
1067
|
+
type: string
|
1068
|
+
default: "30"
|
1069
|
+
responses:
|
1070
|
+
"200":
|
1071
|
+
description: Successful operation
|
1072
|
+
content:
|
1073
|
+
application/json:
|
1074
|
+
schema:
|
1075
|
+
$ref: "#/components/schemas/checkouts_index"
|
1076
|
+
example:
|
1077
|
+
- rental_id: 1
|
1078
|
+
- rental_id: 2
|
1079
|
+
4XX:
|
1080
|
+
$ref: "#/components/responses/4XX"
|
1081
|
+
5XX:
|
1082
|
+
$ref: "#/components/responses/5XX"
|
1083
|
+
/cars/{car_id}/unavailabilities.json:
|
1084
|
+
get:
|
1085
|
+
operationId: getUnavailabilitiesForCar
|
1086
|
+
tags:
|
1087
|
+
- Unavailabilities
|
1088
|
+
summary: Find Unavailabilities related to a car between dates
|
1089
|
+
description: Find between 2 dates when you’ve set a car as unavailable
|
1090
|
+
parameters:
|
1091
|
+
- name: start_date
|
1092
|
+
in: query
|
1093
|
+
description: >-
|
1094
|
+
Start date and time in [ISO8601
|
1095
|
+
format](https://www.iso.org/iso-8601-date-and-time-format.html)
|
1096
|
+
required: true
|
1097
|
+
schema:
|
1098
|
+
type: string
|
1099
|
+
format: date-time
|
1100
|
+
- name: end_date
|
1101
|
+
in: query
|
1102
|
+
description: >-
|
1103
|
+
End date and time in [ISO8601
|
1104
|
+
format](https://www.iso.org/iso-8601-date-and-time-format.html)
|
1105
|
+
required: true
|
1106
|
+
schema:
|
1107
|
+
type: string
|
1108
|
+
format: date-time
|
1109
|
+
- name: car_id
|
1110
|
+
in: path
|
1111
|
+
description: ID of the car
|
1112
|
+
required: true
|
1113
|
+
schema:
|
1114
|
+
type: string
|
1115
|
+
examples: ["123"]
|
1116
|
+
- name: page
|
1117
|
+
description: Page number
|
1118
|
+
in: query
|
1119
|
+
required: false
|
1120
|
+
schema:
|
1121
|
+
type: string
|
1122
|
+
- name: per_page
|
1123
|
+
description: Page size
|
1124
|
+
in: query
|
1125
|
+
required: false
|
1126
|
+
schema:
|
1127
|
+
type: string
|
1128
|
+
default: "30"
|
1129
|
+
responses:
|
1130
|
+
"200":
|
1131
|
+
description: Successful operation
|
1132
|
+
content:
|
1133
|
+
application/json:
|
1134
|
+
schema:
|
1135
|
+
$ref: "#/components/schemas/unavailabilities_index"
|
1136
|
+
example:
|
1137
|
+
- starts_at: "2016-01-02T12:00:00+01:00"
|
1138
|
+
ends_at: "2016-01-07T12:00:00+01:00"
|
1139
|
+
reason: null
|
1140
|
+
car_id: 42
|
1141
|
+
- starts_at: "2016-01-08T12:00:00+01:00"
|
1142
|
+
ends_at: "2016-01-09T12:00:00+01:00"
|
1143
|
+
reason: booked
|
1144
|
+
car_id: 42
|
1145
|
+
4XX:
|
1146
|
+
$ref: "#/components/responses/4XX"
|
1147
|
+
5XX:
|
1148
|
+
$ref: "#/components/responses/5XX"
|
1149
|
+
post:
|
1150
|
+
operationId: createUnavailabilities
|
1151
|
+
tags:
|
1152
|
+
- Unavailabilities
|
1153
|
+
summary: Create Unavailability related to a car between dates
|
1154
|
+
description: Set a car as unavailable between 2 dates
|
1155
|
+
parameters:
|
1156
|
+
- name: car_id
|
1157
|
+
in: path
|
1158
|
+
description: ID of car
|
1159
|
+
required: true
|
1160
|
+
schema:
|
1161
|
+
type: string
|
1162
|
+
examples: ["1"]
|
1163
|
+
requestBody:
|
1164
|
+
description: Unavailability to create
|
1165
|
+
content:
|
1166
|
+
application/json:
|
1167
|
+
schema:
|
1168
|
+
type: object
|
1169
|
+
required:
|
1170
|
+
- starts_at
|
1171
|
+
- ends_at
|
1172
|
+
properties:
|
1173
|
+
starts_at:
|
1174
|
+
description: >-
|
1175
|
+
Start date and time of the unavailability in [ISO8601
|
1176
|
+
format](https://www.iso.org/iso-8601-date-and-time-format.html)
|
1177
|
+
with a 30 min granularity.
|
1178
|
+
type: string
|
1179
|
+
format: date-time
|
1180
|
+
ends_at:
|
1181
|
+
description: >-
|
1182
|
+
End date and time of the unavailability in [ISO8601
|
1183
|
+
format](https://www.iso.org/iso-8601-date-and-time-format.html)
|
1184
|
+
with a 30 min granularity.
|
1185
|
+
type: string
|
1186
|
+
format: date-time
|
1187
|
+
reason:
|
1188
|
+
description: Reason of the unavailability
|
1189
|
+
type: string
|
1190
|
+
enum:
|
1191
|
+
- check_up
|
1192
|
+
- repairs
|
1193
|
+
- connect_issues
|
1194
|
+
- repatriation
|
1195
|
+
- booked
|
1196
|
+
- other
|
1197
|
+
examples:
|
1198
|
+
foo:
|
1199
|
+
summary: Unavailability attributes
|
1200
|
+
value:
|
1201
|
+
starts_at: "2018-08-14T07:30:00.000+02:00"
|
1202
|
+
ends_at: "2018-08-16T07:30:00.000+02:00"
|
1203
|
+
reason: booked
|
1204
|
+
responses:
|
1205
|
+
"204":
|
1206
|
+
description: No content - Successful operation
|
1207
|
+
4XX:
|
1208
|
+
$ref: "#/components/responses/4XX"
|
1209
|
+
5XX:
|
1210
|
+
$ref: "#/components/responses/5XX"
|
1211
|
+
delete:
|
1212
|
+
operationId: destroyUnavailability
|
1213
|
+
tags:
|
1214
|
+
- Unavailabilities
|
1215
|
+
summary: Destroy Unavailability related to a car between dates
|
1216
|
+
description: Set a car as available between 2 dates
|
1217
|
+
parameters:
|
1218
|
+
- name: car_id
|
1219
|
+
in: path
|
1220
|
+
description: ID of car
|
1221
|
+
required: true
|
1222
|
+
schema:
|
1223
|
+
type: string
|
1224
|
+
examples: ["1"]
|
1225
|
+
responses:
|
1226
|
+
"204":
|
1227
|
+
description: No content - Successful operation
|
1228
|
+
4XX:
|
1229
|
+
$ref: "#/components/responses/4XX"
|
1230
|
+
5XX:
|
1231
|
+
$ref: "#/components/responses/5XX"
|
1232
|
+
webhooks:
|
1233
|
+
bookedRental:
|
1234
|
+
post:
|
1235
|
+
tags:
|
1236
|
+
- Rentals
|
1237
|
+
security: []
|
1238
|
+
summary: New rental booked for one of your cars
|
1239
|
+
requestBody:
|
1240
|
+
description: >-
|
1241
|
+
This event is triggered when a new rental booking has been created for
|
1242
|
+
one of your cars
|
1243
|
+
content:
|
1244
|
+
application/json:
|
1245
|
+
schema:
|
1246
|
+
$ref: "#/components/schemas/rentals_booked"
|
1247
|
+
example:
|
1248
|
+
type: rental.booked
|
1249
|
+
data:
|
1250
|
+
rental_id: 234535
|
1251
|
+
occurred_at: "2019-04-18T08:30:05Z"
|
1252
|
+
responses:
|
1253
|
+
"200":
|
1254
|
+
description: >-
|
1255
|
+
Return a 200 status to indicate that the data was received
|
1256
|
+
successfully
|
1257
|
+
canceledRental:
|
1258
|
+
post:
|
1259
|
+
tags:
|
1260
|
+
- Rentals
|
1261
|
+
security: []
|
1262
|
+
summary: Canceled rental for one of your cars
|
1263
|
+
requestBody:
|
1264
|
+
description: >-
|
1265
|
+
This event is triggered when a rental has been canceled for one of
|
1266
|
+
your cars
|
1267
|
+
content:
|
1268
|
+
application/json:
|
1269
|
+
schema:
|
1270
|
+
$ref: "#/components/schemas/rentals_canceled"
|
1271
|
+
example:
|
1272
|
+
type: rental.canceled
|
1273
|
+
data:
|
1274
|
+
rental_id: 234535
|
1275
|
+
occurred_at: "2019-04-22T11:30:05Z"
|
1276
|
+
responses:
|
1277
|
+
"200":
|
1278
|
+
description: >-
|
1279
|
+
Return a 200 status to indicate that the data was received
|
1280
|
+
successfully
|
1281
|
+
carCheckedInRental:
|
1282
|
+
post:
|
1283
|
+
tags:
|
1284
|
+
- Checkins
|
1285
|
+
security: []
|
1286
|
+
summary: Rental started for one of your cars
|
1287
|
+
requestBody:
|
1288
|
+
description: >-
|
1289
|
+
This event is triggered when a rental starts and the car has been
|
1290
|
+
unlocked
|
1291
|
+
content:
|
1292
|
+
application/json:
|
1293
|
+
schema:
|
1294
|
+
$ref: "#/components/schemas/rentals_car_checked_in"
|
1295
|
+
example:
|
1296
|
+
type: rental.car_checked_in
|
1297
|
+
data:
|
1298
|
+
rental_id: 233435
|
1299
|
+
occurred_at: "2019-04-19T10:30:05Z"
|
1300
|
+
responses:
|
1301
|
+
"200":
|
1302
|
+
description: >-
|
1303
|
+
Return a 200 status to indicate that the data was received
|
1304
|
+
successfully
|
1305
|
+
carCheckedOutRental:
|
1306
|
+
post:
|
1307
|
+
tags:
|
1308
|
+
- Checkouts
|
1309
|
+
security: []
|
1310
|
+
summary: Rental ended for one of your cars
|
1311
|
+
requestBody:
|
1312
|
+
description: This event is triggered when a rental ends and the car has been locked
|
1313
|
+
content:
|
1314
|
+
application/json:
|
1315
|
+
schema:
|
1316
|
+
$ref: "#/components/schemas/rentals_car_checked_out"
|
1317
|
+
example:
|
1318
|
+
type: rental.car_checked_out
|
1319
|
+
data:
|
1320
|
+
rental_id: 97437
|
1321
|
+
occurred_at: "2019-04-19T10:30:05Z"
|
1322
|
+
responses:
|
1323
|
+
"200":
|
1324
|
+
description: >-
|
1325
|
+
Return a 200 status to indicate that the data was received
|
1326
|
+
successfully
|
1327
|
+
timesChangedRental:
|
1328
|
+
post:
|
1329
|
+
tags:
|
1330
|
+
- Rentals
|
1331
|
+
security: []
|
1332
|
+
summary: Rental time change for one of your car
|
1333
|
+
requestBody:
|
1334
|
+
description: >-
|
1335
|
+
This event is triggered when the start or end time of a rental has
|
1336
|
+
been changed for one of your cars
|
1337
|
+
content:
|
1338
|
+
application/json:
|
1339
|
+
schema:
|
1340
|
+
$ref: "#/components/schemas/rentals_times_changed"
|
1341
|
+
example:
|
1342
|
+
type: rental.times_changed
|
1343
|
+
data:
|
1344
|
+
rental_id: 234535
|
1345
|
+
occurred_at: "2019-04-19T10:30:05Z"
|
1346
|
+
responses:
|
1347
|
+
"200":
|
1348
|
+
description: >-
|
1349
|
+
Return a 200 status to indicate that the data was received
|
1350
|
+
successfully
|
1351
|
+
carSwitchedRental:
|
1352
|
+
post:
|
1353
|
+
tags:
|
1354
|
+
- Rentals
|
1355
|
+
security: []
|
1356
|
+
summary: There was a switch car on one of your rental
|
1357
|
+
requestBody:
|
1358
|
+
description: >-
|
1359
|
+
This event is triggered when an owner or customer service team member
|
1360
|
+
switches the car used to perform a given rental
|
1361
|
+
content:
|
1362
|
+
application/json:
|
1363
|
+
schema:
|
1364
|
+
$ref: "#/components/schemas/rentals_car_switched"
|
1365
|
+
example:
|
1366
|
+
type: rental.car_switched
|
1367
|
+
data:
|
1368
|
+
rental_id: 234535
|
1369
|
+
occurred_at: "2019-04-22T11:30:05Z"
|
1370
|
+
responses:
|
1371
|
+
"200":
|
1372
|
+
description: >-
|
1373
|
+
Return a 200 status to indicate that the data was received
|
1374
|
+
successfully
|
1375
|
+
createdUnavailability:
|
1376
|
+
post:
|
1377
|
+
tags:
|
1378
|
+
- Unavailabilities
|
1379
|
+
security: []
|
1380
|
+
summary: Unavailability created on one of your cars
|
1381
|
+
requestBody:
|
1382
|
+
description: >-
|
1383
|
+
This event is triggered whenever an unavailability is created (through
|
1384
|
+
the API or directly in the app/website). It shows the unavailability
|
1385
|
+
that has just been created, with the same timestamps as those entered
|
1386
|
+
by the user. It does not show the changes of other potential
|
1387
|
+
overlapping unavailabilities. For example: if an unavailability was
|
1388
|
+
already set between June 10 and June 20, and if the user creates a new
|
1389
|
+
one between June 18 and June 22, this webhook will only send
|
1390
|
+
information about the newly created June 18 - June 22 unavailability.
|
1391
|
+
It will not show that, under the hood, the unavailability from June 10
|
1392
|
+
to June 20 has be deleted, and that a new unavailability from June 10
|
1393
|
+
to June 22 has been created.
|
1394
|
+
content:
|
1395
|
+
application/json:
|
1396
|
+
schema:
|
1397
|
+
$ref: "#/components/schemas/unavailabilities_created"
|
1398
|
+
example:
|
1399
|
+
type: unavailability.created
|
1400
|
+
data:
|
1401
|
+
starts_at: "2019-06-26T09:30:05Z"
|
1402
|
+
ends_at: "2019-06-28T09:30:05Z"
|
1403
|
+
reason: repairs
|
1404
|
+
car_id: 42
|
1405
|
+
occurred_at: "2019-06-24T09:30:05Z"
|
1406
|
+
responses:
|
1407
|
+
"200":
|
1408
|
+
description: >-
|
1409
|
+
Return a 200 status to indicate that the data was received
|
1410
|
+
successfully
|
1411
|
+
deletedUnavailability:
|
1412
|
+
post:
|
1413
|
+
tags:
|
1414
|
+
- Unavailabilities
|
1415
|
+
security: []
|
1416
|
+
summary: Unavailabilities deleted on one of your cars
|
1417
|
+
requestBody:
|
1418
|
+
description: >-
|
1419
|
+
This event is triggered whenever an unavailability is deleted (through
|
1420
|
+
the API or directly in the app/website). It shows the unavailability
|
1421
|
+
that has just been deleted, with the same timestamps as those entered
|
1422
|
+
by the user. It does not show the changes of other potential
|
1423
|
+
overlapping unavailabilities. For example: if an unavailability was
|
1424
|
+
already set between June 10 and June 20, and if the user deletes an
|
1425
|
+
unavailability between June 18 and June 22 (to set their car as
|
1426
|
+
available between this dates), this webhook will only send information
|
1427
|
+
about the newly deleted June 18 - June 22 unavailability. It will not
|
1428
|
+
show that, under the hood, the unavailability from June 10 to June 20
|
1429
|
+
has be deleted, and that a new unavailability from June 10 to June 18
|
1430
|
+
has been created.
|
1431
|
+
content:
|
1432
|
+
application/json:
|
1433
|
+
schema:
|
1434
|
+
$ref: "#/components/schemas/unavailabilities_deleted"
|
1435
|
+
example:
|
1436
|
+
type: unavailability.deleted
|
1437
|
+
data:
|
1438
|
+
starts_at: "2019-06-26T09:30:05Z"
|
1439
|
+
ends_at: "2019-06-28T09:30:05Z"
|
1440
|
+
car_id: 42
|
1441
|
+
occurred_at: "2019-06-24T11:30:05Z"
|
1442
|
+
responses:
|
1443
|
+
"200":
|
1444
|
+
description: >-
|
1445
|
+
Return a 200 status to indicate that the data was received
|
1446
|
+
successfully
|
1447
|
+
updatedUser:
|
1448
|
+
post:
|
1449
|
+
tags:
|
1450
|
+
- Users
|
1451
|
+
security: []
|
1452
|
+
summary: User updated his profile information
|
1453
|
+
requestBody:
|
1454
|
+
description: >-
|
1455
|
+
This event is triggered when a user updates his profile information
|
1456
|
+
(You will only receive this event on users with a booked rental or a
|
1457
|
+
started rental).
|
1458
|
+
content:
|
1459
|
+
application/json:
|
1460
|
+
schema:
|
1461
|
+
$ref: "#/components/schemas/users_updated"
|
1462
|
+
example:
|
1463
|
+
type: user.updated
|
1464
|
+
data:
|
1465
|
+
user_id: 7654327
|
1466
|
+
occurred_at: "2019-06-24T09:30:05Z"
|
1467
|
+
responses:
|
1468
|
+
"200":
|
1469
|
+
description: >-
|
1470
|
+
Return a 200 status to indicate that the data was received
|
1471
|
+
successfully
|
1472
|
+
sentMessage:
|
1473
|
+
post:
|
1474
|
+
tags:
|
1475
|
+
- Messages
|
1476
|
+
security: []
|
1477
|
+
summary: New message sent
|
1478
|
+
requestBody:
|
1479
|
+
description: >-
|
1480
|
+
This event is triggered when a new message has been sent for one of
|
1481
|
+
your rentals
|
1482
|
+
content:
|
1483
|
+
application/json:
|
1484
|
+
schema:
|
1485
|
+
$ref: "#/components/schemas/messages_sent"
|
1486
|
+
example:
|
1487
|
+
type: message.sent
|
1488
|
+
data:
|
1489
|
+
message_id: 234535
|
1490
|
+
rental_id: 345646
|
1491
|
+
occurred_at: "2019-04-18T08:30:05Z"
|
1492
|
+
responses:
|
1493
|
+
"200":
|
1494
|
+
description: >-
|
1495
|
+
Return a 200 status to indicate that the data was received
|
1496
|
+
successfully
|
1497
|
+
security:
|
1498
|
+
- bearerAuth: []
|
1499
|
+
components:
|
1500
|
+
securitySchemes:
|
1501
|
+
bearerAuth:
|
1502
|
+
type: http
|
1503
|
+
scheme: bearer
|
1504
|
+
responses:
|
1505
|
+
4XX:
|
1506
|
+
description: >
|
1507
|
+
The request can't be fulfilled due to an error on client-side, i.e. the
|
1508
|
+
request is invalid. The client should not repeat the request without
|
1509
|
+
modifications. The response body should contain a JSON error object. May
|
1510
|
+
be any HTTP status code specified in [RFC
|
1511
|
+
7231](https://tools.ietf.org/html/rfc7231#section-6.6). HTTP status code
|
1512
|
+
404 indicates path parameter is invalid.
|
1513
|
+
content:
|
1514
|
+
application/json:
|
1515
|
+
example:
|
1516
|
+
errors:
|
1517
|
+
- status: "422"
|
1518
|
+
source:
|
1519
|
+
pointer: /data/attributes/firstName
|
1520
|
+
title: Invalid Attribute
|
1521
|
+
detail: First name must contain at least three characters.
|
1522
|
+
5XX:
|
1523
|
+
description: >
|
1524
|
+
The request can't be fulfilled due to an error at the back-end. The
|
1525
|
+
error is never the client’s fault and therefore it is reasonable for the
|
1526
|
+
client to retry the exact same request that triggered this response. The
|
1527
|
+
response body should contain a JSON error object. May be any HTTP status
|
1528
|
+
code specified in [RFC
|
1529
|
+
7231](https://tools.ietf.org/html/rfc7231#section-6.6).
|
1530
|
+
content:
|
1531
|
+
application/json:
|
1532
|
+
example:
|
1533
|
+
errors:
|
1534
|
+
- status: "422"
|
1535
|
+
source:
|
1536
|
+
pointer: /data/attributes/firstName
|
1537
|
+
title: Invalid Attribute
|
1538
|
+
detail: First name must contain at least three characters.
|
1539
|
+
schemas:
|
1540
|
+
invoices_index:
|
1541
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
1542
|
+
description: An array of invoices
|
1543
|
+
type: array
|
1544
|
+
items:
|
1545
|
+
description: An invoice.
|
1546
|
+
type: object
|
1547
|
+
required:
|
1548
|
+
- id
|
1549
|
+
additionalProperties: false
|
1550
|
+
properties:
|
1551
|
+
id:
|
1552
|
+
description: The invoice ID
|
1553
|
+
type: integer
|
1554
|
+
uniqueItems: true
|
1555
|
+
invoice:
|
1556
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
1557
|
+
description: An invoice.
|
1558
|
+
type: object
|
1559
|
+
required:
|
1560
|
+
- id
|
1561
|
+
- pdf_url
|
1562
|
+
- product_type
|
1563
|
+
- product_id
|
1564
|
+
- emitted_at
|
1565
|
+
- total_price
|
1566
|
+
- currency
|
1567
|
+
- entity_type
|
1568
|
+
additionalProperties: false
|
1569
|
+
properties:
|
1570
|
+
id:
|
1571
|
+
description: The invoice ID
|
1572
|
+
type: integer
|
1573
|
+
pdf_url:
|
1574
|
+
description: >-
|
1575
|
+
The temporary url (lifetime: 20min) to download the pdf of the tax
|
1576
|
+
invoice is generated each to time you call the endpoint. Also, the
|
1577
|
+
'links' variable will not be present if there is no uploaded invoice
|
1578
|
+
yet. This could happen if the job to generate & upload the invoice
|
1579
|
+
is not done yet.
|
1580
|
+
type:
|
1581
|
+
- string
|
1582
|
+
- "null"
|
1583
|
+
product_type:
|
1584
|
+
description: The type of product the invoice is related to
|
1585
|
+
type: string
|
1586
|
+
enum:
|
1587
|
+
- Rental
|
1588
|
+
product_id:
|
1589
|
+
description: The id of the product the invoice is related to
|
1590
|
+
type: integer
|
1591
|
+
emitted_at:
|
1592
|
+
description: The date at which the invoice was emitted
|
1593
|
+
type: string
|
1594
|
+
format: date-time
|
1595
|
+
total_price:
|
1596
|
+
description: >-
|
1597
|
+
The invoice amount, which is what you will receive (or which will be
|
1598
|
+
debited from your account if it is negative)
|
1599
|
+
type: integer
|
1600
|
+
currency:
|
1601
|
+
description: The currency of the invoice amount (ISO 4217 alphabetic code)
|
1602
|
+
type: string
|
1603
|
+
entity_type:
|
1604
|
+
description: The type of entity the invoice is related to
|
1605
|
+
type: string
|
1606
|
+
enum:
|
1607
|
+
- Company
|
1608
|
+
- User
|
1609
|
+
charges:
|
1610
|
+
type: array
|
1611
|
+
description: Array of charges
|
1612
|
+
items:
|
1613
|
+
type: object
|
1614
|
+
properties:
|
1615
|
+
type:
|
1616
|
+
type: string
|
1617
|
+
anyOf:
|
1618
|
+
- description: Trip price (set by the owner)
|
1619
|
+
const: driver_rental_payment
|
1620
|
+
- description: Extra distance fee
|
1621
|
+
const: extra_distance_payment
|
1622
|
+
- description: Mileage package
|
1623
|
+
const: mileage_package
|
1624
|
+
- description: Mileage package insurance
|
1625
|
+
const: mileage_package_insurance
|
1626
|
+
- description: Discount offered to the driver by the owner
|
1627
|
+
const: driver_compensation
|
1628
|
+
- description: Late cancellation fee
|
1629
|
+
const: driver_cancellation_fee
|
1630
|
+
- description: Late return fee
|
1631
|
+
const: driver_late_return_fee
|
1632
|
+
- description: Gas refill fee
|
1633
|
+
const: driver_gas_refill_fee
|
1634
|
+
- description: Recharging fee
|
1635
|
+
const: driver_recharging_fee
|
1636
|
+
- description: Cleanliness fee
|
1637
|
+
const: driver_mess_fee
|
1638
|
+
- description: Penalty notice processing fee
|
1639
|
+
const: driver_infraction_fee
|
1640
|
+
- description: Repatriation fee
|
1641
|
+
const: repatriation_fee
|
1642
|
+
- description: Claim management fee
|
1643
|
+
const: claims_owner_fee_cg
|
1644
|
+
- description: >-
|
1645
|
+
Commercial gesture from Drivy platform to cover late
|
1646
|
+
cancellation fee
|
1647
|
+
const: drivy_cancellation_fee
|
1648
|
+
- description: >-
|
1649
|
+
Commercial gesture from Drivy platform to cover late
|
1650
|
+
return fee
|
1651
|
+
const: drivy_late_return_fee
|
1652
|
+
- description: >-
|
1653
|
+
Commercial gesture from Drivy platform to cover
|
1654
|
+
cleanliness fee
|
1655
|
+
const: drivy_mess_fee
|
1656
|
+
- description: >-
|
1657
|
+
Insurance premium for old price structure (applies to
|
1658
|
+
trips booked before December 2018)
|
1659
|
+
const: insurance_fee
|
1660
|
+
- description: >-
|
1661
|
+
Amount collected from the driver for insurance and given
|
1662
|
+
to self insured partner
|
1663
|
+
const: self_insurance_payment
|
1664
|
+
- description: >-
|
1665
|
+
Amount collected from the driver for additional insurance
|
1666
|
+
(CDW) and given to self insured partner
|
1667
|
+
const: additional_self_insurance_payment
|
1668
|
+
- description: >-
|
1669
|
+
Roadside assistance for old price structure (applies to
|
1670
|
+
trips booked before December 2018)
|
1671
|
+
const: assistance_fee
|
1672
|
+
- description: Drivy service fees
|
1673
|
+
const: drivy_service_fee
|
1674
|
+
- description: Fee charged to the owner when a breakdown occurs
|
1675
|
+
const: drivy_breakdown_management_fee
|
1676
|
+
- description: Fee charged to the owner for late cancellation
|
1677
|
+
const: drivy_unfulfillment_fee
|
1678
|
+
- description: >-
|
1679
|
+
Fuel adjustment when a driver returns the vehicle with
|
1680
|
+
more or less fuel than at vehicle pick-up
|
1681
|
+
const: driver_gas_compensation
|
1682
|
+
- description: Toll reimbursment
|
1683
|
+
const: driver_toll_compensation
|
1684
|
+
- description: >-
|
1685
|
+
Payment made on site between driver and owner (this should
|
1686
|
+
not happen for Open trips since the owner and driver don't
|
1687
|
+
meet)
|
1688
|
+
const: driver_compensation_for_offsite_payment
|
1689
|
+
- description: Penalty notice amount
|
1690
|
+
const: owner_infraction_compensation
|
1691
|
+
- description: >-
|
1692
|
+
Commercial gesture from Drivy platform to cover fuel
|
1693
|
+
adjustment
|
1694
|
+
const: drivy_gas_compensation
|
1695
|
+
- description: >-
|
1696
|
+
Commercial gesture from Drivy platform to cover
|
1697
|
+
exceptional event
|
1698
|
+
const: exceptional_event_compensation
|
1699
|
+
- description: Payment for damage that occurred during a trip
|
1700
|
+
const: damage_compensation
|
1701
|
+
- description: >-
|
1702
|
+
Small financial adjustment that could happened in
|
1703
|
+
accounting
|
1704
|
+
const: other_compensation
|
1705
|
+
- description: Owner guarantee earning
|
1706
|
+
const: guarantee_earning
|
1707
|
+
amount:
|
1708
|
+
type: integer
|
1709
|
+
description: The charge's amount
|
1710
|
+
payouts_index:
|
1711
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
1712
|
+
description: An array of payouts, ordered by completion date
|
1713
|
+
type: array
|
1714
|
+
items:
|
1715
|
+
description: A payout.
|
1716
|
+
type: object
|
1717
|
+
required:
|
1718
|
+
- id
|
1719
|
+
additionalProperties: false
|
1720
|
+
properties:
|
1721
|
+
id:
|
1722
|
+
description: The payout ID
|
1723
|
+
type: integer
|
1724
|
+
uniqueItems: true
|
1725
|
+
payout:
|
1726
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
1727
|
+
description: A payout.
|
1728
|
+
type: object
|
1729
|
+
required:
|
1730
|
+
- id
|
1731
|
+
- amount
|
1732
|
+
- currency
|
1733
|
+
- completed_at
|
1734
|
+
- entity_type
|
1735
|
+
additionalProperties: false
|
1736
|
+
properties:
|
1737
|
+
id:
|
1738
|
+
description: The payout ID
|
1739
|
+
type: integer
|
1740
|
+
amount:
|
1741
|
+
description: The amount of the payout, in cents (0.01€)
|
1742
|
+
type: integer
|
1743
|
+
currency:
|
1744
|
+
description: The currency of the payout (ISO 4217 alphabetic code)
|
1745
|
+
type: string
|
1746
|
+
completed_at:
|
1747
|
+
description: The ISO8601 formatted payout completion date
|
1748
|
+
type: string
|
1749
|
+
format: date-time
|
1750
|
+
entity_type:
|
1751
|
+
description: The type of entity the payout is related to
|
1752
|
+
type: string
|
1753
|
+
enum:
|
1754
|
+
- User
|
1755
|
+
- Company
|
1756
|
+
invoices:
|
1757
|
+
description: An array of invoices paid by this payout
|
1758
|
+
type: array
|
1759
|
+
items:
|
1760
|
+
description: An invoice
|
1761
|
+
type: object
|
1762
|
+
required:
|
1763
|
+
- id
|
1764
|
+
additionalProperties: false
|
1765
|
+
properties:
|
1766
|
+
id:
|
1767
|
+
description: The invoice ID
|
1768
|
+
type: integer
|
1769
|
+
uniqueItems: true
|
1770
|
+
rentals_index:
|
1771
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
1772
|
+
description: An array of rentals
|
1773
|
+
type: array
|
1774
|
+
items:
|
1775
|
+
description: A Rental.
|
1776
|
+
type: object
|
1777
|
+
required:
|
1778
|
+
- id
|
1779
|
+
additionalProperties: false
|
1780
|
+
properties:
|
1781
|
+
id:
|
1782
|
+
description: The rental ID
|
1783
|
+
type: integer
|
1784
|
+
uniqueItems: true
|
1785
|
+
rental:
|
1786
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
1787
|
+
description: A Rental.
|
1788
|
+
type: object
|
1789
|
+
required:
|
1790
|
+
- id
|
1791
|
+
- car_id
|
1792
|
+
- user_id
|
1793
|
+
- starts_at
|
1794
|
+
- ends_at
|
1795
|
+
- booked_at
|
1796
|
+
- price
|
1797
|
+
- insurance_fee
|
1798
|
+
additionalProperties: false
|
1799
|
+
properties:
|
1800
|
+
id:
|
1801
|
+
description: Rental's id
|
1802
|
+
type: integer
|
1803
|
+
car_id:
|
1804
|
+
description: Vehicle's id
|
1805
|
+
type: integer
|
1806
|
+
minimum: 1
|
1807
|
+
user_id:
|
1808
|
+
description: User id of the rental's driver
|
1809
|
+
type: integer
|
1810
|
+
minimum: 1
|
1811
|
+
starts_at:
|
1812
|
+
description: Rental's started time in ISO8601 format
|
1813
|
+
type: string
|
1814
|
+
format: date-time
|
1815
|
+
ends_at:
|
1816
|
+
description: Rental's ended time in ISO8601 format
|
1817
|
+
type: string
|
1818
|
+
format: date-time
|
1819
|
+
booked_at:
|
1820
|
+
description: Rental's booked time in ISO8601 format
|
1821
|
+
type: string
|
1822
|
+
format: date-time
|
1823
|
+
price:
|
1824
|
+
description: Price set by the owner (in cents 0.01€)
|
1825
|
+
type: integer
|
1826
|
+
insurance_fee:
|
1827
|
+
description: Insurance amount collected (in cents 0.01€)
|
1828
|
+
type: integer
|
1829
|
+
rental_invoices_index:
|
1830
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
1831
|
+
description: An array of invoices
|
1832
|
+
type: array
|
1833
|
+
items:
|
1834
|
+
description: An Invoice.
|
1835
|
+
type: object
|
1836
|
+
required:
|
1837
|
+
- id
|
1838
|
+
additionalProperties: false
|
1839
|
+
properties:
|
1840
|
+
id:
|
1841
|
+
description: The invoice ID
|
1842
|
+
type: integer
|
1843
|
+
uniqueItems: true
|
1844
|
+
rental_messages_index:
|
1845
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
1846
|
+
description: An array of messages
|
1847
|
+
type: array
|
1848
|
+
items:
|
1849
|
+
description: A Message.
|
1850
|
+
type: object
|
1851
|
+
required:
|
1852
|
+
- id
|
1853
|
+
additionalProperties: false
|
1854
|
+
properties:
|
1855
|
+
id:
|
1856
|
+
description: The message ID
|
1857
|
+
type: integer
|
1858
|
+
uniqueItems: true
|
1859
|
+
message:
|
1860
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
1861
|
+
description: A Message.
|
1862
|
+
type: object
|
1863
|
+
required:
|
1864
|
+
- id
|
1865
|
+
- rental_id
|
1866
|
+
- sending_user_id
|
1867
|
+
- sent_at
|
1868
|
+
- content
|
1869
|
+
additionalProperties: false
|
1870
|
+
properties:
|
1871
|
+
id:
|
1872
|
+
description: The message ID
|
1873
|
+
type: integer
|
1874
|
+
rental_id:
|
1875
|
+
description: ID of the related rental
|
1876
|
+
type: integer
|
1877
|
+
sending_user_id:
|
1878
|
+
description: ID of the sending user
|
1879
|
+
type: integer
|
1880
|
+
sent_at:
|
1881
|
+
description: Date the message was sent
|
1882
|
+
type: string
|
1883
|
+
content:
|
1884
|
+
description: >-
|
1885
|
+
Content of message, Personal information detected in messages is
|
1886
|
+
hidden
|
1887
|
+
type: string
|
1888
|
+
checkin:
|
1889
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
1890
|
+
description: >-
|
1891
|
+
A checkin is the event created when the user finished the pick up
|
1892
|
+
inspection.
|
1893
|
+
type: object
|
1894
|
+
required:
|
1895
|
+
- rental_id
|
1896
|
+
- occurred_at
|
1897
|
+
additionalProperties: false
|
1898
|
+
properties:
|
1899
|
+
rental_id:
|
1900
|
+
description: Rental's ID linked to this checkin
|
1901
|
+
type: integer
|
1902
|
+
minimum: 1
|
1903
|
+
mileage:
|
1904
|
+
description: >-
|
1905
|
+
The vehicle’s mileage at checkin (in local units, eg: FR: km, GB:
|
1906
|
+
miles, ...)
|
1907
|
+
type: integer
|
1908
|
+
fuel_level:
|
1909
|
+
description: The vehicle’s fuel level at checkin (in percentage)
|
1910
|
+
type: integer
|
1911
|
+
occurred_at:
|
1912
|
+
description: Checkin's time in ISO8601 format
|
1913
|
+
type: string
|
1914
|
+
format: date-time
|
1915
|
+
checkout:
|
1916
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
1917
|
+
description: >-
|
1918
|
+
A checkout is the event created when the user finished the drop off
|
1919
|
+
inspection.
|
1920
|
+
type: object
|
1921
|
+
required:
|
1922
|
+
- rental_id
|
1923
|
+
- distance_driven
|
1924
|
+
- occurred_at
|
1925
|
+
additionalProperties: false
|
1926
|
+
properties:
|
1927
|
+
rental_id:
|
1928
|
+
description: Rental's ID linked to this checkout
|
1929
|
+
type: integer
|
1930
|
+
minimum: 1
|
1931
|
+
mileage:
|
1932
|
+
description: >-
|
1933
|
+
The vehicle’s mileage at checkout (in local units, eg: FR: km, GB:
|
1934
|
+
miles, ...)
|
1935
|
+
type:
|
1936
|
+
- integer
|
1937
|
+
- "null"
|
1938
|
+
fuel_level:
|
1939
|
+
description: The vehicle’s fuel level at checkout (in percentage)
|
1940
|
+
type:
|
1941
|
+
- integer
|
1942
|
+
- "null"
|
1943
|
+
distance_driven:
|
1944
|
+
description: The number of kilometers driven during this rental
|
1945
|
+
type: integer
|
1946
|
+
occurred_at:
|
1947
|
+
description: Checkout's time in ISO8601 format
|
1948
|
+
type: string
|
1949
|
+
format: date-time
|
1950
|
+
cars_index:
|
1951
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
1952
|
+
description: An array of cars
|
1953
|
+
type: array
|
1954
|
+
items:
|
1955
|
+
description: A car.
|
1956
|
+
type: object
|
1957
|
+
required:
|
1958
|
+
- id
|
1959
|
+
additionalProperties: false
|
1960
|
+
properties:
|
1961
|
+
id:
|
1962
|
+
description: The car ID
|
1963
|
+
type: integer
|
1964
|
+
uniqueItems: true
|
1965
|
+
car:
|
1966
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
1967
|
+
description: A Car.
|
1968
|
+
type: object
|
1969
|
+
required:
|
1970
|
+
- id
|
1971
|
+
- state
|
1972
|
+
- plate_number
|
1973
|
+
- brand
|
1974
|
+
- model
|
1975
|
+
- display_address
|
1976
|
+
additionalProperties: false
|
1977
|
+
properties:
|
1978
|
+
id:
|
1979
|
+
description: The car ID
|
1980
|
+
type: integer
|
1981
|
+
state:
|
1982
|
+
description: >-
|
1983
|
+
State of the vehicle can be a) active (only state where the vehicle
|
1984
|
+
can be booked by a user) b) inactive (temporary state when a vehicle
|
1985
|
+
is unavailable for rental) c) pending_approval (temporary state when
|
1986
|
+
a vehicle is under review for quality or other checks) and d)
|
1987
|
+
deleted (when a vehicle is permanently unavailable for rental)
|
1988
|
+
type: string
|
1989
|
+
plate_number:
|
1990
|
+
description: Vehicle's plate number
|
1991
|
+
type: string
|
1992
|
+
brand:
|
1993
|
+
description: "Vehicle's brand (ex: Volkswagen)"
|
1994
|
+
type: string
|
1995
|
+
model:
|
1996
|
+
description: "Vehicle's model (ex: Polo)"
|
1997
|
+
type: string
|
1998
|
+
display_address:
|
1999
|
+
description: Location where the vehicle is parked
|
2000
|
+
type: string
|
2001
|
+
user:
|
2002
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
2003
|
+
description: A User.
|
2004
|
+
type: object
|
2005
|
+
required:
|
2006
|
+
- id
|
2007
|
+
- first_name
|
2008
|
+
- last_name
|
2009
|
+
- phone_number
|
2010
|
+
- address_line1
|
2011
|
+
- postal_code
|
2012
|
+
- city
|
2013
|
+
- country
|
2014
|
+
- birth_date
|
2015
|
+
- license_country
|
2016
|
+
- license_first_issue_date
|
2017
|
+
- license_number
|
2018
|
+
additionalProperties: false
|
2019
|
+
properties:
|
2020
|
+
id:
|
2021
|
+
description: The user ID
|
2022
|
+
type: integer
|
2023
|
+
first_name:
|
2024
|
+
description: First name(s)
|
2025
|
+
type: string
|
2026
|
+
last_name:
|
2027
|
+
description: Last name(s)
|
2028
|
+
type: string
|
2029
|
+
phone_number:
|
2030
|
+
description: The phone number in international format
|
2031
|
+
type: string
|
2032
|
+
address_line1:
|
2033
|
+
description: Residential address of the user
|
2034
|
+
type: string
|
2035
|
+
address_line2:
|
2036
|
+
description: Additional address details
|
2037
|
+
type: string
|
2038
|
+
postal_code:
|
2039
|
+
description: The postal code
|
2040
|
+
type: string
|
2041
|
+
city:
|
2042
|
+
description: The city
|
2043
|
+
type: string
|
2044
|
+
country:
|
2045
|
+
description: "Address's country format ISO_3166-1_alpha-2 (ex: FR, ES, ...)"
|
2046
|
+
type: string
|
2047
|
+
birth_date:
|
2048
|
+
description: The birth date
|
2049
|
+
type: string
|
2050
|
+
format: date
|
2051
|
+
license_country:
|
2052
|
+
description: >-
|
2053
|
+
Driving licence country of issue format ISO_3166-1_alpha-2 (ex: FR,
|
2054
|
+
ES, ...)
|
2055
|
+
type: string
|
2056
|
+
license_first_issue_date:
|
2057
|
+
description: Driving licence first issue date
|
2058
|
+
type: string
|
2059
|
+
format: date
|
2060
|
+
license_number:
|
2061
|
+
description: The license number
|
2062
|
+
type: string
|
2063
|
+
checkins_index:
|
2064
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
2065
|
+
type: array
|
2066
|
+
items:
|
2067
|
+
type: object
|
2068
|
+
required:
|
2069
|
+
- rental_id
|
2070
|
+
additionalProperties: false
|
2071
|
+
properties:
|
2072
|
+
rental_id:
|
2073
|
+
description: The rental ID
|
2074
|
+
type: integer
|
2075
|
+
uniqueItems: true
|
2076
|
+
checkouts_index:
|
2077
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
2078
|
+
type: array
|
2079
|
+
items:
|
2080
|
+
type: object
|
2081
|
+
required:
|
2082
|
+
- rental_id
|
2083
|
+
additionalProperties: false
|
2084
|
+
properties:
|
2085
|
+
rental_id:
|
2086
|
+
description: The rental ID
|
2087
|
+
type: integer
|
2088
|
+
uniqueItems: true
|
2089
|
+
unavailability:
|
2090
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
2091
|
+
description: An unavailability.
|
2092
|
+
type: object
|
2093
|
+
required:
|
2094
|
+
- starts_at
|
2095
|
+
- ends_at
|
2096
|
+
- car_id
|
2097
|
+
additionalProperties: false
|
2098
|
+
properties:
|
2099
|
+
car_id:
|
2100
|
+
description: ID of the related car
|
2101
|
+
type: integer
|
2102
|
+
starts_at:
|
2103
|
+
description: The ISO8601 formatted beginning of the unavailability's period
|
2104
|
+
type: string
|
2105
|
+
format: date-time
|
2106
|
+
ends_at:
|
2107
|
+
description: The ISO8601 formatted ending of the unavailability's period
|
2108
|
+
type: string
|
2109
|
+
format: date-time
|
2110
|
+
reason:
|
2111
|
+
description: The reason of the unavailability of the car.
|
2112
|
+
type:
|
2113
|
+
- string
|
2114
|
+
- "null"
|
2115
|
+
enum:
|
2116
|
+
- check_up
|
2117
|
+
- repairs
|
2118
|
+
- connect_issues
|
2119
|
+
- repatriation
|
2120
|
+
- booked
|
2121
|
+
- other
|
2122
|
+
unavailabilities_index:
|
2123
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
2124
|
+
description: An array of unavailabilities
|
2125
|
+
type: array
|
2126
|
+
items:
|
2127
|
+
$ref: "#/components/schemas/unavailability"
|
2128
|
+
uniqueItems: true
|
2129
|
+
webhook:
|
2130
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
2131
|
+
description: A webhook object
|
2132
|
+
type: object
|
2133
|
+
required:
|
2134
|
+
- type
|
2135
|
+
- data
|
2136
|
+
- occurred_at
|
2137
|
+
properties:
|
2138
|
+
type:
|
2139
|
+
description: The webhook event type
|
2140
|
+
type: string
|
2141
|
+
data:
|
2142
|
+
description: The webhook event data
|
2143
|
+
occurred_at:
|
2144
|
+
description: The webhook event occurred at timestamp
|
2145
|
+
type: string
|
2146
|
+
format: date-time
|
2147
|
+
rentals_booked:
|
2148
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
2149
|
+
allOf:
|
2150
|
+
- properties:
|
2151
|
+
type:
|
2152
|
+
const: rental.booked
|
2153
|
+
data:
|
2154
|
+
type: object
|
2155
|
+
properties:
|
2156
|
+
rental_id:
|
2157
|
+
description: The rental identifier
|
2158
|
+
type: number
|
2159
|
+
- $ref: "#/components/schemas/webhook"
|
2160
|
+
rentals_canceled:
|
2161
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
2162
|
+
allOf:
|
2163
|
+
- properties:
|
2164
|
+
type:
|
2165
|
+
const: rental.canceled
|
2166
|
+
data:
|
2167
|
+
type: object
|
2168
|
+
properties:
|
2169
|
+
rental_id:
|
2170
|
+
description: The rental identifier
|
2171
|
+
type: number
|
2172
|
+
- $ref: "#/components/schemas/webhook"
|
2173
|
+
rentals_car_checked_in:
|
2174
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
2175
|
+
allOf:
|
2176
|
+
- properties:
|
2177
|
+
type:
|
2178
|
+
const: rental.car_checked_in
|
2179
|
+
data:
|
2180
|
+
type: object
|
2181
|
+
properties:
|
2182
|
+
rental_id:
|
2183
|
+
description: The rental identifier
|
2184
|
+
type: number
|
2185
|
+
- $ref: "#/components/schemas/webhook"
|
2186
|
+
rentals_car_checked_out:
|
2187
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
2188
|
+
allOf:
|
2189
|
+
- properties:
|
2190
|
+
type:
|
2191
|
+
const: rental.car_checked_out
|
2192
|
+
data:
|
2193
|
+
type: object
|
2194
|
+
properties:
|
2195
|
+
rental_id:
|
2196
|
+
description: The rental identifier
|
2197
|
+
type: number
|
2198
|
+
- $ref: "#/components/schemas/webhook"
|
2199
|
+
rentals_times_changed:
|
2200
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
2201
|
+
allOf:
|
2202
|
+
- properties:
|
2203
|
+
type:
|
2204
|
+
const: rental.times_changed
|
2205
|
+
data:
|
2206
|
+
type: object
|
2207
|
+
properties:
|
2208
|
+
rental_id:
|
2209
|
+
description: The rental identifier
|
2210
|
+
type: number
|
2211
|
+
- $ref: "#/components/schemas/webhook"
|
2212
|
+
rentals_car_switched:
|
2213
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
2214
|
+
allOf:
|
2215
|
+
- properties:
|
2216
|
+
type:
|
2217
|
+
const: rental.car_switched
|
2218
|
+
data:
|
2219
|
+
type: object
|
2220
|
+
properties:
|
2221
|
+
rental_id:
|
2222
|
+
description: The rental identifier
|
2223
|
+
type: number
|
2224
|
+
- $ref: "#/components/schemas/webhook"
|
2225
|
+
car_id:
|
2226
|
+
description: ID of the related car
|
2227
|
+
type: integer
|
2228
|
+
starts_at:
|
2229
|
+
description: The ISO8601 formatted beginning of the unavailability's period
|
2230
|
+
type: string
|
2231
|
+
format: date-time
|
2232
|
+
ends_at:
|
2233
|
+
description: The ISO8601 formatted ending of the unavailability's period
|
2234
|
+
type: string
|
2235
|
+
format: date-time
|
2236
|
+
unavailabilities_created:
|
2237
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
2238
|
+
allOf:
|
2239
|
+
- properties:
|
2240
|
+
type:
|
2241
|
+
const: unavailability.created
|
2242
|
+
data:
|
2243
|
+
type: object
|
2244
|
+
properties:
|
2245
|
+
car_id:
|
2246
|
+
$ref: "#/components/schemas/car_id"
|
2247
|
+
starts_at:
|
2248
|
+
$ref: "#/components/schemas/starts_at"
|
2249
|
+
ends_at:
|
2250
|
+
$ref: "#/components/schemas/ends_at"
|
2251
|
+
reason:
|
2252
|
+
$ref: "#/components/schemas/reason"
|
2253
|
+
- $ref: "#/components/schemas/webhook"
|
2254
|
+
unavailabilities_deleted:
|
2255
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
2256
|
+
allOf:
|
2257
|
+
- properties:
|
2258
|
+
type:
|
2259
|
+
const: unavailability.deleted
|
2260
|
+
data:
|
2261
|
+
type: object
|
2262
|
+
properties:
|
2263
|
+
car_id:
|
2264
|
+
$ref: "#/components/schemas/car_id"
|
2265
|
+
starts_at:
|
2266
|
+
$ref: "#/components/schemas/starts_at"
|
2267
|
+
ends_at:
|
2268
|
+
$ref: "#/components/schemas/ends_at"
|
2269
|
+
- $ref: "#/components/schemas/webhook"
|
2270
|
+
users_updated:
|
2271
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
2272
|
+
allOf:
|
2273
|
+
- properties:
|
2274
|
+
type:
|
2275
|
+
const: user.updated
|
2276
|
+
data:
|
2277
|
+
type: object
|
2278
|
+
properties:
|
2279
|
+
user_id:
|
2280
|
+
description: The user identifier
|
2281
|
+
type: number
|
2282
|
+
- $ref: "#/components/schemas/webhook"
|
2283
|
+
messages_sent:
|
2284
|
+
$schema: https://json-schema.org/draft/2020-12/schema
|
2285
|
+
allOf:
|
2286
|
+
- properties:
|
2287
|
+
type:
|
2288
|
+
const: message.sent
|
2289
|
+
data:
|
2290
|
+
type: object
|
2291
|
+
properties:
|
2292
|
+
message_id:
|
2293
|
+
description: The message identifier
|
2294
|
+
type: number
|
2295
|
+
rental_id:
|
2296
|
+
description: The rental identifier
|
2297
|
+
type: number
|
2298
|
+
- $ref: "#/components/schemas/webhook"
|