Marketing API Version

Hotel Room

Reading

A hotel room object

Parameters

This endpoint doesn't have any parameters.

Fields

FieldDescription
applinks

App links for native platforms, e.g. Android, IOS and Windows Phone.

base_price
string

Base price per night for this hotel room.

currency
string

The currency used to pay

description
string

Description of the hotel room

id
numeric string

The unique ID of the hotel room generated by Facebook

images
list<string>

Links to hotel room images. Please note that carousel format utilizes a square 1:1 aspect ratio images (recommended size - 600x600px) while single hotel ad uses 1.91:1 aspect ratio image(recommended size - 1200x630px). Please provide at least one image.

margin_level
string

Margin level for this room

name
string

Name of the hotel room

room_id
string

Room's ID for the hotel room. From the room_id field in the feed

sale_price
string

Sale price per night for this hotel room. Make sure the sale_price of a hotel room is lower than its base_price.

url
string

URL of the hotel room

Edges

EdgeDescription

pricing_variables

Vector of prices per date and length of stay

Validation Rules

ErrorDescription
100Invalid parameter

Creating

Example

Example to create a hotel room type which has base_price as 159.99 US dollars with multiple price configurations:

curl \
-X POST \
-F "room_id=r_3" \
-F "name=Sample room type" \
-F "description=room type description" \
-F "base_price=15999" \
-F "currency=USD" \
-F "url=http://www.example.com/sampleroom" \
-F "pricing_variables= [ \
  { \
    'checkin_date':'2016-04-01', \
    'fees':10, \
    'nights':1, \
    'price':170, \
    'tax':14 \
  }, \
  { \
    'checkin_date':'2016-04-01', \
    'fees':10, \
    'nights':5, \
    'price':130, \
    'tax':10 \
  } \
]" \
-F "access_token=<ACCESS_TOKEN>" \
https://graph.facebook.com/<API_VERSION>/<HOTEL_ID>/hotel_rooms


Example to create a hotel room type which has base_price as 175 Japanese Yen with multiple price configurations:

curl \
-X POST \
-F "room_id=r_3" \
-F "name=Sample room type" \
-F "description=room type description" \
-F "base_price=17500" \
-F "currency=JPY" \
-F "url=http://www.example.com/sampleroom" \
-F "pricing_variables= [ \
  { \
    'checkin_date':'2016-04-01', \
    'fees':300, \
    'nights':1, \
    'price':17000, \
    'tax':1400 \
  }, \
  { \
    'checkin_date':'2016-04-01', \
    'fees':300, \
    'nights':5, \
    'price':13800, \
    'tax':1300 \
  } \
]" \
-F "access_token=<ACCESS_TOKEN>" \
https://graph.facebook.com/<API_VERSION>/<HOTEL_ID>/hotel_rooms
  • Price related fields in JPY has to be multiple of 100 (same for all the currencies with offset 1).
  • The checkin_date has to be in the future.


You can make a POST request to hotel_rooms edge from the following paths:
When posting to this edge, a HotelRoom will be created.

Parameters

NameDescription
applinks
Object

App links for native platforms, e.g. Android, IOS and Windows Phone.

android
ios
ipad
iphone
windows_phone
base_price
float

From price of the hotel

Required
currency
ISO 4217 Currency Code

Currency for the hotel room

Required
description
string

Description of the hotel

Required
images
list<Object>

Links to hotel room images. Please note that carousel format utilizes a square 1:1 aspect ratio images (recommended size - 600x600px) while single hotel ad uses 1.91:1 aspect ratio image(recommended size - 1200x630px). Please provide at least one image.

image_url
URL
Required
tags
list<string>
margin_level
int64

Margin level for this room

name
string

Name of the hotel

Required
pricing_variables
list<Object>

Vector of prices per date and length of stay

checkin_date
string
Required
fees
float
Required
nights
int64
Required
price
float
Required
rate_plan
enum {loyalty_members}
tax
float
Required
sale_price
float
sale_price_tax
float
room_id
string

Room's ID for the hotel. From the room_id field in the feed

Required
sale_price
float

Sale price of the hotel room

url
URL

URL of the hotel

Required

Return Type

This endpoint supports read-after-write and will read the node represented by id in the return type.
Struct {
id: numeric string,
}

Validation Rules

ErrorDescription
200Permissions error

Updating

Example to update a hotel room type:

curl \
-X POST \
-F "base_price=17900" \
-F "access_token=<ACCESS_TOKEN>" \
https://graph.facebook.com/<API_VERSION>/<HOTEL_ROOM_ID>
You can update a HotelRoom by making a POST request to /{hotel_room_id}.

Parameters

NameDescription
applinks
Object

App links for native platforms, e.g. Android, IOS and Windows Phone.

android
ios
ipad
iphone
windows_phone
base_price
float

From price of the hotel room

currency
ISO 4217 Currency Code

The currency used to pay

description
string

Description of the hotel

images
list<Object>

Links to hotel room images. Please note that carousel format utilizes a square 1:1 aspect ratio images (recommended size - 600x600px) while single hotel ad uses 1.91:1 aspect ratio image(recommended size - 1200x630px). Please provide at least one image.

image_url
URL
Required
tags
list<string>
margin_level
int64

Margin level for this room

name
string

Name of the hotel

pricing_variables
list<Object>

Vector of prices per date and length of stay

checkin_date
string
Required
fees
float
Required
nights
int64
Required
price
float
Required
rate_plan
enum {loyalty_members}
tax
float
Required
sale_price
float
sale_price_tax
float
sale_price
float

Sale price of the hotel room

url
URL

URL of the hotel

Return Type

This endpoint supports read-after-write and will read the node to which you POSTed.
Struct {
success: bool,
}

Validation Rules

ErrorDescription
200Permissions error

Deleting

You can delete a HotelRoom by making a DELETE request to /{hotel_room_id}.

Parameters

This endpoint doesn't have any parameters.

Return Type

Struct {
success: bool,
}

Validation Rules

ErrorDescription
200Permissions error