curl --request POST \
--url https://api.gridbeds.com/api/v1/integration/guests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"first_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"address": "<string>",
"city": "<string>",
"country": "<string>",
"language": "<string>",
"postal_code": "<string>",
"codice_fiscale": "<string>",
"document_number": "<string>",
"date_of_birth": "2023-12-25",
"nationality": "<string>",
"is_vip": true,
"is_blacklisted": true
}
'import requests
url = "https://api.gridbeds.com/api/v1/integration/guests"
payload = {
"first_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"address": "<string>",
"city": "<string>",
"country": "<string>",
"language": "<string>",
"postal_code": "<string>",
"codice_fiscale": "<string>",
"document_number": "<string>",
"date_of_birth": "2023-12-25",
"nationality": "<string>",
"is_vip": True,
"is_blacklisted": True
}
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({
first_name: '<string>',
last_name: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
address: '<string>',
city: '<string>',
country: '<string>',
language: '<string>',
postal_code: '<string>',
codice_fiscale: '<string>',
document_number: '<string>',
date_of_birth: '2023-12-25',
nationality: '<string>',
is_vip: true,
is_blacklisted: true
})
};
fetch('https://api.gridbeds.com/api/v1/integration/guests', 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/guests",
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([
'first_name' => '<string>',
'last_name' => '<string>',
'email' => 'jsmith@example.com',
'phone' => '<string>',
'address' => '<string>',
'city' => '<string>',
'country' => '<string>',
'language' => '<string>',
'postal_code' => '<string>',
'codice_fiscale' => '<string>',
'document_number' => '<string>',
'date_of_birth' => '2023-12-25',
'nationality' => '<string>',
'is_vip' => true,
'is_blacklisted' => true
]),
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",
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"phone": "<string>"
},
"meta": {
"message": "Guest 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 guest
Creates a guest in the organization, to be named as guest_id when creating a reservation. Requires the guests.write scope.
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 guest.
curl --request POST \
--url https://api.gridbeds.com/api/v1/integration/guests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"first_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"address": "<string>",
"city": "<string>",
"country": "<string>",
"language": "<string>",
"postal_code": "<string>",
"codice_fiscale": "<string>",
"document_number": "<string>",
"date_of_birth": "2023-12-25",
"nationality": "<string>",
"is_vip": true,
"is_blacklisted": true
}
'import requests
url = "https://api.gridbeds.com/api/v1/integration/guests"
payload = {
"first_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"address": "<string>",
"city": "<string>",
"country": "<string>",
"language": "<string>",
"postal_code": "<string>",
"codice_fiscale": "<string>",
"document_number": "<string>",
"date_of_birth": "2023-12-25",
"nationality": "<string>",
"is_vip": True,
"is_blacklisted": True
}
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({
first_name: '<string>',
last_name: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
address: '<string>',
city: '<string>',
country: '<string>',
language: '<string>',
postal_code: '<string>',
codice_fiscale: '<string>',
document_number: '<string>',
date_of_birth: '2023-12-25',
nationality: '<string>',
is_vip: true,
is_blacklisted: true
})
};
fetch('https://api.gridbeds.com/api/v1/integration/guests', 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/guests",
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([
'first_name' => '<string>',
'last_name' => '<string>',
'email' => 'jsmith@example.com',
'phone' => '<string>',
'address' => '<string>',
'city' => '<string>',
'country' => '<string>',
'language' => '<string>',
'postal_code' => '<string>',
'codice_fiscale' => '<string>',
'document_number' => '<string>',
'date_of_birth' => '2023-12-25',
'nationality' => '<string>',
'is_vip' => true,
'is_blacklisted' => true
]),
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",
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"phone": "<string>"
},
"meta": {
"message": "Guest 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
}Autorizări
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.
Anteturi
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.
255Corp
A guest to create.
The guest's first name.
255The guest's last name.
255The guest's email address.
255The guest's phone number.
20The street address.
255The city.
100The guest's country, as a two-letter ISO 3166-1 alpha-2 code.
2The language the guest prefers to be written to in, as a language code such as en. Omit it for the default.
The postal code.
20The guest's Italian tax code (codice fiscale), for guests it applies to. Letters are upper-cased and spaces removed before it is checked.
The kind of identity document the guest travels on.
passport, id_card, driving_license, null The number of that document.
50The guest's date of birth, as YYYY-MM-DD. Before today.
The guest's nationality, as a two-letter ISO 3166-1 alpha-2 code.
2Whether the guest is marked as a VIP. Defaults to false.
Whether the guest is blacklisted. Defaults to false.