get_around_owner 1.0.1 → 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/Gemfile +9 -0
- data/Owner API v1.json +2938 -0
- data/README.md +338 -181
- data/Rakefile +8 -0
- data/docs/Car.md +12 -0
- data/docs/CarId.md +6 -0
- data/docs/CarIdUnavailabilitiesJsonBody.md +9 -0
- data/docs/CarsApi.md +110 -0
- data/docs/CarsIndex.md +6 -0
- data/docs/Checkin.md +10 -0
- data/docs/CheckinsApi.md +114 -0
- data/docs/CheckinsIndex.md +6 -0
- data/docs/Checkout.md +11 -0
- data/docs/CheckoutsApi.md +114 -0
- data/docs/CheckoutsIndex.md +6 -0
- data/docs/EndsAt.md +6 -0
- data/docs/GetaroundCar.md +28 -0
- data/docs/GetaroundCarsIndexInner.md +18 -0
- data/docs/GetaroundCheckin.md +24 -0
- data/docs/GetaroundCheckinsIndexInner.md +18 -0
- data/docs/GetaroundCheckout.md +26 -0
- data/docs/GetaroundCreateMessagesRequest.md +18 -0
- data/docs/GetaroundCreateUnavailabilitiesRequest.md +22 -0
- data/docs/GetaroundDestroyUnavailabilityRequest.md +20 -0
- data/docs/GetaroundInvoice.md +34 -0
- data/docs/GetaroundInvoiceChargesInner.md +20 -0
- data/docs/GetaroundInvoicesIndexInner.md +18 -0
- data/docs/GetaroundMessage.md +26 -0
- data/docs/GetaroundMessagesSent.md +22 -0
- data/docs/GetaroundMessagesSentAllOfData.md +20 -0
- data/docs/GetaroundPayout.md +28 -0
- data/docs/GetaroundPayoutInvoicesInner.md +18 -0
- data/docs/GetaroundPayoutsIndexInner.md +18 -0
- data/docs/GetaroundReason.md +15 -0
- data/docs/GetaroundRental.md +32 -0
- data/docs/GetaroundRentalInvoicesIndexInner.md +18 -0
- data/docs/GetaroundRentalMessagesIndexInner.md +18 -0
- data/docs/GetaroundRentalsBooked.md +22 -0
- data/docs/GetaroundRentalsBookedAllOfData.md +18 -0
- data/docs/GetaroundRentalsCanceled.md +22 -0
- data/docs/GetaroundRentalsCarCheckedIn.md +22 -0
- data/docs/GetaroundRentalsCarCheckedOut.md +22 -0
- data/docs/GetaroundRentalsCarSwitched.md +22 -0
- data/docs/GetaroundRentalsIndexInner.md +18 -0
- data/docs/GetaroundRentalsTimesChanged.md +22 -0
- data/docs/GetaroundUnavailabilitiesCreated.md +22 -0
- data/docs/GetaroundUnavailabilitiesCreatedAllOfData.md +24 -0
- data/docs/GetaroundUnavailabilitiesDeleted.md +22 -0
- data/docs/GetaroundUnavailabilitiesDeletedAllOfData.md +22 -0
- data/docs/GetaroundUnavailability.md +24 -0
- data/docs/GetaroundUser.md +42 -0
- data/docs/GetaroundUsersUpdated.md +22 -0
- data/docs/GetaroundUsersUpdatedAllOfData.md +18 -0
- data/docs/GetaroundWebhook.md +22 -0
- data/docs/Invoice.md +15 -0
- data/docs/InvoicesApi.md +169 -0
- data/docs/InvoicesIndex.md +6 -0
- data/docs/Message.md +11 -0
- data/docs/MessagesApi.md +162 -0
- data/docs/MessagesSent.md +6 -0
- data/docs/Payout.md +12 -0
- data/docs/PayoutsApi.md +114 -0
- 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 +114 -0
- 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 +167 -0
- 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 +57 -0
- 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 +39 -0
- data/getaround-api.gemspec +38 -0
- data/git_push.sh +55 -0
- 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 +289 -133
- 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/Owner API v1.json
ADDED
@@ -0,0 +1,2938 @@
|
|
1
|
+
{
|
2
|
+
"openapi": "3.1.0",
|
3
|
+
"info": {
|
4
|
+
"version": "1.0.0",
|
5
|
+
"title": "Getaround Owner API",
|
6
|
+
"x-logo": {
|
7
|
+
"url": "https://getaround-assets.gumlet.io/logos/logo-getaround.png",
|
8
|
+
"altText": "Getaround logo"
|
9
|
+
},
|
10
|
+
"contact": {
|
11
|
+
"name": "Getaround EU Owner API Support",
|
12
|
+
"email": "owner-api@getaround.com"
|
13
|
+
},
|
14
|
+
"description": "# Quick Start\n\nThe Owner API uses the JSON format, and must be accessed over a [secure connection](https://en.wikipedia.org/wiki/HTTPS).\n\nLet’s assume that the access token provided by your account manager is “TOKEN”.\n\nHere’s how to get the list of ids of all your invoices from the first week of August with a shell script:\n\n```bash\nquery=\"end_date=2018-08-08T00%3A00%3A00%2B00%3A00&start_date=2018-08-01T00%3A00%3A00%2B00%3A00\"\n\ncurl -i \"https://api-eu.getaround.com/owner/v1/invoices?${query}\" \\\n -H \"Authorization: Bearer TOKEN\" \\\n -H \"Accept:application/json\" \\\n -H \"Content-Type:application/json\"\n```\n\nAnd here’s how to get the invoice with the id 12345:\n\n```bash\ncurl -i \"https://api-eu.getaround.com/owner/v1/invoices/12345\" \\\n -H \"Authorization: Bearer TOKEN\" \\\n -H \"Accept: application/json\" \\\n -H \"Content-Type: application/json\"\"\n```\n\nSee the [endpoints section](#tag/Invoices) of this guide for details about the response format.\n\nDates in request params should follow the ISO 8601 standard.\n\n\n# Authentication\n\nAll requests must be authenticated with a [bearer token header](https://tools.ietf.org/html/rfc6750#section-2.1). You token will be sent to you by your account manager.\n\nUnauthenticated requests will return a 401 status.\n\n\n# Pagination\n\nThe page number and the number of items per page can be set with the “page” and “per_page” params.\n\nFor example, this request will return the second page of invoices, and 50 invoices per page:\n\n`https://api-eu.getaround.com/owner/v1/invoices?page=2&per_page=50`\n\nBoth of these params are optional. The default page size is 30 items.\n\nThe Getaround Owner API follows the [RFC 8288 convention](https://datatracker.ietf.org/doc/html/rfc8288) of using the `Link` header to provide the `next` page URL. Please don't build the pagination URLs yourself.\nThe `next` page will be missing when you are requesting the last available page.\n\nHere's an example response header from requesting the second page of invoices `https://api-eu.getaround.com/owner/v1/invoices?page=2&per_page=50`\n```\nLink: <https://api-eu.getaround.com/owner/v1/invoices?page=3&per_page=50>; rel=\"next\"\n```\n\n\n# Throttling policy and Date range limitation\n\nWe have throttling policy that prevents you to perform more than 100 requests per min from the same IP.\n\nAlso, there is a limitation on the size of the range of dates given in params in some requests.\n\nAll requests that need start_date and end_date, do not accept a range bigger than 30 days.\n\n\n# Webhooks\n\nGetaround can send webhook events that notify your application when certain events happen on your account. This is especially useful to follow the lifecycle of rentals, tracking for example bookings or cancellations.\n\n### Setup\n\nTo set up an endpoint, you need to define a route on your server for receiving events, and then <a href=\"mailto:owner-api@getaround.com\">ask Getaround</a> to add this URL to your account.\n\nTo acknowledge receipt of a event, your endpoint must:\n\n- Return a `2xx` HTTP status code.\n- Be a secure `https` endpoint with a valid SSL certificate.\n\n### Testing\n\nOnce Getaround has set up the endpoint, and it is properly configured as described above, a test `ping` event can be sent by clicking the button below:\n\n<form action=\"/docs/api/owner/fire_ping_webhook\" method=\"post\"><input type=\"submit\" value=\"Send Ping Event\"></form>\n\nYou should receive the following JSON payload:\n\n```json\n{\n \"data\": {\n \"ping\": \"pong\"\n },\n \"type\": \"ping\",\n \"occurred_at\": \"2019-04-18T08:30:05Z\"\n}\n```\n\n### Retries\n\nWebhook deliveries will be attempted for up to three days with an exponential back off. After that point the delivery will be abandoned.\n\n### Verifying Signatures\n\nGetaround will also provide you with a secret token, which is used to create a hash signature with each payload.\n\nThis hash signature is passed along with each request in the headers as `X-Drivy-Signature`. Suppose you have a basic server listening to webhooks that looks like this:\n\n```ruby\nrequire 'sinatra'\nrequire 'json'\n\npost '/payload' do\n push = JSON.parse(params[:payload])\n \"I got some JSON: #{push.inspect}\"\nend\n```\n\nThe goal is to compute a hash using your secret token, and ensure that the hash from Getaround matches. Getaround uses an HMAC hexdigest to compute the hash, so you could change your server to look a little like this:\n\n```ruby\npost '/payload' do\n request.body.rewind\n payload_body = request.body.read\n verify_signature(payload_body)\n push = JSON.parse(params[:payload])\n \"I got some JSON: #{push.inspect}\"\nend\n\ndef verify_signature(payload_body)\n signature = 'sha1=' + OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha1'), ENV['SECRET_TOKEN'], payload_body)\n return halt 500, \"Signatures didn't match!\" unless Rack::Utils.secure_compare(signature, request.env['HTTP_X_DRIVY_SIGNATURE'])\nend\n```\n\nObviously, your language and server implementations may differ from this code. There are a couple of important things to point out, however:\n\nNo matter which implementation you use, the hash signature starts with `sha1=`, using the key of your secret token and your payload body.\n\nUsing a plain `==` operator is not advised. A method like secure_compare performs a \"constant time\" string comparison, which renders it safe from certain timing attacks against regular equality operators.\n\n### Best Practices\n\n- **Acknowledge events immediately**. If your webhook script performs complex logic, or makes network calls, it’s possible that the script would time out before Getaround sees its complete execution. Ideally, your webhook handler code (acknowledging receipt of an event by returning a `2xx` status code) is separate of any other logic you do for that event.\n- **Handle duplicate events**. Webhook endpoints might occasionally receive the same event more than once. We advise you to guard against duplicated event receipts by making your event processing idempotent. One way of doing this is logging the events you’ve processed, and then not processing already-logged events.\n- **Do not expect events in order**. Getaround does not guarantee delivery of events in the order in which they are generated. Your endpoint should therefore handle this accordingly. We do provide an `occurred_at` timestamp for each event, though, to help reconcile ordering.\n"
|
15
|
+
},
|
16
|
+
"servers": [
|
17
|
+
{
|
18
|
+
"url": "https://api-eu.getaround.com/owner/v1",
|
19
|
+
"description": "Production server"
|
20
|
+
}
|
21
|
+
],
|
22
|
+
"tags": [
|
23
|
+
{
|
24
|
+
"name": "Cars",
|
25
|
+
"description": "Cars"
|
26
|
+
},
|
27
|
+
{
|
28
|
+
"name": "Messages",
|
29
|
+
"description": "The messages endpoints will allow you to send and read rentals messages"
|
30
|
+
},
|
31
|
+
{
|
32
|
+
"name": "Checkins",
|
33
|
+
"description": "Checkin - data from the start of the rental"
|
34
|
+
},
|
35
|
+
{
|
36
|
+
"name": "Checkouts",
|
37
|
+
"description": "Checkout - data from the end of the rental"
|
38
|
+
},
|
39
|
+
{
|
40
|
+
"name": "Invoices",
|
41
|
+
"description": "Invoices"
|
42
|
+
},
|
43
|
+
{
|
44
|
+
"name": "Payouts",
|
45
|
+
"description": "Payouts received on your bank account"
|
46
|
+
},
|
47
|
+
{
|
48
|
+
"name": "Rentals",
|
49
|
+
"description": "Car rentals"
|
50
|
+
},
|
51
|
+
{
|
52
|
+
"name": "Unavailabilities",
|
53
|
+
"description": "Car unavailabilities"
|
54
|
+
},
|
55
|
+
{
|
56
|
+
"name": "Users",
|
57
|
+
"description": "User operations"
|
58
|
+
}
|
59
|
+
],
|
60
|
+
"x-tagGroups": [
|
61
|
+
{
|
62
|
+
"name": "Accounting",
|
63
|
+
"tags": [
|
64
|
+
"Invoices",
|
65
|
+
"Payouts"
|
66
|
+
]
|
67
|
+
},
|
68
|
+
{
|
69
|
+
"name": "Rentals",
|
70
|
+
"tags": [
|
71
|
+
"Rentals",
|
72
|
+
"Checkins",
|
73
|
+
"Checkouts",
|
74
|
+
"Users"
|
75
|
+
]
|
76
|
+
},
|
77
|
+
{
|
78
|
+
"name": "Calendar",
|
79
|
+
"tags": [
|
80
|
+
"Unavailabilities"
|
81
|
+
]
|
82
|
+
},
|
83
|
+
{
|
84
|
+
"name": "",
|
85
|
+
"tags": [
|
86
|
+
"Cars"
|
87
|
+
]
|
88
|
+
},
|
89
|
+
{
|
90
|
+
"name": "Messages",
|
91
|
+
"tags": [
|
92
|
+
"Messages"
|
93
|
+
]
|
94
|
+
}
|
95
|
+
],
|
96
|
+
"paths": {
|
97
|
+
"/invoices.json": {
|
98
|
+
"get": {
|
99
|
+
"operationId": "getInvoices",
|
100
|
+
"tags": [
|
101
|
+
"Invoices"
|
102
|
+
],
|
103
|
+
"summary": "Find invoices emitted between dates",
|
104
|
+
"description": "Find invoices emitted between dates",
|
105
|
+
"parameters": [
|
106
|
+
{
|
107
|
+
"name": "start_date",
|
108
|
+
"in": "query",
|
109
|
+
"description": "Start date and time in [ISO8601 format](https://www.iso.org/iso-8601-date-and-time-format.html)",
|
110
|
+
"required": false,
|
111
|
+
"schema": {
|
112
|
+
"type": "string",
|
113
|
+
"format": "date-time"
|
114
|
+
}
|
115
|
+
},
|
116
|
+
{
|
117
|
+
"name": "end_date",
|
118
|
+
"in": "query",
|
119
|
+
"description": "End date and time in [ISO8601 format](https://www.iso.org/iso-8601-date-and-time-format.html)",
|
120
|
+
"required": false,
|
121
|
+
"schema": {
|
122
|
+
"type": "string",
|
123
|
+
"format": "date-time"
|
124
|
+
}
|
125
|
+
},
|
126
|
+
{
|
127
|
+
"name": "page",
|
128
|
+
"description": "Page number",
|
129
|
+
"in": "query",
|
130
|
+
"required": false,
|
131
|
+
"schema": {
|
132
|
+
"type": "string"
|
133
|
+
}
|
134
|
+
},
|
135
|
+
{
|
136
|
+
"name": "per_page",
|
137
|
+
"description": "Page size",
|
138
|
+
"in": "query",
|
139
|
+
"required": false,
|
140
|
+
"schema": {
|
141
|
+
"type": "string",
|
142
|
+
"default": "30"
|
143
|
+
}
|
144
|
+
}
|
145
|
+
],
|
146
|
+
"responses": {
|
147
|
+
"200": {
|
148
|
+
"description": "Successful operation",
|
149
|
+
"content": {
|
150
|
+
"application/json": {
|
151
|
+
"schema": {
|
152
|
+
"$ref": "#/components/schemas/invoices_index"
|
153
|
+
},
|
154
|
+
"example": [
|
155
|
+
{
|
156
|
+
"id": 1
|
157
|
+
},
|
158
|
+
{
|
159
|
+
"id": 2
|
160
|
+
}
|
161
|
+
]
|
162
|
+
}
|
163
|
+
}
|
164
|
+
},
|
165
|
+
"4XX": {
|
166
|
+
"$ref": "#/components/responses/4XX"
|
167
|
+
},
|
168
|
+
"5XX": {
|
169
|
+
"$ref": "#/components/responses/5XX"
|
170
|
+
}
|
171
|
+
}
|
172
|
+
}
|
173
|
+
},
|
174
|
+
"/invoices/{id}.json": {
|
175
|
+
"get": {
|
176
|
+
"operationId": "getInvoiceById",
|
177
|
+
"tags": [
|
178
|
+
"Invoices"
|
179
|
+
],
|
180
|
+
"summary": "Find an invoice by ID",
|
181
|
+
"description": "Find an invoice by ID",
|
182
|
+
"parameters": [
|
183
|
+
{
|
184
|
+
"name": "id",
|
185
|
+
"in": "path",
|
186
|
+
"description": "ID of invoice to return",
|
187
|
+
"required": true,
|
188
|
+
"schema": {
|
189
|
+
"type": "string",
|
190
|
+
"example": "1"
|
191
|
+
}
|
192
|
+
}
|
193
|
+
],
|
194
|
+
"responses": {
|
195
|
+
"200": {
|
196
|
+
"description": "Successful operation",
|
197
|
+
"content": {
|
198
|
+
"application/json": {
|
199
|
+
"schema": {
|
200
|
+
"$ref": "#/components/schemas/invoice"
|
201
|
+
},
|
202
|
+
"example": {
|
203
|
+
"id": 29,
|
204
|
+
"pdf_url": "https://bit.ly/2wuJPAS",
|
205
|
+
"product_type": "Rental",
|
206
|
+
"product_id": 87,
|
207
|
+
"emitted_at": "2015-12-30T11:00:00.000Z",
|
208
|
+
"total_price": 999,
|
209
|
+
"currency": "EUR",
|
210
|
+
"entity_type": "User",
|
211
|
+
"charges": [
|
212
|
+
{
|
213
|
+
"type": "driver_rental_payment",
|
214
|
+
"amount": 18745
|
215
|
+
},
|
216
|
+
{
|
217
|
+
"type": "self_insurance_payment",
|
218
|
+
"amount": 2000
|
219
|
+
},
|
220
|
+
{
|
221
|
+
"type": "additional_self_insurance_payment",
|
222
|
+
"amount": 500
|
223
|
+
},
|
224
|
+
{
|
225
|
+
"type": "mileage_package",
|
226
|
+
"amount": 1000
|
227
|
+
},
|
228
|
+
{
|
229
|
+
"type": "mileage_package_insurance",
|
230
|
+
"amount": 4200
|
231
|
+
},
|
232
|
+
{
|
233
|
+
"type": "extra_distance_payment",
|
234
|
+
"amount": 1200
|
235
|
+
},
|
236
|
+
{
|
237
|
+
"type": "driver_compensation",
|
238
|
+
"amount": -800
|
239
|
+
},
|
240
|
+
{
|
241
|
+
"type": "driver_cancellation_fee",
|
242
|
+
"amount": 5000
|
243
|
+
},
|
244
|
+
{
|
245
|
+
"type": "driver_late_return_fee",
|
246
|
+
"amount": 1500
|
247
|
+
},
|
248
|
+
{
|
249
|
+
"type": "driver_gas_refill_fee",
|
250
|
+
"amount": 700
|
251
|
+
},
|
252
|
+
{
|
253
|
+
"type": "driver_recharging_fee",
|
254
|
+
"amount": 100
|
255
|
+
},
|
256
|
+
{
|
257
|
+
"type": "driver_mess_fee",
|
258
|
+
"amount": 1620
|
259
|
+
},
|
260
|
+
{
|
261
|
+
"type": "driver_infraction_fee",
|
262
|
+
"amount": 1050
|
263
|
+
},
|
264
|
+
{
|
265
|
+
"type": "repatriation_fee",
|
266
|
+
"amount": 10000
|
267
|
+
},
|
268
|
+
{
|
269
|
+
"type": "claims_owner_fee_cg",
|
270
|
+
"amount": 200
|
271
|
+
},
|
272
|
+
{
|
273
|
+
"type": "drivy_cancellation_fee",
|
274
|
+
"amount": 400
|
275
|
+
},
|
276
|
+
{
|
277
|
+
"type": "drivy_late_return_fee",
|
278
|
+
"amount": 600
|
279
|
+
},
|
280
|
+
{
|
281
|
+
"type": "drivy_mess_fee",
|
282
|
+
"amount": 480
|
283
|
+
},
|
284
|
+
{
|
285
|
+
"type": "insurance_fee",
|
286
|
+
"amount": -1053
|
287
|
+
},
|
288
|
+
{
|
289
|
+
"type": "assistance_fee",
|
290
|
+
"amount": -261
|
291
|
+
},
|
292
|
+
{
|
293
|
+
"type": "drivy_service_fee",
|
294
|
+
"amount": -2686
|
295
|
+
},
|
296
|
+
{
|
297
|
+
"type": "drivy_unfulfillment_fee",
|
298
|
+
"amount": -5000
|
299
|
+
},
|
300
|
+
{
|
301
|
+
"type": "drivy_breakdown_management_fee",
|
302
|
+
"amount": -500
|
303
|
+
},
|
304
|
+
{
|
305
|
+
"type": "driver_gas_compensation",
|
306
|
+
"amount": 1500
|
307
|
+
},
|
308
|
+
{
|
309
|
+
"type": "driver_toll_compensation",
|
310
|
+
"amount": 1500
|
311
|
+
},
|
312
|
+
{
|
313
|
+
"type": "driver_compensation_for_offsite_payment",
|
314
|
+
"amount": -4460
|
315
|
+
},
|
316
|
+
{
|
317
|
+
"type": "owner_infraction_compensation",
|
318
|
+
"amount": 430
|
319
|
+
},
|
320
|
+
{
|
321
|
+
"type": "drivy_gas_compensation",
|
322
|
+
"amount": 200
|
323
|
+
},
|
324
|
+
{
|
325
|
+
"type": "exceptional_event_compensation",
|
326
|
+
"amount": 1800
|
327
|
+
},
|
328
|
+
{
|
329
|
+
"type": "damage_compensation",
|
330
|
+
"amount": 480
|
331
|
+
},
|
332
|
+
{
|
333
|
+
"type": "other_compensation",
|
334
|
+
"amount": -2515
|
335
|
+
},
|
336
|
+
{
|
337
|
+
"type": "guarantee_earning",
|
338
|
+
"amount": 200
|
339
|
+
}
|
340
|
+
]
|
341
|
+
}
|
342
|
+
}
|
343
|
+
}
|
344
|
+
},
|
345
|
+
"4XX": {
|
346
|
+
"$ref": "#/components/responses/4XX"
|
347
|
+
},
|
348
|
+
"5XX": {
|
349
|
+
"$ref": "#/components/responses/5XX"
|
350
|
+
}
|
351
|
+
}
|
352
|
+
}
|
353
|
+
},
|
354
|
+
"/payouts.json": {
|
355
|
+
"get": {
|
356
|
+
"operationId": "getPayouts",
|
357
|
+
"tags": [
|
358
|
+
"Payouts"
|
359
|
+
],
|
360
|
+
"summary": "Find payouts paid between dates",
|
361
|
+
"description": "Find payouts paid between dates",
|
362
|
+
"parameters": [
|
363
|
+
{
|
364
|
+
"name": "start_date",
|
365
|
+
"in": "query",
|
366
|
+
"description": "Start date and time in [ISO8601 format](https://www.iso.org/iso-8601-date-and-time-format.html)",
|
367
|
+
"required": true,
|
368
|
+
"schema": {
|
369
|
+
"type": "string",
|
370
|
+
"format": "date-time"
|
371
|
+
}
|
372
|
+
},
|
373
|
+
{
|
374
|
+
"name": "end_date",
|
375
|
+
"in": "query",
|
376
|
+
"description": "End date and time in [ISO8601 format](https://www.iso.org/iso-8601-date-and-time-format.html)",
|
377
|
+
"required": true,
|
378
|
+
"schema": {
|
379
|
+
"type": "string",
|
380
|
+
"format": "date-time"
|
381
|
+
}
|
382
|
+
},
|
383
|
+
{
|
384
|
+
"name": "page",
|
385
|
+
"description": "Page number",
|
386
|
+
"in": "query",
|
387
|
+
"required": false,
|
388
|
+
"schema": {
|
389
|
+
"type": "string"
|
390
|
+
}
|
391
|
+
},
|
392
|
+
{
|
393
|
+
"name": "per_page",
|
394
|
+
"description": "Page size",
|
395
|
+
"in": "query",
|
396
|
+
"required": false,
|
397
|
+
"schema": {
|
398
|
+
"type": "string",
|
399
|
+
"default": "30"
|
400
|
+
}
|
401
|
+
}
|
402
|
+
],
|
403
|
+
"responses": {
|
404
|
+
"200": {
|
405
|
+
"description": "Successful operation",
|
406
|
+
"content": {
|
407
|
+
"application/json": {
|
408
|
+
"schema": {
|
409
|
+
"$ref": "#/components/schemas/payouts_index"
|
410
|
+
},
|
411
|
+
"example": [
|
412
|
+
{
|
413
|
+
"id": 1
|
414
|
+
},
|
415
|
+
{
|
416
|
+
"id": 2
|
417
|
+
}
|
418
|
+
]
|
419
|
+
}
|
420
|
+
}
|
421
|
+
},
|
422
|
+
"4XX": {
|
423
|
+
"$ref": "#/components/responses/4XX"
|
424
|
+
},
|
425
|
+
"5XX": {
|
426
|
+
"$ref": "#/components/responses/5XX"
|
427
|
+
}
|
428
|
+
}
|
429
|
+
}
|
430
|
+
},
|
431
|
+
"/payouts/{id}.json": {
|
432
|
+
"get": {
|
433
|
+
"operationId": "getPayoutById",
|
434
|
+
"tags": [
|
435
|
+
"Payouts"
|
436
|
+
],
|
437
|
+
"summary": "Find a payout by ID",
|
438
|
+
"description": "Find a payout by ID",
|
439
|
+
"parameters": [
|
440
|
+
{
|
441
|
+
"name": "id",
|
442
|
+
"in": "path",
|
443
|
+
"description": "ID of payout to return",
|
444
|
+
"required": true,
|
445
|
+
"schema": {
|
446
|
+
"type": "string",
|
447
|
+
"example": "1"
|
448
|
+
}
|
449
|
+
}
|
450
|
+
],
|
451
|
+
"responses": {
|
452
|
+
"200": {
|
453
|
+
"description": "Successful operation",
|
454
|
+
"content": {
|
455
|
+
"application/json": {
|
456
|
+
"schema": {
|
457
|
+
"$ref": "#/components/schemas/payout"
|
458
|
+
},
|
459
|
+
"example": {
|
460
|
+
"id": 12,
|
461
|
+
"amount": 10000,
|
462
|
+
"currency": "EUR",
|
463
|
+
"completed_at": "2019-04-02T12:00:00+01:00",
|
464
|
+
"entity_type": "User",
|
465
|
+
"invoices": [
|
466
|
+
{
|
467
|
+
"id": 1
|
468
|
+
},
|
469
|
+
{
|
470
|
+
"id": 2
|
471
|
+
}
|
472
|
+
]
|
473
|
+
}
|
474
|
+
}
|
475
|
+
}
|
476
|
+
},
|
477
|
+
"4XX": {
|
478
|
+
"$ref": "#/components/responses/4XX"
|
479
|
+
},
|
480
|
+
"5XX": {
|
481
|
+
"$ref": "#/components/responses/5XX"
|
482
|
+
}
|
483
|
+
}
|
484
|
+
}
|
485
|
+
},
|
486
|
+
"/rentals.json": {
|
487
|
+
"get": {
|
488
|
+
"operationId": "getRentals",
|
489
|
+
"tags": [
|
490
|
+
"Rentals"
|
491
|
+
],
|
492
|
+
"summary": "Find rentals booked between dates",
|
493
|
+
"description": "Find rentals booked between dates",
|
494
|
+
"parameters": [
|
495
|
+
{
|
496
|
+
"name": "start_date",
|
497
|
+
"in": "query",
|
498
|
+
"description": "Start date and time in [ISO8601 format](https://www.iso.org/iso-8601-date-and-time-format.html)",
|
499
|
+
"required": true,
|
500
|
+
"schema": {
|
501
|
+
"type": "string",
|
502
|
+
"format": "date-time"
|
503
|
+
}
|
504
|
+
},
|
505
|
+
{
|
506
|
+
"name": "end_date",
|
507
|
+
"in": "query",
|
508
|
+
"description": "End date and time in [ISO8601 format](https://www.iso.org/iso-8601-date-and-time-format.html)",
|
509
|
+
"required": true,
|
510
|
+
"schema": {
|
511
|
+
"type": "string",
|
512
|
+
"format": "date-time"
|
513
|
+
}
|
514
|
+
},
|
515
|
+
{
|
516
|
+
"name": "page",
|
517
|
+
"description": "Page number",
|
518
|
+
"in": "query",
|
519
|
+
"required": false,
|
520
|
+
"schema": {
|
521
|
+
"type": "string"
|
522
|
+
}
|
523
|
+
},
|
524
|
+
{
|
525
|
+
"name": "per_page",
|
526
|
+
"description": "Page size",
|
527
|
+
"in": "query",
|
528
|
+
"required": false,
|
529
|
+
"schema": {
|
530
|
+
"type": "string",
|
531
|
+
"default": "30"
|
532
|
+
}
|
533
|
+
}
|
534
|
+
],
|
535
|
+
"responses": {
|
536
|
+
"200": {
|
537
|
+
"description": "Successful operation",
|
538
|
+
"content": {
|
539
|
+
"application/json": {
|
540
|
+
"schema": {
|
541
|
+
"$ref": "#/components/schemas/rentals_index"
|
542
|
+
},
|
543
|
+
"example": [
|
544
|
+
{
|
545
|
+
"id": 1
|
546
|
+
},
|
547
|
+
{
|
548
|
+
"id": 2
|
549
|
+
}
|
550
|
+
]
|
551
|
+
}
|
552
|
+
}
|
553
|
+
},
|
554
|
+
"4XX": {
|
555
|
+
"$ref": "#/components/responses/4XX"
|
556
|
+
},
|
557
|
+
"5XX": {
|
558
|
+
"$ref": "#/components/responses/5XX"
|
559
|
+
}
|
560
|
+
}
|
561
|
+
}
|
562
|
+
},
|
563
|
+
"/rentals/{id}.json": {
|
564
|
+
"get": {
|
565
|
+
"operationId": "getRentalById",
|
566
|
+
"tags": [
|
567
|
+
"Rentals"
|
568
|
+
],
|
569
|
+
"summary": "Find a rental by ID",
|
570
|
+
"description": "Find a rental by ID",
|
571
|
+
"parameters": [
|
572
|
+
{
|
573
|
+
"name": "id",
|
574
|
+
"in": "path",
|
575
|
+
"description": "ID of rental to return",
|
576
|
+
"required": true,
|
577
|
+
"schema": {
|
578
|
+
"type": "string",
|
579
|
+
"example": "1"
|
580
|
+
}
|
581
|
+
}
|
582
|
+
],
|
583
|
+
"responses": {
|
584
|
+
"200": {
|
585
|
+
"description": "Successful operation",
|
586
|
+
"content": {
|
587
|
+
"application/json": {
|
588
|
+
"schema": {
|
589
|
+
"$ref": "#/components/schemas/rental"
|
590
|
+
},
|
591
|
+
"example": {
|
592
|
+
"id": 1,
|
593
|
+
"car_id": 1,
|
594
|
+
"user_id": 933838,
|
595
|
+
"starts_at": "2018-08-14T07:30:00.000+02:00",
|
596
|
+
"ends_at": "2018-08-16T07:30:00.000+02:00",
|
597
|
+
"booked_at": "2018-08-27T09:54:25.000+02:00",
|
598
|
+
"price": 3500,
|
599
|
+
"insurance_fee": 800
|
600
|
+
}
|
601
|
+
}
|
602
|
+
}
|
603
|
+
},
|
604
|
+
"4XX": {
|
605
|
+
"$ref": "#/components/responses/4XX"
|
606
|
+
},
|
607
|
+
"5XX": {
|
608
|
+
"$ref": "#/components/responses/5XX"
|
609
|
+
}
|
610
|
+
}
|
611
|
+
}
|
612
|
+
},
|
613
|
+
"/rentals/{rental_id}/invoices.json": {
|
614
|
+
"get": {
|
615
|
+
"operationId": "getInvoicesForRental",
|
616
|
+
"tags": [
|
617
|
+
"Invoices"
|
618
|
+
],
|
619
|
+
"summary": "Find invoices associated to a rental",
|
620
|
+
"description": "Find invoices associated to a rental",
|
621
|
+
"parameters": [
|
622
|
+
{
|
623
|
+
"name": "rental_id",
|
624
|
+
"in": "path",
|
625
|
+
"description": "ID of rental",
|
626
|
+
"required": true,
|
627
|
+
"schema": {
|
628
|
+
"type": "string",
|
629
|
+
"example": "1"
|
630
|
+
}
|
631
|
+
},
|
632
|
+
{
|
633
|
+
"name": "page",
|
634
|
+
"description": "Page number",
|
635
|
+
"in": "query",
|
636
|
+
"required": false,
|
637
|
+
"schema": {
|
638
|
+
"type": "string"
|
639
|
+
}
|
640
|
+
},
|
641
|
+
{
|
642
|
+
"name": "per_page",
|
643
|
+
"description": "Page size",
|
644
|
+
"in": "query",
|
645
|
+
"required": false,
|
646
|
+
"schema": {
|
647
|
+
"type": "string",
|
648
|
+
"default": "30"
|
649
|
+
}
|
650
|
+
}
|
651
|
+
],
|
652
|
+
"responses": {
|
653
|
+
"200": {
|
654
|
+
"description": "Successful operation",
|
655
|
+
"content": {
|
656
|
+
"application/json": {
|
657
|
+
"schema": {
|
658
|
+
"$ref": "#/components/schemas/rental_invoices_index"
|
659
|
+
},
|
660
|
+
"example": [
|
661
|
+
{
|
662
|
+
"id": 1
|
663
|
+
},
|
664
|
+
{
|
665
|
+
"id": 2
|
666
|
+
}
|
667
|
+
]
|
668
|
+
}
|
669
|
+
}
|
670
|
+
},
|
671
|
+
"4XX": {
|
672
|
+
"$ref": "#/components/responses/4XX"
|
673
|
+
},
|
674
|
+
"5XX": {
|
675
|
+
"$ref": "#/components/responses/5XX"
|
676
|
+
}
|
677
|
+
}
|
678
|
+
}
|
679
|
+
},
|
680
|
+
"/rentals/{rental_id}/messages.json": {
|
681
|
+
"get": {
|
682
|
+
"operationId": "getMessagesForRental",
|
683
|
+
"tags": [
|
684
|
+
"Messages"
|
685
|
+
],
|
686
|
+
"summary": "Find messages associated to a rental",
|
687
|
+
"description": "Find messages associated to a rental",
|
688
|
+
"parameters": [
|
689
|
+
{
|
690
|
+
"name": "rental_id",
|
691
|
+
"in": "path",
|
692
|
+
"description": "ID of rental",
|
693
|
+
"required": true,
|
694
|
+
"schema": {
|
695
|
+
"type": "string",
|
696
|
+
"example": "1"
|
697
|
+
}
|
698
|
+
}
|
699
|
+
],
|
700
|
+
"responses": {
|
701
|
+
"200": {
|
702
|
+
"description": "Successful operation",
|
703
|
+
"content": {
|
704
|
+
"application/json": {
|
705
|
+
"schema": {
|
706
|
+
"$ref": "#/components/schemas/rental_messages_index"
|
707
|
+
},
|
708
|
+
"example": [
|
709
|
+
{
|
710
|
+
"id": 1
|
711
|
+
},
|
712
|
+
{
|
713
|
+
"id": 2
|
714
|
+
}
|
715
|
+
]
|
716
|
+
}
|
717
|
+
}
|
718
|
+
},
|
719
|
+
"4XX": {
|
720
|
+
"$ref": "#/components/responses/4XX"
|
721
|
+
},
|
722
|
+
"5XX": {
|
723
|
+
"$ref": "#/components/responses/5XX"
|
724
|
+
}
|
725
|
+
}
|
726
|
+
},
|
727
|
+
"post": {
|
728
|
+
"operationId": "createMessages",
|
729
|
+
"tags": [
|
730
|
+
"Messages"
|
731
|
+
],
|
732
|
+
"summary": "Create Message associated to a rental",
|
733
|
+
"description": "Create Message associated to a rental",
|
734
|
+
"parameters": [
|
735
|
+
{
|
736
|
+
"name": "rental_id",
|
737
|
+
"in": "path",
|
738
|
+
"description": "ID of rental",
|
739
|
+
"required": true,
|
740
|
+
"schema": {
|
741
|
+
"type": "string",
|
742
|
+
"example": "1"
|
743
|
+
}
|
744
|
+
}
|
745
|
+
],
|
746
|
+
"requestBody": {
|
747
|
+
"description": "Message to create",
|
748
|
+
"content": {
|
749
|
+
"application/json": {
|
750
|
+
"schema": {
|
751
|
+
"type": "object",
|
752
|
+
"required": [
|
753
|
+
"content"
|
754
|
+
],
|
755
|
+
"properties": {
|
756
|
+
"content": {
|
757
|
+
"description": "Content of the message (2000 characters max)",
|
758
|
+
"type": "string"
|
759
|
+
}
|
760
|
+
}
|
761
|
+
},
|
762
|
+
"examples": {
|
763
|
+
"foo": {
|
764
|
+
"summary": "Message attributes",
|
765
|
+
"value": {
|
766
|
+
"content": "Hello, I hope the vehicle rental met all your expectations. Thank you for your respect and trust. Please do not hesitate to tell me how I can improve my service. Have a nice day!"
|
767
|
+
}
|
768
|
+
}
|
769
|
+
}
|
770
|
+
}
|
771
|
+
}
|
772
|
+
},
|
773
|
+
"responses": {
|
774
|
+
"200": {
|
775
|
+
"description": "Successful operation",
|
776
|
+
"content": {
|
777
|
+
"application/json": {
|
778
|
+
"schema": {
|
779
|
+
"$ref": "#/components/schemas/message"
|
780
|
+
},
|
781
|
+
"example": {
|
782
|
+
"id": 1,
|
783
|
+
"rental_id": 23,
|
784
|
+
"sending_user_id": 123432,
|
785
|
+
"sent_at": "2016-01-02T12:00:00+01:00",
|
786
|
+
"content": "Hello, I hope the vehicle rental met all your expectations. Thank you for your respect and trust. Please do not hesitate to tell me how I can improve my service. Have a nice day!"
|
787
|
+
}
|
788
|
+
}
|
789
|
+
}
|
790
|
+
},
|
791
|
+
"4XX": {
|
792
|
+
"$ref": "#/components/responses/4XX"
|
793
|
+
},
|
794
|
+
"5XX": {
|
795
|
+
"$ref": "#/components/responses/5XX"
|
796
|
+
}
|
797
|
+
}
|
798
|
+
}
|
799
|
+
},
|
800
|
+
"/rentals/{rental_id}/messages/{id}.json": {
|
801
|
+
"get": {
|
802
|
+
"operationId": "getMessageById",
|
803
|
+
"tags": [
|
804
|
+
"Messages"
|
805
|
+
],
|
806
|
+
"summary": "Find a message by ID associated to a rental",
|
807
|
+
"description": "Find a message by ID associated to a rental",
|
808
|
+
"parameters": [
|
809
|
+
{
|
810
|
+
"name": "rental_id",
|
811
|
+
"in": "path",
|
812
|
+
"description": "ID of rental",
|
813
|
+
"required": true,
|
814
|
+
"schema": {
|
815
|
+
"type": "string",
|
816
|
+
"example": "1"
|
817
|
+
}
|
818
|
+
},
|
819
|
+
{
|
820
|
+
"name": "id",
|
821
|
+
"in": "path",
|
822
|
+
"description": "ID of message to return",
|
823
|
+
"required": true,
|
824
|
+
"schema": {
|
825
|
+
"type": "string",
|
826
|
+
"example": "1"
|
827
|
+
}
|
828
|
+
}
|
829
|
+
],
|
830
|
+
"responses": {
|
831
|
+
"200": {
|
832
|
+
"description": "Successful operation",
|
833
|
+
"content": {
|
834
|
+
"application/json": {
|
835
|
+
"schema": {
|
836
|
+
"$ref": "#/components/schemas/message"
|
837
|
+
},
|
838
|
+
"example": {
|
839
|
+
"id": 1,
|
840
|
+
"rental_id": 23,
|
841
|
+
"sending_user_id": 123432,
|
842
|
+
"sent_at": "2016-01-02T12:00:00+01:00",
|
843
|
+
"content": "Hello, I hope the vehicle rental met all your expectations. Thank you for your respect and trust. Please do not hesitate to tell me how I can improve my service. Have a nice day!"
|
844
|
+
}
|
845
|
+
}
|
846
|
+
}
|
847
|
+
},
|
848
|
+
"4XX": {
|
849
|
+
"$ref": "#/components/responses/4XX"
|
850
|
+
},
|
851
|
+
"5XX": {
|
852
|
+
"$ref": "#/components/responses/5XX"
|
853
|
+
}
|
854
|
+
}
|
855
|
+
}
|
856
|
+
},
|
857
|
+
"/rentals/{rental_id}/checkin.json": {
|
858
|
+
"get": {
|
859
|
+
"operationId": "getCheckinByRentalId",
|
860
|
+
"tags": [
|
861
|
+
"Checkins"
|
862
|
+
],
|
863
|
+
"summary": "Find a checkin by rental ID",
|
864
|
+
"description": "Find a checkin by rental ID",
|
865
|
+
"parameters": [
|
866
|
+
{
|
867
|
+
"name": "rental_id",
|
868
|
+
"in": "path",
|
869
|
+
"description": "ID of the rental related to the checkin to return",
|
870
|
+
"required": true,
|
871
|
+
"schema": {
|
872
|
+
"type": "string",
|
873
|
+
"example": "1"
|
874
|
+
}
|
875
|
+
}
|
876
|
+
],
|
877
|
+
"responses": {
|
878
|
+
"200": {
|
879
|
+
"description": "Successful operation",
|
880
|
+
"content": {
|
881
|
+
"application/json": {
|
882
|
+
"schema": {
|
883
|
+
"$ref": "#/components/schemas/checkin"
|
884
|
+
},
|
885
|
+
"example": {
|
886
|
+
"rental_id": 4,
|
887
|
+
"mileage": 104132,
|
888
|
+
"fuel_level": 70,
|
889
|
+
"occurred_at": "2018-08-27T09:54:25.000+02:00"
|
890
|
+
}
|
891
|
+
}
|
892
|
+
}
|
893
|
+
},
|
894
|
+
"4XX": {
|
895
|
+
"$ref": "#/components/responses/4XX"
|
896
|
+
},
|
897
|
+
"5XX": {
|
898
|
+
"$ref": "#/components/responses/5XX"
|
899
|
+
}
|
900
|
+
}
|
901
|
+
}
|
902
|
+
},
|
903
|
+
"/rentals/{rental_id}/checkout.json": {
|
904
|
+
"get": {
|
905
|
+
"operationId": "getCheckoutByRentalId",
|
906
|
+
"tags": [
|
907
|
+
"Checkouts"
|
908
|
+
],
|
909
|
+
"summary": "Find a checkout by rental ID",
|
910
|
+
"description": "Find a checkout by rental ID",
|
911
|
+
"parameters": [
|
912
|
+
{
|
913
|
+
"name": "rental_id",
|
914
|
+
"in": "path",
|
915
|
+
"description": "ID of the rental related to the checkout to return",
|
916
|
+
"required": true,
|
917
|
+
"schema": {
|
918
|
+
"type": "string",
|
919
|
+
"example": "1"
|
920
|
+
}
|
921
|
+
}
|
922
|
+
],
|
923
|
+
"responses": {
|
924
|
+
"200": {
|
925
|
+
"description": "Successful operation",
|
926
|
+
"content": {
|
927
|
+
"application/json": {
|
928
|
+
"schema": {
|
929
|
+
"$ref": "#/components/schemas/checkout"
|
930
|
+
},
|
931
|
+
"example": {
|
932
|
+
"rental_id": 4,
|
933
|
+
"mileage": 104132,
|
934
|
+
"fuel_level": 70,
|
935
|
+
"distance_driven": 120,
|
936
|
+
"occurred_at": "2018-08-27T09:54:25.000+02:00"
|
937
|
+
}
|
938
|
+
}
|
939
|
+
}
|
940
|
+
},
|
941
|
+
"4XX": {
|
942
|
+
"$ref": "#/components/responses/4XX"
|
943
|
+
},
|
944
|
+
"5XX": {
|
945
|
+
"$ref": "#/components/responses/5XX"
|
946
|
+
}
|
947
|
+
}
|
948
|
+
}
|
949
|
+
},
|
950
|
+
"/cars.json": {
|
951
|
+
"get": {
|
952
|
+
"operationId": "getCars",
|
953
|
+
"tags": [
|
954
|
+
"Cars"
|
955
|
+
],
|
956
|
+
"summary": "Find all cars",
|
957
|
+
"description": "Find all cars",
|
958
|
+
"parameters": [
|
959
|
+
{
|
960
|
+
"name": "page",
|
961
|
+
"description": "Page number",
|
962
|
+
"in": "query",
|
963
|
+
"required": false,
|
964
|
+
"schema": {
|
965
|
+
"type": "string"
|
966
|
+
}
|
967
|
+
},
|
968
|
+
{
|
969
|
+
"name": "per_page",
|
970
|
+
"description": "Page size",
|
971
|
+
"in": "query",
|
972
|
+
"required": false,
|
973
|
+
"schema": {
|
974
|
+
"type": "string",
|
975
|
+
"default": "30"
|
976
|
+
}
|
977
|
+
}
|
978
|
+
],
|
979
|
+
"responses": {
|
980
|
+
"200": {
|
981
|
+
"description": "Successful operation",
|
982
|
+
"content": {
|
983
|
+
"application/json": {
|
984
|
+
"schema": {
|
985
|
+
"$ref": "#/components/schemas/cars_index"
|
986
|
+
},
|
987
|
+
"example": [
|
988
|
+
{
|
989
|
+
"id": 1
|
990
|
+
},
|
991
|
+
{
|
992
|
+
"id": 2
|
993
|
+
}
|
994
|
+
]
|
995
|
+
}
|
996
|
+
}
|
997
|
+
},
|
998
|
+
"4XX": {
|
999
|
+
"$ref": "#/components/responses/4XX"
|
1000
|
+
},
|
1001
|
+
"5XX": {
|
1002
|
+
"$ref": "#/components/responses/5XX"
|
1003
|
+
}
|
1004
|
+
}
|
1005
|
+
}
|
1006
|
+
},
|
1007
|
+
"/cars/{id}.json": {
|
1008
|
+
"get": {
|
1009
|
+
"operationId": "getCarById",
|
1010
|
+
"tags": [
|
1011
|
+
"Cars"
|
1012
|
+
],
|
1013
|
+
"summary": "Find a car by ID",
|
1014
|
+
"description": "Find a car by ID",
|
1015
|
+
"parameters": [
|
1016
|
+
{
|
1017
|
+
"name": "id",
|
1018
|
+
"in": "path",
|
1019
|
+
"description": "ID of car to return",
|
1020
|
+
"required": true,
|
1021
|
+
"schema": {
|
1022
|
+
"type": "string",
|
1023
|
+
"example": "1"
|
1024
|
+
}
|
1025
|
+
}
|
1026
|
+
],
|
1027
|
+
"responses": {
|
1028
|
+
"200": {
|
1029
|
+
"description": "Successful operation",
|
1030
|
+
"content": {
|
1031
|
+
"application/json": {
|
1032
|
+
"schema": {
|
1033
|
+
"$ref": "#/components/schemas/car"
|
1034
|
+
},
|
1035
|
+
"example": {
|
1036
|
+
"id": 1,
|
1037
|
+
"state": "active",
|
1038
|
+
"plate_number": "555FDK95",
|
1039
|
+
"brand": "Ford",
|
1040
|
+
"model": "Focus",
|
1041
|
+
"display_address": "Corentin Celton, Issy-les-Moulineaux, France"
|
1042
|
+
}
|
1043
|
+
}
|
1044
|
+
}
|
1045
|
+
},
|
1046
|
+
"4XX": {
|
1047
|
+
"$ref": "#/components/responses/4XX"
|
1048
|
+
},
|
1049
|
+
"5XX": {
|
1050
|
+
"$ref": "#/components/responses/5XX"
|
1051
|
+
}
|
1052
|
+
}
|
1053
|
+
}
|
1054
|
+
},
|
1055
|
+
"/users/{id}.json": {
|
1056
|
+
"get": {
|
1057
|
+
"operationId": "getUserById",
|
1058
|
+
"tags": [
|
1059
|
+
"Users"
|
1060
|
+
],
|
1061
|
+
"summary": "Find a user by ID (Users are customers who rent one of your cars)",
|
1062
|
+
"description": "Find a user by ID (Users are customers who rent one of your cars)",
|
1063
|
+
"parameters": [
|
1064
|
+
{
|
1065
|
+
"name": "id",
|
1066
|
+
"in": "path",
|
1067
|
+
"description": "ID of user to return",
|
1068
|
+
"required": true,
|
1069
|
+
"schema": {
|
1070
|
+
"type": "string",
|
1071
|
+
"example": "1"
|
1072
|
+
}
|
1073
|
+
}
|
1074
|
+
],
|
1075
|
+
"responses": {
|
1076
|
+
"200": {
|
1077
|
+
"description": "Successful operation",
|
1078
|
+
"content": {
|
1079
|
+
"application/json": {
|
1080
|
+
"schema": {
|
1081
|
+
"$ref": "#/components/schemas/user"
|
1082
|
+
},
|
1083
|
+
"example": {
|
1084
|
+
"id": 1,
|
1085
|
+
"first_name": "Thibauld",
|
1086
|
+
"last_name": "Busso",
|
1087
|
+
"phone_number": "+33 7 83 43 45 75",
|
1088
|
+
"address_line1": "112 rue de charonne",
|
1089
|
+
"address_line2": "Batiment D9",
|
1090
|
+
"postal_code": "75011",
|
1091
|
+
"city": "Paris",
|
1092
|
+
"country": "FR",
|
1093
|
+
"birth_date": "1960-08-25",
|
1094
|
+
"license_country": "FR",
|
1095
|
+
"license_first_issue_date": "1986-03-14",
|
1096
|
+
"license_number": "869175121164"
|
1097
|
+
}
|
1098
|
+
}
|
1099
|
+
}
|
1100
|
+
},
|
1101
|
+
"4XX": {
|
1102
|
+
"$ref": "#/components/responses/4XX"
|
1103
|
+
},
|
1104
|
+
"5XX": {
|
1105
|
+
"$ref": "#/components/responses/5XX"
|
1106
|
+
}
|
1107
|
+
}
|
1108
|
+
}
|
1109
|
+
},
|
1110
|
+
"/checkins.json": {
|
1111
|
+
"get": {
|
1112
|
+
"operationId": "getCheckins",
|
1113
|
+
"tags": [
|
1114
|
+
"Checkins"
|
1115
|
+
],
|
1116
|
+
"summary": "List of checkins that occurred between two dates",
|
1117
|
+
"description": "List of checkins that occurred between two dates",
|
1118
|
+
"parameters": [
|
1119
|
+
{
|
1120
|
+
"name": "start_date",
|
1121
|
+
"in": "query",
|
1122
|
+
"description": "Start date and time in [ISO8601 format](https://www.iso.org/iso-8601-date-and-time-format.html)",
|
1123
|
+
"required": true,
|
1124
|
+
"schema": {
|
1125
|
+
"type": "string",
|
1126
|
+
"format": "date-time"
|
1127
|
+
}
|
1128
|
+
},
|
1129
|
+
{
|
1130
|
+
"name": "end_date",
|
1131
|
+
"in": "query",
|
1132
|
+
"description": "End date and time in [ISO8601 format](https://www.iso.org/iso-8601-date-and-time-format.html)",
|
1133
|
+
"required": true,
|
1134
|
+
"schema": {
|
1135
|
+
"type": "string",
|
1136
|
+
"format": "date-time"
|
1137
|
+
}
|
1138
|
+
},
|
1139
|
+
{
|
1140
|
+
"name": "page",
|
1141
|
+
"description": "Page number",
|
1142
|
+
"in": "query",
|
1143
|
+
"required": false,
|
1144
|
+
"schema": {
|
1145
|
+
"type": "string"
|
1146
|
+
}
|
1147
|
+
},
|
1148
|
+
{
|
1149
|
+
"name": "per_page",
|
1150
|
+
"description": "Page size",
|
1151
|
+
"in": "query",
|
1152
|
+
"required": false,
|
1153
|
+
"schema": {
|
1154
|
+
"type": "string",
|
1155
|
+
"default": "30"
|
1156
|
+
}
|
1157
|
+
}
|
1158
|
+
],
|
1159
|
+
"responses": {
|
1160
|
+
"200": {
|
1161
|
+
"description": "Successful operation",
|
1162
|
+
"content": {
|
1163
|
+
"application/json": {
|
1164
|
+
"schema": {
|
1165
|
+
"$ref": "#/components/schemas/checkins_index"
|
1166
|
+
},
|
1167
|
+
"example": [
|
1168
|
+
{
|
1169
|
+
"rental_id": 1
|
1170
|
+
},
|
1171
|
+
{
|
1172
|
+
"rental_id": 2
|
1173
|
+
}
|
1174
|
+
]
|
1175
|
+
}
|
1176
|
+
}
|
1177
|
+
},
|
1178
|
+
"4XX": {
|
1179
|
+
"$ref": "#/components/responses/4XX"
|
1180
|
+
},
|
1181
|
+
"5XX": {
|
1182
|
+
"$ref": "#/components/responses/5XX"
|
1183
|
+
}
|
1184
|
+
}
|
1185
|
+
}
|
1186
|
+
},
|
1187
|
+
"/checkouts.json": {
|
1188
|
+
"get": {
|
1189
|
+
"operationId": "getCheckouts",
|
1190
|
+
"tags": [
|
1191
|
+
"Checkouts"
|
1192
|
+
],
|
1193
|
+
"summary": "List of checkouts that occurred between two dates",
|
1194
|
+
"description": "List of checkouts that occurred between two dates",
|
1195
|
+
"parameters": [
|
1196
|
+
{
|
1197
|
+
"name": "start_date",
|
1198
|
+
"in": "query",
|
1199
|
+
"description": "Start date and time in [ISO8601 format](https://www.iso.org/iso-8601-date-and-time-format.html)",
|
1200
|
+
"required": true,
|
1201
|
+
"schema": {
|
1202
|
+
"type": "string",
|
1203
|
+
"format": "date-time"
|
1204
|
+
}
|
1205
|
+
},
|
1206
|
+
{
|
1207
|
+
"name": "end_date",
|
1208
|
+
"in": "query",
|
1209
|
+
"description": "End date and time in [ISO8601 format](https://www.iso.org/iso-8601-date-and-time-format.html)",
|
1210
|
+
"required": true,
|
1211
|
+
"schema": {
|
1212
|
+
"type": "string",
|
1213
|
+
"format": "date-time"
|
1214
|
+
}
|
1215
|
+
},
|
1216
|
+
{
|
1217
|
+
"name": "page",
|
1218
|
+
"description": "Page number",
|
1219
|
+
"in": "query",
|
1220
|
+
"required": false,
|
1221
|
+
"schema": {
|
1222
|
+
"type": "string"
|
1223
|
+
}
|
1224
|
+
},
|
1225
|
+
{
|
1226
|
+
"name": "per_page",
|
1227
|
+
"description": "Page size",
|
1228
|
+
"in": "query",
|
1229
|
+
"required": false,
|
1230
|
+
"schema": {
|
1231
|
+
"type": "string",
|
1232
|
+
"default": "30"
|
1233
|
+
}
|
1234
|
+
}
|
1235
|
+
],
|
1236
|
+
"responses": {
|
1237
|
+
"200": {
|
1238
|
+
"description": "Successful operation",
|
1239
|
+
"content": {
|
1240
|
+
"application/json": {
|
1241
|
+
"schema": {
|
1242
|
+
"$ref": "#/components/schemas/checkouts_index"
|
1243
|
+
},
|
1244
|
+
"example": [
|
1245
|
+
{
|
1246
|
+
"rental_id": 1
|
1247
|
+
},
|
1248
|
+
{
|
1249
|
+
"rental_id": 2
|
1250
|
+
}
|
1251
|
+
]
|
1252
|
+
}
|
1253
|
+
}
|
1254
|
+
},
|
1255
|
+
"4XX": {
|
1256
|
+
"$ref": "#/components/responses/4XX"
|
1257
|
+
},
|
1258
|
+
"5XX": {
|
1259
|
+
"$ref": "#/components/responses/5XX"
|
1260
|
+
}
|
1261
|
+
}
|
1262
|
+
}
|
1263
|
+
},
|
1264
|
+
"/cars/{car_id}/unavailabilities.json": {
|
1265
|
+
"get": {
|
1266
|
+
"operationId": "getUnavailabilitiesForCar",
|
1267
|
+
"tags": [
|
1268
|
+
"Unavailabilities"
|
1269
|
+
],
|
1270
|
+
"summary": "Find Unavailabilities related to a car between dates",
|
1271
|
+
"description": "Find between 2 dates when you’ve set a car as unavailable",
|
1272
|
+
"parameters": [
|
1273
|
+
{
|
1274
|
+
"name": "start_date",
|
1275
|
+
"in": "query",
|
1276
|
+
"description": "Start date and time in [ISO8601 format](https://www.iso.org/iso-8601-date-and-time-format.html)",
|
1277
|
+
"required": true,
|
1278
|
+
"schema": {
|
1279
|
+
"type": "string",
|
1280
|
+
"format": "date-time"
|
1281
|
+
}
|
1282
|
+
},
|
1283
|
+
{
|
1284
|
+
"name": "end_date",
|
1285
|
+
"in": "query",
|
1286
|
+
"description": "End date and time in [ISO8601 format](https://www.iso.org/iso-8601-date-and-time-format.html)",
|
1287
|
+
"required": true,
|
1288
|
+
"schema": {
|
1289
|
+
"type": "string",
|
1290
|
+
"format": "date-time"
|
1291
|
+
}
|
1292
|
+
},
|
1293
|
+
{
|
1294
|
+
"name": "car_id",
|
1295
|
+
"in": "path",
|
1296
|
+
"description": "ID of the car",
|
1297
|
+
"required": true,
|
1298
|
+
"schema": {
|
1299
|
+
"type": "string",
|
1300
|
+
"example": "123"
|
1301
|
+
}
|
1302
|
+
},
|
1303
|
+
{
|
1304
|
+
"name": "page",
|
1305
|
+
"description": "Page number",
|
1306
|
+
"in": "query",
|
1307
|
+
"required": false,
|
1308
|
+
"schema": {
|
1309
|
+
"type": "string"
|
1310
|
+
}
|
1311
|
+
},
|
1312
|
+
{
|
1313
|
+
"name": "per_page",
|
1314
|
+
"description": "Page size",
|
1315
|
+
"in": "query",
|
1316
|
+
"required": false,
|
1317
|
+
"schema": {
|
1318
|
+
"type": "string",
|
1319
|
+
"default": "30"
|
1320
|
+
}
|
1321
|
+
}
|
1322
|
+
],
|
1323
|
+
"responses": {
|
1324
|
+
"200": {
|
1325
|
+
"description": "Successful operation",
|
1326
|
+
"content": {
|
1327
|
+
"application/json": {
|
1328
|
+
"schema": {
|
1329
|
+
"$ref": "#/components/schemas/unavailabilities_index"
|
1330
|
+
},
|
1331
|
+
"example": [
|
1332
|
+
{
|
1333
|
+
"starts_at": "2016-01-02T12:00:00+01:00",
|
1334
|
+
"ends_at": "2016-01-07T12:00:00+01:00",
|
1335
|
+
"reason": null,
|
1336
|
+
"car_id": 42
|
1337
|
+
},
|
1338
|
+
{
|
1339
|
+
"starts_at": "2016-01-08T12:00:00+01:00",
|
1340
|
+
"ends_at": "2016-01-09T12:00:00+01:00",
|
1341
|
+
"reason": "booked",
|
1342
|
+
"car_id": 42
|
1343
|
+
}
|
1344
|
+
]
|
1345
|
+
}
|
1346
|
+
}
|
1347
|
+
},
|
1348
|
+
"4XX": {
|
1349
|
+
"$ref": "#/components/responses/4XX"
|
1350
|
+
},
|
1351
|
+
"5XX": {
|
1352
|
+
"$ref": "#/components/responses/5XX"
|
1353
|
+
}
|
1354
|
+
}
|
1355
|
+
},
|
1356
|
+
"post": {
|
1357
|
+
"operationId": "createUnavailabilities",
|
1358
|
+
"tags": [
|
1359
|
+
"Unavailabilities"
|
1360
|
+
],
|
1361
|
+
"summary": "Create Unavailability related to a car between dates",
|
1362
|
+
"description": "Set a car as unavailable between 2 dates",
|
1363
|
+
"parameters": [
|
1364
|
+
{
|
1365
|
+
"name": "car_id",
|
1366
|
+
"in": "path",
|
1367
|
+
"description": "ID of car",
|
1368
|
+
"required": true,
|
1369
|
+
"schema": {
|
1370
|
+
"type": "string",
|
1371
|
+
"example": "1"
|
1372
|
+
}
|
1373
|
+
}
|
1374
|
+
],
|
1375
|
+
"requestBody": {
|
1376
|
+
"description": "Unavailability to create",
|
1377
|
+
"content": {
|
1378
|
+
"application/json": {
|
1379
|
+
"schema": {
|
1380
|
+
"type": "object",
|
1381
|
+
"required": [
|
1382
|
+
"starts_at",
|
1383
|
+
"ends_at"
|
1384
|
+
],
|
1385
|
+
"properties": {
|
1386
|
+
"starts_at": {
|
1387
|
+
"description": "Start date and time of the unavailability in [ISO8601 format](https://www.iso.org/iso-8601-date-and-time-format.html) with a 30 min granularity.",
|
1388
|
+
"type": "string",
|
1389
|
+
"format": "date-time"
|
1390
|
+
},
|
1391
|
+
"ends_at": {
|
1392
|
+
"description": "End date and time of the unavailability in [ISO8601 format](https://www.iso.org/iso-8601-date-and-time-format.html) with a 30 min granularity.",
|
1393
|
+
"type": "string",
|
1394
|
+
"format": "date-time"
|
1395
|
+
},
|
1396
|
+
"reason": {
|
1397
|
+
"description": "Reason of the unavailability",
|
1398
|
+
"type": "string",
|
1399
|
+
"enum": [
|
1400
|
+
"check_up",
|
1401
|
+
"repairs",
|
1402
|
+
"connect_issues",
|
1403
|
+
"repatriation",
|
1404
|
+
"booked",
|
1405
|
+
"other"
|
1406
|
+
]
|
1407
|
+
}
|
1408
|
+
}
|
1409
|
+
},
|
1410
|
+
"examples": {
|
1411
|
+
"foo": {
|
1412
|
+
"summary": "Unavailability attributes",
|
1413
|
+
"value": {
|
1414
|
+
"starts_at": "2018-08-14T07:30:00.000+02:00",
|
1415
|
+
"ends_at": "2018-08-16T07:30:00.000+02:00",
|
1416
|
+
"reason": "booked"
|
1417
|
+
}
|
1418
|
+
}
|
1419
|
+
}
|
1420
|
+
}
|
1421
|
+
}
|
1422
|
+
},
|
1423
|
+
"responses": {
|
1424
|
+
"204": {
|
1425
|
+
"description": "No content - Successful operation"
|
1426
|
+
},
|
1427
|
+
"4XX": {
|
1428
|
+
"$ref": "#/components/responses/4XX"
|
1429
|
+
},
|
1430
|
+
"5XX": {
|
1431
|
+
"$ref": "#/components/responses/5XX"
|
1432
|
+
}
|
1433
|
+
}
|
1434
|
+
},
|
1435
|
+
"delete": {
|
1436
|
+
"operationId": "destroyUnavailability",
|
1437
|
+
"tags": [
|
1438
|
+
"Unavailabilities"
|
1439
|
+
],
|
1440
|
+
"summary": "Destroy Unavailability related to a car between dates",
|
1441
|
+
"description": "Set a car as available between 2 dates",
|
1442
|
+
"parameters": [
|
1443
|
+
{
|
1444
|
+
"name": "car_id",
|
1445
|
+
"in": "path",
|
1446
|
+
"description": "ID of car",
|
1447
|
+
"required": true,
|
1448
|
+
"schema": {
|
1449
|
+
"type": "string",
|
1450
|
+
"example": "1"
|
1451
|
+
}
|
1452
|
+
}
|
1453
|
+
],
|
1454
|
+
"requestBody": {
|
1455
|
+
"description": "Unavailability to destroy",
|
1456
|
+
"content": {
|
1457
|
+
"application/json": {
|
1458
|
+
"schema": {
|
1459
|
+
"type": "object",
|
1460
|
+
"required": [
|
1461
|
+
"starts_at",
|
1462
|
+
"ends_at"
|
1463
|
+
],
|
1464
|
+
"properties": {
|
1465
|
+
"starts_at": {
|
1466
|
+
"description": "Start date and time of the unavailability in [ISO8601 format](https://www.iso.org/iso-8601-date-and-time-format.html) with a 30 min granularity.",
|
1467
|
+
"type": "string",
|
1468
|
+
"format": "date-time"
|
1469
|
+
},
|
1470
|
+
"ends_at": {
|
1471
|
+
"description": "End date and time of the unavailability in [ISO8601 format](https://www.iso.org/iso-8601-date-and-time-format.html) with a 30 min granularity.",
|
1472
|
+
"type": "string",
|
1473
|
+
"format": "date-time"
|
1474
|
+
}
|
1475
|
+
}
|
1476
|
+
},
|
1477
|
+
"examples": {
|
1478
|
+
"foo": {
|
1479
|
+
"summary": "Unavailability attributes",
|
1480
|
+
"value": {
|
1481
|
+
"starts_at": "2018-08-14T07:30:00.000+02:00",
|
1482
|
+
"ends_at": "2018-08-16T07:30:00.000+02:00"
|
1483
|
+
}
|
1484
|
+
}
|
1485
|
+
}
|
1486
|
+
}
|
1487
|
+
}
|
1488
|
+
},
|
1489
|
+
"responses": {
|
1490
|
+
"204": {
|
1491
|
+
"description": "No content - Successful operation"
|
1492
|
+
},
|
1493
|
+
"4XX": {
|
1494
|
+
"$ref": "#/components/responses/4XX"
|
1495
|
+
},
|
1496
|
+
"5XX": {
|
1497
|
+
"$ref": "#/components/responses/5XX"
|
1498
|
+
}
|
1499
|
+
}
|
1500
|
+
}
|
1501
|
+
}
|
1502
|
+
},
|
1503
|
+
"webhooks": {
|
1504
|
+
"bookedRental": {
|
1505
|
+
"post": {
|
1506
|
+
"tags": [
|
1507
|
+
"Rentals"
|
1508
|
+
],
|
1509
|
+
"security": [],
|
1510
|
+
"summary": "New rental booked for one of your cars",
|
1511
|
+
"requestBody": {
|
1512
|
+
"description": "This event is triggered when a new rental booking has been created for one of your cars",
|
1513
|
+
"content": {
|
1514
|
+
"application/json": {
|
1515
|
+
"schema": {
|
1516
|
+
"$ref": "#/components/schemas/rentals_booked"
|
1517
|
+
},
|
1518
|
+
"example": {
|
1519
|
+
"type": "rental.booked",
|
1520
|
+
"data": {
|
1521
|
+
"rental_id": 234535
|
1522
|
+
},
|
1523
|
+
"occurred_at": "2019-04-18T08:30:05Z"
|
1524
|
+
}
|
1525
|
+
}
|
1526
|
+
}
|
1527
|
+
},
|
1528
|
+
"responses": {
|
1529
|
+
"200": {
|
1530
|
+
"description": "Return a 200 status to indicate that the data was received successfully"
|
1531
|
+
}
|
1532
|
+
}
|
1533
|
+
}
|
1534
|
+
},
|
1535
|
+
"canceledRental": {
|
1536
|
+
"post": {
|
1537
|
+
"tags": [
|
1538
|
+
"Rentals"
|
1539
|
+
],
|
1540
|
+
"security": [],
|
1541
|
+
"summary": "Canceled rental for one of your cars",
|
1542
|
+
"requestBody": {
|
1543
|
+
"description": "This event is triggered when a rental has been canceled for one of your cars",
|
1544
|
+
"content": {
|
1545
|
+
"application/json": {
|
1546
|
+
"schema": {
|
1547
|
+
"$ref": "#/components/schemas/rentals_canceled"
|
1548
|
+
},
|
1549
|
+
"example": {
|
1550
|
+
"type": "rental.canceled",
|
1551
|
+
"data": {
|
1552
|
+
"rental_id": 234535
|
1553
|
+
},
|
1554
|
+
"occurred_at": "2019-04-22T11:30:05Z"
|
1555
|
+
}
|
1556
|
+
}
|
1557
|
+
}
|
1558
|
+
},
|
1559
|
+
"responses": {
|
1560
|
+
"200": {
|
1561
|
+
"description": "Return a 200 status to indicate that the data was received successfully"
|
1562
|
+
}
|
1563
|
+
}
|
1564
|
+
}
|
1565
|
+
},
|
1566
|
+
"carCheckedInRental": {
|
1567
|
+
"post": {
|
1568
|
+
"tags": [
|
1569
|
+
"Checkins"
|
1570
|
+
],
|
1571
|
+
"security": [],
|
1572
|
+
"summary": "Rental started for one of your cars",
|
1573
|
+
"requestBody": {
|
1574
|
+
"description": "This event is triggered when a rental starts and the car has been unlocked",
|
1575
|
+
"content": {
|
1576
|
+
"application/json": {
|
1577
|
+
"schema": {
|
1578
|
+
"$ref": "#/components/schemas/rentals_car_checked_in"
|
1579
|
+
},
|
1580
|
+
"example": {
|
1581
|
+
"type": "rental.car_checked_in",
|
1582
|
+
"data": {
|
1583
|
+
"rental_id": 233435
|
1584
|
+
},
|
1585
|
+
"occurred_at": "2019-04-19T10:30:05Z"
|
1586
|
+
}
|
1587
|
+
}
|
1588
|
+
}
|
1589
|
+
},
|
1590
|
+
"responses": {
|
1591
|
+
"200": {
|
1592
|
+
"description": "Return a 200 status to indicate that the data was received successfully"
|
1593
|
+
}
|
1594
|
+
}
|
1595
|
+
}
|
1596
|
+
},
|
1597
|
+
"carCheckedOutRental": {
|
1598
|
+
"post": {
|
1599
|
+
"tags": [
|
1600
|
+
"Checkouts"
|
1601
|
+
],
|
1602
|
+
"security": [],
|
1603
|
+
"summary": "Rental ended for one of your cars",
|
1604
|
+
"requestBody": {
|
1605
|
+
"description": "This event is triggered when a rental ends and the car has been locked",
|
1606
|
+
"content": {
|
1607
|
+
"application/json": {
|
1608
|
+
"schema": {
|
1609
|
+
"$ref": "#/components/schemas/rentals_car_checked_out"
|
1610
|
+
},
|
1611
|
+
"example": {
|
1612
|
+
"type": "rental.car_checked_out",
|
1613
|
+
"data": {
|
1614
|
+
"rental_id": 97437
|
1615
|
+
},
|
1616
|
+
"occurred_at": "2019-04-19T10:30:05Z"
|
1617
|
+
}
|
1618
|
+
}
|
1619
|
+
}
|
1620
|
+
},
|
1621
|
+
"responses": {
|
1622
|
+
"200": {
|
1623
|
+
"description": "Return a 200 status to indicate that the data was received successfully"
|
1624
|
+
}
|
1625
|
+
}
|
1626
|
+
}
|
1627
|
+
},
|
1628
|
+
"timesChangedRental": {
|
1629
|
+
"post": {
|
1630
|
+
"tags": [
|
1631
|
+
"Rentals"
|
1632
|
+
],
|
1633
|
+
"security": [],
|
1634
|
+
"summary": "Rental time change for one of your car",
|
1635
|
+
"requestBody": {
|
1636
|
+
"description": "This event is triggered when the start or end time of a rental has been changed for one of your cars",
|
1637
|
+
"content": {
|
1638
|
+
"application/json": {
|
1639
|
+
"schema": {
|
1640
|
+
"$ref": "#/components/schemas/rentals_times_changed"
|
1641
|
+
},
|
1642
|
+
"example": {
|
1643
|
+
"type": "rental.times_changed",
|
1644
|
+
"data": {
|
1645
|
+
"rental_id": 234535
|
1646
|
+
},
|
1647
|
+
"occurred_at": "2019-04-19T10:30:05Z"
|
1648
|
+
}
|
1649
|
+
}
|
1650
|
+
}
|
1651
|
+
},
|
1652
|
+
"responses": {
|
1653
|
+
"200": {
|
1654
|
+
"description": "Return a 200 status to indicate that the data was received successfully"
|
1655
|
+
}
|
1656
|
+
}
|
1657
|
+
}
|
1658
|
+
},
|
1659
|
+
"carSwitchedRental": {
|
1660
|
+
"post": {
|
1661
|
+
"tags": [
|
1662
|
+
"Rentals"
|
1663
|
+
],
|
1664
|
+
"security": [],
|
1665
|
+
"summary": "There was a switch car on one of your rental",
|
1666
|
+
"requestBody": {
|
1667
|
+
"description": "This event is triggered when an owner or customer service team member switches the car used to perform a given rental",
|
1668
|
+
"content": {
|
1669
|
+
"application/json": {
|
1670
|
+
"schema": {
|
1671
|
+
"$ref": "#/components/schemas/rentals_car_switched"
|
1672
|
+
},
|
1673
|
+
"example": {
|
1674
|
+
"type": "rental.car_switched",
|
1675
|
+
"data": {
|
1676
|
+
"rental_id": 234535
|
1677
|
+
},
|
1678
|
+
"occurred_at": "2019-04-22T11:30:05Z"
|
1679
|
+
}
|
1680
|
+
}
|
1681
|
+
}
|
1682
|
+
},
|
1683
|
+
"responses": {
|
1684
|
+
"200": {
|
1685
|
+
"description": "Return a 200 status to indicate that the data was received successfully"
|
1686
|
+
}
|
1687
|
+
}
|
1688
|
+
}
|
1689
|
+
},
|
1690
|
+
"createdUnavailability": {
|
1691
|
+
"post": {
|
1692
|
+
"tags": [
|
1693
|
+
"Unavailabilities"
|
1694
|
+
],
|
1695
|
+
"security": [],
|
1696
|
+
"summary": "Unavailability created on one of your cars",
|
1697
|
+
"requestBody": {
|
1698
|
+
"description": "This event is triggered whenever an unavailability is created (through the API or directly in the app/website). It shows the unavailability that has just been created, with the same timestamps as those entered by the user. It does not show the changes of other potential overlapping unavailabilities. For example: if an unavailability was already set between June 10 and June 20, and if the user creates a new one between June 18 and June 22, this webhook will only send information about the newly created June 18 - June 22 unavailability. It will not show that, under the hood, the unavailability from June 10 to June 20 has be deleted, and that a new unavailability from June 10 to June 22 has been created.",
|
1699
|
+
"content": {
|
1700
|
+
"application/json": {
|
1701
|
+
"schema": {
|
1702
|
+
"$ref": "#/components/schemas/unavailabilities_created"
|
1703
|
+
},
|
1704
|
+
"example": {
|
1705
|
+
"type": "unavailability.created",
|
1706
|
+
"data": {
|
1707
|
+
"starts_at": "2019-06-26T09:30:05Z",
|
1708
|
+
"ends_at": "2019-06-28T09:30:05Z",
|
1709
|
+
"reason": "repairs",
|
1710
|
+
"car_id": 42
|
1711
|
+
},
|
1712
|
+
"occurred_at": "2019-06-24T09:30:05Z"
|
1713
|
+
}
|
1714
|
+
}
|
1715
|
+
}
|
1716
|
+
},
|
1717
|
+
"responses": {
|
1718
|
+
"200": {
|
1719
|
+
"description": "Return a 200 status to indicate that the data was received successfully"
|
1720
|
+
}
|
1721
|
+
}
|
1722
|
+
}
|
1723
|
+
},
|
1724
|
+
"deletedUnavailability": {
|
1725
|
+
"post": {
|
1726
|
+
"tags": [
|
1727
|
+
"Unavailabilities"
|
1728
|
+
],
|
1729
|
+
"security": [],
|
1730
|
+
"summary": "Unavailabilities deleted on one of your cars",
|
1731
|
+
"requestBody": {
|
1732
|
+
"description": "This event is triggered whenever an unavailability is deleted (through the API or directly in the app/website). It shows the unavailability that has just been deleted, with the same timestamps as those entered by the user. It does not show the changes of other potential overlapping unavailabilities. For example: if an unavailability was already set between June 10 and June 20, and if the user deletes an unavailability between June 18 and June 22 (to set their car as available between this dates), this webhook will only send information about the newly deleted June 18 - June 22 unavailability. It will not show that, under the hood, the unavailability from June 10 to June 20 has be deleted, and that a new unavailability from June 10 to June 18 has been created.",
|
1733
|
+
"content": {
|
1734
|
+
"application/json": {
|
1735
|
+
"schema": {
|
1736
|
+
"$ref": "#/components/schemas/unavailabilities_deleted"
|
1737
|
+
},
|
1738
|
+
"example": {
|
1739
|
+
"type": "unavailability.deleted",
|
1740
|
+
"data": {
|
1741
|
+
"starts_at": "2019-06-26T09:30:05Z",
|
1742
|
+
"ends_at": "2019-06-28T09:30:05Z",
|
1743
|
+
"car_id": 42
|
1744
|
+
},
|
1745
|
+
"occurred_at": "2019-06-24T11:30:05Z"
|
1746
|
+
}
|
1747
|
+
}
|
1748
|
+
}
|
1749
|
+
},
|
1750
|
+
"responses": {
|
1751
|
+
"200": {
|
1752
|
+
"description": "Return a 200 status to indicate that the data was received successfully"
|
1753
|
+
}
|
1754
|
+
}
|
1755
|
+
}
|
1756
|
+
},
|
1757
|
+
"updatedUser": {
|
1758
|
+
"post": {
|
1759
|
+
"tags": [
|
1760
|
+
"Users"
|
1761
|
+
],
|
1762
|
+
"security": [],
|
1763
|
+
"summary": "User updated his profile information",
|
1764
|
+
"requestBody": {
|
1765
|
+
"description": "This event is triggered when a user updates his profile information (You will only receive this event on users with a booked rental or a started rental).",
|
1766
|
+
"content": {
|
1767
|
+
"application/json": {
|
1768
|
+
"schema": {
|
1769
|
+
"$ref": "#/components/schemas/users_updated"
|
1770
|
+
},
|
1771
|
+
"example": {
|
1772
|
+
"type": "user.updated",
|
1773
|
+
"data": {
|
1774
|
+
"user_id": 7654327
|
1775
|
+
},
|
1776
|
+
"occurred_at": "2019-06-24T09:30:05Z"
|
1777
|
+
}
|
1778
|
+
}
|
1779
|
+
}
|
1780
|
+
},
|
1781
|
+
"responses": {
|
1782
|
+
"200": {
|
1783
|
+
"description": "Return a 200 status to indicate that the data was received successfully"
|
1784
|
+
}
|
1785
|
+
}
|
1786
|
+
}
|
1787
|
+
},
|
1788
|
+
"sentMessage": {
|
1789
|
+
"post": {
|
1790
|
+
"tags": [
|
1791
|
+
"Messages"
|
1792
|
+
],
|
1793
|
+
"security": [],
|
1794
|
+
"summary": "New message sent",
|
1795
|
+
"requestBody": {
|
1796
|
+
"description": "This event is triggered when a new message has been sent for one of your rentals",
|
1797
|
+
"content": {
|
1798
|
+
"application/json": {
|
1799
|
+
"schema": {
|
1800
|
+
"$ref": "#/components/schemas/messages_sent"
|
1801
|
+
},
|
1802
|
+
"example": {
|
1803
|
+
"type": "message.sent",
|
1804
|
+
"data": {
|
1805
|
+
"message_id": 234535,
|
1806
|
+
"rental_id": 345646
|
1807
|
+
},
|
1808
|
+
"occurred_at": "2019-04-18T08:30:05Z"
|
1809
|
+
}
|
1810
|
+
}
|
1811
|
+
}
|
1812
|
+
},
|
1813
|
+
"responses": {
|
1814
|
+
"200": {
|
1815
|
+
"description": "Return a 200 status to indicate that the data was received successfully"
|
1816
|
+
}
|
1817
|
+
}
|
1818
|
+
}
|
1819
|
+
}
|
1820
|
+
},
|
1821
|
+
"security": [
|
1822
|
+
{
|
1823
|
+
"bearerAuth": []
|
1824
|
+
}
|
1825
|
+
],
|
1826
|
+
"components": {
|
1827
|
+
"securitySchemes": {
|
1828
|
+
"bearerAuth": {
|
1829
|
+
"type": "http",
|
1830
|
+
"scheme": "bearer"
|
1831
|
+
}
|
1832
|
+
},
|
1833
|
+
"responses": {
|
1834
|
+
"4XX": {
|
1835
|
+
"description": "The request can't be fulfilled due to an error on client-side, i.e. the request is invalid. The client should not repeat the request without modifications. The response body should contain a JSON error object. May be any HTTP status code specified in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-6.6). HTTP status code 404 indicates path parameter is invalid.\n",
|
1836
|
+
"content": {
|
1837
|
+
"application/json": {
|
1838
|
+
"example": {
|
1839
|
+
"errors": [
|
1840
|
+
{
|
1841
|
+
"status": "422",
|
1842
|
+
"source": {
|
1843
|
+
"pointer": "/data/attributes/firstName"
|
1844
|
+
},
|
1845
|
+
"title": "Invalid Attribute",
|
1846
|
+
"detail": "First name must contain at least three characters."
|
1847
|
+
}
|
1848
|
+
]
|
1849
|
+
}
|
1850
|
+
}
|
1851
|
+
}
|
1852
|
+
},
|
1853
|
+
"5XX": {
|
1854
|
+
"description": "The request can't be fulfilled due to an error at the back-end. The error is never the client’s fault and therefore it is reasonable for the client to retry the exact same request that triggered this response. The response body should contain a JSON error object. May be any HTTP status code specified in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-6.6).\n",
|
1855
|
+
"content": {
|
1856
|
+
"application/json": {
|
1857
|
+
"example": {
|
1858
|
+
"errors": [
|
1859
|
+
{
|
1860
|
+
"status": "422",
|
1861
|
+
"source": {
|
1862
|
+
"pointer": "/data/attributes/firstName"
|
1863
|
+
},
|
1864
|
+
"title": "Invalid Attribute",
|
1865
|
+
"detail": "First name must contain at least three characters."
|
1866
|
+
}
|
1867
|
+
]
|
1868
|
+
}
|
1869
|
+
}
|
1870
|
+
}
|
1871
|
+
}
|
1872
|
+
},
|
1873
|
+
"schemas": {
|
1874
|
+
"invoices_index": {
|
1875
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
1876
|
+
"description": "An array of invoices",
|
1877
|
+
"type": "array",
|
1878
|
+
"items": {
|
1879
|
+
"description": "An invoice.",
|
1880
|
+
"type": "object",
|
1881
|
+
"required": [
|
1882
|
+
"id"
|
1883
|
+
],
|
1884
|
+
"additionalProperties": false,
|
1885
|
+
"properties": {
|
1886
|
+
"id": {
|
1887
|
+
"description": "The invoice ID",
|
1888
|
+
"type": "integer"
|
1889
|
+
}
|
1890
|
+
}
|
1891
|
+
},
|
1892
|
+
"uniqueItems": true
|
1893
|
+
},
|
1894
|
+
"invoice": {
|
1895
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
1896
|
+
"description": "An invoice.",
|
1897
|
+
"type": "object",
|
1898
|
+
"required": [
|
1899
|
+
"id",
|
1900
|
+
"pdf_url",
|
1901
|
+
"product_type",
|
1902
|
+
"product_id",
|
1903
|
+
"emitted_at",
|
1904
|
+
"total_price",
|
1905
|
+
"currency",
|
1906
|
+
"entity_type"
|
1907
|
+
],
|
1908
|
+
"additionalProperties": false,
|
1909
|
+
"properties": {
|
1910
|
+
"id": {
|
1911
|
+
"description": "The invoice ID",
|
1912
|
+
"type": "integer"
|
1913
|
+
},
|
1914
|
+
"pdf_url": {
|
1915
|
+
"description": "The temporary url (lifetime: 20min) to download the pdf of the tax invoice is generated each to time you call the endpoint. Also, the 'links' variable will not be present if there is no uploaded invoice yet. This could happen if the job to generate & upload the invoice is not done yet.",
|
1916
|
+
"type": [
|
1917
|
+
"string",
|
1918
|
+
"null"
|
1919
|
+
]
|
1920
|
+
},
|
1921
|
+
"product_type": {
|
1922
|
+
"description": "The type of product the invoice is related to",
|
1923
|
+
"type": "string",
|
1924
|
+
"enum": [
|
1925
|
+
"Rental"
|
1926
|
+
]
|
1927
|
+
},
|
1928
|
+
"product_id": {
|
1929
|
+
"description": "The id of the product the invoice is related to",
|
1930
|
+
"type": "integer"
|
1931
|
+
},
|
1932
|
+
"emitted_at": {
|
1933
|
+
"description": "The date at which the invoice was emitted",
|
1934
|
+
"type": "string",
|
1935
|
+
"format": "date-time"
|
1936
|
+
},
|
1937
|
+
"total_price": {
|
1938
|
+
"description": "The invoice amount, which is what you will receive (or which will be debited from your account if it is negative)",
|
1939
|
+
"type": "integer"
|
1940
|
+
},
|
1941
|
+
"currency": {
|
1942
|
+
"description": "The currency of the invoice amount (ISO 4217 alphabetic code)",
|
1943
|
+
"type": "string"
|
1944
|
+
},
|
1945
|
+
"entity_type": {
|
1946
|
+
"description": "The type of entity the invoice is related to",
|
1947
|
+
"type": "string",
|
1948
|
+
"enum": [
|
1949
|
+
"Company",
|
1950
|
+
"User"
|
1951
|
+
]
|
1952
|
+
},
|
1953
|
+
"charges": {
|
1954
|
+
"type": "array",
|
1955
|
+
"description": "Array of charges",
|
1956
|
+
"items": {
|
1957
|
+
"type": "object",
|
1958
|
+
"properties": {
|
1959
|
+
"type": {
|
1960
|
+
"type": "string",
|
1961
|
+
"anyOf": [
|
1962
|
+
{
|
1963
|
+
"description": "Trip price (set by the owner)",
|
1964
|
+
"const": "driver_rental_payment"
|
1965
|
+
},
|
1966
|
+
{
|
1967
|
+
"description": "Extra distance fee",
|
1968
|
+
"const": "extra_distance_payment"
|
1969
|
+
},
|
1970
|
+
{
|
1971
|
+
"description": "Mileage package",
|
1972
|
+
"const": "mileage_package"
|
1973
|
+
},
|
1974
|
+
{
|
1975
|
+
"description": "Mileage package insurance",
|
1976
|
+
"const": "mileage_package_insurance"
|
1977
|
+
},
|
1978
|
+
{
|
1979
|
+
"description": "Discount offered to the driver by the owner",
|
1980
|
+
"const": "driver_compensation"
|
1981
|
+
},
|
1982
|
+
{
|
1983
|
+
"description": "Late cancellation fee",
|
1984
|
+
"const": "driver_cancellation_fee"
|
1985
|
+
},
|
1986
|
+
{
|
1987
|
+
"description": "Late return fee",
|
1988
|
+
"const": "driver_late_return_fee"
|
1989
|
+
},
|
1990
|
+
{
|
1991
|
+
"description": "Gas refill fee",
|
1992
|
+
"const": "driver_gas_refill_fee"
|
1993
|
+
},
|
1994
|
+
{
|
1995
|
+
"description": "Recharging fee",
|
1996
|
+
"const": "driver_recharging_fee"
|
1997
|
+
},
|
1998
|
+
{
|
1999
|
+
"description": "Cleanliness fee",
|
2000
|
+
"const": "driver_mess_fee"
|
2001
|
+
},
|
2002
|
+
{
|
2003
|
+
"description": "Penalty notice processing fee",
|
2004
|
+
"const": "driver_infraction_fee"
|
2005
|
+
},
|
2006
|
+
{
|
2007
|
+
"description": "Repatriation fee",
|
2008
|
+
"const": "repatriation_fee"
|
2009
|
+
},
|
2010
|
+
{
|
2011
|
+
"description": "Claim management fee",
|
2012
|
+
"const": "claims_owner_fee_cg"
|
2013
|
+
},
|
2014
|
+
{
|
2015
|
+
"description": "Commercial gesture from Drivy platform to cover late cancellation fee",
|
2016
|
+
"const": "drivy_cancellation_fee"
|
2017
|
+
},
|
2018
|
+
{
|
2019
|
+
"description": "Commercial gesture from Drivy platform to cover late return fee",
|
2020
|
+
"const": "drivy_late_return_fee"
|
2021
|
+
},
|
2022
|
+
{
|
2023
|
+
"description": "Commercial gesture from Drivy platform to cover cleanliness fee",
|
2024
|
+
"const": "drivy_mess_fee"
|
2025
|
+
},
|
2026
|
+
{
|
2027
|
+
"description": "Insurance premium for old price structure (applies to trips booked before December 2018)",
|
2028
|
+
"const": "insurance_fee"
|
2029
|
+
},
|
2030
|
+
{
|
2031
|
+
"description": "Amount collected from the driver for insurance and given to self insured partner",
|
2032
|
+
"const": "self_insurance_payment"
|
2033
|
+
},
|
2034
|
+
{
|
2035
|
+
"description": "Amount collected from the driver for additional insurance (CDW) and given to self insured partner",
|
2036
|
+
"const": "additional_self_insurance_payment"
|
2037
|
+
},
|
2038
|
+
{
|
2039
|
+
"description": "Roadside assistance for old price structure (applies to trips booked before December 2018)",
|
2040
|
+
"const": "assistance_fee"
|
2041
|
+
},
|
2042
|
+
{
|
2043
|
+
"description": "Drivy service fees",
|
2044
|
+
"const": "drivy_service_fee"
|
2045
|
+
},
|
2046
|
+
{
|
2047
|
+
"description": "Fee charged to the owner when a breakdown occurs",
|
2048
|
+
"const": "drivy_breakdown_management_fee"
|
2049
|
+
},
|
2050
|
+
{
|
2051
|
+
"description": "Fee charged to the owner for late cancellation",
|
2052
|
+
"const": "drivy_unfulfillment_fee"
|
2053
|
+
},
|
2054
|
+
{
|
2055
|
+
"description": "Fuel adjustment when a driver returns the vehicle with more or less fuel than at vehicle pick-up",
|
2056
|
+
"const": "driver_gas_compensation"
|
2057
|
+
},
|
2058
|
+
{
|
2059
|
+
"description": "Toll reimbursment",
|
2060
|
+
"const": "driver_toll_compensation"
|
2061
|
+
},
|
2062
|
+
{
|
2063
|
+
"description": "Payment made on site between driver and owner (this should not happen for Open trips since the owner and driver don't meet)",
|
2064
|
+
"const": "driver_compensation_for_offsite_payment"
|
2065
|
+
},
|
2066
|
+
{
|
2067
|
+
"description": "Penalty notice amount",
|
2068
|
+
"const": "owner_infraction_compensation"
|
2069
|
+
},
|
2070
|
+
{
|
2071
|
+
"description": "Commercial gesture from Drivy platform to cover fuel adjustment",
|
2072
|
+
"const": "drivy_gas_compensation"
|
2073
|
+
},
|
2074
|
+
{
|
2075
|
+
"description": "Commercial gesture from Drivy platform to cover exceptional event",
|
2076
|
+
"const": "exceptional_event_compensation"
|
2077
|
+
},
|
2078
|
+
{
|
2079
|
+
"description": "Payment for damage that occurred during a trip",
|
2080
|
+
"const": "damage_compensation"
|
2081
|
+
},
|
2082
|
+
{
|
2083
|
+
"description": "Small financial adjustment that could happened in accounting",
|
2084
|
+
"const": "other_compensation"
|
2085
|
+
},
|
2086
|
+
{
|
2087
|
+
"description": "Owner guarantee earning",
|
2088
|
+
"const": "guarantee_earning"
|
2089
|
+
}
|
2090
|
+
]
|
2091
|
+
},
|
2092
|
+
"amount": {
|
2093
|
+
"type": "integer",
|
2094
|
+
"description": "The charge's amount"
|
2095
|
+
}
|
2096
|
+
}
|
2097
|
+
}
|
2098
|
+
}
|
2099
|
+
}
|
2100
|
+
},
|
2101
|
+
"payouts_index": {
|
2102
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
2103
|
+
"description": "An array of payouts, ordered by completion date",
|
2104
|
+
"type": "array",
|
2105
|
+
"items": {
|
2106
|
+
"description": "A payout.",
|
2107
|
+
"type": "object",
|
2108
|
+
"required": [
|
2109
|
+
"id"
|
2110
|
+
],
|
2111
|
+
"additionalProperties": false,
|
2112
|
+
"properties": {
|
2113
|
+
"id": {
|
2114
|
+
"description": "The payout ID",
|
2115
|
+
"type": "integer"
|
2116
|
+
}
|
2117
|
+
}
|
2118
|
+
},
|
2119
|
+
"uniqueItems": true
|
2120
|
+
},
|
2121
|
+
"payout": {
|
2122
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
2123
|
+
"description": "A payout.",
|
2124
|
+
"type": "object",
|
2125
|
+
"required": [
|
2126
|
+
"id",
|
2127
|
+
"amount",
|
2128
|
+
"currency",
|
2129
|
+
"completed_at",
|
2130
|
+
"entity_type"
|
2131
|
+
],
|
2132
|
+
"additionalProperties": false,
|
2133
|
+
"properties": {
|
2134
|
+
"id": {
|
2135
|
+
"description": "The payout ID",
|
2136
|
+
"type": "integer"
|
2137
|
+
},
|
2138
|
+
"amount": {
|
2139
|
+
"description": "The amount of the payout, in cents (0.01€)",
|
2140
|
+
"type": "integer"
|
2141
|
+
},
|
2142
|
+
"currency": {
|
2143
|
+
"description": "The currency of the payout (ISO 4217 alphabetic code)",
|
2144
|
+
"type": "string"
|
2145
|
+
},
|
2146
|
+
"completed_at": {
|
2147
|
+
"description": "The ISO8601 formatted payout completion date",
|
2148
|
+
"type": "string",
|
2149
|
+
"format": "date-time"
|
2150
|
+
},
|
2151
|
+
"entity_type": {
|
2152
|
+
"description": "The type of entity the payout is related to",
|
2153
|
+
"type": "string",
|
2154
|
+
"enum": [
|
2155
|
+
"User",
|
2156
|
+
"Company"
|
2157
|
+
]
|
2158
|
+
},
|
2159
|
+
"invoices": {
|
2160
|
+
"description": "An array of invoices paid by this payout",
|
2161
|
+
"type": "array",
|
2162
|
+
"items": {
|
2163
|
+
"description": "An invoice",
|
2164
|
+
"type": "object",
|
2165
|
+
"required": [
|
2166
|
+
"id"
|
2167
|
+
],
|
2168
|
+
"additionalProperties": false,
|
2169
|
+
"properties": {
|
2170
|
+
"id": {
|
2171
|
+
"description": "The invoice ID",
|
2172
|
+
"type": "integer"
|
2173
|
+
}
|
2174
|
+
}
|
2175
|
+
},
|
2176
|
+
"uniqueItems": true
|
2177
|
+
}
|
2178
|
+
}
|
2179
|
+
},
|
2180
|
+
"rentals_index": {
|
2181
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
2182
|
+
"description": "An array of rentals",
|
2183
|
+
"type": "array",
|
2184
|
+
"items": {
|
2185
|
+
"description": "A Rental.",
|
2186
|
+
"type": "object",
|
2187
|
+
"required": [
|
2188
|
+
"id"
|
2189
|
+
],
|
2190
|
+
"additionalProperties": false,
|
2191
|
+
"properties": {
|
2192
|
+
"id": {
|
2193
|
+
"description": "The rental ID",
|
2194
|
+
"type": "integer"
|
2195
|
+
}
|
2196
|
+
}
|
2197
|
+
},
|
2198
|
+
"uniqueItems": true
|
2199
|
+
},
|
2200
|
+
"rental": {
|
2201
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
2202
|
+
"description": "A Rental.",
|
2203
|
+
"type": "object",
|
2204
|
+
"required": [
|
2205
|
+
"id",
|
2206
|
+
"car_id",
|
2207
|
+
"user_id",
|
2208
|
+
"starts_at",
|
2209
|
+
"ends_at",
|
2210
|
+
"booked_at",
|
2211
|
+
"price",
|
2212
|
+
"insurance_fee"
|
2213
|
+
],
|
2214
|
+
"additionalProperties": false,
|
2215
|
+
"properties": {
|
2216
|
+
"id": {
|
2217
|
+
"description": "Rental's id",
|
2218
|
+
"type": "integer"
|
2219
|
+
},
|
2220
|
+
"car_id": {
|
2221
|
+
"description": "Vehicle's id",
|
2222
|
+
"type": "integer",
|
2223
|
+
"minimum": 1
|
2224
|
+
},
|
2225
|
+
"user_id": {
|
2226
|
+
"description": "User id of the rental's driver",
|
2227
|
+
"type": "integer",
|
2228
|
+
"minimum": 1
|
2229
|
+
},
|
2230
|
+
"starts_at": {
|
2231
|
+
"description": "Rental's started time in ISO8601 format",
|
2232
|
+
"type": "string",
|
2233
|
+
"format": "date-time"
|
2234
|
+
},
|
2235
|
+
"ends_at": {
|
2236
|
+
"description": "Rental's ended time in ISO8601 format",
|
2237
|
+
"type": "string",
|
2238
|
+
"format": "date-time"
|
2239
|
+
},
|
2240
|
+
"booked_at": {
|
2241
|
+
"description": "Rental's booked time in ISO8601 format",
|
2242
|
+
"type": "string",
|
2243
|
+
"format": "date-time"
|
2244
|
+
},
|
2245
|
+
"price": {
|
2246
|
+
"description": "Price set by the owner (in cents 0.01€)",
|
2247
|
+
"type": "integer"
|
2248
|
+
},
|
2249
|
+
"insurance_fee": {
|
2250
|
+
"description": "Insurance amount collected (in cents 0.01€)",
|
2251
|
+
"type": "integer"
|
2252
|
+
}
|
2253
|
+
}
|
2254
|
+
},
|
2255
|
+
"rental_invoices_index": {
|
2256
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
2257
|
+
"description": "An array of invoices",
|
2258
|
+
"type": "array",
|
2259
|
+
"items": {
|
2260
|
+
"description": "An Invoice.",
|
2261
|
+
"type": "object",
|
2262
|
+
"required": [
|
2263
|
+
"id"
|
2264
|
+
],
|
2265
|
+
"additionalProperties": false,
|
2266
|
+
"properties": {
|
2267
|
+
"id": {
|
2268
|
+
"description": "The invoice ID",
|
2269
|
+
"type": "integer"
|
2270
|
+
}
|
2271
|
+
}
|
2272
|
+
},
|
2273
|
+
"uniqueItems": true
|
2274
|
+
},
|
2275
|
+
"rental_messages_index": {
|
2276
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
2277
|
+
"description": "An array of messages",
|
2278
|
+
"type": "array",
|
2279
|
+
"items": {
|
2280
|
+
"description": "A Message.",
|
2281
|
+
"type": "object",
|
2282
|
+
"required": [
|
2283
|
+
"id"
|
2284
|
+
],
|
2285
|
+
"additionalProperties": false,
|
2286
|
+
"properties": {
|
2287
|
+
"id": {
|
2288
|
+
"description": "The message ID",
|
2289
|
+
"type": "integer"
|
2290
|
+
}
|
2291
|
+
}
|
2292
|
+
},
|
2293
|
+
"uniqueItems": true
|
2294
|
+
},
|
2295
|
+
"message": {
|
2296
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
2297
|
+
"description": "A Message.",
|
2298
|
+
"type": "object",
|
2299
|
+
"required": [
|
2300
|
+
"id",
|
2301
|
+
"rental_id",
|
2302
|
+
"sending_user_id",
|
2303
|
+
"sent_at",
|
2304
|
+
"content"
|
2305
|
+
],
|
2306
|
+
"additionalProperties": false,
|
2307
|
+
"properties": {
|
2308
|
+
"id": {
|
2309
|
+
"description": "The message ID",
|
2310
|
+
"type": "integer"
|
2311
|
+
},
|
2312
|
+
"rental_id": {
|
2313
|
+
"description": "ID of the related rental",
|
2314
|
+
"type": "integer"
|
2315
|
+
},
|
2316
|
+
"sending_user_id": {
|
2317
|
+
"description": "ID of the sending user",
|
2318
|
+
"type": "integer"
|
2319
|
+
},
|
2320
|
+
"sent_at": {
|
2321
|
+
"description": "Date the message was sent",
|
2322
|
+
"type": "string"
|
2323
|
+
},
|
2324
|
+
"content": {
|
2325
|
+
"description": "Content of message, Personal information detected in messages is hidden",
|
2326
|
+
"type": "string"
|
2327
|
+
}
|
2328
|
+
}
|
2329
|
+
},
|
2330
|
+
"checkin": {
|
2331
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
2332
|
+
"description": "A checkin is the event created when the user finished the pick up inspection.",
|
2333
|
+
"type": "object",
|
2334
|
+
"required": [
|
2335
|
+
"rental_id",
|
2336
|
+
"occurred_at"
|
2337
|
+
],
|
2338
|
+
"additionalProperties": false,
|
2339
|
+
"properties": {
|
2340
|
+
"rental_id": {
|
2341
|
+
"description": "Rental's ID linked to this checkin",
|
2342
|
+
"type": "integer",
|
2343
|
+
"minimum": 1
|
2344
|
+
},
|
2345
|
+
"mileage": {
|
2346
|
+
"description": "The vehicle’s mileage at checkin (in local units, eg: FR: km, GB: miles, ...)",
|
2347
|
+
"type": "integer"
|
2348
|
+
},
|
2349
|
+
"fuel_level": {
|
2350
|
+
"description": "The vehicle’s fuel level at checkin (in percentage)",
|
2351
|
+
"type": "integer"
|
2352
|
+
},
|
2353
|
+
"occurred_at": {
|
2354
|
+
"description": "Checkin's time in ISO8601 format",
|
2355
|
+
"type": "string",
|
2356
|
+
"format": "date-time"
|
2357
|
+
}
|
2358
|
+
}
|
2359
|
+
},
|
2360
|
+
"checkout": {
|
2361
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
2362
|
+
"description": "A checkout is the event created when the user finished the drop off inspection.",
|
2363
|
+
"type": "object",
|
2364
|
+
"required": [
|
2365
|
+
"rental_id",
|
2366
|
+
"distance_driven",
|
2367
|
+
"occurred_at"
|
2368
|
+
],
|
2369
|
+
"additionalProperties": false,
|
2370
|
+
"properties": {
|
2371
|
+
"rental_id": {
|
2372
|
+
"description": "Rental's ID linked to this checkout",
|
2373
|
+
"type": "integer",
|
2374
|
+
"minimum": 1
|
2375
|
+
},
|
2376
|
+
"mileage": {
|
2377
|
+
"description": "The vehicle’s mileage at checkout (in local units, eg: FR: km, GB: miles, ...)",
|
2378
|
+
"type": [
|
2379
|
+
"integer",
|
2380
|
+
"null"
|
2381
|
+
]
|
2382
|
+
},
|
2383
|
+
"fuel_level": {
|
2384
|
+
"description": "The vehicle’s fuel level at checkout (in percentage)",
|
2385
|
+
"type": [
|
2386
|
+
"integer",
|
2387
|
+
"null"
|
2388
|
+
]
|
2389
|
+
},
|
2390
|
+
"distance_driven": {
|
2391
|
+
"description": "The number of kilometers driven during this rental",
|
2392
|
+
"type": "integer"
|
2393
|
+
},
|
2394
|
+
"occurred_at": {
|
2395
|
+
"description": "Checkout's time in ISO8601 format",
|
2396
|
+
"type": "string",
|
2397
|
+
"format": "date-time"
|
2398
|
+
}
|
2399
|
+
}
|
2400
|
+
},
|
2401
|
+
"cars_index": {
|
2402
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
2403
|
+
"description": "An array of cars",
|
2404
|
+
"type": "array",
|
2405
|
+
"items": {
|
2406
|
+
"description": "A car.",
|
2407
|
+
"type": "object",
|
2408
|
+
"required": [
|
2409
|
+
"id"
|
2410
|
+
],
|
2411
|
+
"additionalProperties": false,
|
2412
|
+
"properties": {
|
2413
|
+
"id": {
|
2414
|
+
"description": "The car ID",
|
2415
|
+
"type": "integer"
|
2416
|
+
}
|
2417
|
+
}
|
2418
|
+
},
|
2419
|
+
"uniqueItems": true
|
2420
|
+
},
|
2421
|
+
"car": {
|
2422
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
2423
|
+
"description": "A Car.",
|
2424
|
+
"type": "object",
|
2425
|
+
"required": [
|
2426
|
+
"id",
|
2427
|
+
"state",
|
2428
|
+
"plate_number",
|
2429
|
+
"brand",
|
2430
|
+
"model",
|
2431
|
+
"display_address"
|
2432
|
+
],
|
2433
|
+
"additionalProperties": false,
|
2434
|
+
"properties": {
|
2435
|
+
"id": {
|
2436
|
+
"description": "The car ID",
|
2437
|
+
"type": "integer"
|
2438
|
+
},
|
2439
|
+
"state": {
|
2440
|
+
"description": "State of the vehicle can be a) active (only state where the vehicle can be booked by a user) b) inactive (temporary state when a vehicle is unavailable for rental) c) pending_approval (temporary state when a vehicle is under review for quality or other checks) and d) deleted (when a vehicle is permanently unavailable for rental)",
|
2441
|
+
"type": "string"
|
2442
|
+
},
|
2443
|
+
"plate_number": {
|
2444
|
+
"description": "Vehicle's plate number",
|
2445
|
+
"type": "string"
|
2446
|
+
},
|
2447
|
+
"brand": {
|
2448
|
+
"description": "Vehicle's brand (ex: Volkswagen)",
|
2449
|
+
"type": "string"
|
2450
|
+
},
|
2451
|
+
"model": {
|
2452
|
+
"description": "Vehicle's model (ex: Polo)",
|
2453
|
+
"type": "string"
|
2454
|
+
},
|
2455
|
+
"display_address": {
|
2456
|
+
"description": "Location where the vehicle is parked",
|
2457
|
+
"type": "string"
|
2458
|
+
}
|
2459
|
+
}
|
2460
|
+
},
|
2461
|
+
"user": {
|
2462
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
2463
|
+
"description": "A User.",
|
2464
|
+
"type": "object",
|
2465
|
+
"required": [
|
2466
|
+
"id",
|
2467
|
+
"first_name",
|
2468
|
+
"last_name",
|
2469
|
+
"phone_number",
|
2470
|
+
"address_line1",
|
2471
|
+
"postal_code",
|
2472
|
+
"city",
|
2473
|
+
"country",
|
2474
|
+
"birth_date",
|
2475
|
+
"license_country",
|
2476
|
+
"license_first_issue_date",
|
2477
|
+
"license_number"
|
2478
|
+
],
|
2479
|
+
"additionalProperties": false,
|
2480
|
+
"properties": {
|
2481
|
+
"id": {
|
2482
|
+
"description": "The user ID",
|
2483
|
+
"type": "integer"
|
2484
|
+
},
|
2485
|
+
"first_name": {
|
2486
|
+
"description": "First name(s)",
|
2487
|
+
"type": "string"
|
2488
|
+
},
|
2489
|
+
"last_name": {
|
2490
|
+
"description": "Last name(s)",
|
2491
|
+
"type": "string"
|
2492
|
+
},
|
2493
|
+
"phone_number": {
|
2494
|
+
"description": "The phone number in international format",
|
2495
|
+
"type": "string"
|
2496
|
+
},
|
2497
|
+
"address_line1": {
|
2498
|
+
"description": "Residential address of the user",
|
2499
|
+
"type": "string"
|
2500
|
+
},
|
2501
|
+
"address_line2": {
|
2502
|
+
"description": "Additional address details",
|
2503
|
+
"type": "string"
|
2504
|
+
},
|
2505
|
+
"postal_code": {
|
2506
|
+
"description": "The postal code",
|
2507
|
+
"type": "string"
|
2508
|
+
},
|
2509
|
+
"city": {
|
2510
|
+
"description": "The city",
|
2511
|
+
"type": "string"
|
2512
|
+
},
|
2513
|
+
"country": {
|
2514
|
+
"description": "Address's country format ISO_3166-1_alpha-2 (ex: FR, ES, ...)",
|
2515
|
+
"type": "string"
|
2516
|
+
},
|
2517
|
+
"birth_date": {
|
2518
|
+
"description": "The birth date",
|
2519
|
+
"type": "string",
|
2520
|
+
"format": "date"
|
2521
|
+
},
|
2522
|
+
"license_country": {
|
2523
|
+
"description": "Driving licence country of issue format ISO_3166-1_alpha-2 (ex: FR, ES, ...)",
|
2524
|
+
"type": "string"
|
2525
|
+
},
|
2526
|
+
"license_first_issue_date": {
|
2527
|
+
"description": "Driving licence first issue date",
|
2528
|
+
"type": "string",
|
2529
|
+
"format": "date"
|
2530
|
+
},
|
2531
|
+
"license_number": {
|
2532
|
+
"description": "The license number",
|
2533
|
+
"type": "string"
|
2534
|
+
}
|
2535
|
+
}
|
2536
|
+
},
|
2537
|
+
"checkins_index": {
|
2538
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
2539
|
+
"type": "array",
|
2540
|
+
"items": {
|
2541
|
+
"type": "object",
|
2542
|
+
"required": [
|
2543
|
+
"rental_id"
|
2544
|
+
],
|
2545
|
+
"additionalProperties": false,
|
2546
|
+
"properties": {
|
2547
|
+
"rental_id": {
|
2548
|
+
"description": "The rental ID",
|
2549
|
+
"type": "integer"
|
2550
|
+
}
|
2551
|
+
}
|
2552
|
+
},
|
2553
|
+
"uniqueItems": true
|
2554
|
+
},
|
2555
|
+
"checkouts_index": {
|
2556
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
2557
|
+
"type": "array",
|
2558
|
+
"items": {
|
2559
|
+
"type": "object",
|
2560
|
+
"required": [
|
2561
|
+
"rental_id"
|
2562
|
+
],
|
2563
|
+
"additionalProperties": false,
|
2564
|
+
"properties": {
|
2565
|
+
"rental_id": {
|
2566
|
+
"description": "The rental ID",
|
2567
|
+
"type": "integer"
|
2568
|
+
}
|
2569
|
+
}
|
2570
|
+
},
|
2571
|
+
"uniqueItems": true
|
2572
|
+
},
|
2573
|
+
"unavailability": {
|
2574
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
2575
|
+
"description": "An unavailability.",
|
2576
|
+
"type": "object",
|
2577
|
+
"required": [
|
2578
|
+
"starts_at",
|
2579
|
+
"ends_at",
|
2580
|
+
"car_id"
|
2581
|
+
],
|
2582
|
+
"additionalProperties": false,
|
2583
|
+
"properties": {
|
2584
|
+
"car_id": {
|
2585
|
+
"description": "ID of the related car",
|
2586
|
+
"type": "integer"
|
2587
|
+
},
|
2588
|
+
"starts_at": {
|
2589
|
+
"description": "The ISO8601 formatted beginning of the unavailability's period",
|
2590
|
+
"type": "string",
|
2591
|
+
"format": "date-time"
|
2592
|
+
},
|
2593
|
+
"ends_at": {
|
2594
|
+
"description": "The ISO8601 formatted ending of the unavailability's period",
|
2595
|
+
"type": "string",
|
2596
|
+
"format": "date-time"
|
2597
|
+
},
|
2598
|
+
"reason": {
|
2599
|
+
"description": "The reason of the unavailability of the car.",
|
2600
|
+
"type": [
|
2601
|
+
"string",
|
2602
|
+
"null"
|
2603
|
+
],
|
2604
|
+
"enum": [
|
2605
|
+
"check_up",
|
2606
|
+
"repairs",
|
2607
|
+
"connect_issues",
|
2608
|
+
"repatriation",
|
2609
|
+
"booked",
|
2610
|
+
"other",
|
2611
|
+
null
|
2612
|
+
]
|
2613
|
+
}
|
2614
|
+
}
|
2615
|
+
},
|
2616
|
+
"unavailabilities_index": {
|
2617
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
2618
|
+
"description": "An array of unavailabilities",
|
2619
|
+
"type": "array",
|
2620
|
+
"items": {
|
2621
|
+
"$ref": "#/components/schemas/unavailability"
|
2622
|
+
},
|
2623
|
+
"uniqueItems": true
|
2624
|
+
},
|
2625
|
+
"webhook": {
|
2626
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
2627
|
+
"description": "A webhook object",
|
2628
|
+
"type": "object",
|
2629
|
+
"required": [
|
2630
|
+
"type",
|
2631
|
+
"data",
|
2632
|
+
"occurred_at"
|
2633
|
+
],
|
2634
|
+
"properties": {
|
2635
|
+
"type": {
|
2636
|
+
"description": "The webhook event type",
|
2637
|
+
"type": "string"
|
2638
|
+
},
|
2639
|
+
"data": {
|
2640
|
+
"description": "The webhook event data"
|
2641
|
+
},
|
2642
|
+
"occurred_at": {
|
2643
|
+
"description": "The webhook event occurred at timestamp",
|
2644
|
+
"type": "string",
|
2645
|
+
"format": "date-time"
|
2646
|
+
}
|
2647
|
+
}
|
2648
|
+
},
|
2649
|
+
"rentals_booked": {
|
2650
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
2651
|
+
"allOf": [
|
2652
|
+
{
|
2653
|
+
"properties": {
|
2654
|
+
"type": {
|
2655
|
+
"const": "rental.booked"
|
2656
|
+
},
|
2657
|
+
"data": {
|
2658
|
+
"type": "object",
|
2659
|
+
"properties": {
|
2660
|
+
"rental_id": {
|
2661
|
+
"description": "The rental identifier",
|
2662
|
+
"type": "number"
|
2663
|
+
}
|
2664
|
+
}
|
2665
|
+
}
|
2666
|
+
}
|
2667
|
+
},
|
2668
|
+
{
|
2669
|
+
"$ref": "#/components/schemas/webhook"
|
2670
|
+
}
|
2671
|
+
]
|
2672
|
+
},
|
2673
|
+
"rentals_canceled": {
|
2674
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
2675
|
+
"allOf": [
|
2676
|
+
{
|
2677
|
+
"properties": {
|
2678
|
+
"type": {
|
2679
|
+
"const": "rental.canceled"
|
2680
|
+
},
|
2681
|
+
"data": {
|
2682
|
+
"type": "object",
|
2683
|
+
"properties": {
|
2684
|
+
"rental_id": {
|
2685
|
+
"description": "The rental identifier",
|
2686
|
+
"type": "number"
|
2687
|
+
}
|
2688
|
+
}
|
2689
|
+
}
|
2690
|
+
}
|
2691
|
+
},
|
2692
|
+
{
|
2693
|
+
"$ref": "#/components/schemas/webhook"
|
2694
|
+
}
|
2695
|
+
]
|
2696
|
+
},
|
2697
|
+
"rentals_car_checked_in": {
|
2698
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
2699
|
+
"allOf": [
|
2700
|
+
{
|
2701
|
+
"properties": {
|
2702
|
+
"type": {
|
2703
|
+
"const": "rental.car_checked_in"
|
2704
|
+
},
|
2705
|
+
"data": {
|
2706
|
+
"type": "object",
|
2707
|
+
"properties": {
|
2708
|
+
"rental_id": {
|
2709
|
+
"description": "The rental identifier",
|
2710
|
+
"type": "number"
|
2711
|
+
}
|
2712
|
+
}
|
2713
|
+
}
|
2714
|
+
}
|
2715
|
+
},
|
2716
|
+
{
|
2717
|
+
"$ref": "#/components/schemas/webhook"
|
2718
|
+
}
|
2719
|
+
]
|
2720
|
+
},
|
2721
|
+
"rentals_car_checked_out": {
|
2722
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
2723
|
+
"allOf": [
|
2724
|
+
{
|
2725
|
+
"properties": {
|
2726
|
+
"type": {
|
2727
|
+
"const": "rental.car_checked_out"
|
2728
|
+
},
|
2729
|
+
"data": {
|
2730
|
+
"type": "object",
|
2731
|
+
"properties": {
|
2732
|
+
"rental_id": {
|
2733
|
+
"description": "The rental identifier",
|
2734
|
+
"type": "number"
|
2735
|
+
}
|
2736
|
+
}
|
2737
|
+
}
|
2738
|
+
}
|
2739
|
+
},
|
2740
|
+
{
|
2741
|
+
"$ref": "#/components/schemas/webhook"
|
2742
|
+
}
|
2743
|
+
]
|
2744
|
+
},
|
2745
|
+
"rentals_times_changed": {
|
2746
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
2747
|
+
"allOf": [
|
2748
|
+
{
|
2749
|
+
"properties": {
|
2750
|
+
"type": {
|
2751
|
+
"const": "rental.times_changed"
|
2752
|
+
},
|
2753
|
+
"data": {
|
2754
|
+
"type": "object",
|
2755
|
+
"properties": {
|
2756
|
+
"rental_id": {
|
2757
|
+
"description": "The rental identifier",
|
2758
|
+
"type": "number"
|
2759
|
+
}
|
2760
|
+
}
|
2761
|
+
}
|
2762
|
+
}
|
2763
|
+
},
|
2764
|
+
{
|
2765
|
+
"$ref": "#/components/schemas/webhook"
|
2766
|
+
}
|
2767
|
+
]
|
2768
|
+
},
|
2769
|
+
"rentals_car_switched": {
|
2770
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
2771
|
+
"allOf": [
|
2772
|
+
{
|
2773
|
+
"properties": {
|
2774
|
+
"type": {
|
2775
|
+
"const": "rental.car_switched"
|
2776
|
+
},
|
2777
|
+
"data": {
|
2778
|
+
"type": "object",
|
2779
|
+
"properties": {
|
2780
|
+
"rental_id": {
|
2781
|
+
"description": "The rental identifier",
|
2782
|
+
"type": "number"
|
2783
|
+
}
|
2784
|
+
}
|
2785
|
+
}
|
2786
|
+
}
|
2787
|
+
},
|
2788
|
+
{
|
2789
|
+
"$ref": "#/components/schemas/webhook"
|
2790
|
+
}
|
2791
|
+
]
|
2792
|
+
},
|
2793
|
+
"car_id": {
|
2794
|
+
"description": "ID of the related car",
|
2795
|
+
"type": "integer"
|
2796
|
+
},
|
2797
|
+
"starts_at": {
|
2798
|
+
"description": "The ISO8601 formatted beginning of the unavailability's period",
|
2799
|
+
"type": "string",
|
2800
|
+
"format": "date-time"
|
2801
|
+
},
|
2802
|
+
"ends_at": {
|
2803
|
+
"description": "The ISO8601 formatted ending of the unavailability's period",
|
2804
|
+
"type": "string",
|
2805
|
+
"format": "date-time"
|
2806
|
+
},
|
2807
|
+
"reason": {
|
2808
|
+
"description": "The reason of the unavailability of the car.",
|
2809
|
+
"type": [
|
2810
|
+
"string",
|
2811
|
+
"null"
|
2812
|
+
],
|
2813
|
+
"enum": [
|
2814
|
+
"check_up",
|
2815
|
+
"repairs",
|
2816
|
+
"connect_issues",
|
2817
|
+
"repatriation",
|
2818
|
+
"booked",
|
2819
|
+
"other",
|
2820
|
+
null
|
2821
|
+
]
|
2822
|
+
},
|
2823
|
+
"unavailabilities_created": {
|
2824
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
2825
|
+
"allOf": [
|
2826
|
+
{
|
2827
|
+
"properties": {
|
2828
|
+
"type": {
|
2829
|
+
"const": "unavailability.created"
|
2830
|
+
},
|
2831
|
+
"data": {
|
2832
|
+
"type": "object",
|
2833
|
+
"properties": {
|
2834
|
+
"car_id": {
|
2835
|
+
"$ref": "#/components/schemas/car_id"
|
2836
|
+
},
|
2837
|
+
"starts_at": {
|
2838
|
+
"$ref": "#/components/schemas/starts_at"
|
2839
|
+
},
|
2840
|
+
"ends_at": {
|
2841
|
+
"$ref": "#/components/schemas/ends_at"
|
2842
|
+
},
|
2843
|
+
"reason": {
|
2844
|
+
"$ref": "#/components/schemas/reason"
|
2845
|
+
}
|
2846
|
+
}
|
2847
|
+
}
|
2848
|
+
}
|
2849
|
+
},
|
2850
|
+
{
|
2851
|
+
"$ref": "#/components/schemas/webhook"
|
2852
|
+
}
|
2853
|
+
]
|
2854
|
+
},
|
2855
|
+
"unavailabilities_deleted": {
|
2856
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
2857
|
+
"allOf": [
|
2858
|
+
{
|
2859
|
+
"properties": {
|
2860
|
+
"type": {
|
2861
|
+
"const": "unavailability.deleted"
|
2862
|
+
},
|
2863
|
+
"data": {
|
2864
|
+
"type": "object",
|
2865
|
+
"properties": {
|
2866
|
+
"car_id": {
|
2867
|
+
"$ref": "#/components/schemas/car_id"
|
2868
|
+
},
|
2869
|
+
"starts_at": {
|
2870
|
+
"$ref": "#/components/schemas/starts_at"
|
2871
|
+
},
|
2872
|
+
"ends_at": {
|
2873
|
+
"$ref": "#/components/schemas/ends_at"
|
2874
|
+
}
|
2875
|
+
}
|
2876
|
+
}
|
2877
|
+
}
|
2878
|
+
},
|
2879
|
+
{
|
2880
|
+
"$ref": "#/components/schemas/webhook"
|
2881
|
+
}
|
2882
|
+
]
|
2883
|
+
},
|
2884
|
+
"users_updated": {
|
2885
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
2886
|
+
"allOf": [
|
2887
|
+
{
|
2888
|
+
"properties": {
|
2889
|
+
"type": {
|
2890
|
+
"const": "user.updated"
|
2891
|
+
},
|
2892
|
+
"data": {
|
2893
|
+
"type": "object",
|
2894
|
+
"properties": {
|
2895
|
+
"user_id": {
|
2896
|
+
"description": "The user identifier",
|
2897
|
+
"type": "number"
|
2898
|
+
}
|
2899
|
+
}
|
2900
|
+
}
|
2901
|
+
}
|
2902
|
+
},
|
2903
|
+
{
|
2904
|
+
"$ref": "#/components/schemas/webhook"
|
2905
|
+
}
|
2906
|
+
]
|
2907
|
+
},
|
2908
|
+
"messages_sent": {
|
2909
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
2910
|
+
"allOf": [
|
2911
|
+
{
|
2912
|
+
"properties": {
|
2913
|
+
"type": {
|
2914
|
+
"const": "message.sent"
|
2915
|
+
},
|
2916
|
+
"data": {
|
2917
|
+
"type": "object",
|
2918
|
+
"properties": {
|
2919
|
+
"message_id": {
|
2920
|
+
"description": "The message identifier",
|
2921
|
+
"type": "number"
|
2922
|
+
},
|
2923
|
+
"rental_id": {
|
2924
|
+
"description": "The rental identifier",
|
2925
|
+
"type": "number"
|
2926
|
+
}
|
2927
|
+
}
|
2928
|
+
}
|
2929
|
+
}
|
2930
|
+
},
|
2931
|
+
{
|
2932
|
+
"$ref": "#/components/schemas/webhook"
|
2933
|
+
}
|
2934
|
+
]
|
2935
|
+
}
|
2936
|
+
}
|
2937
|
+
}
|
2938
|
+
}
|