AnchorIntroduction

Newbook Online is a powerful and comprehensive online engine for creating accommodation bookings, facility hirage, activity bookings, and many other sales, integrated directly into the Newbook product.

It has several layout options, and several features can be enabled or disabled, but the scope of this document is only to show how the URL structure can prefill certain aspects or enable specific functionality.

This list is not guaranteed to be all possible parameters, and is not guaranteed to remain the same permanently, though we will aim for backwards compatibility if the need arises to change parameters.

As with all our documentation, a basic understanding of what Newbook is and how our clients operate will help understand these requests and responses.

In the below examples, {newbook_online_url} is a placeholder for your actual Newbook Online URL. Please reach out to Newbook Support if you don't know what your Newbook Online URL is.

All of the below parameters can be used in combination with each other. You combine two or more parameters by separating them with the & symbol, e.g.

								
									{newbook_online_url}?available_from=22+April+24&force_category_id=1&adults=2
								
							
AnchorNewbook Online Bookings: hosted versus visual copy

Each Instance has its own Online Bookings URL as defined in its Settings.

This should be the URL of a page of a website, where that page includes the Newbook Online Bookings API file (written in PHP).

For technical reasons, if the Instance wishes to utilise its own URL for Newbook Online, they must have a web host that supports PHP.

Alternatively, if the Instance does not have web hosting that supports PHP, we arrange for a visual copy of the Instance's website to be constructed and host that on our own domain e.g. https://bookingsau.newbook.cloud/[INSTANCE_NAME]/

In either case the final URL is what needs to be set into the Instance's Settings as its Online Bookings URL.

Please note: for browser security and code compatibility reasons, embedding an Online Booking Engine in a Frame or iFrame is not supported.

Anchorclear_cart

Used to clear the current cart data when linking from external sites.

If there is any existing cart data this parameter will provide the guest with a prompt to clear their cart data.

This is primarily intended for use with other parameters such as force_category_id but can also be used standalone.

URL Example

								
									{newbook_online_url}?clear_cart
								
							
AnchorNEWBOOK_HTTP_REFERER

This parameter should be delivered URL Encoded

Use NEWBOOK_HTTP_REFERER to provide an original referrer to the Online Bookings engine.

The parameter changes Google Analytics tracking which is performed on the last step of saving a booking.

When this is not provided, the Online Booking engine will default to the originating website (usually your website) being the referrer.

URL Example

								
									{newbook_online_url}?NEWBOOK_HTTP_REFERER=https%3A%2F%2Fwww.google.com								
							
Anchoravailable_from

This parameter should be delivered URL Encoded

Defines the date from when the Online Bookings engine should load.

Date format should be

  • either human-understandable ("22 April 2024" or "April 22 2024") or
  • Y-m-d ("2024-04-22")

Invalid dates will simply be ignored and the engine will load from the current date.

URL Example

								
									{newbook_online_url}?available_from=22+April+24								
							
Anchoravailable_to

This parameter should be delivered URL Encoded

Defines the date to when the Online Bookings engine should load.

Date format should be

  • either human-understandable ("25 April 2024" or "April 25 2024") or
  • Y-m-d ("2024-04-25")

Invalid dates will simply be ignored and the engine will load to the date of available_from +x days, with x being the value of the Setting Newbook Online: Days to show by default.

URL Example

								
									{newbook_online_url}?available_to=25+April+24								
							
Anchoradults

Defines the number of adults the Online Bookings engine should load.

Positive integers only.

Each Category defines its own maximum adults (and maximum of adults+children+infants+animals); exceed that limit and the Category becomes unavailable to book.

URL Example

								
									{newbook_online_url}?adults=2
								
							
Anchorchildren

Defines the number of children the Online Bookings engine should load.

Positive integers only.

Each Category defines its own maximum children (and maximum of adults+children+infants+animals); exceed that limit and the Category becomes unavailable to book.

URL Example

								
									{newbook_online_url}?children=3
								
							
Anchorinfants

Defines the number of infants the Online Bookings engine should load.

Positive integers only.

Each Category defines its own maximum infants (and maximum of adults+children+infants+animals); exceed that limit and the Category becomes unavailable to book.

URL Example

								
									{newbook_online_url}?infants=1
								
							
Anchoranimals

Defines the number of animals the Online Bookings engine should load.

Positive integers only.

Each Category defines its own maximum animals; exceed that limit and the Category becomes unavailable to book.

URL Example

								
									{newbook_online_url}?animals=2
								
							
Anchorpromo_code

Tariffs in Newbook can optionally be hidden behind a Promo Code, and unless that Promo Code is provided to the Online Bookings engine, those tariffs are not displayed.

When a tariff is set up with a Promo Code the engine will show a text field to enter one.

Providing promo_code in the URL will prefill that field, and so, show the relevant tariffs by default.

URL Example

								
									{newbook_online_url}?promo_code=my_promo
								
							
Anchordiscount_code

Discounts in Newbook are hidden behind a Discount Code. The guest is able to enter their Discount Code on the Checkout page, or you can provide one in the URL.

Discounts still have their own validation rules which need to be met before any price reduction is granted.

Providing this parameter changes the display of the price on Newbook Online to be struck through when the discount applies e.g. "$100.00 $80.00 Per Night".

URL Example

								
									{newbook_online_url}?discount_code=my_discount
								
							

Or optionally:

								
									{newbook_online_url}?discount_code=my_discount&discount_id=5
								
							
Anchorforce_category_id

Use force_category_id to have the Online Bookings engine show only the specified Category.

The parameter can be singular or an array, which will then show all the specified Categories.

You can specify this as an array in the URL or as a JSON string in the URL.

All the regular rules/restrictions of the engine still apply e.g. the Categories must still be available over the specified date range, for the specified number of people, etc.

URL Example

Singular:

									
										{newbook_online_url}?force_category_id=1
									
								

Array:

									
										{newbook_online_url}?force_category_id[]=1&force_category_id[]=2&force_category_id[]=3
									
								

JSON:

									
										{newbook_online_url}?force_category_id=[1,2,3]
									
								
Anchorforce_category_type_id

Use force_category_type_id to have the Online Bookings engine show only Categories matching the specified Category Type.

The parameter can be singular or an array, which will then show the all the Categories matching the specified Category Types.

You can specify this as an array in the URL or as a JSON string in the URL.

All the regular rules/restrictions of the engine still apply e.g. the Categories must still be available over the specified date range, for the specified number of people, etc.

URL Example

Singular:

									
										{newbook_online_url}?force_category_type_id=1
									
								

Array:

									
										{newbook_online_url}?force_category_type_id[]=1&force_category_type_id[]=2&force_category_type_id[]=3
									
								

JSON:

									
										{newbook_online_url}?force_category_type_id=[1,2,3]
									
								
Anchorforce_site_id

Use force_site_id to have the Online Bookings engine show only the Category of the specified Site.

Under ordinary circumstances the engine will not allow a guest to nominate a particular Site as this can prevent maximisation of availability.

This parameter forces the engine determine availability for the given Site only.

If the given Site is not available, then the whole Category appears as unavailable to book.

The parameter can be singular or an array, which will then show the all the Categories matching the specified Sites.

You can specify this as an array in the URL or as a JSON string in the URL.

All the regular rules/restrictions of the engine still apply e.g. the Categories must still be available over the specified date range, for the specified number of people, etc.

URL Example

Singular:

									
										{newbook_online_url}?force_site_id=1
									
								

Array:

									
										{newbook_online_url}?force_site_id[]=1&force_site_id[]=2&force_site_id[]=3
									
								

JSON:

									
										{newbook_online_url}?force_site_id=[1,2,3]
									
								
Anchorforce_tariff_type_id

Use force_tariff_type_id to have the Online Bookings engine show only the tariffs of the specified Tariff Type.

This parameter forces the engine determine availability for the given Tariff Type only.

If the given Tariff Type is not currently in use, or stop sold, or not available for Newbook Online, then the whole Category appears as unavailable to book.

The parameter can be singular or an array, which will then show the all the Categories using the specified Tariff Types.

You can specify this as an array in the URL or as a JSON string in the URL.

All the regular rules/restrictions of the engine still apply e.g. the Categories must still be available over the specified date range, for the specified number of people, etc.

URL Example

Singular:

									
										{newbook_online_url}?force_tariff_type_id=1
									
								

Array:

									
										{newbook_online_url}?force_tariff_type_id[]=1&force_tariff_type_id[]=2&force_tariff_type_id[]=3
									
								

JSON:

									
										{newbook_online_url}?force_tariff_type_id=[1,2,3]
									
								
Anchorforce_online_product_id

Defines the Online Add-On ID.

Add-Ons are set up by Newbook users as extras which a Booking can sell. These can also be purchased outside of the regular Booking process.

The parameter can be singular or an array, which will then show all the specified Add-Ons.

You can specify this as an array in the URL or as a JSON string in the URL.

Invalid Add-On IDs will result in a the guest seeing a message that no such Add-On exists.

See Also force_online_product_category_id

URL Example

Singular:

									
										{newbook_online_url}?online_products&force_online_product_id=3
									
								

Array:

									
										{newbook_online_url}?online_products&force_online_product_id[]=3&force_online_product_id[]=5
									
								

JSON:

									
										{newbook_online_url}?online_products&force_online_product_id=[3,5]
									
								
Anchorforce_online_product_category_id

Defines the Online Add-Ons Category ID.

Add-On Categories are optionally set up by Newbook users, so that many Add-Ons can be categorised within the one name or branding.

The parameter can be singular or an array, which will then show all the specified Add-On Categories.

You can specify this as an array in the URL or as a JSON string in the URL.

Invalid Category IDs will result in a the guest seeing a message that no such Add-On Category exists.

URL Example

Singular:

									
										{newbook_online_url}?online_products&force_online_product_category_id=1
									
								

Array:

									
										{newbook_online_url}?online_products&force_online_product_category_id[]=1&force_online_product_category_id[]=4
									
								

JSON:

									
										{newbook_online_url}?online_products&force_online_product_category_id=[1,4]
									
								
Anchoractivities_available_from

This parameter should be delivered URL Encoded

Defines the date from when the Online Activities engine should load.

Date format should be

  • either human-understandable ("22 April 2024" or "April 22 2024") or
  • Y-m-d ("2024-04-22")

Invalid dates will simply be ignored and the engine will load from the current date.

URL Example

								
									{newbook_online_url}?availability_activity&activities_available_from=22+April+24								
							
Anchoractivities_available_to

This parameter should be delivered URL Encoded

Defines the date to when the Online Activities engine should load.

Date format should be

  • either human-understandable ("25 April 2024" or "April 25 2024") or
  • Y-m-d ("2024-04-25")

Invalid dates will simply be ignored and the engine will load to the date of available_from +x days, with x being the value of the Setting Newbook Online: Days to show by default.

URL Example

								
									{newbook_online_url}?availability_activity&activities_available_to=25+April+24								
							
Anchoractivities_adults

Defines the number of adults the Online Activities engine should load.

Positive integers only.

Each Activity defines its own maximum adults (and maximum of adults+children+infants+animals); exceed that limit and the Activity becomes unavailable to book.

URL Example

								
									{newbook_online_url}?availability_activity&activities_adults=2
								
							
Anchoractivities_children

Defines the number of children the Online Activities engine should load.

Positive integers only.

Each Activity defines its own maximum children (and maximum of adults+children+infants+animals); exceed that limit and the Activity becomes unavailable to book.

URL Example

								
									{newbook_online_url}?availability_activity&activities_children=3
								
							
Anchoractivities_infants

Defines the number of infants the Online Activities engine should load.

Positive integers only.

Each Activity defines its own maximum infants (and maximum of adults+children+infants+animals); exceed that limit and the Activity becomes unavailable to book.

URL Example

								
									{newbook_online_url}?availability_activity&activities_infants=1
								
							
Anchoractivities_animals

Defines the number of animals the Online Activities engine should load.

Positive integers only.

Each Activity defines its own maximum animals; exceed that limit and the Activity becomes unavailable to book.

URL Example

								
									{newbook_online_url}?availability_activity&activities_animals=2
								
							
Anchorforce_activity_id

Use force_activity_id to have the Online Activities engine show only the specified Activities.

The parameter can be singular or an array, which will then show all the specified Activities.

You can specify this as an array in the URL or as a JSON string in the URL.

All the regular rules/restrictions of the engine still apply e.g. the Activities must still be available over the specified date range, for the specified number of people, etc.

URL Example

Singular:

									
										{newbook_online_url}?availability_activity&force_activity_id=5
									
								

Array:

									
										{newbook_online_url}?availability_activity&force_activity_id[]=5&force_activity_id[]=6
									
								

JSON:

									
										{newbook_online_url}?availability_activity&force_activity_id=[5,6]