Skip to main content

Preparing the context

Before searching availability and creating bookings, it's a good idea to load the tenant's context: which languages and currencies it supports, in which places it operates, and with which attention schedules. Together, these catalogs define which bookings can be created (where, when, and in which currency).

Cache the context

This data rarely changes. Fetch it once at startup and reuse it; refresh it occasionally instead of requesting it on every operation. All endpoints use the header Authorization: Bearer {token}.

Languages

GET /api/languages returns the languages supported by the system. They determine the valid values for the ?language= query param that controls the language of the responses (see Languages).

curl "https://{tenant}.rently.com.ar/api/languages" \
-H "Authorization: Bearer {token}"
note

For richer metadata about each language (native name, etc.) there is GET /api/languages-info.

Currencies

GET /api/currencies returns the supported currencies with their exchange rate. This is where the CurrencyCode you use in GET /api/search, GET /api/booking/price and POST /api/booking/book comes from.

curl "https://{tenant}.rently.com.ar/api/currencies" \
-H "Authorization: Bearer {token}"
[
{ "Id": 1, "ISOCode": "USD", "Name": "Dólar", "Symbol": "U$S", "ExchangeRate": 1.0, "IsSystemDefault": true },
{ "Id": 2, "ISOCode": "ARS", "Name": "Peso argentino", "Symbol": "$", "ExchangeRate": 950.0, "IsSystemDefault": false }
]
FieldDescription
ISOCodeThe currency's ISO code. This is what is sent as CurrencyCode.
Symbol / NameFor display.
ExchangeRateExchange rate relative to the system's default currency.
IsSystemDefaultMarks the tenant's base currency.

Places

GET /api/places returns the places for delivery and return. Their Ids are the ones passed as FromPlace/ToPlace (search) and DeliveryPlace/ReturnPlace (booking). Each place belongs to a branch office (BranchOfficeId) and has a type (airport, agency, hotel…), whose catalog is GET /api/placetypes.

curl "https://{tenant}.rently.com.ar/api/places" \
-H "Authorization: Bearer {token}"
[
{
"Id": 1,
"Name": "Aeropuerto LAX",
"Category": "Aeropuerto",
"City": "Los Angeles",
"Country": "United States",
"BranchOfficeId": 10,
"BranchOfficeName": "LAX",
"BranchOfficeIATACode": "LAX"
}
]
FieldDescription
IdThe place identifier. This is the FromPlace/ToPlace/DeliveryPlace.Id.
CategoryPlace type (from GET /api/placetypes).
BranchOfficeId / BranchOfficeName / BranchOfficeIATACodeBranch office it belongs to.

Attention schedules

GET /api/attentionschedule returns the schedule configuration per branch office. This defines when a car can be delivered and returned: opening days and hours, time zone, margins (gaps) and after-hours rules. It is what determines whether a given From/To is valid for a place.

curl "https://{tenant}.rently.com.ar/api/attentionschedule" \
-H "Authorization: Bearer {token}"
FieldDescription
ScheduleOpening time slots per day.
TimezoneId / TimezoneUTCOffsetBranch office time zone (interpret the From/To in it).
Gap / GapForBookingTimeMinimum margins for booking / between operations.
AllowAfterHours / BeforeHoursMaxMinutes / AfterHoursMaxMinutesWhether after-hours operation is allowed and within which limits.

How they relate

To know which bookings can be created, combine the four catalogs:

Language (?language=) → which language the responses come in

Place (place) → WHERE it is delivered/returned (FromPlace / DeliveryPlace)
│ belongs to

Branch office (branch office)
│ has

Attention schedule → WHEN it is valid (days/hours/timezone/after-hours) → defines From/To

Currency (CurrencyCode) → IN WHICH CURRENCY the price is calculated

In practice:

  1. Pick a delivery (and return) place from GET /api/places.
  2. Check the attention schedule of its branch office (GET /api/attentionschedule) to set a From/To within the valid time slots and in the correct time zone.
  3. Pick a supported currency (GET /api/currencies).
  4. Optionally, set the language of the responses with ?language=.

With that, you can get started with the End-to-end booking.