curl --request POST \
--url https://api.gridbeds.com/api/v1/integration/reservations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"property_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"room_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"guest_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"check_in": "2023-12-25",
"check_out": "2023-12-25",
"adults": 2,
"base_price": 1,
"total_price": 1,
"rate_plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"children": 1,
"infants": 1,
"currency": "<string>",
"cleaning_fee": 123,
"service_fee": 123,
"taxes": 123,
"discounts": 123,
"special_requests": "<string>",
"internal_notes": "<string>",
"expected_arrival_time": "<string>",
"arrival_transport_number": "<string>"
}
'import requests
url = "https://api.gridbeds.com/api/v1/integration/reservations"
payload = {
"property_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"room_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"guest_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"check_in": "2023-12-25",
"check_out": "2023-12-25",
"adults": 2,
"base_price": 1,
"total_price": 1,
"rate_plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"children": 1,
"infants": 1,
"currency": "<string>",
"cleaning_fee": 123,
"service_fee": 123,
"taxes": 123,
"discounts": 123,
"special_requests": "<string>",
"internal_notes": "<string>",
"expected_arrival_time": "<string>",
"arrival_transport_number": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
property_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
room_type_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
guest_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
check_in: '2023-12-25',
check_out: '2023-12-25',
adults: 2,
base_price: 1,
total_price: 1,
rate_plan_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
channel_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
children: 1,
infants: 1,
currency: '<string>',
cleaning_fee: 123,
service_fee: 123,
taxes: 123,
discounts: 123,
special_requests: '<string>',
internal_notes: '<string>',
expected_arrival_time: '<string>',
arrival_transport_number: '<string>'
})
};
fetch('https://api.gridbeds.com/api/v1/integration/reservations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gridbeds.com/api/v1/integration/reservations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'property_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'room_type_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'guest_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'check_in' => '2023-12-25',
'check_out' => '2023-12-25',
'adults' => 2,
'base_price' => 1,
'total_price' => 1,
'rate_plan_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'channel_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'children' => 1,
'infants' => 1,
'currency' => '<string>',
'cleaning_fee' => 123,
'service_fee' => 123,
'taxes' => 123,
'discounts' => 123,
'special_requests' => '<string>',
'internal_notes' => '<string>',
'expected_arrival_time' => '<string>',
'arrival_transport_number' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"check_in": "2023-11-07T05:31:56Z",
"check_out": "2023-11-07T05:31:56Z",
"total_price": "<string>",
"currency": "<string>",
"guest_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"meta": {
"message": "Reservation created."
}
}{
"message": "<string>",
"code": "<string>",
"errors": {}
}{
"message": "<string>",
"code": "<string>",
"errors": {}
}{
"message": "<string>",
"code": "<string>",
"errors": {}
}{
"message": "<string>",
"code": "<string>",
"errors": {}
}{
"error": "<string>",
"message": "<string>",
"retry_after": 123
}Create a reservation
Creates a reservation in the organization for an existing guest, named by guest_id (create one with createGuest first). Requires the reservations.write scope.
The reservation is made pending. The API does not price the stay: the amounts you send are recorded as sent. It does check that the room type has a room free for every night, and answers 422 when it has not.
Send an Idempotency-Key header to make a retry safe: for at least 24 hours, the same key with the same body answers with the first response instead of creating a second reservation.
curl --request POST \
--url https://api.gridbeds.com/api/v1/integration/reservations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"property_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"room_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"guest_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"check_in": "2023-12-25",
"check_out": "2023-12-25",
"adults": 2,
"base_price": 1,
"total_price": 1,
"rate_plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"children": 1,
"infants": 1,
"currency": "<string>",
"cleaning_fee": 123,
"service_fee": 123,
"taxes": 123,
"discounts": 123,
"special_requests": "<string>",
"internal_notes": "<string>",
"expected_arrival_time": "<string>",
"arrival_transport_number": "<string>"
}
'import requests
url = "https://api.gridbeds.com/api/v1/integration/reservations"
payload = {
"property_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"room_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"guest_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"check_in": "2023-12-25",
"check_out": "2023-12-25",
"adults": 2,
"base_price": 1,
"total_price": 1,
"rate_plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"children": 1,
"infants": 1,
"currency": "<string>",
"cleaning_fee": 123,
"service_fee": 123,
"taxes": 123,
"discounts": 123,
"special_requests": "<string>",
"internal_notes": "<string>",
"expected_arrival_time": "<string>",
"arrival_transport_number": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
property_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
room_type_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
guest_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
check_in: '2023-12-25',
check_out: '2023-12-25',
adults: 2,
base_price: 1,
total_price: 1,
rate_plan_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
channel_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
children: 1,
infants: 1,
currency: '<string>',
cleaning_fee: 123,
service_fee: 123,
taxes: 123,
discounts: 123,
special_requests: '<string>',
internal_notes: '<string>',
expected_arrival_time: '<string>',
arrival_transport_number: '<string>'
})
};
fetch('https://api.gridbeds.com/api/v1/integration/reservations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gridbeds.com/api/v1/integration/reservations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'property_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'room_type_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'guest_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'check_in' => '2023-12-25',
'check_out' => '2023-12-25',
'adults' => 2,
'base_price' => 1,
'total_price' => 1,
'rate_plan_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'channel_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'children' => 1,
'infants' => 1,
'currency' => '<string>',
'cleaning_fee' => 123,
'service_fee' => 123,
'taxes' => 123,
'discounts' => 123,
'special_requests' => '<string>',
'internal_notes' => '<string>',
'expected_arrival_time' => '<string>',
'arrival_transport_number' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"check_in": "2023-11-07T05:31:56Z",
"check_out": "2023-11-07T05:31:56Z",
"total_price": "<string>",
"currency": "<string>",
"guest_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"meta": {
"message": "Reservation created."
}
}{
"message": "<string>",
"code": "<string>",
"errors": {}
}{
"message": "<string>",
"code": "<string>",
"errors": {}
}{
"message": "<string>",
"code": "<string>",
"errors": {}
}{
"message": "<string>",
"code": "<string>",
"errors": {}
}{
"error": "<string>",
"message": "<string>",
"retry_after": 123
}Autorizzazioni
An integration token, sent as Authorization: Bearer <token>.
A token belongs to one installation of an app. Someone at the property who may manage its integrations installs the app in Gridbeds, under Settings → Integrations, and issues the token there, granting the scopes the app requested or a subset of them. The token is shown once; issuing a new one revokes the previous one.
Every request reads and writes the data of the organization that installed the app, and nothing else. Each operation names the scope it requires. A token without that scope, and the token of an installation that is disabled or in error, are refused with 403; a token that is missing, unknown or revoked, and a user's own sign-in token, are refused with 401.
Intestazioni
A key of your choosing, such as a UUID, that makes a retry safe: for at least 24 hours the same key with the same body answers with the first response instead of repeating the write. Only a successful response is remembered; after a failure the same key may be tried again.
255Corpo
A reservation to create. It is made pending.
The property the stay is at. It must belong to the organization.
The room type being booked. It must belong to property_id, and have a room free for every night of the stay.
The guest the reservation is for: an id from listGuests, or from createGuest for a guest not yet known.
The arrival date, as YYYY-MM-DD. Not before today.
The departure date, as YYYY-MM-DD. After check_in, and at most 365 nights later.
How many adults are staying.
x >= 1The price of the stay before fees, taxes and discounts. Not negative. Prices are recorded as sent: the API does not price the stay.
x >= 0The total price of the stay, in currency. Not negative. Recorded as sent.
x >= 0The rate plan the stay is sold under, recorded on the reservation. It must belong to property_id. The plan's restrictions, such as a minimum stay, are not checked.
The booking channel the reservation came through, when it came through one.
How many children are staying. Omit it for none.
x >= 0How many infants are staying. Omit it for none.
x >= 0The three-letter ISO 4217 code of the amounts below. Omit it for the property's currency.
The cleaning fee, recorded as sent. Not negative. Omit it for none.
The service fee, recorded as sent. Not negative. Omit it for none.
The taxes on the stay, recorded as sent. Not negative. Omit it for none.
The discount given on the stay, recorded as sent. Not negative. Omit it for none.
What the guest asked for, in their words.
Notes for the property's staff.
When the guest expects to arrive, as HH:MM on the property's clock.
How the guest is travelling to the property.
flight, train, car, other The flight or train number, for arrival_transport_mode. Letters, digits, spaces and -, / or ..
20^[\pL\pN][\pL\pN \-\/.]*$