Download OpenAPI specification:Download
API for supply partners to implement to allow pre-registration information for a car rental booking to be transferred to them.
Validate the service account credentials the partner has provided to Rentalcars and issue a bearer token to use to authorize subsequent requests
Updated pre-registration information
username | string Service account username provided to Rentalcars |
password | string Service account password provided to Rentalcars |
{- "username": "rentalcars",
- "password": "pa55word"
}
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ3cml0ZTpwcmVyZWciLCJuYW1lIjoicmVudGFsY2FycyIsImlhdCI6MTUxNjIzOTAyMn0.bk-Eh4aOiSvgpSYaZh64emn4rCtGKknxCiQ23Vc2jZg"
Provide pre-registration information for a booking reference
Authorization required | string Example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ3cml0ZTpwcmVyZWciLCJuYW1lIjoicmVudGFsY2FycyIsImlhdCI6MTUxNjIzOTAyMn0.bk-Eh4aOiSvgpSYaZh64emn4rCtGKknxCiQ23Vc2jZg |
Updated pre-registration information
reference required | string 9 characters Booking reference |
email required | string [ 0 .. 100 ] characters E-mail address associated with the booking |
nationality required | string 2 characters Nationality of the customer that made the booking (ISO 3166-1 alpha-2 code) |
required | object (IdentityDocument) Details of an identity document for the customer |
required | Array of objects (Driver) non-empty [ items ] |
{- "reference": "987654321",
- "email": "john.smith@gmail.com",
- "nationality": "GB",
- "identityDocument": {
- "type": "PASSPORT",
- "number": "64599458",
- "issueCountry": "GB",
- "issueDate": "2016-05-10",
- "expiryDate": "2026-05-10"
}, - "drivers": [
- {
- "mainDriver": true,
- "firstName": "John",
- "lastName": "Smith",
- "birthDate": "1982-01-01",
- "phoneNumber": "+447555123456",
- "address": {
- "line1": "Sunlight House",
- "line2": "Little Quay Street",
- "city": "Manchester",
- "state": "Greater Manchester",
- "postalCode": "M3 3NN",
- "country": "United Kingdom"
}, - "licenceDocument": {
- "number": "SMITH465746J6GT",
- "issueCountry": "GB",
- "issueDate": "2016-05-10",
- "expiryDate": "2022-05-10"
}
}
]
}
Update previously provided pre-registration information for a booking reference
bookingRef required | string The booking for which pre-registration information needs to be updated |
Authorization required | string Example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ3cml0ZTpwcmVyZWciLCJuYW1lIjoicmVudGFsY2FycyIsImlhdCI6MTUxNjIzOTAyMn0.bk-Eh4aOiSvgpSYaZh64emn4rCtGKknxCiQ23Vc2jZg |
Updated pre-registration information
reference required | string 9 characters Booking reference |
email required | string [ 0 .. 100 ] characters E-mail address associated with the booking |
nationality required | string 2 characters Nationality of the customer that made the booking (ISO 3166-1 alpha-2 code) |
required | object (IdentityDocument) Details of an identity document for the customer |
required | Array of objects (Driver) non-empty [ items ] |
{- "reference": "987654321",
- "email": "john.smith@gmail.com",
- "nationality": "GB",
- "identityDocument": {
- "type": "PASSPORT",
- "number": "64599458",
- "issueCountry": "GB",
- "issueDate": "2016-05-10",
- "expiryDate": "2026-05-10"
}, - "drivers": [
- {
- "mainDriver": true,
- "firstName": "John",
- "lastName": "Smith",
- "birthDate": "1982-01-01",
- "phoneNumber": "+447555123456",
- "address": {
- "line1": "Sunlight House",
- "line2": "Little Quay Street",
- "city": "Manchester",
- "state": "Greater Manchester",
- "postalCode": "M3 3NN",
- "country": "United Kingdom"
}, - "licenceDocument": {
- "number": "SMITH465746J6GT",
- "issueCountry": "GB",
- "issueDate": "2016-05-10",
- "expiryDate": "2022-05-10"
}
}
]
}
The following requests are some common scenarios to test the behaviour of the API conforms to the specification.
Successful requests to the /login/authenticate
endpoint should return a 200 OK
response status code with a response body containing a valid bearer token
curl --location --request POST 'https://www.example.com/api/login/authenticate' \
--header 'Content-Type: application/json' \
--data-raw '{"username" : "rentalcars", "password": "pa55word"}'
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ3cml0ZTpwcmVyZWciLCJuYW1lIjoicmVudGFsY2FycyIsImlhdCI6MTUxNjIzOTAyMn0.bk-Eh4aOiSvgpSYaZh64emn4rCtGKknxCiQ23Vc2jZg"
Valid authenticated requests to the /prereg
endpoint should return a 200 OK
HTTP response status code
curl --location --request POST 'https://www.example.com/api/prereg' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c' \
--header 'Content-Type: application/json' \
--data-raw '{
"reference": "123456789",
"email": "test.customer@rentalcars.com",
"nationality": "GB",
"identityDocument": {
"type": "PASSPORT",
"number": "12345678",
"issueCountry": "GB",
"issueDate": "2020-05-10",
"expiryDate": "2030-05-10"
},
"drivers": [
{
"mainDriver": true,
"firstName": "Rental",
"lastName": "Cars",
"birthDate": "1980-01-01",
"phoneNumber": "441611234567",
"address": {
"line1": "10",
"line2": "Downing Street",
"city": "London",
"state": "Greater London",
"postalCode": "SW1A 2AA",
"country": "GB"
},
"licenceDocument": {
"number": "CARS123456R7GT",
"issueCountry": "GB",
"issueDate": "2020-01-01",
"expiryDate": "2030-01-10"
}
}
]
}'
License issue dates in certain regions are the issue dates of the physical license and not the date the customer passed their driving test.
Requests to the /prereg
endpoint should return a 200 OK
HTTP response status code, when the license issue date is less than a year.
curl --location --request POST 'https://www.example.com/api/prereg' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c' \
--header 'Content-Type: application/json' \
--data-raw '{
"reference": "123456789",
"email": "test.customer@rentalcars.com",
"nationality": "GB",
"identityDocument": {
"type": "PASSPORT",
"number": "12345678",
"issueCountry": "GB",
"issueDate": "2020-05-10",
"expiryDate": "2030-05-10"
},
"drivers": [
{
"mainDriver": true,
"firstName": "Rental",
"lastName": "Cars",
"birthDate": "1980-01-01",
"phoneNumber": "441611234567",
"address": {
"line1": "10",
"line2": "Downing Street",
"city": "London",
"state": "Greater London",
"postalCode": "SW1A 2AA",
"country": "GB"
},
"licenceDocument": {
"number": "CARS123456R7GT",
"issueCountry": "GB",
"issueDate": "2021-06-01",
"expiryDate": "2030-01-10"
}
}
]
}'
Some driver details, such as name, may be in non-roman characters.
Requests to the /prereg
endpoint should return a 200 OK
HTTP response status code, when driver details contain non-roman characters.
curl --location --request POST 'https://www.example.com/api/prereg' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c' \
--header 'Content-Type: application/json' \
--data-raw '{
"reference": "123456789",
"email": "test.customer@rentalcars.com",
"nationality": "GB",
"identityDocument": {
"type": "PASSPORT",
"number": "12345678",
"issueCountry": "GB",
"issueDate": "2020-05-10",
"expiryDate": "2030-05-10"
},
"drivers": [
{
"mainDriver": true,
"firstName": "عبد",
"lastName": "اللطيف",
"birthDate": "1980-01-01",
"phoneNumber": "441611234567",
"address": {
"line1": "10",
"line2": "Downing Street",
"city": "London",
"state": "Greater London",
"postalCode": "SW1A 2AA",
"country": "GB"
},
"licenceDocument": {
"number": "CARS123456R7GT",
"issueCountry": "GB",
"issueDate": "2020-01-01",
"expiryDate": "2030-01-10"
}
}
]
}'
Requests to the /prereg
endpoint should return a 200 OK
HTTP response status code, when optional fields are empty.
curl --location --request POST 'https://www.example.com/api/prereg' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c' \
--header 'Content-Type: application/json' \
--data-raw '{
"reference": "123456789",
"email": "test.customer@rentalcars.com",
"nationality": "GB",
"identityDocument": {
"type": "PASSPORT",
"number": "12345678",
"issueCountry": "GB",
"issueDate": "",
"expiryDate": "2030-05-10"
},
"drivers": [
{
"mainDriver": true,
"firstName": "Rental",
"lastName": "Cars",
"birthDate": "1980-01-01",
"phoneNumber": "441611234567",
"address": {
"line1": "10 Downing Street",
"line2": "",
"city": "",
"state": "",
"postalCode": "SW1A 2AA",
"country": "GB"
},
"licenceDocument": {
"number": "CARS123456R7GT",
"issueCountry": "GB",
"issueDate": "2020-01-01",
"expiryDate": "2030-01-10"
}
}
]
}'
Requests to the /prereg
endpoint with an invalid email format should return a 400 Bad Request
HTTP response status code
curl --location --request POST 'https://www.example.com/api/prereg' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c' \
--header 'Content-Type: application/json' \
--data-raw '{
"reference": "123456789",
"email": "invalidemailformat.com",
"nationality": "GB",
"identityDocument": {
"type": "PASSPORT",
"number": "12345678",
"issueCountry": "GB",
"issueDate": "2020-05-10",
"expiryDate": "2030-05-10"
},
"drivers": [
{
"mainDriver": true,
"firstName": "Rental",
"lastName": "Cars",
"birthDate": "1980-01-01",
"phoneNumber": "441611234567",
"address": {
"line1": "10",
"line2": "Downing Street",
"city": "London",
"state": "Greater London",
"postalCode": "SW1A 2AA",
"country": "GB"
},
"licenceDocument": {
"number": "CARS123456R7GT",
"issueCountry": "GB",
"issueDate": "2020-01-01",
"expiryDate": "2030-01-10"
}
}
]
}'