AnchorIntroduction

This document provides instructions on using our REST API to work with NewBook.

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

Please note that any examples below should not be used on your development servers. These are only examples and do not work.

The NewBook REST API currently implements throttling after 100 requests per minute. Requests beyond this limit are denied.

AnchorRelease Notes

2022.11

2022.10

2022.07

2022.06

  • Guests: Merge - request added
  • Membership Purchase - request added
  • Site Maps - added ability to limit to a single Map, and request availability validation along with the returned data
  • Bookings Create - required_features added for when you know what features you need, but not the specific Site ID

2022.05

2022.03

2022.02

2022.01

2021.02

  • Charges: Create - will now be able to accept an optional parameter of payment_amount. This paired with the payment_type will allow you to create a Payment for a specified amount different to the Charge amount.
  • Credits: Create - will now be able to accept an optional parameter of refund_amount. This paired with the refund_type will allow you to create a Refund for a specified amount different to the Credit amount.
  • Notes: Create - will now be able to accept an optional parameter of check_for_duplicates.
  • Access Codes: List - now also returns guest_id and guest_name for the associated Access Code.
  • Bookings: Pull Availability & Pricing - now returns extra tariffs when requested with any of the following: membership pricing when requested with return_membership_discount_pricing, and discount pricing when requested with return_general_discount_pricing, and tariffs locked behind promo_codes when requested with return_promo_code_pricing.

2020.10

  • Leads: Create, Guests: Create - will now automatically update the first existing record when a duplicate is found
  • Users: List - will now be able to accept an optional parameter of show_inactive. This will allow the list to return deactivated Users.

2020.06

2020.03

2019.12

2019.07

  • Token: Store request added
  • Inventory Items: List - will now return NewBook Online Category Restrictions.
  • Companies: List - account_currency_code, auto_debit added to each object in the response
  • Incidents: List - will return a list of Incidents.
  • Leads: List - will now return the following additional fields: Source, Method, Status Reason, Inventory Items, Categories, Interests, Types, Notes, Points, Parent Lead ID, Interest Level, Expected Revenue, Title, Other Name, Created By, Assigned When.
  • Guests: List - will now return the following additional fields: Notes
  • Quotes: List - will now return the following additional fields: Notes

2019.04

2018.11

2018.08

  • Bookings: Pull Availability & Pricing - sort added to each object in the response; inventory_items added to each tariffs_available element in the response
  • Bookings: Get Details - will return success:"false" in the response when the requested Booking does not exist
  • Bookings: List / Get Details - will now return booking_market_segment_id and booking_market_segment_name in the response
  • Bookings: Retrieve Current In Site - will return success:"false" in the response when the requested Site does not exist
  • Contact Templates: Create, Update, Options - requests added
  • Requests which return Custom Field data - Custom Fields now have their type returned along with the data
  • Tasks: Create - location_name can now be used for Site and Facility Tasks

2018.05

2018.02

2017.12

2017.10

2017.08

AnchorAuthentication

To use the NewBook REST API you must authenticate via HTTP Basic Authentication using a username and password.

These details will be provided to you by the NewBook Support team.

You must also supply the region and api_key parameters with each JSON request to specify which NewBook Region and Instance you are querying.

It is a requirement to use HTTPS to communicate with the NewBook REST API, for both testing and real live use. Your JSON request must be sent via HTTP POST.

Live Endpoint

  • URL: https://api.newbook.cloud/rest/request_action

    Each REST API request has a distinct "action" which must be used in place of request_action in the above URL.

  • Region Options:
    • au - Australia
    • ap - Asia Pacific
    • eu - Europe
    • us - United States

Test Endpoint (must be specifically requested; access is not automatic)

Please contact NewBook Support if you are unsure about which Endpoint or Region to use.

Authentication Examples

Request URL

https://api.newbook.cloud/rest/api_keys

Request JSON
						
							{
								"region": "your_region_here"
							}
						
					
Response JSON
						
							{
								"success": "true",
								"data": {
									"instances_08626af5abca4e680a249debfe4bdb5a": "Random CRM",
									"instances_54459f5b0e9b4d5wjv9e02a1a904fafb": "Hotel Test"
								},
								"message": ""
							}
						
					
AnchorBuilding an example Request

In this example we will build an Authentication Test Request using the Test Endpoint.

HTTP Method: POST

HTTP Basic Auth Username: [as provided]

HTTP Basic Auth Password: [as provided]

URL: https://testapi.newbook.cloud/rest (see Authentication for alternate URLs]

POST data: [see right hand side Request JSON]

Request Notes:

request_action must be provided to tell the REST API which action to execute. For this example we will use auth_test.

region must be provided to tell the REST API the NewBook Region of the Client you're trying to connect to. See Authentication for alternate regions.

Building an example Request

Request URL

https://api.newbook.cloud/rest/auth_test

Request JSON
						
							{
								"region": "your_region_here",
								"api_key": "your_api_key_here"
							}
						
					
Response JSON
						
							{
								"success": "true",
								"data": "NewBook Test Instance",
								"message": "Successfully authenticated for NewBook Test Instance"
							}
						
					
AnchorHandling Errors

If a request has an error (missing parameters, invalid requests, server errors, etc.) a response with success set to "false" will be returned.

Handling Errors Examples

Response JSON
						
							{
								"success": "false",
								"data": [],
								"message": "Descriptive error message here"
							}
						
					
AnchorHandling Paginated Lists

The majority of our *_list requests are paginated, to minimize server load and ensure a timely response.

Requests default to showing results from 0 (data_offset), and limits results to the first 100 (data_limit).

Further, the response indicates how many results are currently being returned (data_count), and how many results there are in total (data_total).


Notes:

Using data_offset, data_limit, and data_total you will be able to paginate through the results.

You can increase data_limit to a maximum of 1000. Anything over this value will be capped at 1000.

You can request data_limit higher than data_total however data_count will still be the number of results returned.

Handling Paginated Lists

Request URL

https://api.newbook.cloud/rest/companies_list

Request JSON (with no pagination parameters / default behaviour)
						
							{
								"region": "your_region_here",
								"api_key": "your_api_key_here"
							}
						
					
Response JSON
						
							{
								"success": "true",
								"data": [
									0-100 results
								],
								"data_offset": 0,
								"data_limit": 100,
								"data_count": 100,
								"data_total": 550,
								"message": ""
							}
						
					
Request URL

https://api.newbook.cloud/rest/companies_list

Request JSON (with pagination parameters)
						
							{
								"region": "your_region_here",
								"api_key": "your_api_key_here",
								"data_offset": 100,
								"data_limit": 25,
							}
						
					
Response JSON
						
							{
								"success": "true",
								"data": [
									100-125 results
								],
								"data_offset": 100,
								"data_limit": 25,
								"data_count": 25,
								"data_total": 550,
								"message": ""
							}
						
					
AnchorAPI Keys Request

Return a list of API Keys (NewBook Instances) which your username & password can connect with.

API Keys Request Example

Request URL

https://api.newbook.cloud/rest/api_keys

Request JSON
						
							{
								"region": "your_region_here"
							}
						
					
Response JSON
						
							{
								"success": "true",
								"data": {
									"instances_08626af5abca4e680a249debfe4bdb5a": "Random CRM",
									"instances_54459f5b0e9b4d5wjv9e02a1a904fafb": "Hotel Test"
								},
								"message": ""
							}
						
					
AnchorAuthentication Test Request

Verify the username, password, and API Key in your possession work as expected.

Authentication Test Request Example

Request URL

https://api.newbook.cloud/rest/auth_test

Request JSON
						
							{
								"region": "your_region_here",
								"api_key": "your_api_key_here"
							}
						
					
Response JSON
						
							{
								"success": "true",
								"data": "NewBook Test Instance",
								"message": "Successfully authenticated for NewBook Test Instance"
							}
						
					
AnchorBookings: List

Retrieve a list of Bookings within the given time period.

Request Notes:

The only required fields are period_from, period_to and list_type - the rest are optional

If guest_id is provided it will limit results to an individual Guest

list_type Shows Bookings which:
arrived1

have Arrived during the specified dates

Optional parameter mode with value projected changes the behaviour to who should have Arrived, opposed to who actually Arrived

arriving2 are expected to Arrive during the specified dates
cancelled have been Cancelled during the specified dates
departed1 have Departed during the specified dates
departing3 are expected to Depart during the specified dates
inhouse3 are currently In-House (dates not required)
placed2 were placed during the specified dates
staying2 are expected to stay during the specified dates
no_show have been marked as No Show and were meant to arrive during the specified dates
quoted are only Quotes (not actually staying) during the specified dates
waitlist are only Waitlisted (not actually staying) during the specified dates
all

returns all Bookings, this will be a Paginated List.

period_from can be optionally provided to limit the response to Bookings created/modified after the specified timestamp

period_to can be optionally provided to limit the response to Bookings created/modified before the specified timestamp

  • 1 ignores bookings of status Cancelled, No Show, Quote, Waitlist, and Owner Occupied
  • 2 shows only bookings of status Confirmed and Unconfirmed
  • 3 shows only bookings of status Arrived

restrict_mail_outs controls whether to return Guests which have opted to be contacted automatically i.e. by systems not expressly related to their specific booking (aka marketing opt-in). In NewBook, this is enabled on all Guests by default unless the Instance decides to disable it by default. If you send 1, i.e. only return Guests who allow contact automatically, and the Guest has already opted-out, the booking data in the return response will still be present but the Guests array will be empty.

booking_reason, booking_source, booking_method and booking_demographic are allowed to be integers or arrays of integers. They all correspond to values specific to the Instance - you need to determine the values you want before trying to query for matching bookings.

search is optional and when provided it will restrict the results to the matching Guests. It will search their name, contact details (phone, email, etc) and membership details for a match

Response Notes:

The Guests array returned may contain more than one entry for multi-Guest Bookings - you can determine the main Guest as indicated by the primary_client field

The Equipment array returned has the data of all the equipment related to the booking. It returns an empty array if the booking has no equipment added

If the Bookings: List request has account_breakdown as true this will also affect the Guests array returned

The default_client_account_id field in the Booking array can be used to charge to the Booking Client Account, this may be different from the account_id where the Booking is part of a Group and the Guests are not paying individually

Inventory Item Notes:

The inventory_item field holds all the Inventory Items on the Booking.

  • The stay_cost_contribution key on each inventory_item indicates whether the amount is Included in the price of each night, or if it Increases the price of each night, or if it is Excluded from the price of each night (still counts as an add on cost but is not subject to discounts).
  • When the inventory_item gl_account_id key is null this means match the Booking gl_account_id
  • When the inventory_item gl_category_id key is null this means match the Booking gl_category_id

Guest data

title can be any string; NewBook does not restrict users to specific titles for Guests

contact_details

  • allow_transactional: Guest allows general contact related to Bookings or accounts
  • allow_marketing: Guest allows marketing contact such as newsletters

Bookings: List Example

Request URL

https://api.newbook.cloud/rest/bookings_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"period_from": "2015-08-21 00:00:00",
											"period_to": "2015-08-21 23:59:59",
											"list_type": "inhouse",
											"restrict_mail_outs": 1,
											"booking_reason": [1,2,3,4],
											"booking_source": 1,
											"booking_method": 2,
											"booking_demographic": 3,
											"account_breakdown": true
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"booking_id": 11033,
												"booking_arrival": "2022-12-03 14:00:00",
												"booking_departure": "2022-12-07 10:00:00",
												"booking_eta": "15:00",
												"booking_length": "4",
												"booking_status": "Confirmed",
												"booking_checkedin": null,
												"booking_checkedout": null,
												"booking_adults": 2,
												"booking_children": 0,
												"booking_infants": 0,
												"booking_animals": 0,
												"booking_total": "445.00",
												"booking_method_id": 2,
												"booking_method_name": "Booking.com",
												"booking_source_id": 5,
												"booking_source_name": "Booking.com",
												"booking_reason_id": 1,
												"booking_reason_name": "Business",
												"booking_demographic_id": null,
												"booking_demographic_name": "None",
												"booking_market_segment_id": null,
												"booking_market_segment_name": "None",
												"booking_parent_source_id": "1",
												"booking_parent_source_name": "Short Term",
												"booking_placed": "2022-12-01 11:30:00",
												"booking_booked_by": "NewBook Support",
												"gl_account_id": "1",
												"gl_category_id": "1",
												"company_id": null,
												"company_name": null,
												"travel_agent_id": 46,
												"travel_agent_name": "Booking.com",
												"travel_agent_commission_total": "44.50",
												"booking_reference_id": "1234567890",
												"tariff_name": "BOOK NOW",
												"tariff_total": "400.00",
												"tariffs_quoted": [
												    {
												        "stay_date": "2022-12-03",
												        "label": "Standard",
												        "tariff_applied_id": 2,
												        "original_amount": "110.00",
												        "calculated_amount": "100.00"
												    },
												    {
												        "stay_date": "2022-12-04",
												        "label": "Standard",
												        "tariff_applied_id": 2,
												        "original_amount": "110.00",
												        "calculated_amount": "100.00"
												    },
												    {
												        "stay_date": "2022-12-05",
												        "label": "Standard",
												        "tariff_applied_id": 2,
												        "original_amount": "110.00",
												        "calculated_amount": "100.00"
												    }
												],
												"inventory_items": [{
													"description": "Champagne",
													"stay_date": "2022-12-03",
													"stay_cost_contribution": "Include",
													"gl_account_id": "4",
													"gl_category_id": "2",
													"amount": "75.00"
												},{
													"description": "Picnic Basket",
													"stay_date": "2022-12-03",
													"stay_cost_contribution": "Increase",
													"gl_account_id": "4",
													"gl_category_id": "2",
													"amount": "125.00"
												}],
												"discount_id": "1",
												"discount_name": "Member Discount",
												"discount_total": "80.00",
												"discounts": [{
													"discount_id": "1",
													"discount_name": "Member Discount",
													"discount_total": "20.00",
												}],
												"account_id": "14042",
												"default_client_account_id": "14042",
												"account_balance": "99.00",
												"auto_billing_limit": null,
												"site_id": "1",
												"site_name": "DC001",
												"site_status": "Clean",
												"category_id": "1",
												"category_name": "Standard Cabin (2BR) - A",
												"custom_fields": [{
													"id": 2,
													"type": "text",
													"label": "Custom Text",
													"value": "Custom Value"
												}],
												"guests": [{
													"guest_id": "1",
													"title": "Mr",
													"firstname": "John",
													"lastname": "Doe",
													"othername": "",
													"gender": null,
													"date_of_birth": null,
													"company_id": null,
													"company_name": null,
													"date_created": "2022-12-01 11:30:00",
													"modified_when": "2022-12-01 00:00:00",
													"last_note_when": "2022-12-01 00:00:00",
													"blacklisted_when": "2022-12-02 00:00:00",
													"vip_when": null,
													"account_id": "13783",
													"account_balance": "15.00",
													"auto_billing_limit": null,
													"primary_client": "1",
													"street": "Level 2, 9 Ouyan Street",
													"city": "Surfers Paradise",
													"state": "Queensland (QLD)",
													"postcode": "4217",
													"country": "Australia",
													"contact_details": [{
														"id": 1,
														"type": "phone",
														"content": "0756554600",
														"notes": "",
														"allow_transactional": "1",
														"allow_marketing": "1"
													},{
														"id": 2,
														"type": "email",
														"content": "[email protected]",
														"notes": "",
														"allow_transactional": "1",
														"allow_marketing": "0"
													}],
													"custom_fields": [{
														"id": 1,
														"type": "text",
														"label": "My Test Field",
														"value": "Something"
													}],
													"membership_details": [{
														"type": "Testing Service",
														"type_id": "2",
														"content": "1234567",
														"expiry_date": "2023-09-02"
													}],
													"equipment": [
														{
															"id": "26",
															"equipment_name": "My Honda",
															"equipment_make": "Honda",
															"equipment_model": "Accord",
															"equipment_type_id": "1",
															"equipment_type_name": "car",
															"equipment_length": "5.00",
															"equipment_width": "2.00",
															"equipment_height": "2.00",
															"equipment_registration": "222ABC",
															"equipment_registration_expiry": "2023-09-02"
														}
													],
													"dietary_requirements": [
														"1",
														"2"
													],
													"notes": [{
														"type_id": "1",
														"content": "This is my Guest note",
														"created_when": "2022-12-01 11:30:00",
														"created_by": "11",
														"updated_when": "2022-12-02 00:00:00",
														"updated_by": "5"
													}],
													"account_breakdown": [{
														"name": "Accommodation",
														"gl_category_id": "1",
														"balance": "7.00"
													},{
														"name": "Extras",
														"gl_category_id": "2",
														"balance": "8.00"
													}]
												}],
												"equipment": [],
												"notes": [{
													"type_id": "1",
													"content": "This is my Booking note",
													"created_when": "2022-12-01 11:30:00",
													"created_by": "11",
													"updated_when": "2022-12-02 00:00:00",
													"updated_by": "5"
												}]
												"payment_plans": [],
												"access_codes": [{
													"id": "1017",
													"card_id": "354",
													"access_code": "689323",
													"type": "bookings",
													"type_id": "11033",
													"description": "Access Card: 5",
													"car_rego": "",
													"period_from": "2022-12-03 14:00:00",
													"period_to": "2022-12-07 10:00:00",
													"area_id": "18",
													"created_when": "2022-12-01 11:30:00",
													"cancelled_when": null,
													"cancelled_reason": "",
													"cancelled_by": "0",
													"access_code_status": null,
													"area_name": "All Access"
												}],
												"bookings_group_id": null,
												"bookings_group_name": null,
												"booking_cancelled": null,
												"booking_cancelled_reason_id": null,
												"booking_cancelled_reason_name": null,
												"account_breakdown": [{
													"name": "Accommodation",
													"gl_category_id": "1",
													"balance": "90.00"
												},{
													"name": "Extras",
													"gl_category_id": "2",
													"balance": "9.00"
												}]
											},{
												"booking_id": 11034,
												"booking_arrival": "2022-12-03 14:00:00",
												"booking_departure": "2023-04-03 10:00:00",
												"booking_eta": "15:00",
												"booking_length": "121",
												"booking_status": "Confirmed",
												"booking_checkedin": null,
												"booking_checkedout": null,
												"booking_adults": 2,
												"booking_children": 0,
												"booking_infants": 0,
												"booking_animals": 0,
												"booking_total": "80.00",
												"booking_method_id": null,
												"booking_method_name": "None",
												"booking_source_id": null,
												"booking_source_name": "None",
												"booking_reason_id": 4,
												"booking_reason_name": "Permanent",
												"booking_demographic_id": null,
												"booking_demographic_name": "None",
												"booking_market_segment_id": null,
												"booking_market_segment_name": "None",
												"booking_parent_source_id": "2",
												"booking_parent_source_name": "Long Term",
												"booking_placed": "2022-12-01 11:30:00",
												"booking_booked_by": "NewBook Support",
												"gl_account_id": "1",
												"gl_category_id": "1",
												"company_id": null,
												"company_name": null,
												"travel_agent_id": null,
												"travel_agent_name": null,
												"travel_agent_commission_total": "0.00",
												"booking_reference_id": "",
												"tariff_name": "",
												"tariff_total": "1728.57"
												"inventory_items": [],
												"discount_id": null,
												"discount_name": "None",
												"discount_total": "0.00",
												"discounts": [],
												"account_id": "14032",
												"default_client_account_id": "14043",
												"account_balance": "0.00",
												"auto_billing_limit": null,
												"site_id": "2",
												"site_name": "DC002",
												"site_status": "Clean",
												"category_id": "1",
												"category_name": "Standard Cabin (2BR) - A",
												"custom_fields": [],
												"guests": [{
													"guest_id": "1",
													"title": "Mr",
													"firstname": "John",
													"lastname": "Doe",
													"othername": "",
													"gender": null,
													"date_of_birth": null,
													"company_id": null,
													"company_name": null,
													"date_created": "2022-12-01 11:30:00",
													"modified_when": "2022-12-01 00:00:00",
													"last_note_when": "2022-12-01 00:00:00",
													"blacklisted_when": "2022-12-02 00:00:00",
													"vip_when": null,
													"account_id": "13783",
													"account_balance": "15.00",
													"auto_billing_limit": null,
													"primary_client": "1",
													"street": "Level 2, 9 Ouyan Street",
													"city": "Surfers Paradise",
													"state": "Queensland (QLD)",
													"postcode": "4217",
													"country": "Australia",
													"contact_details": [{
														"id": 1,
														"type": "phone",
														"content": "0756554600",
														"notes": "",
														"allow_transactional": "1",
														"allow_marketing": "1"
													},{
														"id": 2,
														"type": "email",
														"content": "[email protected]",
														"notes": "",
														"allow_transactional": "1",
														"allow_marketing": "0"
													}],
													"custom_fields": [{
														"id": 1,
														"type": "text",
														"label": "My Test Field",
														"value": "Something"
													}],
													"membership_details": [{
														"type": "Testing Service",
														"type_id": "2",
														"content": "1234567",
														"expiry_date": "2023-09-02"
													}],
													"equipment": [
														{
															"id": "26",
															"equipment_name": "My Honda",
															"equipment_make": "Honda",
															"equipment_model": "Accord",
															"equipment_type_id": "1",
															"equipment_type_name": "car",
															"equipment_length": "5.00",
															"equipment_width": "2.00",
															"equipment_height": "2.00",
															"equipment_registration": "222ABC",
															"equipment_registration_expiry": "2023-09-02"
														}
													],
													"dietary_requirements": [
														"1",
														"2"
													],
													"notes": [{
														"type_id": "1",
														"content": "This is my Guest note",
														"created_when": "2022-12-01 11:30:00",
														"created_by": "11",
														"updated_when": "2022-12-02 00:00:00",
														"updated_by": "5"
													}],
													"account_breakdown": [{
														"name": "Accommodation",
														"gl_category_id": "1",
														"balance": "7.00"
													},{
														"name": "Extras",
														"gl_category_id": "2",
														"balance": "8.00"
													}]
												}],
												"equipment": [
													{
														"id": "26",
														"equipment_name": "My Honda",
														"equipment_make": "Honda",
														"equipment_model": "Accord",
														"equipment_type_id": "1",
														"equipment_type_name": "car",
														"equipment_length": "5.00",
														"equipment_width": "2.00",
														"equipment_height": "2.00",
														"equipment_registration": "222ABC",
														"equipment_registration_expiry": "2022-12-03"
													}
												],
												"notes": [{
													"type_id": "1",
													"content": "This is my Booking note",
													"created_when": "2022-12-01 11:30:00",
													"created_by": "11",
													"updated_when": "2022-12-02 00:00:00",
													"updated_by": "5"
												}]
												"payment_plans": [{
													"booking_id": "11034",
													"billing_cycle": "week",
													"instalment_count": "8",
													"instalment_attempts": "1",
													"instalment_amount": "216.07",
													"admin_fee_amount": "0.00",
													"authorisation_type": "cc_authorisations",
													"next_run": "2022-12-08",
													"status": "uptodate"
												}],
												"access_codes": [{
													"id": "1018",
													"card_id": "355",
													"access_code": "753093",
													"type": "bookings",
													"type_id": "11034",
													"description": "Access Card: 6",
													"car_rego": "",
													"period_from": "2022-12-03 14:00:00",
													"period_to": "2023-04-03 10:00:00",
													"area_id": "18",
													"created_when": "2022-12-01 11:30:00",
													"cancelled_when": null,
													"cancelled_reason": "",
													"cancelled_by": "0",
													"access_code_status": null,
													"area_name": "All Access"
												}],
												"bookings_group_id": null,
												"bookings_group_name": null,
												"booking_cancelled": null,
												"booking_cancelled_reason_id": null,
												"booking_cancelled_reason_name": null,
												"account_breakdown": [{
													"name": "Accommodation",
													"gl_category_id": "1",
													"balance": "0.00"
												},{
													"name": "Extras",
													"gl_category_id": "2",
													"balance": "0.00"
												}]
											}],
											"message": ""
										}
									
								
AnchorBookings: Get Details

Retrieve the details of a single Booking.

Request Notes:

booking_id must be provided to retrieve the Booking.

Send account_breakdown as true to see the balance of each associated Sub Client Account (gl_category).

Send access_code_mappings as true to also return a list of Access Code mapping details to other software integrations such as Access Control Systems.

Response Notes:

The returned data from this request is identical to Bookings: List but for the specific Booking alone.

If no such Booking ID exists, the success response parameter will be "false" and no data will be returned.

Bookings: Get Details Example

Request URL

https://api.newbook.cloud/rest/bookings_get

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"booking_id": 11033
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"booking_id": 11033,
												"booking_arrival": "2022-12-03 14:00:00",
												"booking_departure": "2022-12-07 10:00:00",
												"booking_eta": "15:00",
												"booking_length": "4",
												"booking_status": "Confirmed",
												"booking_checkedin": null,
												"booking_checkedout": null,
												"booking_adults": 2,
												"booking_children": 0,
												"booking_infants": 0,
												"booking_animals": 0,
												"booking_total": "445.00",
												"booking_method_id": 2,
												"booking_method_name": "Booking.com",
												"booking_source_id": 5,
												"booking_source_name": "Booking.com",
												"booking_reason_id": 1,
												"booking_reason_name": "Business",
												"booking_demographic_id": null,
												"booking_demographic_name": "None",
												"booking_market_segment_id": null,
												"booking_market_segment_name": "None",
												"booking_parent_source_id": "1",
												"booking_parent_source_name": "Short Term",
												"booking_placed": "2022-12-01 11:30:00",
												"booking_booked_by": "NewBook Support",
												"gl_account_id": "1",
												"gl_category_id": "1",
												"company_id": null,
												"company_name": null,
												"travel_agent_id": 46,
												"travel_agent_name": "Booking.com",
												"travel_agent_commission_total": "44.50",
												"booking_reference_id": "1234567890",
												"tariff_name": "BOOK NOW",
												"tariff_total": "400.00",
												"tariffs_quoted": [
												    {
												        "stay_date": "2022-12-03",
												        "label": "Standard",
												        "tariff_applied_id": 2,
												        "original_amount": "110.00",
												        "calculated_amount": "100.00"
												    },
												    {
												        "stay_date": "2022-12-04",
												        "label": "Standard",
												        "tariff_applied_id": 2,
												        "original_amount": "110.00",
												        "calculated_amount": "100.00"
												    },
												    {
												        "stay_date": "2022-12-05",
												        "label": "Standard",
												        "tariff_applied_id": 2,
												        "original_amount": "110.00",
												        "calculated_amount": "100.00"
												    }
												],
												"inventory_items": [{
													"description": "Champagne",
													"stay_date": "2022-12-03",
													"stay_cost_contribution": "Include",
													"gl_account_id": "4",
													"gl_category_id": "2",
													"amount": "75.00"
												},{
													"description": "Picnic Basket",
													"stay_date": "2022-12-03",
													"stay_cost_contribution": "Increase",
													"gl_account_id": "4",
													"gl_category_id": "2",
													"amount": "125.00"
												}],
												"discount_id": "1",
												"discount_name": "Member Discount",
												"discount_total": "80.00",
												"discounts": [{
													"discount_id": "1",
													"discount_name": "Member Discount",
													"discount_total": "20.00",
												}],
												"account_id": "14042",
												"default_client_account_id": "14042",
												"account_balance": "99.00",
												"auto_billing_limit": null,
												"site_id": "1",
												"site_name": "DC001",
												"site_status": "Clean",
												"category_id": "1",
												"category_name": "Standard Cabin (2BR) - A",
												"custom_fields": [{
													"id": 2,
													"type": "text",
													"label": "Custom Text",
													"value": "Custom Value"
												}],
												"guests": [{
													"guest_id": "1",
													"title": "Mr",
													"firstname": "John",
													"lastname": "Doe",
													"othername": "",
													"gender": null,
													"date_of_birth": null,
													"company_id": null,
													"company_name": null,
													"date_created": "2022-12-01 11:30:00",
													"modified_when": "2022-12-01 00:00:00",
													"last_note_when": "2022-12-01 00:00:00",
													"blacklisted_when": "2022-12-02 00:00:00",
													"vip_when": null,
													"account_id": "13783",
													"account_balance": "15.00",
													"auto_billing_limit": null,
													"primary_client": "1",
													"street": "Level 2, 9 Ouyan Street",
													"city": "Surfers Paradise",
													"state": "Queensland (QLD)",
													"postcode": "4217",
													"country": "Australia",
													"contact_details": [{
														"id": 1,
														"type": "phone",
														"content": "0756554600",
														"notes": "",
														"allow_transactional": "1",
														"allow_marketing": "1"
													},{
														"id": 2,
														"type": "email",
														"content": "[email protected]",
														"notes": "",
														"allow_transactional": "1",
														"allow_marketing": "0"
													}],
													"custom_fields": [{
														"id": 1,
														"type": "text",
														"label": "My Test Field",
														"value": "Something"
													}],
													"membership_details": [{
														"type": "Testing Service",
														"type_id": "2",
														"content": "1234567",
														"expiry_date": "2023-09-02"
													}],
													"equipment": [
														{
															"id": "26",
															"equipment_name": "My Honda",
															"equipment_make": "Honda",
															"equipment_model": "Accord",
															"equipment_type_id": "1",
															"equipment_type_name": "car",
															"equipment_length": "5.00",
															"equipment_width": "2.00",
															"equipment_height": "2.00",
															"equipment_registration": "222ABC",
															"equipment_registration_expiry": "2023-09-02"
														}
													],
													"dietary_requirements": [
														"1",
														"2"
													],
													"notes": [{
														"type_id": "1",
														"content": "This is my Guest note",
														"created_when": "2022-12-01 11:30:00",
														"created_by": "11",
														"updated_when": "2022-12-02 00:00:00",
														"updated_by": "5"
													}]
												}],
												"equipment": [],
												"notes": [{
													"type_id": "1",
													"content": "This is my Booking note",
													"created_when": "2022-12-01 11:30:00",
													"created_by": "11",
													"updated_when": "2022-12-02 00:00:00",
													"updated_by": "5"
												}]
												"payment_plans": [],
												"access_codes": [{
													"id": "1017",
													"card_id": "354",
													"access_code": "689323",
													"type": "bookings",
													"type_id": "11033",
													"description": "Access Card: 5",
													"car_rego": "",
													"period_from": "2022-12-03 14:00:00",
													"period_to": "2022-12-07 10:00:00",
													"area_id": "18",
													"created_when": "2022-12-01 11:30:00",
													"cancelled_when": null,
													"cancelled_reason": "",
													"cancelled_by": "0",
													"access_code_status": null,
													"area_name": "All Access"
												}],
												"bookings_group_id": null,
												"bookings_group_name": null,
												"booking_cancelled": null,
												"booking_cancelled_reason_id": null,
												"booking_cancelled_reason_name": null
											},
											"message": ""
										}
									
								
AnchorBookings: Retrieve Current in Site

Check a particular Site to see if a Guest is currently In-House

Request Notes:

site_id or site_name must be provided. If you use site_name it must match character for character.

Response Notes:

The returned data from this request is identical to Bookings: List but for the specific Booking alone.

If no such Site exists, the success response parameter will be "false" and no data will be returned.

Bookings: Retrieve Current in Site Example

Request URL

https://api.newbook.cloud/rest/site_inhouse_booking

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"site_name": "101"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"booking_id": 11033,
												"booking_arrival": "2022-12-03 14:00:00",
												"booking_departure": "2022-12-07 10:00:00",
												"booking_eta": "15:00",
												"booking_length": "4",
												"booking_status": "Confirmed",
												"booking_checkedin": null,
												"booking_checkedout": null,
												"booking_adults": 2,
												"booking_children": 0,
												"booking_infants": 0,
												"booking_animals": 0,
												"booking_total": "445.00",
												"booking_method_id": 2,
												"booking_method_name": "Booking.com",
												"booking_source_id": 5,
												"booking_source_name": "Booking.com",
												"booking_reason_id": 1,
												"booking_reason_name": "Business",
												"booking_demographic_id": null,
												"booking_demographic_name": "None",
												"booking_market_segment_id": null,
												"booking_market_segment_name": "None",
												"booking_parent_source_id": "1",
												"booking_parent_source_name": "Short Term",
												"booking_placed": "2022-12-01 11:30:00",
												"booking_booked_by": "NewBook Support",
												"gl_account_id": "1",
												"gl_category_id": "1",
												"company_id": null,
												"company_name": null,
												"travel_agent_id": 46,
												"travel_agent_name": "Booking.com",
												"travel_agent_commission_total": "44.50",
												"booking_reference_id": "1234567890",
												"tariff_name": "BOOK NOW",
												"tariff_total": "400.00",
												"tariffs_quoted": [
												    {
												        "stay_date": "2022-12-03",
												        "label": "Standard",
												        "tariff_applied_id": 2,
												        "original_amount": "110.00",
												        "calculated_amount": "100.00"
												    },
												    {
												        "stay_date": "2022-12-04",
												        "label": "Standard",
												        "tariff_applied_id": 2,
												        "original_amount": "110.00",
												        "calculated_amount": "100.00"
												    },
												    {
												        "stay_date": "2022-12-05",
												        "label": "Standard",
												        "tariff_applied_id": 2,
												        "original_amount": "110.00",
												        "calculated_amount": "100.00"
												    }
												],
												"inventory_items": [{
													"description": "Champagne",
													"stay_date": "2022-12-03",
													"stay_cost_contribution": "Include",
													"gl_account_id": "4",
													"gl_category_id": "2",
													"amount": "75.00"
												},{
													"description": "Picnic Basket",
													"stay_date": "2022-12-03",
													"stay_cost_contribution": "Increase",
													"gl_account_id": "4",
													"gl_category_id": "2",
													"amount": "125.00"
												}],
												"discount_id": "1",
												"discount_name": "Member Discount",
												"discount_total": "80.00",
												"discounts": [{
													"discount_id": "1",
													"discount_name": "Member Discount",
													"discount_total": "20.00",
												}],
												"account_id": "14042",
												"default_client_account_id": "14042",
												"account_balance": "99.00",
												"auto_billing_limit": null,
												"site_id": "1",
												"site_name": "DC001",
												"site_status": "Clean",
												"category_id": "1",
												"category_name": "Standard Cabin (2BR) - A",
												"custom_fields": [{
													"id": 2,
													"type": "text",
													"label": "Custom Text",
													"value": "Custom Value"
												}],
												"guests": [{
													"guest_id": "1",
													"title": "Mr",
													"firstname": "John",
													"lastname": "Doe",
													"othername": "",
													"gender": null,
													"date_of_birth": null,
													"company_id": null,
													"company_name": null,
													"date_created": "2022-12-01 11:30:00",
													"modified_when": "2022-12-01 00:00:00",
													"last_note_when": "2022-12-01 00:00:00",
													"blacklisted_when": "2022-12-02 00:00:00",
													"vip_when": null,
													"account_id": "13783",
													"account_balance": "15.00",
													"auto_billing_limit": null,
													"primary_client": "1",
													"street": "Level 2, 9 Ouyan Street",
													"city": "Surfers Paradise",
													"state": "Queensland (QLD)",
													"postcode": "4217",
													"country": "Australia",
													"contact_details": [{
														"id": 1,
														"type": "phone",
														"content": "0756554600",
														"notes": "",
														"allow_transactional": "1",
														"allow_marketing": "1"
													},{
														"id": 2,
														"type": "email",
														"content": "[email protected]",
														"notes": "",
														"allow_transactional": "1",
														"allow_marketing": "0"
													}],
													"custom_fields": [{
														"id": 1,
														"type": "text",
														"label": "My Test Field",
														"value": "Something"
													}],
													"membership_details": [{
														"type": "Testing Service",
														"type_id": "2",
														"content": "1234567",
														"expiry_date": "2023-09-02"
													}],
													"equipment": [
														{
															"id": "26",
															"equipment_name": "My Honda",
															"equipment_make": "Honda",
															"equipment_model": "Accord",
															"equipment_type_id": "1",
															"equipment_type_name": "car",
															"equipment_length": "5.00",
															"equipment_width": "2.00",
															"equipment_height": "2.00",
															"equipment_registration": "222ABC",
															"equipment_registration_expiry": "2023-09-02"
														}
													],
													"dietary_requirements": [
														"1",
														"2"
													],
													"notes": [{
														"type_id": "1",
														"content": "This is my Guest note",
														"created_when": "2022-12-01 11:30:00",
														"created_by": "11",
														"updated_when": "2022-12-02 00:00:00",
														"updated_by": "5"
													}]
												}],
												"equipment": [],
												"notes": [{
													"type_id": "1",
													"content": "This is my Booking note",
													"created_when": "2022-12-01 11:30:00",
													"created_by": "11",
													"updated_when": "2022-12-02 00:00:00",
													"updated_by": "5"
												}]
												"payment_plans": [],
												"access_codes": [{
													"id": "1017",
													"card_id": "354",
													"access_code": "689323",
													"type": "bookings",
													"type_id": "11033",
													"description": "Access Card: 5",
													"car_rego": "",
													"period_from": "2022-12-03 14:00:00",
													"period_to": "2022-12-07 10:00:00",
													"area_id": "18",
													"created_when": "2022-12-01 11:30:00",
													"cancelled_when": null,
													"cancelled_reason": "",
													"cancelled_by": "0",
													"access_code_status": null,
													"area_name": "All Access"
												}],
												"bookings_group_id": null,
												"bookings_group_name": null,
												"booking_cancelled": null,
												"booking_cancelled_reason_id": null,
												"booking_cancelled_reason_name": null
											},
											"message": ""
										}
									
								
AnchorBookings: Pull Availability & Pricing

Retrieve a list of Categories with the number of Sites available and the calculated tariff (cost) for bookings.

A URL is returned (online_booking_url) to convert the enquiry to an actual Booking via NewBook Online.

Request Notes:

You can also provide children, infants and animals as numeric parameters (like the adults parameter).

You can also provide site_id, category_id and category_type_id parameters.

You can also provide length and width parameters to find Sites with matching sizes.

You can supply the following parameters for detailed Site matching based on particular Equipment Sizes or Equipment Types:

  • equipment_length, equipment_width and equipment_height (optional) to filter by sizing.
  • You can also optionally supply equipment_measurement_unit as m for metres (default) or ft for feet, if you need NewBook to convert these for you.
  • equipment_type_ids to filter by supported Equipment Types.

Providing any of the above restricts the results returned.

You can also provide discount_id parameter to have the response factor that provided Discount for the Booking. Please be advised some clients set up a required discount_code too like a "password" to unlock a given discount_id. If that is done, you must supply both to use the Discount.

When discount_id or discount_code parameters are provided, each object in the tariffs_available array will also include discount_success as a string boolean indicating if the Discount has applied to this Tariff, discount_total as a float indicating the Discount amount to be granted, and discount_message which will have a human-readable explanation when discount_success is false.

To see additional information in the response, you can provide daily_mode as "true". When this is done, each object in the tariffs_available array in the response will gain a new key tariffs_quoted, which is an object for each day requested detailing specifics about the price for that day.

								
									"2022-12-03": {
										"label": "Special",
										"type_id": "8",
										"tariff_id": "45",
										"stop_sell": "0",
										"minimum_periods": "7",
										"maximum_periods": "0",
										"base_min_combined": "1",
										"base_max_combined": "7",
										"tariffs_period_id": "19",
										"tariff_applied_id": "480",
										"original_amount": "112.85",
										"calculated_amount": "112.85",
										"base_adult": 0,
										"base_child": 0,
										"base_infant": 0,
										"base_animal": 0,
										"base_combined": "2",
										"base_day_based": "1",
										"additionals_day_based": "0",
										"reset_night_counter": "1",
										"min_days_in_advance": "0",
										"max_days_in_advance": "0",
										"stop_sell_occupancy_percentage": "0",
										"amount": "112.85",
										"dynamic_base": null,
										"extras_combined": "1",
										"special_deal": "0",
										"dynamic": 0,
										"overridden": "standard",
										"close_arrival": 0,
										"close_departure": 0
									}
								
							

In addition, when daily_mode is provided as "true" the sites_available, sites_message, sites_code, and sites_extra_info keys in the response change from a single value into an object with a key/value for each day requested:

								
									"sites_available": {
    "2022-12-03": 2,
    "2022-12-04": 5,
    "2022-12-05": 0,
    "2022-12-06": 4,
    "2022-12-07": 4,
    "2022-12-08": 4
},
"sites_message": {
    "2022-12-03": "Minimum Advance Days has not been met, so there are no Sites available",
    "2022-12-04": "Minimum Advance Days has not been met, so there are no Sites available",
    "2022-12-05": "Minimum Advance Days has not been met, so there are no Sites available",
    "2022-12-06": "",
    "2022-12-07": "",
    "2022-12-08": ""
}
"sites_code": {
    "2022-12-03": 8,
    "2022-12-04": 8,
    "2022-12-05": 8,
    "2022-12-06": 0,
    "2022-12-07": 0,
    "2022-12-08": 0
}
"sites_extra_info": {
    "2022-12-03": "3",
    "2022-12-04": "3",
    "2022-12-05": "3",
    "2022-12-06": "",
    "2022-12-07": "",
    "2022-12-08": ""
}
								
							

In addition, when daily_mode is provided as "true" the response will have stay_through_sites_available, stay_through_sites_message, stay_through_sites_code, and stay_through_sites_extra_info per the original keys which would have been returned in the response:

								
									{
										"stay_through_sites_available": 1,
										"stay_through_sites_message": "",
										"stay_through_sites_code": 0,
										"stay_through_sites_extra_info": ""
									}
								
							

Another parameter you can provide is return_sites which when "true" changes sites_available in the response from just a number to an array of objects detailing the available Sites:

								
									"sites_available": [{
										"site_id": "6",
										"site_name": "Room 5",
										"category_id": "16",
										"category_name": "Single Room",
										"period_from": "2022-12-03 14:00:00",
										"period_to": "2022-12-10 10:00:00",
										"gl_account_id": "20",
										"gl_category_id": "1",
										"tax_free": "1",
										"vacancy_length": 1080
									},{
										"site_id": "15",
										"site_name": "Room 8",
										"category_id": "16",
										"category_name": "Single Room",
										"period_from": "2022-12-03 14:00:00",
										"period_to": "2022-12-10 10:00:00",
										"gl_account_id": "20",
										"gl_category_id": "1",
										"tax_free": "1",
										"vacancy_length": 45
									}],
								
							

Another parameter you can provide is return_membership_discount_pricing which when "true" calculates all the applicable Membership Discounts in each tariffs_available object:

								
									 "membership_discount_pricing": [
										{
											"discount_id": "1",
											"discount_name": "Membership Discount",
											"discount_amount": 90.00,
											"membership_id": "2",
											"membership_name": "your membership program",
											"membership_description": "

Get a great discount by using your Membership!

", "membership_icon": "https://driveau.newbook.cloud/instance_manager_e240bdef70fa7392a0332a76c7431a46_5f8532ea266d2.png", "service_class": "Membership_Service_NAME", "service_level": "Your Configured Membership Service Level" } ]

If the membership_discount_pricing is empty it means the calculated discount amount was $0, or there is no applicable membership discount for this combination of Category and Tariff.


Another parameter you can provide is return_general_discount_pricing which when "true" calculates all the applicable Discounts in each tariffs_available object, without needing to perform this request with the discount_id parameter:

								
									 "discount_pricing": [
										{
											"discount_id": "2",
											"discount_code": "gen_disc",
											"discount_name": "General Discount",
											"discount_amount": 100.00,
										}
									]
								
							

If you were to redirect guests to NewBook Online, you could use the discount_code returned above to have the booking engine grant that same discount.

If the discount_pricing is empty it means the calculated discount amount was $0, or there is no applicable discount for this combination of Category and Tariff.


Another parameter you can provide is return_promo_code_pricing which when "true" will return all available tariffs, even the ones ordinarily locked behind a promo_code requirement. Such tariffs are returned with the others in the tariffs_available array:

								
									 "tariffs_available": [
										{
											"tariff_label": "Promotional Tariff",
											"site_selection_allowed": true,
											"site_selection_fee": "3.00",
											"tariff_short_description": "Special Tariff",
											"tariff_success": "true",
											"tariff_message": "",
											"tariff_code": 0,
											"tariff_extra_info": "",
											"promo_code": "special",
											"inventory_items": [],
											"deposits": [],
											"tariff_total": 120,
										}
									]
								
							

Response Notes:

Availability is returned per-Category. For each Category in the data returned, the below are useful to understand why sites_available may be "0":

  • sites_message provides you with the internal reasoning NewBook has used to determine availability - you can present this message to your Guests if you like
  • sites_code is a numeric representation of sites_message for you to use in constructing your own messages to your Guests it you prefer
    sites_codeReasoning
    0No error occurred - a successful result
    1Requested parameters were invalid and calculation cannot be done
    2The Site is not yet opened, or already closed, over the date range requested
    3NewBook has computed there is no availability for the requested parameters
    4There is no availability due to a Special Date blocking
    5An Allotment takes the last remaining availability
    6The Category is configured for Dirty Sites to be exempt from availability, and the Site is dirty, therefore it is unavailable (same-day arrivals only)
    7The Instance Setting for Daily Stop Sell Time has passed (same-day arrivals only)
    8The Instance Setting Minimum Advance Days for Online Bookings has not been met
    9The Instance Setting Maximum Advance Days for Online Bookings has been exceeded
  • sites_extra_info is populated when there is a specific value in relation to sites_code above. It can be an integer, a date, a string, etc.

In addition, each Category returns one or more Tariffs. For each Category -> Tariff in the data returned, the below are useful to understand why tariff_success may be "false":

  • tariff_message provides you with the internal reasoning NewBook has used to determine why this tariff is not applicable - you can present this message to your Guests if you like
  • tariff_code is a numeric representation of tariff_message for you to use in constructing your own messages to your Guests it you prefer
    tariff_codeReasoning
    0No error occurred - a successful result
    1Requested parameters were invalid and calculation cannot be done
    2The Tariff Minimum Occupants has not been met
    3The Tariff Maximum Occupants has been exceeded
    4The Tariff Minimum Days in Advance for Bookings has not been met
    5The Tariff Maximum Days in Advance for Bookings has been exceeded
    6The Tariff Minimum Nights for Bookings has not been met
    7The Tariff Maximum Nights for Bookings has been exceeded
    8The Tariff is not applicable due to a Special Date blocking
    9The Tariff has a Closed to Arrival Override for the days requested - Bookings cannot use this Tariff to arrive on the date requested
    10The Tariff has a Closed to Departure Override for the days requested - Bookings cannot use this Tariff to depart on the date requested
    11The Tariff has a Stop-Sold Override for the days requested
  • tariff_extra_info is populated when there is a specific value in relation to tariff_code above. It can be an integer, a date, a string, etc.
  • online_cart_url is populated when the Tariff and Category are available for Booking. Following this link will open up a Booking Cart on NewBook Online. This first erases any cart data the guest may have assembled.

The sort key is returned, in both object and array return, to indicate the sorting order the Instance has established for the categories returned. This should be respected in your code as the sequential order the Instance intended for the categories returned.

inventory_items will be returned if they are associated with the Tariff or Category inside NewBook. Beyond the name and amount, they expose two important aspects:

  • amount_already_included_in_tariff_total: when "true", the Inventory Item amount is already factored in the tariff_total, however when "false" the expectation is your software will add the amount into the total cost - and make the Guest aware of this addition
  • discounts_apply: whether or not the Inventory Item amount has been discounted if the Booking has a discount associated. Some Inventory Items are just not eligable for this e.g. Security Bonds. This setup is up to the Instance.

This request is one which can return either an array of objects or an object of objects (default) identified by their Category ID. This can be controlled by adding

{"return": "array"}
to your request parameters. When provided, data is returned as requested.

Bookings: Pull Availability & Pricing Example

Request URL

https://api.newbook.cloud/rest/bookings_availability_pricing

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"period_from": "2022-12-03",
											"period_to": "2022-12-10",
											"adults": 2,
											"daily_mode": "false"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"16": {
													"category_id": 16,
													"category_name": "Single Room",
													"sites_available": 2,
													"sites_message": "",
													"sites_code": 0,
													"sites_extra_info": "",
													"online_booking_url": "your_online_booking_url_here?available_from=1442239200&available_to=1442887939&force_category_id=16",
													"tariffs_available": [{
														"tariff_label": "Special",
														"tariff_short_description": "Special Rate available for the Peak Seasons of the year",
														"tariff_success": "true",
														"tariff_message": "",
														"tariff_code": 0,
														"tariff_extra_info": "",
														"tariff_total": "789.95",
														"tariff_inclusions": [{
															"dates": "03 Dec 2022 to 10 Dec 2022",
															"html": "<p>Includes Breakfast</p>"
														}],
														"inventory_items": [{
															"inventory_item_id": "2",
															"item_type": "charges",
															"description": "Security Bond",
															"amount": "100.00",
															"amount_already_included_in_tariff_total": "false",
															"discounts_apply": "0"
														}],
														"online_cart_url": "your_online_booking_url_here?rest_api_data=hj234brt89724bn49"
													},{
														"tariff_label": "Theme Park Package",
														"tariff_short_description": "Stay and Play at our local theme parks",
														"tariff_success": "false",
														"tariff_message": "There is a minimum stay length of 10 Nights",
														"tariff_code": 6,
														"tariff_extra_info": "10",
														"tariff_total": "1519.00",
														"inventory_items": [{
															"inventory_item_id": "4",
															"item_type": "charges",
															"description": "Theme Park Tickets",
															"amount": "50.00",
															"amount_already_included_in_tariff_total": "true",
															"discounts_apply": "0"
														}]
													}],
													"sort": 1
												},
												"5": {
													"category_id": 5,
													"category_name": "Double Room",
													"sites_available": 0,
													"sites_message": "Minimum Advance Days has not been met, so there are no Sites available",
													"sites_code": 8,
													"sites_extra_info": "3",
													"online_booking_url": "your_online_booking_url_here?available_from=1442239200&available_to=1442887939&force_category_id=5",
													"tariffs_available": [{
														"tariff_label": "Standard",
														"tariff_short_description": "Standard pricing for regular season",
														"tariff_success": "true",
														"tariff_message": "",
														"tariff_code": 0,
														"tariff_extra_info": "",
														"tariff_total": "900",
														"inventory_items": []
													}],
													"sort": 2
												}
											},
											"message": ""
										}
									
								
AnchorBookings: Create Availability Email

An Availability Email is NewBook recording a set of parameters for a potential Booking, such as arrival and departure dates, number of adults, children, infants etc. and a particular Category and Tariff.

A URL is returned (online_booking_url) to convert the enquiry to an actual Booking via NewBook Online. Thanks to most of the data being pre-filled, there is very little input required from the Guest to complete a Booking.

Calling this method will create an Availability Email, but despite its name this will not send an email to the Guest.

Request Notes:

You can also provide children, infants and animals as numeric parameters (like the adults parameter).

Regarding specifying a Guest:

  • If you have already used the guests_create request to create a new Guest, or the Guests: List request to find an existing Guest, you can simply provide guest_id and the other guests_create parameters will not be used or required.
  • However if you are trying to match an existing Guest, guest_firstname, guest_lastname, address_street, address_city and address_postcode are all required, and only one of guest_email or guest_phone is required, but both are acceptable.
  • Finally if you want to create a new Guest, guest_firstname, guest_lastname are required, and only one of guest_email or guest_phone is required, but both are acceptable.

expire_quote_on is optional, and it controls the date from which the Guest cannot accept the offer via NewBook Online. It defaults to +2 weeks from the date of the Availability Email (this default can be changed by the Instance in NewBook Settings).

source_id is optional, and is used on the resulting Booking if the Guest accepts the offer via NewBook Online. It must be a valid source_id or the request will fail.

Response Notes:

The response for this request is identical to the response for Bookings: Pull Availability & Pricing, except for the below:

In comparison to the Bookings: Pull Availability & Pricing request, the data key in the response of this method is an array of objects by default, not an object of objects.

This request is one which can return either an array of objects (default) or an object of objects identified by their Category ID. This can be controlled by adding

{"return": "object"}
to your request parameters. When provided, data is returned as requested.

Bookings: Create Availability Email Example

Request URL

https://api.newbook.cloud/rest/bookings_availability_email

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"period_from": "2022-12-03",
											"period_to": "2022-12-10",
											"guest_firstname": "NewBook",
											"guest_lastname": "Support",
											"address_street": "Level 2, 9 Ouyan Street",
											"address_city": "Surfers Paradise",
											"address_postcode": "4217",
											"guest_email": "[email protected]",
											"guest_phone": "0756554600",
											"category_id": [5,16],
											"adults": 2,
											"expire_quote_on": "2015-09-29",
											"source_id": "5"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"category_id": 5,
												"category_name": "Double Room",
												"sites_available": 4,
												"online_booking_url": "your_online_booking_url_here?newbook_api_action=process&category_id=5&availability_email_data=569dff9d56ehy",
												"tariffs_available": [{
													"tariff_label": "Regular",
													"tariff_success": "true",
													"tariff_message": "",
													"tariff_code": 0,
													"tariff_extra_info": "",
													"tariff_total": "1200.00"
												}]
											},{
												"category_id": 16,
												"category_name": "Single Room",
												"sites_available": 2,
												"online_booking_url": "your_online_booking_url_here?newbook_api_action=process&category_id=5&availability_email_data=569dff9c90afa",
												"tariffs_available": [{
													"tariff_label": "Special",
													"tariff_success": "true",
													"tariff_message": "",
													"tariff_code": 0,
													"tariff_extra_info": "",
													"tariff_total": "790.00"
												}]
											}],
											"message": ""
										}
									
								
AnchorBookings: Create

Bookings can be submitted to NewBook by using this method. Please note that these are treated equal to NewBook Online bookings and are subject to fees per booking received.

For now, the Guest will not receive an email from this process as it is expected that the implementing code will be responsible for that kind of communication. The Instance will receive an email as per normal for incoming bookings.

Request Notes:

You can also provide children, infants and animals as numeric parameters (like the adults parameter).

You can also provide the category_id for this request to automatically allocate an available Site from that Category, or manually supply site_id either as a string value or an array of strings. NewBook will use only one Site on a resulting Booking, so providing an array is providing "options" - NewBook will validate them all and then use the first valid Site.

You can also provide an array of required_features. This data will be used to find an applicable Site; all provided Features will need to match. If multiple matching Sites are found, NewBook will use the first one. If no matching Sites are found, the request will abort and you will receive a "No availability" response.

Regarding specifying a Guest:

  • If you have already used the guests_create request to create a new Guest, or the Guests: List request to find an existing Guest, you can simply provide guest_id and the other guests_create parameters will not be used or required.
  • However if you are trying to match an existing Guest, guest_firstname, guest_lastname, address_street, address_city and address_postcode are all required, and only one of guest_email or guest_phone is required, but both are acceptable.
  • Finally if you want to create a new Guest, guest_firstname, guest_lastname are required, and only one of guest_email or guest_phone is required, but both are acceptable.

Regarding specifying Equipment:

  • The equipment parameter is optional in creating a booking. However, if provided, it must be in array format, because a booking can have multiple equipment added to it as shown in the example request.
  • The following are the parameters for creating equipment on a booking:
    • equipment_name (required)
    • equipment_make
    • equipment_model
    • equipment_type (must be a number)
    • equipment_length (must be a number)
    • equipment_width (must be a number)
    • equipment_height (must be a number)
    • equipment_registration
    • equipment_registration_expiry
  • The equipment are saved onto the Equipment table and linked to the booking and guest. Please note that if an equipment is being added for an existing guest, the guest_id parameter should be specified, instead of the guest_firstname and guest_lastname parameters. Also note that if the equipment_registration is not specified, a new equipment will be created for the guest.

The following parameters are optional and save onto the Guest:

  • address_street
  • address_city
  • address_postcode
  • address_state_name
  • address_country_name
  • guest_phone
  • guest_email
  • membership_number
  • membership_program
  • membership_expiry
  • dietary_requirements

If specified, dietary_requirements can be provided based on the response to Dietary Requirements request.

The following parameters are optional and save onto the Booking:

  • tariffs_quoted
  • repeat_charges
  • inventory_items
  • status
  • reason_id
  • source_id
  • method_id
  • demographic_id
  • company_id
  • company_staff_id
  • travel_agent_id
  • travel_agent_staff_id
  • discount_id
  • eta
  • notes
  • flagged
  • locked
  • booking_group_id
  • create_charges
  • market_segment_id

If specified, tariffs_quoted must cover the entire date range of the booking and must follow this format:

  • 									[{"specific date":{"tariff_applied_id":sourced from NewBook,"price":number}]
    								
  • tariff_applied_id is optional in each object

If specified, repeat_charges must be a single array and must follow this format:

  • 									[{"interval":amount}]
    								
  • Valid values for interval are day, week, month, or year
  • Valid values for amount are 0 through to 10×1013-1
  • Currently the multiplier is assumed to be 1 e.g. every 1 interval (week) charge amount ($500)

Note: Bookings can have neither of tariffs_quoted or repeat_charges, and therefore be set up with No Billing, but they cannot have both of tariffs_quoted and repeat_charges - please supply only one of the above billing methods.

If specified, inventory_items must follow this format:

  • 									[{
    										"inventory_item_id": sourced from NewBook,
    										"description": text value,
    										"amount": number,
    										"qty": number,
    										"per_adult": number,
    										"per_child": number,
    										"per_infant": number,
    										"per_animal": number,
    										"adults": number,
    										"children": number,
    										"infants": number,
    										"animals": number
    									}]
    								
  • inventory_item_id is required in each array, but everything else is optional

If specified, status must be one of the following (this ordering has no meaning):

  • Arrived
  • Cancelled
  • Confirmed
  • Departed
  • No Guest Data (Incomplete)
  • No-Show
  • Owner Occupied
  • Quote
  • Unconfirmed
  • Waitlist

You should have a proper understanding of what the different statuses are intended to be used for before use. Please contact NewBook Support for more information here.

If not specified, NewBook will use the value given in the Setting Status for Bookings with no payment or failed payment

If specified, notes must be an array, even if only 1 note is delivered.

If specified, booking_group_id must match an existing Bookings Group within NewBook. You can control which Client Account the Booking will bill to by supplying default_client_account_id which must be either "new_id" to denote the Client Account of the Booking about to be created, or a valid Client Account ID (e.g. the Group account). If this is omitted then NewBook will analyse other Bookings in the Group - if any of those bill to themselves, so to will this Booking.

If specified, custom_fields must be based on the response to the Custom Fields request, to retrieve the different Custom Fields set up in the instance:

									
										"custom_fields": [
											{
												"field_id": 2,
												"field_value": 8
											}
										]
									
								

If specified, allow_dirty_arrivals must be "true" or "false". This parameter will tell NewBook whether or not a same day Booking can be placed in a Dirty Site. The Instance controls the default of this on each Category.

If specified, allow_backtoback_bookings must be "true" or "false". This parameter will tell NewBook whether a Booking can be placed if another Booking is Departing on the same day. The Instance controls the default of this, for each day of the week, on each Category.

Response Notes:

account_id in the response can be used to push charges or payments onto the account

Bookings: Create Example

Request URL

https://api.newbook.cloud/rest/bookings_create

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"guest_firstname": "NewBook",
											"guest_lastname": "Support",
											"address_street": "Level 2, 9 Ouyan Street",
											"address_city": "Surfers Paradise",
											"address_postcode": "4217",
											"guest_email": "[email protected]",
											"guest_phone": "0400000000",
											"adults": "1",
											"children": "0",
											"period_from": "2016-10-25",
											"period_to": "2016-10-28",
											"category_id": "4",
											"required_features": [
												14,
												23,
												1
											],
											"tariffs_quoted": {
												"2016-10-25": {"tariff_applied_id": 480, "price": 500},
												"2016-10-26": {"tariff_applied_id": 480, "price": 750},
												"2016-10-27": {"tariff_applied_id": 480, "price": 300}
											},
											"equipment": [
												{
													"equipment_name": "My Honda",
													"equipment_make": "Honda",
													"equipment_model": "Accord",
													"equipment_type": "1",
													"equipment_length": "5",
													"equipment_width": "2",
													"equipment_height": "2",
													"equipment_registration": "222ABC",
										 			"equipment_registration_expiry": "2022-12-03"

												},
												{
													"equipment_name": "My Toyota",
													"equipment_make": "Toyota",
													"equipment_model": "Camry",
													"equipment_type": "1",
													"equipment_length": "4",
													"equipment_width": "2",
													"equipment_height": "1"
												}
											]
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"booking_id": "12345",
												"account_id": "501",
												"guest_id": "40",
												"invoice_ids": [
													"883"
												]
											},
											"message": ""
										}
									
								
AnchorBookings: Update

Update an existing Booking.

Request Notes:

booking_id is required

All other parameters are optional, please see Bookings: Create for more details.

Bookings: Update Example

Request URL

https://api.newbook.cloud/rest/bookings_update

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"booking_id": "12345",
											"period_from": "2016-10-25",
											"period_to": "2016-10-29",
											"tariffs_quoted": {
												"2016-10-25": {"tariff_applied_id": 480, "price": 500},
												"2016-10-26": {"tariff_applied_id": 480, "price": 750},
												"2016-10-27": {"tariff_applied_id": 480, "price": 300},
												"2016-10-28": {"tariff_applied_id": 480, "price": 300}
											},
											"equipment": [
												{
													"equipment_name": "My Honda",
													"equipment_make": "Honda",
													"equipment_model": "Accord",
													"equipment_type": "1",
													"equipment_length": "5",
													"equipment_width": "2",
													"equipment_height": "2",
													"equipment_registration": "222ABC",
										 			"equipment_registration_expiry": "2022-12-03"
												}
											]
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"booking_id": "12345",
												"account_id": "501",
												"guest_id": "40",
											},
											"message": ""
										}
									
								
AnchorBookings: Update Market Segment

Bulk update existing Bookings with a new Market Segment

Request Notes:

booking_id is required

market_segment_id is required and must be a single Market Segment ID

This method will only update the Market Segment field (instead of all fields on a single Booking and the validation involved in that process) allowing for the Market Segment to be updated faster (and in bulk).

Bookings: Update Market Segment Example

Request URL

https://api.newbook.cloud/rest/bookings_update_market_segment

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"booking_id": ["12345","123456"],
											"market_segment_id": "1"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [],
											"message": "Updated 2 Bookings"
										}
									
								
AnchorBookings: Update Booking Source

Bulk update existing Bookings with a new Booking Source.

Request Notes:

booking_id is required and may be either a single ID or an array of IDs. Unmatched IDs will be ignored

source_id is required and must be a single Booking Source ID

This method will only update the Booking Source field and will not alter or update any other field on the Booking. This request is significantly faster than Bookings: Update for bulk updating Booking Source.

Bookings: Update Source Example

Request URL

https://api.newbook.cloud/rest/bookings_update_source

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"booking_id": ["12345","123456"],
											"source_id": "1"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [],
											"message": "Updated 2 Bookings"
										}
									
								
AnchorBooking Sources: List

Pull the list of Booking Sources from within NewBook.

Request Notes:

name is optional and when provided it will restrict the results to the matching Booking Sources

show_inactive is optional and when provided it will include inactive Booking Sources in the response

Booking Sources: List Example

Request URL

https://api.newbook.cloud/rest/bookings_sources

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"name": "test",
											"show_inactive": "false"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": "1",
												"name": "Booking Channels",
												"available_as_parent": "true",
												"parent_id": null,
												"domain_referer": "",
												"active": "1"
											},{
												"id": "2",
												"name": "Expedia",
												"available_as_parent": "false",
												"parent_id": "1",
												"domain_referer": "https://newbook.cloud",
												"active": "1"
											}],
											"message": ""
										}
									
								
AnchorBooking Sources: Create

Create a new Booking Source within NewBook.

Request Notes:

parent_id must be a valid option from the bookings_sources list where available_as_parent is true. This can only be omitted if is_parent is true.

is_parent is optional and when provided as true this request will create a parent Booking Source. parent_id will be ignored if this is set to true.

Booking Sources: Create Example

Request URL

https://api.newbook.cloud/rest/bookings_sources_create

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"parent_id": -1,
											"is_parent": "false",
											"name": "test"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"source_id": "3"
											},
											"message": ""
										}
									
								
AnchorBooking Cancellation Reasons: List

Pull the list of Booking Cancellation Reasons from within NewBook.

Request Notes:

name is optional and when provided it will restrict the results to the matching Booking Cancellation Reasons

show_inactive is optional and when provided it will include inactive Booking Cancellation Reasons in the response

Booking Cancellation Reasons: List Example

Request URL

https://api.newbook.cloud/rest/bookings_cancellation_reasons

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": "1",
												"name": "Change of Plans",
												"source": "guest",
												"active": "1"
											},{
												"id": "2",
												"name": "Staying Elsewhere",
												"source": "instance",
												"active": "1"
											}],
											"message": ""
										}
									
								
AnchorBooking Methods: List

Pull the list of Booking Methods from within NewBook.

Request Notes:

name is optional and when provided it will restrict the results to the matching Booking Methods

Booking Methods: List Example

Request URL

https://api.newbook.cloud/rest/bookings_methods

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"name": "test"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": "1",
												"name": "Walk In"
											},{
												"id": "2",
												"name": "Email"
											}],
											"message": ""
										}
									
								
AnchorBooking Reasons: List

Pull the list of Booking Reasons from within NewBook.

Request Notes:

name is optional and when provided it will restrict the results to the matching Booking Reasons

Booking Reasons: List Example

Request URL

https://api.newbook.cloud/rest/bookings_reasons

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"name": "test"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": "1",
												"name": "Holiday"
											},{
												"id": "2",
												"name": "Conference"
											}],
											"message": ""
										}
									
								
AnchorBooking Demographics: List

Pull the list of Booking Demographics from within NewBook.

Request Notes:

name is optional and when provided it will restrict the results to the matching Booking Demographics

Booking Demographics: List Example

Request URL

https://api.newbook.cloud/rest/bookings_demographics

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"name": "test"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": "1",
												"name": "Singles"
											},{
												"id": "2",
												"name": "Couples"
											}],
											"message": ""
										}
									
								
AnchorBooking Market Segments: List

Pull the list of Booking Market Segments from within NewBook.

Request Notes:

name is optional and when provided it will restrict the results to the matching Booking Market Segments

Booking Market Segments: List Example

Request URL

https://api.newbook.cloud/rest/bookings_market_segments

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"name": "standard"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": "1",
												"name": "Standard - Single",
												"active": "1"
											},{
												"id": "2",
												"name": "Standard - Groups",
												"active": "1"
											}],
											"message": ""
										}
									
								
AnchorBookings Groups: Create

No emails will be sent when creating a Group Booking. These will be handled on an individual basis when adding Bookings to the Group

Request Notes:

Regarding specifying a Guest:

  • If you have already used the guests_create request to create a new Guest, or the Guests: List request to find an existing Guest, you can simply provide guest_id and the other guests_create parameters will not be used or required.
  • However if you are trying to match an existing Guest, guest_firstname, guest_lastname, address_street, address_city and address_postcode are all required, and only one of guest_email or guest_phone is required, but both are acceptable.
  • Finally if you want to create a new Guest, guest_firstname, guest_lastname are required, and only one of guest_email or guest_phone is required, but both are acceptable.

The following parameters are optional and save onto the Guest:

  • address_street
  • address_city
  • address_postcode
  • address_state_name
  • address_country_name
  • guest_phone
  • guest_email
  • membership_number
  • membership_program
  • membership_expiry
  • dietary_requirements

If specified, dietary_requirements can be provided based on the response to Dietary Requirements request.

The following parameters are optional and save onto the Booking Group:

  • inventory_items
  • status
  • notes
  • eta
  • reason_id
  • source_id
  • method_id
  • demographic_id
  • company_id
  • company_staff_id
  • travel_agent_id
  • travel_agent_staff_id
  • discount_id

If specified, inventory_items must follow this format:

  • 									[{
    										"inventory_item_id": sourced from NewBook,
    										"description": text value,
    										"amount": number,
    										"per_adult": number,
    										"per_child": number,
    										"per_infant" :number,
    										"per_animal": number,
    										"adults": number,
    										"children": number,
    										"infants": number,
    										"animals": number
    									}]
    								
  • inventory_item_id is required in each array, but everything else is optional

If specified, status must be one of the following (this ordering has no meaning):

  • Arrived
  • Cancelled
  • Confirmed
  • Departed
  • No Guest Data (Incomplete)
  • No-Show
  • Owner Occupied
  • Quote
  • Unconfirmed
  • Waitlist

You should have a proper understanding of what the different statuses are intended to be used for before use. Please contact NewBook Support for more information here.

If not specified, NewBook will use the value given in the Setting Status for Bookings with no payment or failed payment

If specified, notes must be an array, even if only 1 note is delivered.

Response Notes:

account_id in the response can be used to push charges or payments onto the account

booking_group_id in the response can be used in the bookings_create request to create Bookings in the Group. Remember also to set the default_client_account_id to the Group account_id if you want the Group to handle the billing for your new Booking(s).

Bookings Groups: Create Example

Request URL

https://api.newbook.cloud/rest/bookings_groups_create

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"name": "NewBook Group",
											"guest_firstname": "NewBook",
											"guest_lastname": "Support",
											"address_street": "Level 2, 9 Ouyan Street",
											"address_city": "Surfers Paradise",
											"address_postcode": "4217",
											"guest_email": "[email protected]",
											"guest_phone": "0400000000",
											"period_from": "2016-10-25",
											"period_to": "2016-10-28"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"booking_group_id": "12345",
												"account_id": "501"
											},
											"message": ""
										}
									
								
AnchorRate Override

Add a Rate Override

Request Notes:

The following parameters are required:

  • period_from
  • period_to
  • using_master
    • master - must provide additional master_id parameter
    • standalone - must provide additional category_id parameter
  • active

The following parameters are optional:

  • override_type
    • fixed - must provide these additional parameters:
      • fixed_override
      • fixed_method
    • dynamic - must provide these additional parameters:
      • dynamic_min
      • dynamic_max
      • dynamic_base
      • dynamic_method
      • dynamic_occupancy
      • dynamic_occupancy_min
    • percentage - must provide these additional parameters:
      • percentage_override
      • percentage_method
  • type_id - Rate Type ID. Leaving this blank will apply the Rate Override to all Rate Types - Number
  • category_id - Category ID - Number
  • discounts - If Discounts Apply or Not - "0" or "1"
  • stop_sell - "0" or "1"
  • base_adult - Number
  • base_child - Number
  • base_infant - Number
  • base_animal - Number
  • base_combined - Number
  • minimum_sites_online - Number
  • minimum_periods - Number
  • maximum_periods - Number
  • close_arrival - "0" or "1"
  • close_departure - "0" or "1"
  • adult_amount - Additional Adult Amount - Number
  • child_amount - Additional Child Amount - Number
  • infant_amount - Additional Infant Amount - Number
  • animal_amount - Additional Animal Amount - Number

Rate Override JSON

Request URL

https://api.newbook.cloud/rest/tariff_override

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"period_from": "2023-01-10",
											"period_to": "2023-01-20",
											"using_master": "standalone",
											"active": "1"
											"category_id": "5",
											"type_id": "23",
											"stop_sell": "1"
										}
									
								
Response JSON
									
										{
											"success": "true"
										}
									
								
AnchorDiscounts: List

Pull the list of Discounts from within NewBook.

Request Notes:

name is optional and when provided it will restrict the results to the matching Discounts

Discounts: List Example

Request URL

https://api.newbook.cloud/rest/discounts_list

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here",
							"name": "Demo"
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": [
								"123": {
									"id": "123",
									"name": "Demo",
									"discount_type": "percentage",
									"discount_amount": "8.92",
									"minimum": "5.00",
									"maximum": "10.00",
									"maximum_applies_per_night": "0",
									"minimum_stay_cost": null,
									"min_stay": "0",
									"min_valid_nights": "0",
									"requires_code": "0",
									"daysofweek": [
										"monday",
										"tuesday",
										"wednesday",
										"thursday",
										"friday",
										"saturday",
										"sunday"
									],
									"discount_id": "244",
									"gl_account_id": null,
									"gl_category_id": null,
									"bookings_source_id": null,
									"bookings_market_segment_id": null,
									"active": "1"
								}
							],
							"message": ""
						}
					
				
AnchorDiscounts: Create

Create a new Discount.

Request Notes:

The following parameters are required:

  • name (string) is required
  • discount_type (string) must be from the following list:
    • percentage
    • nights
    • cheapest_night_percentage
    • nights_average
    • fixed
    • fixed_per_night
    • fixed_per_adult
    • fixed_per_child
    • fixed_per_person
    • fixed_per_adult_per_night
    • fixed_per_child_per_night
    • fixed_per_person_per_night
  • discount_amount (float)
  • minimum (float)
  • maximum (float)
  • active (bool)

The following parameters are optional:

  • minimum_stay_cost (float)
  • min_valid_nights (int)
  • gl_account_id (int) must match a valid GL Account ID if provided
  • gl_category_id (int) must match a valid GL Category ID if provided
  • bookings_source_id (int) must match a valid Booking Source ID if provided
  • bookings_market_segment_id (int) must match a valid Booking Market Segment ID if provided
  • daysofweek (array) should be an array containing lower case day names
    • monday
    • tuesday
    • wednesday
    • thursday
    • friday
    • saturday
    • sunday
  • requires_code (bool) should discount codes be required for this discount
  • discount_codes (array) of discount code objects
    • id (int) should be supplied if updating an existing code
    • code (string) the discount code
    • available_from (string) must be a valid date if provided
    • available_to (string) must be a valid date if provided
    • staying_from (string) must be a valid date if provided
    • staying_to (string) must be a valid date if provided
    • remove (bool) will delete an existing code with matching ID if set to 1

Discounts: Create Example

Request URL

https://api.newbook.cloud/rest/discounts_create

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here",
							"name": "A Discount",
							"discount_type": "percentage",
							"discount_amount": "10.00",
							"minimum": "0.00",
							"maximum": "0.00",
							"active": "1",
							"minimum_stay_cost": "50.00",
							"min_valid_nights": "3",
							"gl_account_id": "145",
							"gl_category_id": "1",
							"bookings_source_id": null,
							"bookings_market_segment_id": null,
							"daysofweek": [
								"monday",
								"tuesday",
								"wednesday",
								"thursday",
								"friday",
								"saturday",
								"sunday"
							],
							"requires_code": "0",
							"discount_codes": [
								{
									"id": 1,
									"code": "NEWCODE"
								},
								{
									"id": 2,
									"remove": "1"
								},
								{
									"code": "ABC123",
									"available_from": "2022-12-03",
									"available_to": "2023-01-02",
									"staying_from": "2022-12-03",
									"staying_to": "2023-01-02"
								}
							]
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": [
								 {
									"discount_id": "123"
								}
							],
							"message": ""
						}
					
				
AnchorDiscounts: Get Details

Retrieve an existing Discount record.

Request Notes:

discount_id must be provided to retrieve the details of a particular Discount.

Response Notes:

The returned data from this request is identical to Discounts: List but for a specific Discount alone and with the addition of any associated Discount codes.

If no such Discount exists, the success response parameter will be "false" and no data will be returned.

Discounts: Get Details Example

Request URL

https://api.newbook.cloud/rest/discounts_get

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here",
							"discount_id": "123"
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": {
								"id": "123",
								"name": "Demo",
								"discount_type": "percentage",
								"discount_amount": "8.92",
								"minimum": "5.00",
								"maximum": "10.00",
								"maximum_applies_per_night": "0",
								"minimum_stay_cost": null,
								"min_stay": "0",
								"min_valid_nights": "0",
								"requires_code": "0",
								"daysofweek": [
									"monday",
									"tuesday",
									"wednesday",
									"thursday",
									"friday",
									"saturday",
									"sunday"
								],
								"discount_id": "243",
								"gl_account_id": null,
								"gl_category_id": null,
								"bookings_source_id": null,
								"bookings_market_segment_id": null,
								"active": "1",
								"discount_codes": [
								    {
									"id": "248",
									"discount_id": "243",
									"code": "abc",
									"available_from": "2022-11-02",
									"available_to": null,
									"staying_from": null,
									"staying_to": null,
									"maximum_use_count": "0",
									"maximum_use_technique": "0",
									"uses": 0,
									"uses_raw": []
								    }
								]
							},
							"message": ""
						}
					
				
AnchorDiscounts: Update

Update a Discount.

Request Notes:

discount_id is required to advise which Discount you are updating.

All other parameters are optional, and are defined in Discounts: Create.

Discounts: Update Example

Request URL

https://api.newbook.cloud/rest/discounts_update

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here",
							"discount_id": 123,
							"name": "A Better Discount",
							"discount_amount": "25.00",
							"minimum": "250.00",
							"maximum": "1000.00",
							"discount_codes": [
							    {
								"id": 1,
								"code": "NEWCODE"
							    },
							]
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": {
								"discount_id": "123"
							},
							"message": ""
						}
					
				
AnchorActivity Setup

Returns description and image details for Activities enabled for Online use.

Please note that Activities have Configurations, and Configurations have Timeslots.
E.g. the Activity might be Jumping Castle, the Configurations might be "Single Child" vs "Family Ticket", and the Timeslots might be "9am-10am, 10am-11am, 11am-12pm".
This request shows the top level data of the Activity only (its name, facility, description, images if any, and Configurations).

If you need to see occupant limits (which are per-Timeslot) please use the Activity Availability and Pricing request.

Request Notes:

activity_id can be provided as an array to limit the response to particular Activities.

Response Notes:

facility_id the ID of the Facility this Activity occurs in (see Facilities: List)

Activity Setup Example

Request URL

https://api.newbook.cloud/rest/activities

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here"
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": [
								{
									"activity_id": 1,
									"activity_name": "Stadium Tour",
									"facility_id": 5,
									"facility_name": "A",
									"facility_category_id": 1,
									"facility_category_name": "Stadium",
									"group_description": "",
									"group_display_order": 0,
									"activity_images": [
										{
											"image_url": "https://drivelocal.newbook.cloud/instances_315806f207b1063571922698cf6af875_618361832aa1d.png",
											"image_type_name": "Stadium Tour",
											"image_file_name": "Stadium.png"
										}
									],
									"activity_configurations": [
										{
											"configuration_id": "1",
											"configuration_name": "Family Pass",
											"configuration_online_description": "Come join us on our great tour",
											"configuration_images": []
										}
									]
								},
								{
									"activity_id": "2",
									"activity_name": "Jumping Castle",
									"facility_id": null,
									"facility_name": null,
									"facility_category_id": null,
									"facility_category_name": null,
									"group_description": "",
									"group_display_order": 1,
									"activity_images": [
										{
											"image_url": "https://drivelocal.newbook.cloud/instances_315806f207b1063571922698cf6af875_618361832aa1d.png",
											"image_type_name": "Bouncy",
											"image_file_name": "Castle.png"
										}
									],
									"activity_configurations": [
										{
											"configuration_id": "2",
											"configuration_name": "Single Child",
											"configuration_online_description": "One Ticket per Child to access our Jumping Castle",
											"configuration_images": [
												{
													"image_url": "https://drivelocal.newbook.cloud/instances_315806f207b1063571922698cf6af875_618361832aa1d.png",
													"image_type_name": "Child Jumping Castle",
													"image_file_name": "castle.png"
												}
											]
										}
									]
								}
							],
							"message": ""
						}
					
				
AnchorActivity Availability and Pricing

Returns Activity availability and pricing for the requested dates/occupants.

Request Notes:

period_from and period_to are required parameters to restrict the pricing request to a particular date/time period.

adults is required to advise the number of Adults participating in the Activity.

children, infants, animals can be optionally provided to advise of Children, Infants or Animals participating in the Activity.

activity_id can be optionally provided as an array to limit the response to particular Activities.

configuration_id can be optionally provided as an array to limit the response to particular Activity Configurations.

Response Notes:

Each activity_configurations object shows included_occupants, extra_occupants and max_occupants:

  • included_occupants defines the number of adults/children/infants/animals which are included in the Timeslot calculated_total price. Null in these values means unlimited.
  • extra_occupants defines the extra price to charge for the number of adults/children/infants/animals above each respective included_occupants number.
  • max_occupants defines the total number of adults/children/infants/animals/combined which can use the Ticket. If you need to sell more occupants than these limits, you will need to use the Create Ticket request again. Null in these values means unlimited.

Using the Create Ticket request will validate the parameters you supply against the above logic.

timeslot_ticket

If there is no way to sell a given Timeslot, the timeslot_ticket object will not be present, timeslot_code will have one of the values listed below, and timeslot_message will show a human-readable error message.

Each timeslot_ticket object:

  • reflects the values you have provided in the request parameters in the adults/children/infants/animals keys
  • shows how many remaining_adults/remaining_children/remaining_infants/remaining_animals and remaining_combined occupants are still able to be booked for the given Timeslot. Null in these values means unlimited. If an occupant type (or the combined figure) in the remaining_X keys reaches 0, any further Create Ticket requests using that occupant type will be rejected
  • should be used in the Create Ticket request (excluding its remaining_X keys)

timeslot_code

timeslot_code is a numeric representation of timeslot_message for you to use in constructing your own messages to your Guests it you prefer:

timeslot_codeReasoning
0No error occurred - a successful result
1The Activity Participant limit has been exceeded for this Timeslot
2The Activity Ticket Participant limit has been exceeded
3The Activity requires at least 1 participant

Activity Availability and Pricing Example

Request URL

https://api.newbook.cloud/rest/activities_pricing

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here",
							"period_from": "2022-12-03 00:00:00",
							"period_to": "2022-12-03 23:59:59",
							"adults": 1,
							"children": 0,
							"infants": 0,
							"animals": 0,
							"activity_id": [1,2],
							"configuration_id": [1,2]
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": [
								{
									"activity_id": 1,
									"activity_name": "Stadium Tour",
									"activity_configurations": [
										{
											"configuration_id": 1,
											"configuration_name": "Family Pass",
											"included_occupants": [
												"adults": 2,
												"children": 2,
												"infants": 0,
												"animals": 0
											],
											"extra_occupants": [
												"adults": 15,
												"children": 10,
												"infants": 5,
												"animals": 0
											],
											"max_occupants": [
												"adults": 20,
												"children": 20,
												"infants": 20,
												"animals": 0,
												"combined": 50
											],
											"timeslots": [
												{
													"date": "2022-12-03",
													"period_from": "2022-12-03 14:00:00",
													"period_to": "2022-12-03 15:00:00",
													"duration": "60",
													"duration_interval": "minute",
													"calculated_total": 60,
													"timeslot_available": true,
													"timeslot_code": 0,
													"timeslot_message": "",
													"timeslot_ticket": {
														"period_from": "2022-12-03 14:00:00",
														"period_to": "2022-12-03 15:00:00",
														"configuration_id": "10",
														"adults": 1,
														"children": 0,
														"infants": 0,
														"animals": 0,
														"remaining_adults": 16,
														"remaining_children": 10,
														"remaining_infants": 20,
														"remaining_animals": 0,
														"remaining_combined": 36
													}
												},
												{
													"date": "2022-12-03",
													"period_from": "2022-12-03 18:00:00",
													"period_to": "2022-12-03 19:00:00",
													"duration": "60",
													"duration_interval": "minute",
													"calculated_total": 60,
													"timeslot_available": true,
													"timeslot_code": 0,
													"timeslot_message": "",
													"timeslot_ticket": {
														"period_from": "2022-12-03 18:00:00",
														"period_to": "2022-12-03 19:00:00",
														"configuration_id": "10",
														"adults": 1,
														"children": 0,
														"infants": 0,
														"animals": 0
														"remaining_adults": 4,
														"remaining_children": 8,
														"remaining_infants": 12,
														"remaining_animals": 0,
														"remaining_combined": 14
													}
												}
											]
										}
									]
								},
								{
									"activity_id": 2,
									"activity_name": "Jumping Castle",
									"activity_configurations": [
										{
											"configuration_id": 2,
											"configuration_name": "Single Child",
											"timeslots": [
												{
													"date": "2022-12-03",
													"period_from": "2022-12-03 18:00:00",
													"period_to": "2022-12-03 19:00:00",
													"duration": "60",
													"duration_interval": "minute",
													"calculated_total": 49.95,
													"timeslot_available": false,
													"timeslot_code": 1,
													"timeslot_message": "Exceeds Occupant Limits"
												}
											]
										}
									]
								}
							],
							"message": ""
						}
					
				
AnchorTicket List

Returns a list of Booked Activities aka Tickets.

Request Notes:

All of the below are optional -

activity_id can be provided as an array to limit the response to particular Activities.

ticket_id can be provided as an array to limit the response to particular Tickets.

for, for_id can be provided to limit the response to a particular Booking/Guest. e.g.

				
					{
						"for": "bookings",
						"for_id": 1234
					}
				
			

account_id can be provided to limit the response to Ticket billing to a particular Client Account.

period_from, period_to can be provided to limit the response to a particular date range.

show_cancelled can be provided as "true" to show Cancelled Activity Tickets.

Ticket List Example

Request URL

https://api.newbook.cloud/rest/activities_ticket_list

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here"
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": [
								{
									"ticket_id": 55,
									"activity_id": 1,
									"name": "Stadium Tour",
									"duration": "4",
									"duration_interval": "hour",
									"facility_id": 5,
									"facility_name": "A",
									"facility_category_id": 1,
									"facility_category_name": "Stadium",
									"configuration_name": "Family Pass",
									"id": 55,
									"period_from": "2022-12-03 06:00:00",
									"period_to": "2022-12-03 10:00:00",
									"activity_configuration_id": 4,
									"for": "bookings",
									"for_id": 1234,
									"adults": 1,
									"children": 0,
									"infants": 0,
									"animals": 0,
									"configuration_included_adults": null,
									"configuration_included_children": null,
									"configuration_included_infants": null,
									"configuration_included_animals": null,
									"inventory_item_id": 3,
									"account_id": 1897,
									"gl_category_id": 1,
									"gl_account_id": 12,
									"description": "Stadium Tour",
									"interval": "once",
									"interval_multiplier": "1",
									"amount": 0,
									"per_adult": 60,
									"per_child": 0,
									"per_infant": 30,
									"per_animal": 0,
									"tax_free": "0",
									"tax_override_amount": null,
									"cancelled_when": null,
									"cancelled_by": null,
									"created_when": "2022-12-02 11:30:00",
									"created_by": "-1",
									"for_name": "John Doe",
									"units": 1,
									"calculated_total": 60,
									"total_paid": 0,
									"payment_status": "Unpaid",
									"access_codes": {
										"926": {
											"id": "926",
											"card_id": null,
											"access_code": "400907",
											"type": "activities_booked",
											"type_id": "55",
											"description": "Access Code for Activity Ticket 55",
											"car_rego": "",
											"period_from": "2022-12-03 06:00:00",
											"period_to": "2022-12-03 10:00:00",
											"area_id": "1",
											"created_when": "2022-12-03 15:08:08",
											"cancelled_when": null,
											"cancelled_reason": "",
											"cancelled_by": "0",
											"access_code_status": null,
											"area_name": "ALL ACCESS"
										}
									},
									"custom_fields": [
										{
											"id": "22",
											"type": "text",
											"label": "Text Input Test",
											"value": "Random value"
										}
									],
									"payment_plans": []
								}
							],
							"message": ""
						}
					
				
AnchorCreate Ticket

Book an Activity / Create an Activity Ticket.

Request Notes:

All fields in the Request JSON are required except for children, infants, animals and account_id.

Most of these fields can be retrieved from the timeslot_ticket object returned in the Availability and Pricing request.

for, for_id advises who the Ticket is for e.g.

				
					{
						"for": "bookings",
						"for_id": 1234
					}
				
			

account_id can be provided to advise which Client Account to bill to, if omitted the Default Client Account of the connected object will be used e.g. the Booking Default Client Account.

Response Notes:

You will receive a ticket_id when the request successfully books an Activity.

Create Ticket Example

Request URL

https://api.newbook.cloud/rest/activities_ticket_create

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here",
							"period_from": "2022-12-03 06:00:00",
							"period_to": "2022-12-03 10:00:00",
							"configuration_id": 1,
							"adults": 1,
							"children": 0,
							"infants": 0,
							"animals": 0,
							"for": "bookings",
							"for_id": 1234,
							"account_id": 1897
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": {
								"ticket_id": 56
							},
							"message": ""
						}
					
				
AnchorUpdate Ticket

Update an Activity Ticket.

Request Notes:

ticket_id is required to advise which Ticket you are updating.

cancel is an optional parameter, when provided as "true" NewBook will cancel the Ticket.

All other parameters are optional and documented on the Create Ticket request.

Response Notes:

You will receive the same ticket_id when the request successfully updates the Activity Ticket.

Update Ticket Example

Request URL

https://api.newbook.cloud/rest/activities_ticket_update

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here",
							"ticket_id": 56,
							"period_from": "2022-12-03 06:00:00",
							"period_to": "2022-12-03 10:00:00",
							"configuration_id": 1,
							"adults": 2,
							"children": 0,
							"infants": 0,
							"animals": 0,
							"for": "bookings",
							"for_id": 1234,
							"account_id": 1897
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": {
								"ticket_id": 56
							},
							"message": ""
						}
					
				
AnchorTicket PDF Content

Retrieve the HTML markup required to print a PDF version of the Activity Ticket.

Ticket PDF Content Example

Request URL

https://api.newbook.cloud/rest/activities_ticket_pdf_content

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here",
							"ticket_id": 56
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": {
								"pdf_content": "

Ticket #56

Ticket Content Here

" }, "message": "" }
AnchorFacility Hire: Availability and Pricing

Returns the Facility Hire Availability and Pricing for the requested dates.

Request Notes:

period_from and period_to are required parameters to restrict the availability request to a particular date/time period.

facility_id is a required parameter provided as an array to limit the response to particular Facilities

adults, children, infants, animals can be optionally provided for hiring the Facility, as these may affect pricing.

Response Notes:

Availability is returned per Facility. For each Facility, the below explains the response keys:

  • facility_id is the ID of the Facility
  • facility_name is the name of the Facility
  • facility_category_id is the ID of the Facility Category
  • facility_category_name is the name of the Facility Category
  • availability is an array of the timeslots, from the period_from to the period_to in increments of the Hire Interval set on the Facility, and the pricing for each period. For example, if the Hire Interval is 2 hours, the availability array will show increments of 2 hours between the period_from & period_to provided in the request.
  • availability[][available] is a boolean which indicates if the Facility is available for the timeslot
  • availability[][period_from] is the start of the timeslot
  • availability[][period_to] is the end of the timeslot
  • availability[][pricing] is an array of the pricing information for the timeslot
  • pricing[][interval] is the Hire Interval for the Facility. It can be once, minute, hour, day, week, month, or year.
  • pricing[][interval_multiplier] is an integer defining the duration of the Hire Interval. For example 15 minute, or 3 hour, or 1 day etc.
  • pricing[][amount_per_interval] is the cost to hire the Facility per Hire Interval.
  • pricing[][total_for_period] is the total cost for the timeslot.

Facility Hire: Availability and Pricing Example

Request URL

https://api.newbook.cloud/rest/facility_hire_availability_pricing

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here",
							"period_from": "2022-12-03 10:00:00",
							"period_to": "2022-12-03 13:00:00",
							"adults": 1,
							"children": 0,
							"infants": 0,
							"animals": 0,
							"facility_ids": [1,2]
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": [
								{
									"facility_id": "1",
									"facility_name": "Surfboard 1",
									"facility_category_id": "2",
									"facility_category_name": "Equipment",
									"availability": [
										{
											"available": true,
											"period_from": "2022-12-03 10:00:00",
											"period_to": "2022-12-03 11:00:00",
											"pricing": {
												"interval": "hour",
												"interval_multiplier": "1",
												"amount_per_interval": "10.00",
												"total_for_period": "30.00"
											}
										},
										{
											"available": true,
											"period_from": "2022-12-03 11:00:00",
											"period_to": "2022-12-03 12:00:00",
											"pricing": {
												"interval": "hour",
												"interval_multiplier": "1",
												"amount_per_interval": "10.00",
												"total_for_period": "30.00"
											}
										},
										{
											"available": true,
											"period_from": "2022-12-03 12:00:00",
											"period_to": "2022-12-03 13:00:00",
											"pricing": {
												"interval": "hour",
												"interval_multiplier": "1",
												"amount_per_interval": "10.00",
												"total_for_period": "30.00"
											}
										}
									]
								},
								{
									"facility_id": "2",
									"facility_name": "Surfboard 2",
									"availability": [
										{
											"available": false,
											"period_from": "2022-12-03 10:00:00",
											"period_to": "2022-12-03 11:00:00",
											"pricing": {
												"interval": "hour",
												"interval_multiplier": "1",
												"amount_per_interval": "10.00",
												"total_for_period": "30.00"
											}
										},
										{
											"available": false,
											"period_from": "2022-12-03 11:00:00",
											"period_to": "2022-12-03 12:00:00",
											"pricing": {
												"interval": "hour",
												"interval_multiplier": "1",
												"amount_per_interval": "10.00",
												"total_for_period": "30.00"
											}
										},
										{
											"available": true,
											"period_from": "2022-12-03 12:00:00",
											"period_to": "2022-12-03 13:00:00",
											"pricing": {
												"interval": "hour",
												"interval_multiplier": "1",
												"amount_per_interval": "10.00",
												"total_for_period": "30.00"
											}
										}
									]
								}
							],
							"message": ""
						}
					
				
AnchorFacility Hire: List

Returns a list of Facility Hires.

Request Notes:

All of the below are optional -

facility_ids can be provided as an array to limit the response to particular Facilities.

for, for_id can be provided to limit the response to a particular Booking/Guest e.g.

				
					{
						"for": "bookings",
						"for_id": 1234
					}
				
			

period_from, period_to can be provided to limit the response to a particular datetime range.

show_cancelled (default "false") can be provided as "true" to show Facility Hires which have been cancelled.

Facility Hie: List Example

Request URL

https://api.newbook.cloud/rest/facility_hire_list

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here"
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": [
								 {
									"id": "56",
									"facility_id": "1",
									"period_from": "2022-12-03 10:00:00",
									"period_to": "2022-12-03 11:00:00",
									"length": "1 hour",
									"amount": "10.00",
									"per_adult": "10.00",
									"per_child": "0.00",
									"per_infant": "0.00",
									"per_animal": "0.00",
									"tax_free": "0",
									"adults": "1",
									"children": "0",
									"infants": "0",
									"animals": "0",
									"hire_account_for_id": "1234",
									"hire_account_for_name": "John Smith",
									"hire_account_for": "bookings",
									"hire_account_balance": "0.00",
									"billing_account_for_id": "1234",
									"billing_account_for_name": "John Smith",
									"billing_account_for": "bookings",
									"billing_account_balance": "0.00",
									"inventory_item_id": "14",
									"gl_category_id": "2",
									"gl_account_id": "4",
									"description": "Surf Board Hire",
									"override_tax_rate_ids": [],
									"units": "1.0000"
								}
							],
							"message": ""
						}
					
				
AnchorFacility Hire: Create

Create a Facility Hire.

Request Notes:

adults is required however children, infants, animals can be optionally provided for hiring the Facility, as these may affect pricing.

facility_id is the ID of the Facility to be hired (see Facilities: List)

for, for_id advises the Booking/Guest this Facility Hire should be attributed to, and must already exist in the Instance database e.g.

				
					{
						"for": "bookings",
						"for_id": 1234
					}
				
			

Response Notes:

success will be false when the Facility is unavailable to Hire for the requested duration.

When the Facility Hire is successful, you will receive hire_id in the data response.

Facility Hire: Create Example

Request URL

https://api.newbook.cloud/rest/facility_hire_create

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here",
							"period_from": "2022-12-03 12:00:00",
							"period_to": "2022-12-03 13:00:00",
							"adults": 1,
							"children": 0,
							"infants": 0,
							"animals": 0,
							"for": "bookings",
							"for_id": 1234,
							"facility_id": 2
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": {
								"hire_id": 56
							},
							"message": ""
						}
					
				
AnchorFacility Hire: Update

Update a Facility Hire.

Request Notes:

hire_id is required to advise which Facility Hire you are updating.

status is an optional parameter, when provided as 0 NewBook will cancel the Facility Hire.

All other parameters are optional, and are defined in Facility Hire: Create.

Facility Hire: Update Example

Request URL

https://api.newbook.cloud/rest/facility_hire_update

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here",
							"hire_id": 56,
							"period_from": "2022-12-03 10:00:00",
							"period_to": "2022-12-03 11:00:00",
							"adults": 1,
							"children": 0,
							"infants": 0,
							"animals": 0,
							"for": "bookings",
							"for_id": 1234,
							"facility_id": 1
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": {
								"hire_id": 56
							},
							"message": ""
						}
					
				
AnchorInventory Items: List

Pull the list of Inventory Items from within NewBook.

Request Notes:

name is optional and when provided it will restrict the results to the matching Inventory Items

You can provide a basic booking object named calculate_price_for_booking in the request parameters and NewBook will return a new key in the response, booking_inventory_calculated_price. The calculation factors the cost per occupant so you don't have to implement such logic in your application:

				
					{
						"calculate_price_for_booking": {
							"period_from": "2022-12-02",
							"period_to": "2022-12-03",
							"total": 199.95,
							"adults": 2,
							"children": 1,
							"infants": 0,
							"animals": 0
						}
					}
				
			

If you use this, calculate_price_for_booking.period_from, calculate_price_for_booking.period_to and calculate_price_for_booking.total and at least one of the occupant keys are required for NewBook to return booking_inventory_calculated_price in the response. This is because the duration of the booking and its total cost can impact the price determination when an Inventory Item is configured that way:

				
					{
						"success": "true",
						"data": [{
							...
							"booking_inventory_calculated_price": 14.50
						}],
						"message": ""
					}
				
			

Inventory Items: List Example

Request URL

https://api.newbook.cloud/rest/inventory_item_list

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here",
							"name": "foldaway"
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": [{
								"id": "1",
								"category_id": null,
								"gl_category_id": "1",
								"gl_account_id": "2",
								"name": "Foldaway Bed",
								"description": "Foldaway Bed",
								"amount": "10.00",
								"unit_amount": "0.00",
								"unit_type": "",
								"unit_category_id": null,
								"repeat_charge_type": "charges",
								"repeat_charge_interval": "week",
								"repeat_charge_interval_multiplier": "1",
								"repeat_charge_guest_visible": "1",
								"repeat_charge_travel_agent_commission": "1",
								"repeat_charge_include_in_stay_cost": "1",
								"repeat_charge_disburse_to_owners": "1",
								"repeat_charge_prorata_end": "1",
								"booking_inventory_item_type": "charges",
								"booking_inventory_calculation_type": "fixed",
								"booking_inventory_calculation_amount": "0.00",
								"booking_inventory_task_type_id": null,
								"booking_inventory_per_adult": "0.00",
								"booking_inventory_per_child": "0.00",
								"booking_inventory_per_infant": "0.00",
								"booking_inventory_per_animal": "0.00",
								"booking_inventory_guest_visible": "0",
								"booking_inventory_travel_agent_commission": "1",
								"booking_inventory_include_in_stay_cost": "1",
								"booking_inventory_disburse_to_owners": "1",
								"booking_inventory_daytype": "once",
								"booking_inventory_interval": "day",
								"booking_inventory_interval_multiplier": "0",
								"booking_inventory_daysofweek": "0",
								"booking_inventory_ignore_other_tariffs": "0",
								"booking_inventory_ignore_period_from": "0",
								"booking_inventory_ignore_period_to": "1",
								"quote_inventory_item_type": "charges",
								"quote_inventory_fixed_commission": null,
								"quote_inventory_guest_visible": "1",
								"subscription_interval": "week",
								"subscription_interval_multiplier": "1",
								"hire_per_adult": "0.00",
								"hire_per_child": "0.00",
								"hire_per_infant": "0.00",
								"hire_per_animal": "0.00",
								"hire_interval": "day",
								"hire_interval_multiplier": "0",
								"tax_free": "0",
								"additional_information": "",
								"cost_price": "0.00",
								"image_uri": "",
								"section_code": "",
								"barcode": "",
								"stock_control": "0",
								"use_stock_serials": "0",
								"low_stock_threshold": "0",
								"push_to_pos": "1",
								"active": "1",
								"online_category_restrictions": [
									"2",
									"7",
									"16"
								]
							}],
							"message": ""
						}
					
				
AnchorInventory Items: Create

Create a new Inventory Item.

Request Notes:

The following parameters are required:

  • name (string) is required
  • amount (float) is required

The following parameters are optional:

  • description (string)
  • cost_price (float)
  • tax_free (bool)
  • push_to_pos (bool)
  • active (bool)
  • gl_category_id (int)
  • gl_account_id (int)
  • repeat_charge_interval_multiplier (bool)
  • repeat_charge_interval (string) must be from the following list:
    • day
    • week
    • month
    • year
  • repeat_charge_type (string) must be from the following list:
    • charges
    • credits
  • repeat_charge_prorata_end (bool)
  • repeat_charge_guest_visible (bool)
  • repeat_charge_travel_agent_commission (bool)
  • repeat_charge_include_in_stay_cost (bool)
  • booking_inventory_item_type (string) must be from the following list:
    • charges
    • credits
  • booking_inventory_per_adult (float)
  • booking_inventory_per_child (float)
  • booking_inventory_per_infant (float)
  • booking_inventory_per_animal (float)
  • booking_inventory_daytype (string) must be from the following list:
    • once
    • every_qualifying_day
    • every_interval
  • booking_inventory_interval (string) must be from the following list:
    • day
    • week
    • month
    • year
  • booking_inventory_interval_multiplier (int)
  • booking_inventory_interval_limit (string)
  • booking_inventory_daysofweek (array) must be an array containing zero or more lower case day names:
    • monday
    • tuesday
    • wednesday
    • thursday
    • friday
    • saturday
    • sunday
  • booking_inventory_guest_visible (bool)
  • booking_inventory_travel_agent_commission (bool)
  • booking_inventory_include_in_stay_cost (bool)
  • booking_inventory_include_in_deposit (bool)
  • booking_inventory_include_in_payment_plan (bool)
  • booking_inventory_discounts_apply (bool)
  • booking_inventory_refundable (bool)
  • booking_inventory_ignore_period_from (bool)
  • booking_inventory_ignore_period_to (bool)
  • hire_interval_multiplier (int)
  • hire_interval (string) must be from the following list:
    • once
    • minute
    • hour
    • day
    • week
    • month
    • year
  • hire_per_adult (float)
  • hire_per_child (float)
  • hire_per_infant (float)
  • hire_per_animal (float)
  • hire_travel_agent_commission (bool)

Inventory Items: Create Example

Request URL

https://api.newbook.cloud/rest/inventory_items_create

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here",
							"name": "Fishing Tour",
							"description": "Few go out and fewer return. Good luck on your next fishing adventure!",
							"amount": "249.95",
							"cost_price": "0.00",
							"tax_free": "0",
							"push_to_pos": "0",
							"active": "1",
							"gl_category_id": "2",
							"gl_account_id": "16",
							"repeat_charge_interval_multiplier": "1",
							"repeat_charge_interval": "week",
							"repeat_charge_type": "charges",
							"repeat_charge_prorata_end": "1",
							"repeat_charge_guest_visible": "1",
							"repeat_charge_travel_agent_commission": "1",
							"repeat_charge_include_in_stay_cost": "1",
							"booking_inventory_item_type": "charges",
							"booking_inventory_per_adult": "0.00",
							"booking_inventory_per_child": "0.00",
							"booking_inventory_per_infant": "0.00",
							"booking_inventory_per_animal": "0.00",
							"booking_inventory_daytype": "once",
							"booking_inventory_interval": "week",
							"booking_inventory_interval_multiplier": "1",
							"booking_inventory_interval_limit": "0",
							"booking_inventory_daysofweek": [
								"monday",
								"tuesday"
							],
							"booking_inventory_guest_visible": "1",
							"booking_inventory_travel_agent_commission": "0",
							"booking_inventory_include_in_stay_cost": "1",
							"booking_inventory_include_in_deposit": "0",
							"booking_inventory_include_in_payment_plan": "1",
							"booking_inventory_discounts_apply": "1",
							"booking_inventory_refundable": "1",
							"booking_inventory_ignore_period_from": "0",
							"booking_inventory_ignore_period_to": "1",
							"hire_interval_multiplier": "1",
							"hire_interval": "hour",
							"hire_per_adult": "25.00",
							"hire_per_child": "10.00",
							"hire_per_infant": "0.00",
							"hire_per_animal": "0.00",
							"hire_travel_agent_commission": "0"
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": [
								 {
									"inventory_item_id": "123"
								}
							],
							"message": ""
						}
					
				
AnchorInventory Items: Get Details

Retrieve an existing Inventory Item record.

Request Notes:

inventory_item_id must be provided to retrieve the details of a particular Inventory Item.

Response Notes:

The returned data from this request is identical to Inventory Items: List but for a specific Inventory Item alone.

If no such Inventory Item exists, the success response parameter will be "false" and no data will be returned.

Inventory Items: Get Details Example

Request URL

https://api.newbook.cloud/rest/inventory_items_get

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here",
							"inventory_item_id": "123"
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": {
								"id": "123",
								"category_id": null,
								"gl_category_id": null,
								"gl_account_id": null,
								"name": "Fishing Tour",
								"description": "Few go out and fewer return. Good luck on your next fishing adventure!",
								"amount": "249.95",
								"unit_amount": "0.00",
								"unit_type": "",
								"unit_category_id": null,
								"repeat_charge_type": "charges",
								"repeat_charge_interval": "week",
								"repeat_charge_interval_multiplier": "1",
								"repeat_charge_guest_visible": "1",
								"repeat_charge_travel_agent_commission": "1",
								"repeat_charge_include_in_stay_cost": "1",
								"repeat_charge_disburse_to_owners": "0",
								"repeat_charge_prorata_end": "1",
								"booking_inventory_item_type": "charges",
								"booking_inventory_calculation_type": "fixed",
								"booking_inventory_calculation_amount": "0.00",
								"booking_inventory_per_adult": "0.00",
								"booking_inventory_per_child": "0.00",
								"booking_inventory_per_infant": "0.00",
								"booking_inventory_per_animal": "0.00",
								"booking_inventory_guest_visible": "1",
								"booking_inventory_travel_agent_commission": "0",
								"booking_inventory_include_in_stay_cost": "1",
								"booking_inventory_include_in_deposit": "0",
								"booking_inventory_include_in_payment_plan": "1",
								"booking_inventory_disburse_to_owners": "0",
								"booking_inventory_refundable": "1",
								"booking_inventory_daytype": "once",
								"booking_inventory_interval": "day",
								"booking_inventory_interval_multiplier": "0",
								"booking_inventory_interval_limit": "0",
								"booking_inventory_daysofweek": [
								    "monday",
								    "saturday"
								],
								"booking_inventory_ignore_other_tariffs": "0",
								"booking_inventory_ignore_period_from": "0",
								"booking_inventory_ignore_period_to": "1",
								"booking_inventory_discounts_apply": "1",
								"quote_inventory_item_type": "charges",
								"quote_inventory_fixed_commission": null,
								"quote_inventory_guest_visible": "1",
								"subscription_item_type": "charges",
								"subscription_interval": "week",
								"subscription_interval_multiplier": "1",
								"subscription_length": "week",
								"subscription_length_multiplier": "0",
								"subscription_invoice_description": "",
								"subscription_invoice_system_template_id": null,
								"subscription_invoice_email_template_id": null,
								"subscription_create_task_type_id": null,
								"subscription_create_task_created_for": null,
								"subscription_create_task_description": "",
								"subscription_generate_invoice": "1",
								"subscription_crm_membership": "0",
								"subscription_crm_membership_type": null,
								"subscription_minimum_membership_points": null,
								"subscription_crm_purchase": "0",
								"appointment_available_from": null,
								"appointment_available_to": null,
								"appointment_opening_time": null,
								"appointment_closing_time": null,
								"appointment_buffer_before": "0",
								"appointment_buffer_after": "0",
								"appointment_duration": "0",
								"appointment_active": "0",
								"appointment_max_adults": null,
								"appointment_max_children": null,
								"appointment_max_infants": null,
								"appointment_max_animals": null,
								"appointment_per_adult": "0.00",
								"appointment_per_child": "0.00",
								"appointment_per_infant": "0.00",
								"appointment_per_animal": "0.00",
								"appointment_group_description": "",
								"appointment_group_display_order": "0",
								"hire_per_adult": "25.00",
								"hire_per_child": "10.00",
								"hire_per_infant": "0.00",
								"hire_per_animal": "0.00",
								"hire_interval": "hour",
								"hire_interval_multiplier": "0",
								"hire_travel_agent_commission": "0",
								"online_product_active": "0",
								"online_product_match_occupants": "0",
								"online_product_daytype": "once",
								"online_product_interval": "day",
								"online_product_interval_multiplier": "1",
								"online_product_daysofweek": "0",
								"online_product_ignore_period_from": "0",
								"online_product_ignore_period_to": "1",
								"online_product_per_adult": "0.00",
								"online_product_per_child": "0.00",
								"online_product_per_infant": "0.00",
								"online_product_per_animal": "0.00",
								"online_product_period_from": null,
								"online_product_period_to": null,
								"online_product_default_qty": "0",
								"online_product_minimum_qty": "0",
								"online_product_maximum_qty": "0",
								"online_product_group_description": "",
								"online_product_group_display_order": "0",
								"tax_free": "0",
								"additional_information": "",
								"cost_price": "0.00",
								"image_uri": "",
								"barcode": "",
								"section_code": "",
								"stock_control": "0",
								"use_stock_serials": "0",
								"low_stock_threshold": null,
								"push_to_pos": "0",
								"default_discount_id": null,
								"active": "1",
								"i18n_content": [],
								"display_task_list": [],
								"appointment_users": [],
								"appointment_facility_categories": [],
								"categories": [],
								"tasks": [],
								"inventory_item": "Demo",
								"override_tax_rate_ids": []
							},
							"message": ""
						}
					
				
AnchorInventory Items: Update

Update an Inventory Item.

Request Notes:

inventory_item_id is required to advise which Inventory Item you are updating.

All other parameters are optional, and are defined in Inventory Items: Create.

Inventory Items: Update Example

Request URL

https://api.newbook.cloud/rest/inventory_items_update

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here",
							"inventory_item_id": "123",
							"name": "Demo #2"
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": {
								"inventory_item_id": "123"
							},
							"message": ""
						}
					
				
AnchorGuests: List

Retrieve/search the Guest database.

Request Notes:

search is optional and when provided it will restrict the results to the matching Guests. It will search their name, contact details (phone, email, etc) and membership details for a match

account_id is optional and when provided it will restrict the results to the matching Client Accounts.

membership_type and membership_number can optionally be provided to search for Guests with particular membership details

membership_type when provided must match one of the ID values from a Memberships: List request

created_when is optional and when supplied, restricts the returned Guests to only those which were created on the date given

staff_id is optional and when supplied, restricts the returned Leads to those assigned to that User (see Users: List)

sort_ascending is optional and when supplied as true, sorts the Guests by ID ascending. Defaults to false (sort the Guests by ID descending).

Send account_breakdown as true to see the balance of each associated Sub Client Account (gl_category)

  • This feature is only available on CRMs
  • You can also provide staff_id_include as false to show Leads not assigned to that User
  • If you provide unassigned into the request parameter staff_id Leads that are unassigned will be returned
  • staff_id can be an array of User IDs

Response Notes:

contact_details, custom_fields and membership_details are arrays which will be empty when no data of that type is available

The membership expiry_date can optionally be null when no date is available

The Equipment array returned has the data of all the equipment related to the guest. It returns an empty array if the guest has no equipment

title can be any string; NewBook does not restrict users to specific titles for Guests

contact_details

  • allow_transactional: Guest allows general contact related to Bookings or accounts
  • allow_marketing: Guest allows marketing contact such as newsletters

staff_id and staff_sharing will only be returned for CRM clients

account_id will be null when the Instance is part of a Shared Guest Database and there has been no Guest Activity at this particular Instance.

period_from can be optionally provided to limit the response to Guests created/modified after the specified timestamp

period_to can be optionally provided to limit the response to Guests created/modified after the specified timestamp

Guests: List Example

Request URL

https://api.newbook.cloud/rest/guests_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"search": "John Doe",
											"created_when": "2016-02-01"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": "1",
												"title": "Mr",
												"firstname": "John",
												"lastname": "Doe",
												"othername": "",
												"gender": null,
												"date_of_birth": null,
												"company_id": null,
												"company_name": null,
												"date_created": "2022-12-01 11:30:00",
												"modified_when": "2022-12-01 00:00:00",
												"last_note_when": "2022-12-01 00:00:00",
												"blacklisted_when": "2022-12-02 00:00:00",
												"vip_when": null,
												"account_id": "13783",
												"account_balance": "15.00",
												"auto_billing_limit": null,
												"staff_id": "1",
												"staff_sharing": [{
													"staff_id": "1",
													"ownership": "50.00"
												},
												{
													"staff_id": "2",
													"ownership": "50.00"
												}],
												"street": "Level 2, 9 Ouyan Street",
												"city": "Surfers Paradise",
												"state": "Queensland (QLD)",
												"postcode": "4217",
												"country": "Australia",
												"contact_details": [{
													"id": 1,
													"type": "phone",
													"content": "0756554600",
													"notes": "",
													"allow_transactional": "1",
													"allow_marketing": "1"
												},{
													"id": 2,
													"type": "email",
													"content": "[email protected]",
													"notes": "",
													"allow_transactional": "1",
													"allow_marketing": "0"
												}],
												"custom_fields": [{
													"id": 1,
													"type": "text",
													"label": "My Test Field",
													"value": "Something"
												}],
												"membership_details": [{
													"type": "Testing Service",
													"type_id": "2",
													"content": "1234567",
													"expiry_date": "2023-09-02"
												}],
												"equipment": [
													{
														"id": "26",
														"equipment_name": "My Honda",
														"equipment_make": "Honda",
														"equipment_model": "Accord",
														"equipment_type_id": "1",
														"equipment_type_name": "car",
														"equipment_length": "5.00",
														"equipment_width": "2.00",
														"equipment_height": "2.00",
														"equipment_registration": "222ABC",
														"equipment_registration_expiry": "2023-09-02"
													}
												],
												"dietary_requirements": [
													"1",
													"2"
												],
												"notes": [{
													"type_id": "1",
													"content": "This is my Guest note",
													"created_when": "2022-12-01 11:30:00",
													"created_by": "11",
													"updated_when": "2022-12-02 00:00:00",
													"updated_by": "5"
												}]
											}],
											"message": ""
										}
									
								
AnchorGuests: Create

Create a Guest to use for placing Bookings, Availability Emails, Online Logins, and more.

Request Notes:

firstname and lastname are required. All other parameters are optional but recommended for greater data capture.

contact_email and contact_phone can be provided to create or update Contact Details for a Guest. When updating, these values will also check & not double up if the new information already exists on the Guest. And if you would like to prevent the updating of existing Contact Details please supply update_existing_details as "false".

Alternatively you can manage Contact Details array directly:

				
					"contact_details": [
						{
							"id": 1,
							"type": "phone",
							"content": "0756554600",
							"notes": "",
							"allow_transactional": "1",
							"allow_marketing": "1",
							"remove": 0
						}
					]
				
			
  • id can be optionally provided when updating a Guest to update or remove a particular Contact Detail
  • type is required
  • content is required
  • notes is optional.
  • allow_transactional is optional and will use the Ssytem Default when not provided.
  • allow_marketing is optional and will use the Ssytem Default when not provided
  • remove is optional and when true it will remove the Contact Detail from the Guest

notes will add new details to the Guest (not replace the existing information) and will check & not double up if the new information already exists on the Guest. This can either be provided as a string, or as array of objects containing the following options:

  • content is required. This contains the contents of the note to be added.
  • type_id is optional, and will use the System Default if not provided as per the Note Types: List request.
  • output_message is optional and will default to true when not provided. This controls whether the note will display at the top of the page.
  • task_list is optional, and will default to false when note provided. This controls whether the note will display on any tasks lists.

membership_type and membership_number (and optionally membership_expiry as YYYY-MM-DD) can be provided to create a Membership for the Guest. When updating, these values will also check & not double up if the new information already exists on the Guest (based on membership_type).

Alternatively you can manage the memberships array directly:

								
									"membership_details": [
										{
											"id": 1,
											"type_id": 2,
											"content": "1234567",
											"expiry_date": "2025-02-25",
											"remove": 0
										}
									]
								
							
  • id can be optionally provided when updating a Guest to update or remove a particular Membership.
  • type_id is required and must match one of the ID values from a Memberships: List request.
  • content is required. This is the membership number.
  • expiry_date is optional. This is the expiry date of the membership formatted as YYYY-MM-DD.
  • remove is optional.

date_of_birth can optionally be provided as YYYY-MM-DD to store the guests date of birth

duplicate_matching can optionally be provided as one of the following options:

  • false: do not find duplicates
  • name: Name only
  • phone: Phone only
  • email: Email only
  • name_and_phone: Name and Phone
  • name_and_email: Name and Email
  • name_and_email_and_phone: Name and Email and Phone

When not provided, this determination falls back to the Instance Setting called When adding a Guest, Detect Duplicates using, which defaults to name.

If duplicates are encountered, NewBook will automatically update the record of the first duplicate found.

Regarding specifying Equipment:

  • The equipment parameter is optional in creating a guest. However, if provided, it must be in array format, because a guest own multiple equipment as shown in the example request.
  • The following are the parameters for creating equipment on a booking:
    • equipment_name (required)
    • equipment_make
    • equipment_model
    • equipment_type (must be a number)
    • equipment_length (must be a number)
    • equipment_width (must be a number)
    • equipment_height (must be a number))
    • equipment_registration
    • equipment_registration_expiry
  • The equipment are saved onto the Equipment table and linked to the guest. Please note that if the equipment_registration is not specified, a new equipment will be created for the guest

If specified, custom_fields must be based on the response to the Custom Fields request, to retrieve the different Custom Fields set up in the instance:

									
										"custom_fields": [
											{
												"field_id": 2,
												"field_value": 8
											}
										]
									
								

If specified, dietary_requirements can be provided based on the response to Dietary Requirements request.

To create a new Online Login for this Guest (optional)

online_username and online_password are required to create an Online User for this Guest. Note that online_username must be an email address. If the provided online_username already exists, the whole guests_create request will fail saying the provided online_username is already in use. NewBook implements password complexity requirements: at least 8 characters, at least one upper case letter, at least one lower case letter, and at least one number.

Guests: Create Example

Request URL

https://api.newbook.cloud/rest/guests_create

Request JSON
									
										{
		"region": "your_region_here",
		"api_key": "your_api_key_here",
		"firstname": "John",
		"lastname": "Doe",
		"street": "Level 2, 9 Ouyan Street",
		"city": "Surfers Paradise",
		"state_name": "QLD",
		"postcode": "4217",
		"country_name": "Australia",
		"contact_phone": "0756554600",
		"contact_email": "[email protected]",
		"notes": "Some notes",
		"membership_type": "2",
		"membership_number": "1234567",
		"membership_expiry": "2023-09-02",
		"date_of_birth": "1980-03-25",
		"equipment": [
			{
				"equipment_name": "My Honda",
				"equipment_make": "Honda",
				"equipment_model": "Accord",
				"equipment_type": "1",
				"equipment_length": "5",
				"equipment_width": "2",
				"equipment_height": "2",
				"equipment_registration": "222ABC",
				"equipment_registration_expiry": "2022-12-03"
			},
			{
				"equipment_name": "My Toyota",
				"equipment_make": "Toyota",
				"equipment_model": "Camry",
				"equipment_type": "1",
				"equipment_length": "4",
				"equipment_width": "2",
				"equipment_height": "1"
			}
		]
	}									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"id": "1",
												"account_id": "10"
											},
											"message": "Successfully created Guest"
										}
									
								
AnchorGuests: Get Details

Retrieve an existing Guest record.

Request Notes:

guest_id or account_id must be provided to retrieve the details of a particular Guest.

Send account_breakdown as true to see the balance of each associated Sub Client Account (gl_category)

Response Notes:

The returned data from this request is identical to Guests: List but for the specific Guest alone

If no such Guest exists, the success response parameter will be "false" and no data will be returned.

Guests: Get Details Example

Request URL

https://api.newbook.cloud/rest/guests_get

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"guest_id": "1",
											"account_breakdown": true
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"guest_id": "1",
												"title": "Mr",
												"firstname": "John",
												"lastname": "Doe",
												"othername": "",
												"gender": null,
												"date_of_birth": null,
												"company_id": null,
												"company_name": null,
												"date_created": "2022-12-01 11:30:00",
												"modified_when": "2022-12-01 00:00:00",
												"last_note_when": "2022-12-01 00:00:00",
												"blacklisted_when": "2022-12-02 00:00:00",
												"vip_when": null,
												"account_id": "13783",
												"account_balance": "15.00",
												"auto_billing_limit": null,
												"primary_client": "1",
												"street": "Level 2, 9 Ouyan Street",
												"city": "Surfers Paradise",
												"state": "Queensland (QLD)",
												"postcode": "4217",
												"country": "Australia",
												"contact_details": [{
													"id": 1,
													"type": "phone",
													"content": "0756554600",
													"notes": "",
													"allow_transactional": "1",
													"allow_marketing": "1"
												},{
													"id": 2,
													"type": "email",
													"content": "[email protected]",
													"notes": "",
													"allow_transactional": "1",
													"allow_marketing": "0"
												}],
												"custom_fields": [{
													"id": 1,
													"type": "text",
													"label": "My Test Field",
													"value": "Something"
												}],
												"membership_details": [{
													"type": "Testing Service",
													"type_id": "2",
													"content": "1234567",
													"expiry_date": "2023-09-02"
												}],
												"equipment": [
													{
														"id": "26",
														"equipment_name": "My Honda",
														"equipment_make": "Honda",
														"equipment_model": "Accord",
														"equipment_type_id": "1",
														"equipment_type_name": "car",
														"equipment_length": "5.00",
														"equipment_width": "2.00",
														"equipment_height": "2.00",
														"equipment_registration": "222ABC",
														"equipment_registration_expiry": "2023-09-02"
													}
												],
												"dietary_requirements": [
													"1",
													"2"
												],
												"notes": [{
													"type_id": "1",
													"content": "This is my Guest note",
													"created_when": "2022-12-01 11:30:00",
													"created_by": "11",
													"updated_when": "2022-12-02 00:00:00",
													"updated_by": "5"
												}],
												"account_breakdown": [{
													"name": "Accommodation",
													"gl_category_id": "1",
													"balance": "7.00"
												},{
													"name": "Extras",
													"gl_category_id": "2",
													"balance": "8.00"
												}]
											},
											"message": ""
										}
									
								
AnchorGuests: Update

Update an existing Guest.

Request Notes:

guest_id or account_id must be provided to update the details of a particular Guest.

All other parameters are optional, please see Guests: Create for more details.

To update an existing Online Login for this Guest (optional)

Either online_user_id or online_account_id is required, and can be retrieved using the Online Users: Get request.

If you are updating the password for the Online User, NewBook implements password complexity requirements: at least 8 characters, at least one upper case letter, at least one lower case letter, and at least one number.

online_username is optional, but if provided must be an email address. If the provided online_username already exists and isn't specifically for this Online User (identified by online_user_id or online_account_id), the whole guests_update request will fail saying the provided online_username is already in use.

The Online User for and for_id cannot be updated.

Guests: Update Example

Request URL

https://api.newbook.cloud/rest/guests_update

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"guest_id": "1",
											"firstname": "John",
											"lastname": "Doe",
											"street": "Level 2, 9 Ouyan Street",
											"city": "Surfers Paradise",
											"state": "Queensland (QLD)",
											"postcode": "4217",
											"country": "Australia",
											"contact_phone": "0756554600",
											"contact_email": "[email protected]",
											"membership_type": "2",
											"membership_number": "1234567",
											"membership_expiry": "2023-09-02",
											"equipment": [
												{
													"equipment_name": "My Honda",
													"equipment_make": "Honda",
													"equipment_model": "Accord",
													"equipment_type": "1",
													"equipment_length": "5",
													"equipment_width": "2",
													"equipment_height": "2",
													"equipment_registration": "222ABC",
										 			"equipment_registration_expiry": "2022-12-03"
												}
											]
											"notes": "Some notes"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"guest_id": "1",
												"account_id": "10",
											},
											"message": "Successfully Updated Guest"
										}
									
								
AnchorGuests: Deletion History

Retrieves a list of Guest ID's that have been deleted from NewBook.

Request Notes:

period_from can be optionally provided to limit the response to Guests deleted after the specified timestamp

period_to can be optionally provided to limit the response to Guests deleted after the specified timestamp

Guests: Deletion History Example

Request URL

https://api.newbook.cloud/rest/guests_deletion_history

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"period_from": "2022-12-01 11:30:00",
											"period_to": "2022-12-03 14:00:00"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [
												{
													"guest_id": 150,
													"deleted_when": "2022-12-01 11:30:00"
												},
												{
													"guest_id": 151,
													"deleted_when": "2022-12-01 11:30:00"
												}
											],
											"message": ""
										}
									
								
AnchorMemberships: List

Pull the list of Memberships from within NewBook.

Request Notes:

name is optional and when provided it will restrict the results to the matching Memberships

Response Notes:

If a discount_id is returned in the data, you can cross reference the result of a Discounts: List request to determine how much of a discount is granted based on the membership

Memberships: List Example

Request URL

https://api.newbook.cloud/rest/memberships_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"name": "test"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": "3",
												"name": "Test Membership",
												"description": "Testing 10% off accommodation",
												"membership_service_id": null,
												"membership_service_level_id": null,
												"newbook_loyalty_service_id": null,
												"membership_inventory_item_id": null,
												"enforce_unique": "0",
												"discount_id": null,
												"allow_online": "0",
												"display_order": "0"
											}],
											"message": ""
										}
									
								
AnchorMembership: Purchase

Grant a Membership to one of the connected Membership Types to an existing Guest

Request Notes:

Despite the request name, no purchase transaction or account charging is involved here. This request expects you to have handled that on your side of the integration.

membership_type is required and must match one of the ID values from a Memberships: List request.

Further, only results from the Memberships: List request with a membership_service_id and membership_service_level defined are able to be purchased with this request.

Membership: Purchase Example

Request URL

https://api.newbook.cloud/rest/membership_purchase

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"membership_type": "5",
											"guest_id": "4328"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"member_id": "8",
												"member_expiry": "2023-09-02"
											}],
											"message": ""
										}
									
								
AnchorGuests: Merge

Merge one or more duplicate guests into a primary guest. When a duplicate guest has details not already in the primary guest it will be added. If the primary guest had different existing details then, depending on addtional parameters below, the details will be ignored or added as notes.

Warning, merging a guest cannot reversed, so please ensure you are merging the correct guests.

Request Notes:

primary_id [number] Provides the primary guest id for the duplicate guests to merged into. This guest will keep its original details.

duplicate_ids [number array] Provides array of guest ids to be merged into the primary guest.

merge_tasks [true|false] Provides single or list of guest ids to be merged into the primary guest.

address_note_type_id [null|int] optional If a Note Type ID is provided then any mismatched address details against the duplicated guest will be added to the primary guest as a note of that type.

custom_fields_note_type_id [null|int] optional If a Note Type ID is provided then any unique custom fields against the duplicated guest will be added to the primary guest as a note of that type.

Guests: Merge Example

Request URL

https://api.newbook.cloud/rest/guests_merge

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"primary_id": 1,
											"duplicate_ids": [2,3,4],
											"merge_tasks": true,
											"address_note_type_id": 1,
											"custom_fields_note_type_id": 1
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {},
											"message": "Successfully merged Guests."
										}
									
								
AnchorAccommodation Categories: List

Retrieve a list of Accommodation Categories including all the stored information about the Category.

Request Notes:

category_id can optionally be provided to limit results to a particular Category ID

type_id can optionally be provided to limit results to a particular Category Type ID

Response Notes:

Each Category details its Sites in an array. Each Site has all the same attributes as per the sites_list request.

Sites can optionally inherit Features from their parent Category (see the accommodation_category_list request). When this is the case, site_features_specified will be false, the site_features array will be empty, and the Features should be referenced from the parent Category. When this is not the case, site_features_specified will be true, and only those Features specified on the Site are valid (including an empty site_features array meaning none).

Categories have a set of Images, and Sites do as well. Those returned in site_images should be displayed in conjunction with those from the Category.

Accommodation Categories: List Example

Request URL

https://api.newbook.cloud/rest/accommodation_category_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"category_id": "56"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"category_id": "56",
												"category_name": "Holiday Rentals",
												"category_description": "A stylish holiday apartment ideally situated within the boardwalk entertainment precinct of the Surfers Paradise. Private balcony with amazing views. A walk or bike ride into Surfers Paradise central. Beautiful water ways, foreshore parks and playgrounds, rustic coastline with surf, fishing and swimming beaches.",
												"category_short_description": "Luxurious Holiday Rental apartment situated within the boardwalk entertainment precinct of Surfers Paradise.",
												"category_type_id": "7",
												"category_type_name": "Apartment",
												"category_virtual_tour_url": "https://www.newbook.cloud/virtual_tour_link",
												"category_max_adults": "5",
												"category_max_children": null,
												"category_max_infants": "0",
												"category_max_animals": "0",
												"category_max_combined": "5",
												"sites": [{
													"site_id": "81",
													"site_name": "Luxury Holiday Rental",
													"site_description": "A stylish holiday apartment ideally situated within the boardwalk entertainment precinct of the Surfers Paradise. Private balcony with amazing views. A walk or bike ride into Surfers Paradise central. Beautiful water ways, foreshore parks and playgrounds, rustic coastline with surf, fishing and swimming beaches.",
													"site_short_description": "Luxurious Holiday Rental apartment situated within the boardwalk entertainment precinct of Surfers Paradise.",
													"site_status": "Clean",
													"site_street": "Level 2, 9 Ouyan Street",
													"site_city": "Surfers Paradise",
													"site_postcode": "4217",
													"site_state_id": 4,
													"site_state_name": "Queensland",
													"site_country_id": 13,
													"site_country_name": "Australia",
													"site_lat": "-28.0031270",
													"site_long": "153.4177429",
													"level_id": "",
													"level_name": "",
													"site_size": {
														"id": "1",
														"name": "10x10",
														"length": "10.00",
														"width": "10.00",
														"height": "0.00",
														"unit": "m"
													},
													"parent_id": null,
													"child_ids": [],
													"custom_fields": [{
														"id": 1,
														"type": "text",
														"label": "Suitable for Families",
														"value": "No this is accommodation designed for couples-only"
													}],
													"site_images": [],
													"site_features_specified": false,
													"site_features": [],
													"map_markers": [],
													"notes": []
												}],
												"features": [{
													"feature_id": "1",
													"feature_name": "Air conditioned",
													"feature_count": "1"
												},{
													"feature_id": "2",
													"feature_name": "Balcony",
													"feature_count": "2"
												}],
												"bedding": [{
													"bedding_type_id": "2",
													"bedding_type_name": "Queen",
													"bedding_count": "1"
												},{
													"bedding_type_id": "4",
													"bedding_type_name": "Bunks double & single set",
													"bedding_count": "1"
												}],
												"images": [{
													"image_type_id": "23",
													"image_type_name": "Bedroom",
													"image_url": "https:\/\/driveau.newbook.cloud\/instances_3b951b501ee06d886428eef064d803d2_588050ccc3a87.jpeg"
												},{
													"image_type_id": "24",
													"image_type_name": "Bathroom",
													"image_url": "https:\/\/driveau.newbook.cloud\/instances_3b951b501ee06d886428eef064d803d2_58804da109eb9.jpeg"
												}]
											}],
											"message": ""
										}
									
								
AnchorAccommodation Sites: List

Pull the list of possible Sites from NewBook.

Request Notes:

category_id can optionally be provided to limit results to a particular Category ID

type_id can optionally be provided to limit results to a particular Category Type ID

show_deactivated can optionally be provided as "true" to include deactivated Sites

Response Notes:

Sites can optionally inherit Features from their parent Category (see the accommodation_category_list request). When this is the case, site_features_specified will be false, the site_features array will be empty, and the Features should be referenced from the parent Category. When this is not the case, site_features_specified will be true, and only those Features specified on the Site are valid (including an empty site_features array meaning none).

Categories have a set of Images, and Sites do as well. Those returned in site_images should be displayed in conjunction with those from the Category.

Accommodation Sites: List Example

Request URL

https://api.newbook.cloud/rest/sites_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"site_id": "81",
												"category_id": "56",
												"category_name": "Holiday Rentals",
												"site_name": "Luxury Holiday Rental",
												"site_description": "A stylish holiday apartment ideally situated within the boardwalk entertainment precinct of the Surfers Paradise. Private balcony with amazing views. A walk or bike ride into Surfers Paradise central. Beautiful water ways, foreshore parks and playgrounds, rustic coastline with surf, fishing and swimming beaches.",
												"site_short_description": "Luxurious Holiday Rental apartment situated within the boardwalk entertainment precinct of Surfers Paradise.",
												"site_status": "Clean",
												"site_street": "Level 2, 9 Ouyan Street",
												"site_city": "Surfers Paradise",
												"site_postcode": "4217",
												"site_state_id": 4,
												"site_state_name": "Queensland",
												"site_country_id": 13,
												"site_country_name": "Australia",
												"site_lat": "-28.0031270",
												"site_long": "153.4177429",
												"level_id": "",
												"level_name": "",
												"site_size": {
													"id": "1",
													"name": "10x10",
													"length": "10.00",
													"width": "10.00",
													"height": "0.00",
													"unit": "m"
												},
												"parent_id": null,
												"child_ids": [],
												"custom_fields": [{
													"id": 1,
													"type": "text",
													"label": "Suitable for Families",
													"value": "No this is accommodation designed for couples-only"
												}],
												"site_images": [],
												"site_features_specified": false,
												"site_features": [],
												"map_markers": [],
												"notes": []
											},{
												"site_id": "104",
												"category_id": "28",
												"category_name": "Long Term Stays",
												"site_name": "Deluxe Apartment",
												"site_description": "Long-term deluxe accommodation in Surfers Paradise. Suitable for a couple or small family. Beautiful water ways, foreshore parks and playgrounds, rustic coastline with surf, fishing and swimming beaches.",
												"site_short_description": "Long-term deluxe accommodation in Surfers Paradise for a couple or family.",
												"site_status": "Clean",
												"site_street": "Level 2, 9 Ouyan Street",
												"site_city": "Surfers Paradise",
												"site_postcode": "4217",
												"site_state_id": 4,
												"site_state_name": "Queensland",
												"site_country_id": 13,
												"site_country_name": "Australia",
												"site_lat": "-28.0031270",
												"site_long": "153.4177429",
												"level_id": "",
												"level_name": "",
												"site_size": {
													"id": "2",
													"name": "20x20",
													"length": "20.00",
													"width": "20.00",
													"height": "0.00",
													"unit": "m"
												},
												"parent_id": null,
												"child_ids": [],
												"custom_fields": [{
													"id": 1,
													"type": "text",
													"label": "Suitable for Families",
													"value": "Yes of up to 2 children"
												}],
												"site_images": [{
													"image_type_id": "12",
													"image_type_name": "Kitchen",
													"image_url": "https:\/\/driveau.newbook.cloud\/instances_3b951b501ee06d886428eef064d803d2_588050cd2ab49.jpg"
												}],
												"site_features_specified": true,
												"site_features": [{
													"feature_id": "1",
													"feature_name": "Air conditioned",
													"feature_count": "1"
												},{
													"feature_id": "2",
													"feature_name": "Balcony",
													"feature_count": "1"
												},{
													"feature_id": "3",
													"feature_name": "Bathtub",
													"feature_count": "1"
												}],
												"map_markers": [],
												"notes": ["Suitable for up to two young children. Bathroom has a bathtub with appropriate facilities for infants."]
											}],
											"message": ""
										}
									
								
AnchorAccommodation Features: List

Retrieve the list of possible Accommodation Features in NewBook.

Accommodation Features: List Example

Request URL

https://api.newbook.cloud/rest/accommodation_features_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": "1",
												"name": "Bedroom"
											},{
												"id": "2",
												"name": "Air Conditioning"
											}],
											"message": ""
										}
									
								
AnchorAccommodation Sites: Get/Set Status

Retrieve/update the Status of a particular Site in NewBook.

Request Notes:

site_id or site_name must be provided to indicate the appropriate Site, but only 1 is required

site_status is optional and should only be provided when you wish to update the Status - valid options:

  • Clean
  • Dirty

Response Notes:

message will be filled only when site_status is updated

Accommodation Sites: Get/Set Status Example

Request URL

https://api.newbook.cloud/rest/sites_status

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"site_id": "3",
											"site_name": "001",
											"site_status": "Clean"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"site_id": "3",
												"site_name": "001",
												"site_status": null,
												"category_name": "Powered Site"
											},
											"message": "Successfully updated Site Status"
										}
									
								
AnchorSite Maps

Pull a list of Site Maps and their Markers from NewBook.

map_id is optional and when provided NewBook will return Markers from that Map alone.

period_from and period_to are optional and when provided, NewBook will force the Map Markers to return only for Sites, and will also perform an availability validation for the date range indicated. Please note, the Site still needs to have a Tariff applied and available for use on a booking before you can consider it sellable. This request does not validate the Tariff aspect.

adults, children, infants and animals are optional and when provided, NewBook will force the Map Markers to return only for Sites, and will also perform an occupant validation for the numbers requested. Please note, the Site still needs to have a Tariff applied and applicable for the occupant numbers for use on a booking before you can consider it sellable. This request does not validate the Tariff aspect.

Site Maps Example

Request URL

https://api.newbook.cloud/rest/sites_maps

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": "2",
												"name": "Park Map",
												"map_link": "https:\/\/drivedev.newbook.cloud\/instances_df16e7d1f60da0614b4b72eb95b02a86_55895e22ef045.jpg",
												"system_default": "1",
												"markers": [{
													"id": "2549",
													"marker_id": "1",
													"marker_type": "accommodation_sites",
													"top": "1012",
													"left": "554"
												}]
											}],
											"message": ""
										}
									
								
AnchorSites: Update

Update the details of a particular site inside of NewBook.

Request Notes:

site_id must be provided to update a particular Sites details.

Please see below for a list of optional details that can be updated on the Site. At least one of these must be provided.

  • name - Changes the name of the Site
  • short_description
  • description
  • opened_on - Supports either "null" to remove the opening date or a date to set the opening date.
  • closed_on - Supports either "null" to remove the closing date or a date to set the closing date.
  • category_id - An existing Category ID to change where the Site belongs
  • status - Either "Clean" or "Dirty"
  • gl_category_id - An existing Sub Client Account ID
  • gl_account_id - An existing active GL Account ID
  • show_online - A boolean for whether the Site is available on NewBook Online
  • overbooking - A boolean for whether the Site allows overbooking. Overbooking means that multiple Bookings can be made for the same period.
  • occupancy - A boolean for whether the Site will contribute to occupancy reports
  • notes - An array of notes to add to the Site
  • site_size_id - An existing Site Size ID to assign to the Site

Sites: Update Example

Request URL

https://api.newbook.cloud/rest/sites_update

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"site_id": "1",
											"name": "New Site Name",
											"notes": [
												"Adding a new note"
											]
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"site_id": "1"
											},
											"message": ""
										}
									
								
AnchorSite Sizes: List

Returns a list of active Site Sizes.

Request Notes:

show_inactive is optional and when provided with a truthy value, it will include inactive Site Sizes in the response.

Response Notes:

site_count is the number of active Sites that the Site Size is associated with.

Site Sizes: List Example

Request URL

https://api.newbook.cloud/rest/site_sizes_list

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here"
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": [
								{
									"site_size_id": 1,
									"name": "8m x 8.5m",
									"width": "8.50",
									"length": "8.00",
									"height": "0.00",
									"online": "1",
									"active": "1",
									"site_count": "3"
								},
								{
									"site_size_id": 2,
									"name": "4m x 4m",
									"width": "4.00",
									"length": "4.00",
									"height": "0.00",
									"online": "0",
									"active": "1",
									"site_count": "12"
								},
							],
							"message": ""
						}
					
				
AnchorSite Sizes: Create

Creates a Site Size.

Request Notes:

  • name is required.
  • online and active will default to true if not provided.
  • width, length and height will default to 0 if not provided. If provided, the values must be numeric.

Site Sizes: Create Example

Request URL

https://api.newbook.cloud/rest/site_sizes_create

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here",
							"name": "10x10",
							"width": 10,
							"length": 10,
							"online": "0",
							"active": "1"
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": {
								"site_size_id": 3
							},
							"message": ""
						}
					
				
AnchorSite Sizes: Update

Updates an existing Site Size.

Request Notes:

site_size_id must be provided to update a particular Site Size details.

Please see below for a list of optional details that can be updated on the Site Size. At least one of these must be provided.

  • name
  • online - supports values like "true", false, 1.
  • active - supports values like "true", false, 1.
  • width - must be numeric.
  • length - must be numeric.
  • height - must be numeric.

Site Sizes: Update Example

Request URL

https://api.newbook.cloud/rest/site_sizes_update

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here",
							"site_size_id": 3,
							"name": "11x10",
							"width": 11
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": {
								"site_size_id": 3
							},
							"message": ""
						}
					
				
AnchorCompanies: List

Retrieve the list of Companies for recording non-Booking-specific charges.

Request Notes:

search is optional and when provided it will restrict the results to the matching Companies. It will search their name and contact details (phone, email, etc) for a match

account_id is optional and when provided it will restrict the results to the matching Client Accounts.

type_id is optional and when provided will limit the results to the matching Company Type

created_when is optional and when supplied, restricts the returned Companies to only those which were created on the date given

Send account_breakdown as true to see the balance of each associated Sub Client Account (gl_category)

Companies: List Example

Request URL

https://api.newbook.cloud/rest/companies_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"search": "pty ltd",
											"created_when": "2016-02-01"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": "1",
												"type_id": 1,
												"name": "NewBook Pty Ltd",
												"street": "Level 2, 9 Ouyan Street",
												"city": "Surfers Paradise",
												"state": "Queensland (QLD)",
												"postcode": "4217",
												"country": "Australia",
												"account_id": "13783",
												"account_balance": "0.00",
												"account_currency_code": "AUD",
												"auto_billing_limit": null,
												"auto_debit": 1,
												"contact_details": [{
													"type": "phone",
													"content": "0756554600",
													"notes": "",
													"allow_transactional": 1,
													"allow_marketing": 1
												},{
													"type": "email",
													"content": "[email protected]",
													"notes": "",
													"allow_transactional": 1,
													"allow_marketing": 1
												}],
												"custom_fields": []
											},{
												"id": "2",
												"type_id": null,
												"name": "Xtreme.com.au Pty Ltd",
												"street": "15 Olympic Circuit",
												"city": "Southport",
												"state": "Queensland (QLD)",
												"postcode": "4211",
												"country": "Australia",
												"account_id": "78446",
												"account_balance": "0.00",
												"account_currency_code": "AUD",
												"auto_billing_limit": null,
												"auto_debit": 0,
												"contact_details": [{
													"type": "phone",
													"content": "0755314816",
													"notes": "",
													"allow_transactional": 1,
													"allow_marketing": 1
												},{
													"type": "email",
													"content": "[email protected]",
													"notes": "",
													"allow_transactional": 1,
													"allow_marketing": 1
												}],
												"custom_fields": [{
													"id": 1,
													"type": "text",
													"label": "My Test Field",
													"value": "Something"
												}]
											}],
											"message": ""
										}
									
								
AnchorCompany Types: List

Retrieve the list of Company Types for limiting the Company List.

Company Types: List Example

Request URL

https://api.newbook.cloud/rest/companies_types_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": 1,
												"name": "Supplier"
											}],
											"message": ""
										}
									
								
AnchorCompanies: Update

Update a particular Company

Request Notes:

company_id is required

contact_email and contact_phone can be provided to create or update Contact Details for a Company. When updating, these values will also check & not double up if the new information already exists on the Company. And if you would like to prevent the updating of existing Contact Details please supply update_existing_details as "false".

Alternatively you can manage Contact Details array directly:

				
					"contact_details": [
						{
							"id": 1,
							"type": "phone",
							"content": "0756554600",
							"notes": "",
							"allow_transactional": "1",
							"allow_marketing": "1",
							"remove": 0
						}
					]
				
			
  • id can be optionally provided when updating a Company to update or remove a particular Contact Detail
  • type is required
  • content is required
  • notes is optional.
  • allow_transactional is optional and will use the Ssytem Default when not provided.
  • allow_marketing is optional and will use the Ssytem Default when not provided
  • remove is optional and when true it will remove the Contact Detail from the Company

notes will add new details to the Company (not replace the existing information) and will check & not double up if the new information already exists on the Company. This can either be provided as a string, or as array of objects containing the following options:

  • content is required. This contains the contents of the note to be added.
  • type_id is optional, and will use the System Default if not provided as per the Note Types: List request.
  • output_message is optional and will default to true when not provided. This controls whether the note will display at the top of the page.
  • task_list is optional, and will default to false when note provided. This controls whether the note will display on any tasks lists.

Companies: Update Example

Request URL

https://api.newbook.cloud/rest/companies_update

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"company_id": "3",
											"name": "Website Enquiry",
											"contact_person": "John Doe",
											"contact_email": "[email protected]",
											"contact_phone": "1234567890",
											"notes": [
												"Some custom information",
												"Some more information"
											],
											"custom_fields": [{
												"field_id": 1,
												"field_value": "Something"
											}]
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"company_id": "1"
											},
											"message": "Successfully updated Company"
										}
									
								
AnchorCompanies Staff: List

Retrieve the list of Companies Staff for recording non-Booking-specific charges.

Request Notes:

account_id is optional and when provided it will restrict the results to the matching Client Accounts.

company_id is optional and when provided will limit the results to the matching Company

created_when is optional and when supplied, restricts the returned Staff to only those which were created on the date given

Send account_breakdown as true to see the balance of each associated Sub Client Account (gl_category)

Companies Staff: List Example

Request URL

https://api.newbook.cloud/rest/companies_staff_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"company_id": "3"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": "2",
												"firstname": "John",
												"lastname": "Doe",
												"account_id": "307",
												"account_balance": "0.00",
												"auto_billing_limit": null,
												"street": "",
												"city": "",
												"postcode": "",
												"state": "Unknown",
												"country": "New Zealand",
												"company_id": "3",
												"contact_details": [],
												"custom_fields": []
											}],
											"message": ""
										}
									
								
AnchorCompanies Staff: Update

Update a particular Company Staff

Request Notes:

company_staff_id or account_id must be provided to update the details of a particular Company Staff member.

contact_email and contact_phone can be provided to create or update Contact Details for a Company Staff. When updating, these values will also check & not double up if the new information already exists on the Company Staff. And if you would like to prevent the updating of existing Contact Details please supply update_existing_details as "false".

Alternatively you can manage Contact Details array directly:

				
					"contact_details": [
						{
							"id": 1,
							"type": "phone",
							"content": "0756554600",
							"notes": "",
							"allow_transactional": "1",
							"allow_marketing": "1",
							"remove": 0
						}
					]
				
			
  • id can be optionally provided when updating a Company Staff to update or remove a particular Contact Detail
  • type is required
  • content is required
  • notes is optional.
  • allow_transactional is optional and will use the Ssytem Default when not provided.
  • allow_marketing is optional and will use the Ssytem Default when not provided
  • remove is optional and when true it will remove the Contact Detail from the Company Staff

notes will add new details to the Company Staff (not replace the existing information) and will check & not double up if the new information already exists on the Company Staff. This can either be provided as a string, or as array of objects containing the following options:

  • content is required. This contains the contents of the note to be added.
  • type_id is optional, and will use the System Default if not provided as per the Note Types: List request.
  • output_message is optional and will default to true when not provided. This controls whether the note will display at the top of the page.
  • task_list is optional, and will default to false when note provided. This controls whether the note will display on any tasks lists.

Companies Staff: Update Example

Request URL

https://api.newbook.cloud/rest/companies_staff_update

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"company_staff_id": "2",
											"firstname": "John",
											"lastname": "Doe",
											"contact_email": "[email protected]",
											"contact_phone": "1234567890",
											"notes": [
												"Some custom information",
												"Some more information"
											],
											"custom_fields": [{
												"field_id": 1,
												"field_value": "Something"
											}]
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"company_staff_id": "2"
											},
											"message": "Successfully updated Company Staff"
										}
									
								
AnchorTravel Agents: List

Retrieve the list of Travel Agents for recording non-Booking-specific charges.

Request Notes:

name is optional and when provided it will restrict the results to the matching Travel Agents

created_when is optional and when supplied, restricts the returned Travel Agents to only those which were created on the date given

Send account_breakdown as true to see the balance of each associated Sub Client Account (gl_category)

Travel Agents: List Example

Request URL

https://api.newbook.cloud/rest/travel_agent_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"name": "",
											"created_when": "2016-02-01"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"name": "Booking.com",
												"street": "",
												"city": "",
												"state": "",
												"postcode": "",
												"country": "",
												"account_id": "293586",
												"account_balance": "0.00",
												"auto_billing_limit": null,
												"contact_details": [{
													"type": "email",
													"content": "[email protected]",
													"notes": "",
													"allow_transactional": 1,
													"allow_marketing": 1
												}]
											},{
												"name": "Expedia",
												"street": "",
												"city": "",
												"state": "",
												"postcode": "",
												"country": "",
												"account_id": "294247",
												"account_balance": "0.00",
												"auto_billing_limit": null,
												"contact_details": [{
													"type": "email",
													"content": "[email protected]",
													"notes": "",
													"allow_transactional": 1,
													"allow_marketing": 1
												}]
											}],
											"message": ""
										}
									
								
AnchorEvents: List

Retrieve a list of Events within the given time period.

Request Notes:

The only required fields are period_from, period_to and list_type - the rest are optional

list_type Shows Events which:
incoming1 are expected to Arrive during the specified dates
ongoing2 are currently In-House (dates not required)
departing2 are expected to Depart during the specified dates
departed have Departed during the specific dates
placed1 were placed during the specified dates
cancelled have been Cancelled during the specified dates
staying1 are expected to stay during the specified dates
quoted3 were placed during the specified dates
  • 1ignores Events of status Cancelled, and Quote
  • 2shows only Events of status Ongoing
  • 3shows only Events of status Quote

search is optional and when provided it will restrict the results to the matching Billing or Contact Client Accounts.

Send account_breakdown as true to see the balance of each associated Sub Client Account (gl_category)

Response Notes:

The billing_client_account_id field in the Event array can be used to charge to the Event Client Account, this may be different from the event_account_id when the Event is billing to Group, Company, etc

Please note unlike other responses, in the Events: List response account_breakdown is prefixed as event_account_breakdown to disambiguate against the other keys.

Inventory Item Notes:

The inventory_item field holds all the Inventory Items on the Event.

  • The stay_cost_contribution key on each inventory_item indicates whether the amount Increases the price of each night, or if it is Excluded from the price of each night.

Events: List Example

Request URL

https://api.newbook.cloud/rest/events_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"period_from": "2015-08-21 00:00:00",
											"period_to": "2015-08-21 23:59:59",
											"list_type": "ongoing"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": "2",
												"event_package_id": "null",
												"contact_account_id": "1002",
												"billing_account_id": "1002",
												"name": "Test",
												"period_from": "2022-12-03 14:00:00",
												"period_to": "2022-12-07 10:00:00",
												"adults": "1",
												"children": "0",
												"infants": "0",
												"animals": "0",
												"status": "Unconfirmed",
												"booked_when": "2022-12-01 11:30:00",
												"booked_by": "-2",
												"cancelled_when": "null",
												"cancelled_by": "null",
												"cancellation_reason_id": "null",
												"cancel_event_date": "null",
												"create_charges": "1",
												"contact_account_for": "events",
												"contact_account_for_id": "2",
												"contact_account_name": "Jane Doe",
												"billing_account_for": "events",
												"billing_account_for_id": "2",
												"billing_account_for_name": "Jane Doe",
												"billing_account_balance": "320.00",
												"event_account_id": "870",
												"event_account_balance": "320.00",
												"event_total": "320.00",
												"guest_list": [
													{
														"title": "",
														"firstname": "John",
														"lastname": "Doe",
														"email_address": "[email protected]",
														"contact_number": ""
													}
												],
												"activities": [
													{
														"facility_id": "4",
														"facility_name": "Function Rooms Marble Room",
														"description": "Tour",
														"gl_account_id": "12",
														"gl_category_id": "1",
														"period_from": "2022-12-03 14:00:00",
														"period_to": "2022-12-07 10:00:00",
														"adults": "1",
														"children": "0",
														"infants": "0",
														"animals": "0",
														"amount": "60.00"
													}
												],
												"facilities_hire": [
													{
														"facility_id": "3",
														"facility_name": "Barbeque Area 1",
														"description": "BBQ Hire",
														"gl_account_id": "12",
														"gl_category_id": "1",
														"period_from": "2022-12-03 14:00:00",
														"period_to": "2022-12-07 10:00:00",
														"adults": "1",
														"children": "0",
														"infants": "0",
														"animals": "0",
														"amount": "60.00"
													}
												],
												"inventory_items": [{
													"description": "Champagne",
													"stay_date": "2022-12-03",
													"stay_cost_contribution": "Include",
													"gl_account_id": "4",
													"gl_category_id": "2",
													"amount": "75.00"
												},{
													"description": "Picnic Basket",
													"stay_date": "2022-12-03",
													"stay_cost_contribution": "Increase",
													"gl_account_id": "4",
													"gl_category_id": "2",
													"amount": "125.00"
												}]
											},{
												"id": "3",
												"event_package_id": "null",
												"contact_account_id": "1003",
												"billing_account_id": "1003",
												"name": "Test",
												"period_from": "2022-12-03 14:00:00",
												"period_to": "2022-12-07 10:00:00",
												"adults": "1",
												"children": "0",
												"infants": "0",
												"animals": "0",
												"status": "Unconfirmed",
												"booked_when": "2022-12-01 11:30:00",
												"booked_by": "-2",
												"cancelled_when": "null",
												"cancelled_by": "null",
												"cancellation_reason_id": "null",
												"cancel_event_date": "null",
												"create_charges": "1",
												"contact_account_for": "events",
												"contact_account_for_id": "3",
												"contact_account_name": "Jane Doe",
												"billing_account_for": "events",
												"billing_account_for_id": "3",
												"billing_account_for_name": "Jane Doe",
												"billing_account_balance": "320.00",
												"event_account_id": "870",
												"event_account_balance": "320.00",
												"event_total": "320.00",
												"guest_list": [
													{
														"title": "",
														"firstname": "John",
														"lastname": "Doe",
														"email_address": "[email protected]",
														"contact_number": ""
													}
												],
												"activities": [
													{
														"facility_id": "4",
														"facility_name": "Function Rooms Marble Room",
														"description": "Tour",
														"gl_account_id": "12",
														"gl_category_id": "1",
														"period_from": "2022-12-03 14:00:00",
														"period_to": "2022-12-07 10:00:00",
														"adults": "1",
														"children": "0",
														"infants": "0",
														"animals": "0",
														"amount": "60.00"
													}
												],
												"facilities_hire": [
													{
														"facility_id": "3",
														"facility_name": "Barbeque Area 1",
														"description": "BBQ Hire",
														"gl_account_id": "12",
														"gl_category_id": "1",
														"period_from": "2022-12-03 14:00:00",
														"period_to": "2022-12-07 10:00:00",
														"adults": "1",
														"children": "0",
														"infants": "0",
														"animals": "0",
														"amount": "60.00"
													}
												],
												"inventory_items": [{
													"description": "Champagne",
													"stay_date": "2022-12-03",
													"stay_cost_contribution": "Include",
													"gl_account_id": "4",
													"gl_category_id": "2",
													"amount": "75.00"
												},{
													"description": "Picnic Basket",
													"stay_date": "2022-12-03",
													"stay_cost_contribution": "Increase",
													"gl_account_id": "4",
													"gl_category_id": "2",
													"amount": "125.00"
												}]
											}],
											"message": ""
										}
									
								
AnchorEvents: Get Details

Retrieve the details of a single Event.

Request Notes:

event_id must be provided to retrieve the Event.

Send account_breakdown as true to see the balance of each associated Sub Client Account (gl_category)

Response Notes:

The returned data from this request is identical to Events: List but for the specific Event alone.

If no such Event ID exists, the success response parameter will be "false" and no data will be returned.

Please note unlike other responses, in the Events: Get Details response account_breakdown is prefixed as event_account_breakdown to disambiguate against the other keys.

Events: Get Details Example

Request URL

https://api.newbook.cloud/rest/events_get

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"event_id": 2,
											"account_breakdown": true
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"id": "2",
												"event_package_id": "null",
												"contact_account_id": "1002",
												"billing_account_id": "1002",
												"name": "Test",
												"period_from": "2022-12-03 14:00:00",
												"period_to": "2022-12-07 10:00:00",
												"adults": "1",
												"children": "0",
												"infants": "0",
												"animals": "0",
												"status": "Unconfirmed",
												"booked_when": "2022-12-01 11:30:00",
												"booked_by": "-2",
												"cancelled_when": "null",
												"cancelled_by": "null",
												"cancellation_reason_id": "null",
												"cancel_event_date": "null",
												"create_charges": "1",
												"contact_account_for": "events",
												"contact_account_for_id": "2",
												"contact_account_name": "Jane Doe",
												"billing_account_for": "events",
												"billing_account_for_id": "2",
												"billing_account_for_name": "Jane Doe",
												"billing_account_balance": "320.00",
												"event_account_id": "870",
												"event_account_balance": "320.00",
												"event_total": "320.00",
												"guest_list": [
													{
														"title": "",
														"firstname": "John",
														"lastname": "Doe",
														"email_address": "[email protected]",
														"contact_number": ""
													}
												],
												"activities": [
													{
														"facility_id": "4",
														"facility_name": "Function Rooms Marble Room",
														"description": "Tour",
														"gl_account_id": "12",
														"gl_category_id": "1",
														"period_from": "2022-12-03 14:00:00",
														"period_to": "2022-12-07 10:00:00",
														"adults": "1",
														"children": "0",
														"infants": "0",
														"animals": "0",
														"amount": "60.00"
													}
												],
												"facilities_hire": [
													{
														"facility_id": "3",
														"facility_name": "Barbeque Area 1",
														"description": "BBQ Hire",
														"gl_account_id": "12",
														"gl_category_id": "1",
														"period_from": "2022-12-03 14:00:00",
														"period_to": "2022-12-07 10:00:00",
														"adults": "1",
														"children": "0",
														"infants": "0",
														"animals": "0",
														"amount": "60.00"
													}
												],
												"inventory_items": [{
													"description": "Champagne",
													"stay_date": "2022-12-03",
													"stay_cost_contribution": "Include",
													"gl_account_id": "4",
													"gl_category_id": "2",
													"amount": "75.00"
												},{
													"description": "Picnic Basket",
													"stay_date": "2022-12-03",
													"stay_cost_contribution": "Increase",
													"gl_account_id": "4",
													"gl_category_id": "2",
													"amount": "125.00"
												}],
												"event_account_breakdown": [{
													"name": "Accommodation",
													"gl_category_id": "1",
													"balance": "20.00"
												},{
													"name": "Extras",
													"gl_category_id": "2",
													"balance": "300.00"
												}]
											},
											"message": ""
										}
									
								
AnchorLeads: List

Retrieve/search the Leads database.

Request Notes:

id is optional and when provided it will restrict the results to those with a matching id

search is optional and when provided it will restrict the results to the matching Leads. It will search their name, contact person (first name and last name), and contact details (phone, email, etc) for a match

created_when is optional and when supplied, restricts the returned Leads to only those which were created on the date given

staff_id is optional and when supplied, restricts the returned Leads to those assigned to that User (see Users: List)

  • You can also provide staff_id_include as false to show Leads not assigned to that User
  • If you provide unassigned into the request parameter staff_id Leads that are unassigned will be returned
  • staff_id can be an array of User IDs

status_id is optional and when provided it will restrict the results to Leads with a matching Status (see Lead Statuses: List).

Send account_breakdown as true to see the balance of each associated Sub Client Account (gl_category)

Response Notes:

contact_details and custom_fields are arrays which will be empty when no data of that type is available

Leads: List Example

Request URL

https://api.newbook.cloud/rest/leads_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"search": "tourist",
											"created_when": "2016-02-01",
											"id": "1"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": "1",
												"firstname": "John",
												"lastname": "Doe",
												"name": "A Tourist Park",
												"account_id": "789",
												"account_balance": "0.00",
												"auto_billing_limit": null,
												"street": "Level 2, 9 Ouyan Street",
												"city": "Surfers Paradise",
												"state": "Queensland (QLD)",
												"postcode": "4217",
												"country": "Australia",
												"staff_id": "1",
												"created_when": "2017-08-25 22:44:26",
												"modified_when": "2018-12-18 10:24:51",
												"status_when": "2018-10-22 15:06:29",
												"staff_sharing": [
													{
														"staff_id": "1",
														"ownership": "50.00"
													},
													{
														"staff_id": "2",
														"ownership": "50.00"
													}
												],
												"contact_details": [{
													"type": "phone",
													"content": "0756554600",
													"notes": "",
													"allow_transactional": 1,
													"allow_marketing": 1
												},{
													"type": "email",
													"content": "[email protected]",
													"notes": "",
													"allow_transactional": 1,
													"allow_marketing": 1
												}],
												"custom_fields": [{
													"id": 2,
													"type": "text",
													"label": "My Test Field",
													"value": "Something"
												}],
												"status_id": "-1",
												"status_name": "Potential",
												"status_type": "0",
												"status_type_name": "Open",
												"points": "5",
												"parent_id": null,
												"interest_level": "Low",
												"expected_revenue": "50.00",
												"othername": "Johnny",
												"created_by": "14",
												"assigned_when": "2019-07-21 13:42:14",
												"title": "Mr",
												"notes": [{
													"type_id": "1",
													"content": "This is my Lead note",
													"created_when": "2022-12-01 11:30:00",
													"created_by": "11",
													"updated_when": "2022-12-02 00:00:00",
													"updated_by": "5"
												}],
												"status_reason": {
													"id": "1",
													"name": "My Status Reason"
												},
												"method": {
													"id": "6",
													"name": "My Lead Method"
												},
												"source": {
													"id": "1",
													"name": "Telephone"
												},
												"lead_types": [
													{
														"id": "1",
														"name": "Guests"
													},
													{
														"id": "2",
														"name": "Callers"
													}
												],
												"categories": [
													{
														"id": "3",
														"name": "My Lead Category"
													}
												],
												"interests": [
													{
														"id": "5",
														"name": "Camping"
													}
												],
												"inventory_items": [
													{
														"id": "5",
														"name": "Meal Upgrade"
													}
													{
														"id": "12",
														"name": "Helicopter Ride"
													}
												]
											}],
											"message": ""
										}
									
								
AnchorLeads: Create

Create a Lead within NewBook.

Request Notes:

name and/or firstname + lastname must be provided.

contact_email and contact_phone can be provided to create or update Contact Details for a Lead. When updating, these values will also check & not double up if the new information already exists on the Lead. And if you would like to prevent the updating of existing Contact Details please supply update_existing_details as "false".

Alternatively you can manage Contact Details array directly:

				
					"contact_details": [
						{
							"id": 1,
							"type": "phone",
							"content": "0756554600",
							"notes": "",
							"allow_transactional": "1",
							"allow_marketing": "1",
							"remove": 0
						}
					]
				
			
  • id can be optionally provided when updating a Lead to update or remove a particular Contact Detail
  • type is required
  • content is required
  • notes is optional.
  • allow_transactional is optional and will use the Ssytem Default when not provided.
  • allow_marketing is optional and will use the Ssytem Default when not provided
  • remove is optional and when true it will remove the Contact Detail from the Lead

notes will add new details to the Lead (not replace the existing information) and will check & not double up if the new information already exists on the Lead. This can either be provided as a string, or as array of objects containing the following options:

  • content is required. This contains the contents of the note to be added.
  • type_id is optional, and will use the System Default if not provided as per the Note Types: List request.
  • output_message is optional and will default to true when not provided. This controls whether the note will display at the top of the page.
  • task_list is optional, and will default to false when note provided. This controls whether the note will display on any tasks lists.

status_id is required. You must provide a valid option from the Lead Statuses: List request.

source_id is optional. You must provide a valid option from the Lead Sources: List request.

lead_type_id can optionally be provided as an array. All options must be valid options from the Lead Types: List request.

lead_categories_id can optionally be provided as an array. All options must be valid options from the Lead Categories: List request.

lead_interest_id can optionally be provided as an array. All options must be valid options from the Lead Interests: List request.

duplicate_matching can optionally be provided as one of the following options:

  • false: do not find duplicates
  • name: Name only
  • phone: Phone only
  • email: Email only
  • name_and_phone: Name and Phone
  • name_and_email: Name and Email
  • name_and_email_and_phone: Name and Email and Phone

When not provided, this determination falls back to the Instance Setting called When adding a Lead, Detect Duplicates using, which defaults to name_and_email.

If duplicates are encountered, NewBook will automatically update the record of the first duplicate found.

If specified, custom_fields must be based on the response to the Custom Fields request, to retrieve the different Custom Fields set up in the instance:

									
										"custom_fields": [
											{
												"field_id": 2,
												"field_value": 8
											}
										]
									
								

Leads: Create Example

Request URL

https://api.newbook.cloud/rest/leads_create

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"name": "Website Enquiry",
											"firstname": "John",
											"lastname": "Doe",
											"contact_email": "[email protected]",
											"contact_phone": "1234567890",
											"status_id": 1,
											"notes": [
												"Some custom information",
												"Some more information"
											]
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"lead_id": "1"
											},
											"message": "Successfully Created Lead"
										}
									
								
AnchorLeads: Update

Update an existing Lead within NewBook.

Request Notes:

lead_id is required

All other parameters are optional, please see Leads: Create for more details.

Leads: Update Example

Request URL

https://api.newbook.cloud/rest/leads_update

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"lead_id": "1",
											"name": "Website Enquiry",
											"firstname": "John",
											"lastname": "Doe",
											"contact_email": "[email protected]",
											"contact_phone": "1234567890",
											"notes": [
												"Some custom information",
												"Some more information"
											]
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"lead_id": "1"
											},
											"message": "Successfully updated Lead"
										}
									
								
AnchorLeads: Activity History

Retrieve Activity History for an existing Lead within NewBook.

Request Notes:

lead_id is required

Leads: Activity History Example

Request URL

https://api.newbook.cloud/rest/leads_activity_history

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"lead_id": "1"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [
												{
													"type": "Note #320",
													"date": "2019-02-08 15:01:14",
													"local_time": "3:01 PM (Brisbane, Australia)",
													"description": " Information: Called client yesterday.",
													"status": "",
													"user": "NewBook Support"
												},
												{
													"type": "Task #1341",
													"date": "2019-02-08 14:00:00",
													"local_time": "2:00 PM (Brisbane, Australia)",
													"description": "Accounting: Chase up Invoice",
													"status": "",
													"user": "NewBook Support"
												},
												{
													"type": "Sent Email #283",
													"date": "Queued",
													"local_time": "Queued",
													"description": "Test",
													"status": "Delivered,Opened x 1",
													"user": "NewBook Support"
												}
											],
											"message": ""
										}
									
								
AnchorLead Categories: List

Retrieves the list of available Lead Categories.

Lead Categories: List Example

Request URL

https://api.newbook.cloud/rest/leads_categories

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"1": "Website Contact Form",
												"2": "Website Blog Subscriber"
											},
											"message": ""
										}
									
								
AnchorLead Interests: List

Retrieves the list of available Lead Interests.

Lead Interests: List Example

Request URL

https://api.newbook.cloud/rest/leads_interests

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"1": "Product Type A",
												"2": "Product Type B"
											},
											"message": ""
										}
									
								
AnchorLead Sources: List

Retrieves the list of available Lead Sources.

Lead Sources: List Example

Request URL

https://api.newbook.cloud/rest/leads_sources

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"1": "Google",
												"2": "Facebook",
												"3": "Direct"
											},
											"message": ""
										}
									
								
AnchorLead Sources: Create

Create a new Lead Source within NewBook.

Lead Sources: Create Example

Request URL

https://api.newbook.cloud/rest/leads_sources_create

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"name": "test"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"source_id": "4"
											},
											"message": ""
										}
									
								
AnchorLead Statuses: List

Retrieves the list of available Lead Statuses.

Response Notes:

The IDs of the Lead Statuses in the example here are negative; these are defaults NewBook creates

Lead Statuses: List Example

Request URL

https://api.newbook.cloud/rest/leads_statuses

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [
												{
													"id": "1",
													"name": "Quoted",
													"status_type": "0",
													"status_type_name": "Open"
												},
												{
													"id": "-1",
													"name": "Potential",
													"status_type": "0",
													"status_type_name": "Open"
												},
												{
													"id": "-2",
													"name": "Won",
													"status_type": "1",
													"status_type_name": "Closed"
												},
												{
													"id": "-3",
													"name": "Lost",
													"status_type": "2",
													"status_type_name": "Lost"
												}
											],
											"message": ""
										}
									
								
AnchorLead Types: List

Retrieves the list of available Lead Types.

Lead Types: List Example

Request URL

https://api.newbook.cloud/rest/leads_types

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"1": "Customer",
												"2": "Supplier"
											},
											"message": ""
										}
									
								
AnchorSecurity Gates: List

Retrieve the list of Security Gates configured within NewBook

Security Gates: List Example

Request URL

https://api.newbook.cloud/rest/security_gate_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [
												{
													"security_gate_id": "1",
													"security_gate_name": "South Gate"
												},
												{
													"security_gate_id": "2",
													"security_gate_name": "North Gate"
												}
											],
											"message": ""
										}
									
								
AnchorSecurity Areas: List

Retrieve the list of Security Areas configured within NewBook.

Response Notes:

security_gates contains the list of Gates the Security Area is authorised for.

Security Areas: List Example

Request URL

https://api.newbook.cloud/rest/security_area_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [
												{
													"security_area_id": "1",
													"security_area_name": "All Access",
													"security_gates": [
														{
															"security_gate_id": "1",
															"security_gate_name": "South Gate"
														},
														{
															"security_gate_id": "2",
															"security_gate_name": "North Gate"
														}
													]
												},
												{
													"security_area_id": "2",
													"security_area_name": "North Gate Only",
													"security_gates": [
														{
															"security_gate_id": "2",
															"security_gate_name": "North Gate"
														}
													]
												}
											],
											"message": ""
										}
									
								
AnchorAccess Codes: List

Retrieve the Access Codes valid within the current 48 hour window (+ and - 24 hours).

Request Notes:

created_when is optional and when supplied, restricts the returned Access Codes to only those which were created on the date given

Send access_code_mappings as true to also return a list of Access Code mapping details to other software integrations such as Access Control Systems.

Response Notes:

The booking data fields are returned if the access_code given is related to a Booking

Access Codes: List Example

Request URL

https://api.newbook.cloud/rest/access_codes_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"created_when": "2016-02-01"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"access_code_id": "442724",
												"access_code_car_rego": "ITR86B",
												"access_code_period_from": "2016-02-05 14:00:00",
												"access_code_period_to": "2016-02-08 10:00:00",
												"security_area_id": "1",
												"security_area_name": "All Access",
												"booking_id": "345",
												"booking_name": "John Doe",
												"booking_arrival": "2016-02-05 14:00:00",
												"booking_departure": "2016-02-08 10:00:00",
												"booking_status": "Confirmed",
												"guest_id": "24",
												"guest_name": "John Doe"
											},{
												"access_code_id": "450987",
												"access_code_car_rego": "VRM555",
												"access_code_period_from": "2016-02-06 14:00:00",
												"access_code_period_to": "2016-02-07 10:00:00",
												"security_area_id": "1",
												"security_area_name": "All Access",
												"booking_id": null,
												"booking_name": null,
												"booking_arrival": null,
												"booking_departure": null,
												"booking_status": null,
												"guest_id": null,
												"guest_name": null
											}],
											"message": ""
										}
									
								
AnchorAccess Codes: Push History

Records access history for particular Access Codes and their Bookings.

Request Notes:

access_history an array of individual access attempts, containing:

  • access_code_id is required
  • booking_id is optional; if not provided NewBook will try to determine the Booking based on the Access Code record in the database
  • security_gate_id is required. It can be determined from the Security Gates: List request
  • description is required to specified what happened for this entry.
  • granted is optional. If not provided NewBook will determine this based on the description being "success"
  • timestamp is optional. If not provided it will default to the current timestamp

Access Codes: Push History Example

Request URL

https://api.newbook.cloud/rest/access_codes_history

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"access_history": [{
												"access_code_id": "442724",
												"booking_id": "345",
												"security_gate_id": "1",
												"description": "Failure",
												"granted": "0",
												"timestamp": "2016-02-05 10:52:00"
											},{
												"access_code_id": "442724",
												"booking_id": "345",
												"security_gate_id": "1",
												"description": "Success",
												"granted": "1",
												"timestamp": "2016-02-05 10:55:00"
											},{
												"access_code_id": "450987",
												"booking_id": null,
												"security_gate_id": "2",
												"description": "Unlocked",
												"granted": "1",
												"timestamp": "2016-02-05 11:30:00"
											}]
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [],
											"message": "Created 3 Access History Records"
										}
									
								
AnchorAccess Codes: Get History

Returns access history for particular Access Codes.

Request Notes:

Can be provided any combination of the below filters to limit results:

  • access_code_id, booking_id and security_gate_id are allowed to be integers or arrays of integers corresponding to particular values found in NewBook.
  • description is allowed to be a string or an array of strings and will only find exact matches for the description specified.
  • period_from and period_to will restrict history to results from later or earlier than the specified times respectively. Both can be provided to find results from a specific period.

Access Codes: Get History Example

Request URL

https://api.newbook.cloud/rest/access_codes_get_history

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"access_code_id": 1234,
											"booking_id": 10,
											"security_gate_id": [1,2,3],
											"period_from": "2022-12-01",
											"period_to": "2022-12-03",
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [
												{
													"id": "100",
													"access_code_id": "1234",
													"booking_id": "10",
													"security_gate_id": "1",
													"description": "granted",
													"timestamp": "2022-12-01 11:30:00"
												},
												{
													"id": "99",
													"access_code_id": "1234",
													"booking_id": "10",
													"security_gate_id": "1",
													"description": "granted",
													"timestamp": "2022-12-01 11:30:00"
												},
												{
													"id": "98",
													"access_code_id": "1234",
													"booking_id": "10",
													"security_gate_id": "2",
													"description": "granted",
													"timestamp": "2022-12-03 14:00:00"
												}
											],
											"message": ""
										}
									
								
AnchorGL Accounts: List

Pull the list of GL Accounts from within NewBook.

Request Notes:

id, code, short_description, and long_description are all optional and when any of them are provided they will restrict the results to the matching GL Accounts (each field searches specifically)

show_inactive is optional and when provided with a truthy value, it will include inactive GL Accounts in the response.

Response Notes:

If refundable is set to 1 (true) it means any charges raised in this GL Account are Security Deposits aka Bonds. When these are paid off, the assumption is that money will eventually be returned to the Guest (or converted to other income e.g. Property Damage)

GL Accounts: List Example

Request URL

https://api.newbook.cloud/rest/gl_account_list

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here"
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": [
								{
									"gl_account_id": "1",
									"gl_account_code": "ACC",
									"gl_account_name": "Accommodation",
									"long_description": "",
									"refundable": "0",
									"gl_group_id": null,
									"gl_group_name": null,
									"active": "1"
								},
								{
									"gl_account_id": "2",
									"gl_account_code": "POS",
									"gl_account_name": "POS Charges",
									"long_description": "",
									"refundable": "0",
									"gl_group_id": "1",
									"gl_group_name": "Extras",
									"active": "1"
								},
								{
									"gl_account_id": "3",
									"gl_account_code": "BOND",
									"gl_account_name": "Bonds",
									"long_description": "",
									"refundable": "1",
									"gl_group_id": "1",
									"gl_group_name": "Extras",
									"active": "1"
								},
								{
									"gl_account_id": "4",
									"gl_account_code": "FD",
									"gl_account_name": "Food",
									"long_description": "",
									"refundable": "0",
									"gl_group_id": "1",
									"gl_group_name": "Extras",
									"active": "1"
								}
							],
							"message": ""
						}
					
				
AnchorGL Accounts: Create

Creates a GL Account.

Request Notes:

  • code is required.
  • name is required.
  • long_description
  • refundable will default to false if not provided.
  • reportable will default to true if not provided.
  • gl_group_id must match the ID of an existing GL Account Group ID found at GL Accounts Groups: List if provided.
  • active will default to true if not provided.

GL Accounts: Create Example

Request URL

https://api.newbook.cloud/rest/gl_account_create

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here",
							"code": "FD",
							"name": "Food",
							"refundable": "0",
							"reportable": "1",
							"gl_group_id": 12,
							"active": "1"
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": {
								"gl_account_id": 53
							},
							"message": ""
						}
					
				
AnchorGL Accounts: Update

Updates an existing GL Account.

Request Notes:

gl_account_id must be provided to update a particular GL Accounts details.

Please see below for a list of optional details that can be updated on the GL Account. At least one of these must be provided.

  • code
  • name
  • long_description
  • refundable - supports values like "true", false, 1.
  • reportable - supports values like "true", false, 1.
  • active - supports values like "true", false, 1.
  • gl_group_id must match the ID of an existing GL Account Group ID found at GL Accounts Groups: List if provided.

GL Accounts: Update Example

Request URL

https://api.newbook.cloud/rest/gl_account_update

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here",
							"gl_account_id": 3,
							"name": "Beverages"
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": {
								"gl_account_id": 3
							},
							"message": ""
						}
					
				
AnchorGL Accounts Groups: List

Pull the list of GL Account Groups from within NewBook.

Request Notes:

show_inactive is optional and when provided with a truthy value, it will include inactive GL Account Groups in the response.

id can also be optionally provided to filter results to a particular GL Account Group ID.

GL Accounts Groups: List Example

Request URL

https://api.newbook.cloud/rest/gl_account_groups_list

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here"
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": [
								{
									"gl_account_group_id": 1,
									"name": "Lodge Accommodation",
									"prefix": "",
									"active": "1"
								},
								{
									"gl_account_group_id": 2,
									"name": "Campsite Accommodation",
									"prefix": "",
									"active": "1"
								},
								{
									"gl_account_group_id": 3,
									"name": "Activities",
									"prefix": "",
									"active": "1"
								},
								{
									"gl_account_group_id": 4,
									"name": "F&B",
									"prefix": "",
									"active": "1"
								}
							],
							"message": ""
						}
					
				
AnchorGL Accounts Groups: Create

Creates a GL Account Group.

Request Notes:

  • name is required.
  • prefix
  • active will default to true if not provided.

GL Accounts Group: Create Example

Request URL

https://api.newbook.cloud/rest/gl_account_groups_create

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here",
							"name": "Retail",
							"prefix": "",
							"active": "1"
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": {
								"gl_account_group_id": 5
							},
							"message": ""
						}
					
				
AnchorGL Accounts Groups: Update

Updates an existing GL Account Group.

Request Notes:

gl_account_group_id must be provided to update a particular GL Account Groups details.

Please see below for a list of optional details that can be updated on the GL Account Group. At least one of these must be provided.

  • name
  • prefix
  • active - supports values like "true", false, 1.

GL Accounts Group: Update Example

Request URL

https://api.newbook.cloud/rest/gl_account_groups_update

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here",
							"gl_account_group_id": 4,
							"name": "Food&Beverages"
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": {
								"gl_account_group_id": 4
							},
							"message": ""
						}
					
				
AnchorSub Client Accounts: List

Pull the list of Sub Client Accounts (aka GL Categories) from within NewBook.

Sub Client Accounts: List Example

Request URL

https://api.newbook.cloud/rest/gl_category_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"gl_category_id": "1",
												"gl_category_name": "Accommodation"
											},{
												"gl_category_id": "2",
												"gl_category_name": "Extras"
											}],
											"message": ""
										}
									
								
AnchorClients Accounts: List

Retrieve a list of Client Accounts.

Request Notes:

for (optional): An array of the type of Client Account to return

Send account_breakdown as true to see the balance of each associated Sub Client Account (gl_category)

Clients Accounts: List Example

Request URL

https://api.newbook.cloud/rest/clients_accounts_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"for": [
												"companies"
											],
											"account_breakdown": true
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": "10",
												"for": "companies",
												"for_id": "20",
												"for_name": "Acme Pty Ltd",
												"balance": "12.00",
												"active": "1",
												"account_breakdown": [{
													"name": "Accommodation",
													"gl_category_id": "1",
													"balance": "0.00"
												},{
													"name": "Extras",
													"gl_category_id": "2",
													"balance": "12.00"
												}]
											}],
											"message": ""
										}
									
								
AnchorClients Accounts: Get

Retrieve a particular Client Account.

Request Notes:

account_id: The Account ID to query

Send account_breakdown as true to see the balance of each associated Sub Client Account (gl_category)

Clients Accounts: Get Example

Request URL

https://api.newbook.cloud/rest/clients_accounts_get

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"account_id": "10"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"account_id": "10",
												"account_for": "companies",
												"account_for_id": "20",
												"account_for_name": "Acme Pty Ltd",
												"account_balance": "12.00",
												"account_active": "1"
											},
											"message": ""
										}
									
								
AnchorCharges: Create

Used to charge to a Client Account.

Request Notes:

account_id: The Client Account ID retrieved in a previous request

generated_when (optional): The datetime to record for the charge. Defaults to the current timestamp

gl_account_code: The GL Account code to record for the Charge. You can use gl_account_id instead by using the GL Accounts: List request for list of valid IDs

gl_category_id: Use the Sub Client Accounts: List request to retrieve a list of valid IDs

tax_free: 1 = Tax Free, 0 = Has Tax

tax_rates: (optional) Instead of NewBook calculating the Tax Amounts for you, use this parameter to manually provide Tax Amounts

  • 					
    						[
    							{"tax_id":sourced from NewBook,"tax_amount":number},
    							{"tax_id":sourced from NewBook,"tax_amount":number}
    						]
    					
    				
  • tax_id: is based on the response to 3rd Party Tax Rates

payment_amount (optional): tells NewBook how much the Payment taken was. When specified, payment_type will also be required to create the Payment.

payment_type (optional): tells NewBook how the Payment was received - valid options:

  • cash
  • cheque
  • visa
  • mastercard
  • amex
  • diners
  • discover
  • jcb
  • eftpos
  • eft (online banking funds transfer)
  • eurocard
  • bartercard

inventory_item_id (optional): links this Charge to a matching Inventory Item for reporting purposes

booking_id (optional): tells NewBook which Booking this Charge is related to, useful for when the Booking is billing to a Company Client Account

Response Notes:

If payment_type was provided in the request, you will receive a payment_id in the response

Charges: Create Example

Request URL

https://api.newbook.cloud/rest/charges_create

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"account_id": "2",
											"generated_when": "2015-09-13 14:00:00",
											"description": "Misc Charge",
											"gl_account_code": "POS",
											"gl_category_id": "1",
											"amount": "3.95",
											"tax_free": "0",
											"payment_amount": "3.95"
											"payment_type": "visa"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"charge_id": "7",
												"payment_id": "10"
											},
											"message": ""
										}
									
								
AnchorCharges: List

Used to retrieve a list of Charges

Request Notes:

account_id: Can optionally filter the list by Client Account ID

account_for: Can optionally filter the list by Client Account Type, possible options include:

  • leads
  • guests
  • bookings
  • companies
  • travel_agents

period_from + period_to: Can optionally be provided together to find Charges raised or voided within that time period.

Charges: List Example

Request URL

https://api.newbook.cloud/rest/charges_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"account_id": [
												"2"
											],
											"period_from": "2017-06-15 00:00:00",
											"period_to": "2017-06-15 23:59:59"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": 9,
												"account_id": 10,
												"account_for": "bookings",
												"account_for_id": "34",
												"account_for_name": "John Doe",
												"gl_account_id": 1,
												"gl_category_id": 1,
												"description": "Accommodation",
												"amount": 119.95,
												"amount_inc_tax": 119.95,
												"amount_ex_tax": 109.05,
												"tax": 10.90,
												"tax_breakdown": [
													{
														"tax_id": 1,
														"tax_name": "GST",
														"tax_amount": 10.90
													}
												],
												"generated_when": "2017-07-15 12:30:00",
												"voided_when": null,
												"gl_account_code": "1-100"
											}],
											"message": ""
										}
									
								
AnchorCredits: Create

Used to add negative charges to a Client Account (not to be used for payments - that is a separate request).

Request Notes:

account_id: The Client Account ID retrieved in a previous request

generated_when (optional): The datetime to record for the credit. Defaults to the current timestamp

gl_account_code: The GL Account code to record for the Charge. You can use gl_account_id instead by using the GL Accounts: List request for list of valid IDs

gl_category_id: Use the Sub Client Accounts: List request to retrieve a list of valid IDs

tax_free: 1 = Tax Free, 0 = Has Tax

tax_rates: (optional) Instead of NewBook calculating the Tax Amounts for you, use this parameter to manually provide Tax Amounts

  • 					
    						[
    							{"tax_id":sourced from NewBook,"tax_amount":number},
    							{"tax_id":sourced from NewBook,"tax_amount":number}
    						]
    					
    				
  • tax_id: is based on the response to 3rd Party Tax Rates

refund_amount (optional): tells NewBook how much the Refund processed was for. When specified, refund_type will also be required to create the Refund.

refund_type (optional): tells NewBook if the Credit has been Refunded - valid options:

  • cash
  • cheque
  • visa
  • mastercard
  • amex
  • diners
  • discover
  • jcb
  • eftpos
  • eft (online banking funds transfer)
  • eurocard
  • bartercard

inventory_item_id (optional): links this Credit to a matching Inventory Item for reporting purposes

booking_id (optional): tells NewBook which Booking this Credit is related to, useful for when the Booking is billing to a Company Client Account

Response Notes:

If refund_type was provided in the request, you will receive a refund_id in the response

Credits: Create Example

Request URL

https://api.newbook.cloud/rest/credits_create

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"account_id": "2",
											"generated_when": "2015-09-13 14:00:00",
											"description": "Misc Credit",
											"gl_account_code": "POS",
											"gl_category_id": "1",
											"amount": "3.95",
											"tax_free": "0",
											"refund_amount": "3.95"
											"refund_type": "visa"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"credit_id": "7",
												"refund_id": "10"
											},
											"message": ""
										}
									
								
AnchorCredits: List

Used to retrieve a list of Credits

Request Notes:

account_id: Can optionally filter the list by Client Account ID

account_for: Can optionally filter the list by Client Account Type, possible options include:

  • leads
  • guests
  • bookings
  • companies
  • travel_agents

period_from + period_to: Can optionally be provided together to find Credits raised or voided within that time period.

Credits: List Example

Request URL

https://api.newbook.cloud/rest/credits_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"account_id": [
												"2",
											],
											"period_from": "2017-06-15 00:00:00",
											"period_to": "2017-06-15 23:59:59"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": 6,
												"account_id": 10,
												"account_for": "bookings",
												"account_for_id": "34",
												"account_for_name": "John Doe",
												"gl_account_id": 1,
												"gl_category_id": 1,
												"description": "Discount",
												"amount": 20.00,
												"amount_inc_tax": 20.00,
												"amount_ex_tax": 18.18,
												"tax" 1.82:
												"tax_breakdown": [
													{
														"tax_id": 1,
														"tax_name": "GST",
														"tax_amount": 1.82
													}
												],
												"generated_when": "2017-07-15 13:30:00",
												"voided_when": null,
												"gl_account_code": "1-100"
											}],
											"message": ""
										}
									
								
AnchorTransaction Fees: Get

Used to calculate Transaction Fees for the requested Payment Type

Request Notes:

amount (required): The amount to calculate transaction fee.

type (required): Please see the Payment Types request for a list of valid types.

Transaction Fees: Get Example

Request URL

https://api.newbook.cloud/rest/transaction_fees_get

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"amount": "100",
											"type": "visa"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"inventory_item_id": null,
												"id": "1",
												"name": "Transaction Fee",
												"refunds": "0",
												"gl_account_id": "1",
												"gl_category_id": "1",
												"amount": 10,
												"base_amount": 10,
												"exclusive_tax_amount": 0,
												"tax_free": "0",
												"show_offline": "1"
											}],
											"message": ""
										}
									
								
AnchorPayments: Create

Used to add payments to a Client Account.

Request Notes:

account_id (required): The Client Account ID retrieved in a previous request

amount (required): The amount to record as paid

description (required): A textual label for the payment - can be anything but is required

type (required): Please see the Payment Types request for a list of valid types. Please note that balance transfers are not currently supported for use as a Payment Type

type_reference: Alpha-numeric descriptor for the payment

generated_when: The datetime to record for the payment. Defaults to the current timestamp

gl_category_id: Use the Sub Client Accounts: List request to retrieve a list of valid IDs

deposit: 1/0, default 0; Whether or not this payment should be considered Deposits Held for reporting purposes

invoice_id: (optional): Reconcile towards the nominated Invoice. If you need to, you can use the Invoices: List request to retrieve a Invoice(s) for an account, and return one of those IDs. This parameter can be provided as either a single Invoice ID or an array of Invoice IDs. Using this parameter will ignore reconcile_payment.

reconcile_payment (optional): 1/0, default 0; Whether saving this payment should attribute it towards existing charges on the account. This is encouraged, but for backwards-compatibility, the default behaviour is 0.

auto_receipt (optional): Please see the System Templates: List request for a list of valid System Templates. Alternatively you can provide "default" to utilise the Default Receipt Template.

Recording Credit Card Transactions (optional)

If you have a Credit Card Gateway linked to NewBook and are using the same Gateway within your application, you can provide the following parameters to record the payment as a Credit Card Transaction for future use* within NewBook:

  • type_reference (required): The Transaction ID from the Credit Card Gateway
  • cc_name (required): The name on the Credit Card
  • cc_last_digits (required): This must be the Last 4 digits of the Credit Card
  • cc_gateway (required): The type of Credit Card Gateway, will be provided by NewBook

* when provided this way, the payment can be refunded through the Gateway from within NewBook if required. The payment can also have its Gateway status verified inside NewBook if required (e.g. validate it legitimately succeeded/failed).

Payments: Create Example

Request URL

https://api.newbook.cloud/rest/payments_create

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"account_id": "2",
											"amount": "50",
											"description": "Misc Payment",
											"type": "visa",
											"type_reference": "abc_1234567890",
											"generated_when": "2015-09-13 14:00:00",
											"gl_category_id": "1",
											"deposit": "0"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"payment_id": "54",
												"receipt_id": 75
											},
											"message": ""
										}
									
								
AnchorPayments: List

Used to retrieve a list of Payments

Request Notes:

account_id: Can optionally filter the list by Client Account ID

account_for: Can optionally filter the list by Client Account Type, possible options include:

  • leads
  • guests
  • bookings
  • companies
  • travel_agents

period_from + period_to: Can optionally be provided together to find Payments received or voided within that time period.

If get_paid_by is provided as "true" the Payment object in the response will include the following additional information:

								
									"paid_by": "24",
									"paid_by_for": "guests",
									"paid_by_for_id": "15",
									"paid_by_for_name": "Jane Doe"
								
							

Response Notes:

You can run the Payments Types request to get the list of possible Payment Types.

transaction_method can be one of the following:

  • manual - a manually recorded Payment
  • cc_gateway - processed through a Credit Card Gateway
  • dd_gateway - processed through a Direct Debit Gateway
  • eftpos_terminal - processed through an Eftpos Terminal

Payments: List Example

Request URL

https://api.newbook.cloud/rest/payments_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"account_id": [
												"2"
											],
											"period_from": "2017-06-15 00:00:00",
											"period_to": "2017-06-15 23:59:59"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": 9,
												"account_id": 10,
												"account_for": "bookings",
												"account_for_id": "34",
												"account_for_name": "John Doe",
												"gl_category_id": 1,
												"type": "mastercard",
												"transaction_method": "cc_gateway",
												"description": "Booking Deposit",
												"amount": "100.00",
												"generated_when": "2017-07-15 12:30:00",
												"voided_when": null
											}],
											"message": ""
										}
									
								
AnchorPayment Types

Pull a list of Payment / Refund Types from NewBook.

Payment Types Example

Request URL

https://api.newbook.cloud/rest/payments_types

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"type": "amex",
												"default_translation": "AMEX",
												"current_translation": "AMEX",
												"active_offline": "1",
												"active_online": "1",
												"is_card": "1",
												"combine_cc": "1",
												"type_reference": "1",
												"rounding": "0"
											}],
											"message": ""
										}
									
								
AnchorRefunds: Create

Used to add refunds to a Client Account.

Request Notes:

account_id: The Client Account ID retrieved in a previous request

generated_when (optional): The datetime to record for the refund. Defaults to the current timestamp

gl_category_id: Use the Sub Client Accounts: List request to retrieve a list of valid IDs

type: please see the Payment Types request for a list of valid types. Please note that balance transfers are not currently supported for use as a Payment Type

type_reference (optional): alpha-numeric descriptor for the refund

Refunds: Create Example

Request URL

https://api.newbook.cloud/rest/refunds_create

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"account_id": "2",
											"generated_when": "2015-09-13 14:00:00",
											"description": "Misc Refund",
											"gl_category_id": "1",
											"amount": "50",
											"type": "visa",
											"type_reference": "def_0987654321"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"refund_id": "55"
											},
											"message": ""
										}
									
								
AnchorRefunds: List

Used to retrieve a list of Refunds

Request Notes:

account_id: Can optionally filter the list by Client Account ID

account_for: Can optionally filter the list by Client Account Type, possible options include:

  • leads
  • guests
  • bookings
  • companies
  • travel_agents

period_from + period_to: Can optionally be provided together to find Refunds given or voided within that time period.

If get_refunded_to is provided as "true" the Refund object in the response will include the following additional information:

								
									"refunded_to": "24",
									"refunded_to_for": "guests",
									"refunded_to_for_id": "15",
									"refunded_to_for_name": "Jane Doe"
								
							

Response Notes:

You can run the Payments Types request to get the list of possible Refund Types.

transaction_method can be one of the following:

  • manual - a manually recorded Payment
  • cc_gateway - processed through a Credit Card Gateway
  • dd_gateway - processed through a Direct Debit Gateway
  • eftpos_terminal - processed through an Eftpos Terminal

Refunds: List Example

Request URL

https://api.newbook.cloud/rest/refunds_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"account_id": [
												"2"
											],
											"period_from": "2017-06-15 00:00:00",
											"period_to": "2017-06-15 23:59:59"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": 9,
												"account_id": 10,
												"account_for": "bookings",
												"account_for_id": "34",
												"account_for_name": "John Doe",
												"gl_category_id": 1,
												"type": "mastercard",
												"transaction_method": "cc_gateway",
												"description": "Deposit Refund",
												"amount": "100.00",
												"generated_when": "2017-07-15 12:30:00",
												"voided_when": null
											}],
											"message": ""
										}
									
								
AnchorToken: Store

Used to store a credit card token created outside of NewBook

The token must be created using the same credit card gateway account as used in NewBook otherwise processing payments will fail

Request Notes:

for: Must be one of the following:

  • guests
  • leads
  • users
  • companies
  • companies_staff
  • travel_agents
  • travel_agents_staff

for_id: ID of the above entity to store the token against

token: Credit card token created using the same credit card gateway account as used in NewBook

last_digits: Last 4 digits of the credit card number to be displayed within the NewBook interface

card_type: Must be one of the results from Payment Types which is marked as is_card=1

expiry: Credit card expiry date. An object matching this format:

								
									{
										month: "MM",
										year: "YYYY"
									}
								
							

card_name: Can optionally override the name on the card

gateway_id: Can optionally store the token against a specific NewBook credit card gateway connection other than the default

Token: Store Example

Request URL

https://api.newbook.cloud/rest/token_store

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"for": "guests",
											"for_id": 20,
											"token": "123abc",
											"last_digits": 1234,
											"card_name": "John Doe",
											"card_type": "visa",
											"expiry": {
												"month": "02",
												"year": "2021"
											}
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [
												"id": "123"
											],
											"message": "Created Token Credit Card Authorisation"
										}
									
								
Anchor3rd Party Tax Rates

Used to retrieve Tax Rates that can be used when creating Charges / Credits with custom Tax Amounts.

3rd Party Tax Rates Example

Request URL

https://api.newbook.cloud/rest/third_party_tax_rates

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [
												{
													"tax_id": "1",
													"tax_name": "Tax"
												}
											],
											"message": ""
										}
									
								
AnchorQuotes: List (CRM)

Used to retrieve a list of Quotes

Request Notes:

account_id: Can optionally filter the list by Client Account ID

account_for: Can optionally filter the list by Client Account Type, possible options include:

  • leads
  • guests
  • bookings
  • companies
  • travel_agents

period_from + period_to: Can optionally be provided together to find Invoices generated or voided within that time period.

Quotes: List (CRM) Example

Request URL

https://api.newbook.cloud/rest/quotes_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"account_id": [
												"2"
											],
											"period_from": "2017-06-15 00:00:00",
											"period_to": "2017-06-15 23:59:59"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": "14",
												"account_id": "402",
												"account_for": "companies",
												"account_for_id": "3",
												"account_for_name": "Acme",
												"name": "Fix Website",
												"description": "<p>Details about this job.</p>",
												"status": "completed",
												"expiry_date": "2017-03-15",
												"approval_status": "approved",
												"approved_when": "2017-03-01 14:08:29",
												"generated_when": "2017-03-01 13:39:27",
												"total": 648.5,
												"invoice_ids": [],
												"signed_documents": [{
													"name": "NewBook Quote for Fix Website",
													"sent_on": "2017-03-01 13:57:50",
													"signed_when": "2017-03-01 14:08:29",
													"esignature_url": "http://tempurl.org/signature_link"
												}],
												"notes": [{
													"type_id": "1",
													"content": "This is my Quote note",
													"created_when": "2022-12-01 11:30:00",
													"created_by": "11",
													"updated_when": "2022-12-02 00:00:00",
													"updated_by": "5"
												}]
											}],
											"message": ""
										}
									
								
AnchorQuotes: PDF Content (CRM)

Used to retrieve the PDF content for a Quote.

Quotes: PDF Content (CRM) Example

Request URL

https://api.newbook.cloud/rest/quotes_pdf_content

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"quote_id": 882
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"pdf_content": "<p>HTML for the Quote PDF will appear here.</p>"
											},
											"message": ""
										}
									
								
AnchorInvoices: List

Used to retrieve a list of Invoices

Request Notes:

account_id: Can optionally filter the list by Client Account ID

account_for: Can optionally filter the list by Client Account Type, possible options include:

  • leads
  • guests
  • bookings
  • companies
  • travel_agents

period_from + period_to: Can optionally be provided together to find Invoices generated or voided within that time period.

fetch_guests: Can optionally be provided to include the guest_id for each Invoice (where available).

fetch_items: Can optionally be provided to include details about each Item on Invoices.

If get_invoiced_to is provided as "true" the Invoice object in the response will include the following additional information:

								
									"invoiced_to": "24",
									"invoiced_to_for": "guests",
									"invoiced_to_for_id": "15",
									"invoiced_to_for_name": "Jane Doe"
								
							

Invoices: List Example

Request URL

https://api.newbook.cloud/rest/invoices_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"account_id": [
												"2"
											],
											"period_from": "2017-06-15 00:00:00",
											"period_to": "2017-06-15 23:59:59"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": "882",
												"account_for": "bookings",
												"account_for_id": "34",
												"account_for_name": "John Doe",
												"description": "Accommodation",
												"po_number": "",
												"due_on": "2017-06-27",
												"total": 330,
												"paid_total": 330,
												"generated_when": "2017-06-20 00:00:00",
												"voided_when": null
											}],
											"message": ""
										}
									
								
AnchorInvoices: PDF Content

Used to retrieve the PDF content for an Invoice.

Invoices: PDF Content Example

Request URL

https://api.newbook.cloud/rest/invoices_pdf_content

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"invoice_id": 882
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"pdf_content": "<p>HTML for the Invoice PDF will appear here.</p>"
											},
											"message": ""
										}
									
								
AnchorReceipts: List

Used to retrieve a list of Receipts

Request Notes:

account_id: Can optionally filter the list by Client Account ID

account_for: Can optionally filter the list by Client Account Type, possible options include:

  • leads
  • guests
  • bookings
  • companies
  • travel_agents

period_from + period_to: Can optionally be provided together to find Receipts generated or voided within that time period.

fetch_guests: Can optionally be provided to include the guest_id for each Receipt (where available).

fetch_invoices: Can optionally be provided to include the Invoice + Payment Type breakdown for each Receipt (where available).

If get_receipted_to is provided as "true" the Receipt object in the response will include the following additional information:

								
									"receipted_to": "24",
									"receipted_to_for": "guests",
									"receipted_to_for_id": "15",
									"receipted_to_for_name": "Jane Doe"
								
							

Response Notes:

total: Will be a negative value for Payment Receipts and a positive value for Refund Receipts. This is to reflect how the Receipt affects their Client Account Balance.

Receipts: List Example

Request URL

https://api.newbook.cloud/rest/receipts_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"account_id": [
												"2"
											],
											"period_from": "2017-06-15 00:00:00",
											"period_to": "2017-06-15 23:59:59"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": "229",
												"account_id": "371",
												"account_for": "bookings",
												"account_for_id": "34",
												"account_for_name": "John Doe",
												"description": "Accommodation",
												"total": -70,
												"generated_when": "2017-08-14 10:14:38",
												"voided_when": null
											}],
											"message": ""
										}
									
								
AnchorReceipts: PDF Content

Used to retrieve the PDF content for a Receipt.

Receipts: PDF Content Example

Request URL

https://api.newbook.cloud/rest/receipts_pdf_content

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"receipt_id": 882
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"pdf_content": "<p>HTML for the Receipt PDF will appear here.</p>"
											},
											"message": ""
										}
									
								
AnchorContact Templates: List

Retrieve a list of available Contact Templates for sending.

Response Notes:

type will always be "body" to indicate an Email template and "sms" for an SMS template

bind the type of object the template can be sent to e.g. bookings, guests, etc

Contact Templates: List Example

Request URL

https://api.newbook.cloud/rest/contact_templates_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": 1,
												"name": "Confirmation Email",
												"type": "body",
												"bind": "bookings"
											},{
												"id": 2,
												"name": "Confirmation SMS",
												"type": "sms",
												"bind": "bookings"
											}],
											"message": ""
										}
									
								
AnchorContact Templates: Send

Send a Contact Template.

Request Notes:

template_id is required and can be retrieved from Contact Templates: List

data_type is required and must match the bind of the Contact Template

data_id is required and must be an existing object e.g. if data_type is "bookings" it must be a valid Booking ID

send_via is required and must be one of

  • html_email - used for HTML emails
  • pdf_email - will attach the Template Body as a PDF and use the Email HTML in the Email
  • sms - used for SMS messages

Contact Templates: Send Example

Request URL

https://api.newbook.cloud/rest/contact_templates_send

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"template_id": 1,
											"data_type": "bookings",
											"data_id": 263,
											"send_via": "html_email"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"contact_sent": 1
											},
											"message": ""
										}
									
								
AnchorContact Templates: Create

Used to create new Contact Templates

Response Notes:

name and content are required, the rest are optional.

If email_subject is left blank then name will be used instead.

All available options for the following values are available from the Contact Templates: Options request:

  • bind
  • pdf_size
  • type
  • favourites
  • sending_type
  • send_via
  • header
  • email_header
  • footer
  • email_footer

counter_signable is only applicable when type is set to "signed_document"

When a template is sent via Email (PDF) the email_content will be sent as the email, and content will be attached as a PDF

text_content is sent as well as the email, as some email programs require a plain-text alternative version, but most will not display it. When this template is sent via Marketing Campaigns, the Plain Text Content alternative version is required.

When send_via is set to sms then only the sms_content is sent

Contact Templates: Create Example

Request URL

https://api.newbook.cloud/rest/contact_templates_create

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"name": "Confirmation Email",
											"email_subject": "",
											"content": "<p>This is an email to confirm your Booking.</p>",
											"email_content": "",
											"text_content": "",
											"sms_content": "",
											"slack_content": "",
											"type": "body",
											"pdf_size": "A4",
											"bind": null,
											"header": null,
											"email_header": null,
											"footer": null,
											"email_footer": null,
											"letterhead": null,
											"send_via": "html_email",
											"favourites": 0,
											"internal_email": 0,
											"sending_type": "transactional",
											"counter_signable": 0
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"contact_template_id": 1
											},
											"message": ""
										}
									
								
AnchorContact Templates: Get

Used to retrieve a Contact Template

Response Notes:

Retrieve a contact template by providing its id

Returns all fields, even if they were not provided when the template was created

Contact Templates: Get Example

Request URL

https://api.newbook.cloud/rest/contact_templates_get

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"id": "43"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"id": "43",
												"name": "Unconfirmed Booking Cancellation",
												"email_subject": "Your Unconfirmed Booking has been Cancelled",
												"content": "<p>Dear&nbsp;[guest:full_name],<\/p>\r\n\r\n<p>Your Booking&nbsp;[booking:id] staying&nbsp;[booking:period_from] to&nbsp;[booking:period_to] in&nbsp;[booking:category_site] has been Cancelled as it was not confirmed before:&nbsp;[booking:expire_quote_date].<\/p>\r\n\r\n<p>We hope you&#39;ll contact us to stay again in the future.<\/p>\r\n\r\n<p>Kind Regards,<\/p>\r\n\r\n<p>The team at [instance:name]<\/p>\r\n",
												"email_content": "",
												"text_content": "",
												"sms_content": "",
												"slack_content": "",
												"type": "body",
												"pdf_size": "A4",
												"bind": "bookings",
												"header": null,
												"email_header": null,
												"footer": null,
												"email_footer": null,
												"letterhead": null,
												"send_via": null,
												"last_updated": "2016-02-02 08:00:47",
												"favourites": "0",
												"internal_email": "0",
												"sending_type": "transactional",
												"counter_signable": "0",
												"active": "1"
											},
											"message": ""
										}
									
								
AnchorContact Templates: Update

Update an existing Contact Template.

Response Notes:

id is required, all other fields are optional

The other fields are the same as those provided in Contact Templates: Create

Contact Templates: Update Example

Request URL

https://api.newbook.cloud/rest/contact_templates_update

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"id": 1,
											"name": "Updated contact template"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"contact_template_updated": 1
											},
											"message": ""
										}
									
								
AnchorContact Templates: Options

Returns a list of available options for Contact Templates: Create optional values.

The results returned will depend on what is available in your database.

If an array key and value is returned, the array key is what is provided to Contact Templates: Create

The results returned by header and footer can also be used for email_header and email_footer respectively

Contact Templates: Update Example

Request URL

https://api.newbook.cloud/rest/contact_templates_options

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"data": {
													"bind": [
														"null",
														"bookings",
														"bookings_groups",
														"events",
														"guests",
														"availability_emails",
														"companies",
														"companies_staff",
														"travel_agents",
														"travel_agents_staff",
														"quotes",
														"subscriptions",
														"invoices",
														"receipts",
														"clients_accounts",
														"access_codes",
														"owners",
														"gift_vouchers_codes",
														"instances",
														"corporations",
														"corporations_staff",
														"users",
														"leads",
														"licenses_templates",
														"purchase_orders",
														"rest_api_users",
														"activities",
														"support_requests",
														"tickets",
														"tasks",
														"facilities_hire",
														"appointments",
														"jobs"
													],
													"pdf_size": [
														"A4",
														"A5",
														"Letter",
														"C5",
														"DL",
														"GC420D",
														"TMT81"
													],
													"type": [
														"body",
														"sms",
														"signed_document",
														"internal_document",
														"header",
														"footer",
														"insert_field"
													],
													"favourites": {
														"0": "No",
														"1": "Yes (Send Automatically)",
														"2": "Yes"
													},
													"sending_type": [
														"transactional",
														"marketing"
													],
													"send_via": {
														"null": "Use Page Default",
														"sms": "SMS (Unlicensed)",
														"html_email": "Email as HTML",
														"pdf_email": "Email as PDF Attachment",
														"pdf_local": "Display PDF"
													},
													"header": {
														"1": "Header",
														"null": "None"
													},
													"footer": {
														"2": "Footer",
														"null": "None"
													},
													"letterhead": {
														"1": "Plain Letterhead",
														"null": "None"
													}
												},
											},
											"message": ""
										}
									
								
AnchorSystem Templates: List

Retrieve a list of available System Templates.

Response Notes:

type will always be "body" to indicate an Email template and "sms" for an SMS template

bind the type of object the template can be sent to e.g. bookings, guests, receipts, etc

System Templates: List Example

Request URL

https://api.newbook.cloud/rest/system_templates_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": "1",
												"name": "access_codes_table",
												"type": "body",
												"bind": "access_codes"
											},{
												"id": "2",
												"name": "tasks_daily_sms_reminder",
												"type": "sms",
												"bind": "tasks"
											}],
											"message": ""
										}
									
								
AnchorSystem Templates: Create

Used to create new System Templates

Response Notes:

name, description and content are required, the rest are optional.

If email_subject is left blank then name will be used instead.

Valid fields:

  • name
  • description
  • content
  • email_subject
  • pdf_size
  • bind
  • table_font_size
  • table_group_by
  • type
  • letterhead
  • header
  • footer

System Templates: Create Example

Request URL

https://api.newbook.cloud/rest/system_templates_create

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"name": "Guest_agreement",
											"pdf_size": "a4",
											"bind": "guests",
											"email_subject": "The Guest Agreement",
											"description": "The agreement to be signed by new guests",
											"content": " <h2>Please read and sign the agreement</h2><p>...</p>",
											"type": "body"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"message": "Created System Template",
											"data": {
												"contact_template_id": "1"
											}
										}
									
								
AnchorSystem Templates: Get

Used to retrieve a System Template

Response Notes:

Retrieve a system template by providing its id

Returns all fields, even if they were not provided when the template was created

System Templates: Get Example

Request URL

https://api.newbook.cloud/rest/system_templates_get

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"id": "1"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"message": "Created System Template",
											"data": {
												"id": "1",
												"name": "Guest_agreement",
												"email_subject": "The Guest Agreement",
												"bind": "guests",
												"description": "The agreement to be signed by new guests",
												"content": "<h2>Please read and sign the agreement</h2><p>...</p>",
												"type": "body",
												"pdf_size": "A4",
												"table_font_size": "12",
												"table_group_by": "none",
												"header": null,
												"footer": null,
												"letterhead": null,
												"last_updated": "2018-08-29 10:33:52"
											},
											"message": ""
										}
									
								
AnchorSystem Templates: Update

Used to update a System Template

Response Notes:

Any field except ID can be updated

last_updated is set to the time that the request is processed

Valid fields:

  • name
  • description
  • content
  • email_subject
  • pdf_size
  • bind
  • table_font_size
  • table_group_by
  • type
  • letterhead
  • header
  • footer

System Templates: Update Example

Request URL

https://api.newbook.cloud/rest/system_templates_update

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"id": "1",
											"name": "Guest and Visitor agreement",
											"pdf_size": "a3"
											"bind": "bookings"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"message": "Updated System Template",
											"data": {
												"id": "1"
											},
										}
									
								
AnchorContact Emails: Create

Used to create an historical entry for an email sent.

Request Notes:

All fields except for the real_recipient_type and real_recipient_id are required and documented below:

  • name the name / subject of the email
  • recipient_type the type of recipient the email will be recorded against. The available options are:
    • guests
    • bookings
    • bookings_groups
    • events
    • activities_bookings
    • companies
    • companies_staff
    • travel_agents
    • travel_agents_staff
    • users
    • facilities_hire
    • appointments
  • recipient_id the ID of the recipient based on the recipient_type above
  • real_recipient_type the actual recipient the email was sent to. E.g. this will be the guest for a booking
  • real_recipient_id the ID of the recipient based on the real_recipient_type above
  • recipient_name the name of the recipient the email was sent to
  • content the content of the email
  • sender the name of the person who sent the email
  • sent_by the User who sent the email, and should be a valid User ID as per the Users: List
  • sent_on the timestamp of when the email was sent

Contact Emails: Create Example

Request URL

https://api.newbook.cloud/rest/contact_emails_create

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here",
							"name": "Example email subject",
							"recipient_id": 123,
							"recipient_type": "bookings",
							"real_recipient_id": 321,
							"real_recipient_type": "guests",
							"recipient_name": "John Doe",
							"content": "This is the content of the email that is being saved",
							"sender": "Bob",
							"sent_by": 4,
							"sent_on": "2022-11-01 23:30:00"
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": {
								"id": "123456"
							}
						}
					
				
AnchorContact SMS: Create

Used to create an historical entry for an sms sent.

Request Notes:

All fields except for the real_recipient_type and real_recipient_id are required and documented below:

  • name the name / subject of the sms
  • recipient_type the type of recipient the sms will be recorded against. The available options are:
    • guests
    • bookings
    • bookings_groups
    • events
    • activities_bookings
    • companies
    • companies_staff
    • travel_agents
    • travel_agents_staff
    • users
    • facilities_hire
    • appointments
  • recipient_id the ID of the recipient based on the recipient_type above
  • real_recipient_type the actual recipient the sms was sent to. E.g. this will be the guest for a booking
  • real_recipient_id the ID of the recipient based on the real_recipient_type above
  • recipient_name the name of the recipient the sms was sent to
  • content the content of the sms
  • sender the name of the person who sent the sms
  • sent_by the User who sent the sms, and should be a valid User ID as per the Users: List
  • sent_on the timestamp of when the sms was sent

Contact SMS: Create Example

Request URL

https://api.newbook.cloud/rest/contact_sms_create

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here",
							"name": "Example SMS subject",
							"recipient_id": 123,
							"recipient_type": "bookings",
							"real_recipient_id": 321,
							"real_recipient_type": "guests",
							"recipient_name": "John Doe",
							"content": "This is the content of the sms that is being saved",
							"sender": "Bob",
							"sent_by": 4,
							"sent_on": "2022-11-01 23:30:00"
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": {
								"id": "123456"
							}
						}
					
				
AnchorReporting: NewBook Status

Pull data showing a wide range of information about the Instance.

Response Notes:

Some of the data objects in the response have keys for rest_action and rest_parameters. With these, you can submit a secondary request to elaborate on the returned value

In future releases, more of these data objects will have this ability

Reporting: NewBook Status Example

Request URL

https://api.newbook.cloud/rest/newbook_status

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"label": "Arriving Today",
												"value": "23",
												"rest_action": "bookings_list",
												"rest_parameters": {
													"period_from": "2015-08-21 00:00:00",
													"period_to": "2015-08-21 23:59:59",
													"list_type": "arriving"
												}
											},{
												"label": "Departing Today",
												"value": "5",
												"rest_action": "bookings_list",
												"rest_parameters": {
													"period_from": "2015-08-21 00:00:00",
													"period_to": "2015-08-21 23:59:59",
													"list_type": "departing"
												}
											},{
												"label": "Checked-In Today",
												"value": "20",
												"rest_action": "bookings_list",
												"rest_parameters": {
													"period_from": "2015-08-21 00:00:00",
													"period_to": "2015-08-21 23:59:59",
													"list_type": "arrived"
												}
											},{
												"label": "Checked-Out Today",
												"value": "7",
												"rest_action": "bookings_list",
												"rest_parameters": {
													"period_from": "2015-08-21 00:00:00",
													"period_to": "2015-08-21 23:59:59",
													"list_type": "departed"
												}
											},{
												"label": "In-House Today",
												"value": "40",
												"rest_action": "bookings_list",
												"rest_parameters": {
													"period_from": "2015-08-21 00:00:00",
													"period_to": "2015-08-21 23:59:59",
													"list_type": "inhouse"
												}
											},{
												"label": "Cancelled Today",
												"value": "1"
											},{
												"label": "Quoted Today",
												"value": "7"
											},{
												"label": "Flagged Today",
												"value": "2"
											},{
												"label": "Earned Revenue",
												"value": "$2500"
											},{
												"label": "Received Revenue",
												"value": "$1355"
											},{
												"label": "Payments Received",
												"value": "$1760 (12)"
											},{
												"label": "Refunds Issued",
												"value": "$405 (4)"
											},{
												"label": "Occupancy",
												"value": "87"
											},{
												"label": "Sites in Maintenance",
												"value": "4"
											}],
											"message": ""
										}
									
								
AnchorReporting: Earned Revenue

Pull data from the Earned Revenue Report for the dates specified.

Request Notes:

Optionally data_display can be provided as "list" to show each Charge/Credit individually on this report

Optionally providing get_booking_data as "true" when using list mode will also return some basic Booking data

Reporting: Earned Revenue Example

Request URL

https://api.newbook.cloud/rest/reports_earned_revenue

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"period_from": "2015-08-21 00:00:00",
											"period_to": "2015-08-21 23:59:59"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"gl_account_code": "100",
												"gl_account_description": "Accommodation",
												"charges_raised": 830,
												"charges_voided": 0,
												"credits_raised": 20,
												"credits_voided": 0,
												"earned_revenue": 810,
												"earned_revenue_ex": 736.37,
												"earned_revenue_tax": 73.63
											}],
											"message": ""
										}
									
								
AnchorReporting: Transaction Flow

Pull data from the Transaction Flow Report for the dates specified.

Reporting: Transaction Flow Example

Request URL

https://api.newbook.cloud/rest/reports_transaction_flow

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"period_from": "2015-08-21 00:00:00",
											"period_to": "2015-08-21 23:59:59"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"item_id": "143",
												"item_type": "payments_raised",
												"item_description": "Accommodation",
												"item_date": "2017-07-04 10:03:00",
												"item_amount": -50,
												"payment_type": "visa",
												"payment_type_reference": "",
												"account_id": "304",
												"account_for": "bookings",
												"account_for_id": "230",
												"account_for_name": "John Doe",
												"booking_id": "230",
												"booked_when": "2017-07-03 14:27:37"
											},{
												"item_id": "143",
												"item_type": "payments_raised",
												"item_description": "Accommodation",
												"item_date": "2017-07-04 10:30:00",
												"item_amount": 5,
												"payment_type": "cash",
												"payment_type_reference": "",
												"account_id": "305",
												"account_for": "companies",
												"account_for_id": "145",
												"account_for_name": "ACME Pty Ltd"
											 }],
											"message": ""
										}
									
								
AnchorReporting: Reconciliation

Pull data from the Reconciliation Report for the dates specified.

Reporting: Reconciliation Example

Request URL

https://api.newbook.cloud/rest/reports_reconciliation

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"period_from": "2017-08-08 00:00:00",
											"period_to": "2017-08-08 23:59:59"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"item_id": "190",
												"item_type": "payments_raised",
												"item_description": "Raised Payment #190",
												"item_date": "2017-08-08 15:34:00",
												"gl_account_id": -2,
												"gl_account_code": "",
												"gl_account_description": "Unallocated Payments",
												"reconciled_id": null,
												"reconciled_type": null,
												"payment_type": "cash",
												"payment_type_reference": "",
												"payment_transaction_method": "manual",
												"reconciled_amount": "-5.00",
												"reconciled_tax": "0.00",
												"account_id": "347",
												"account_for": "bookings",
												"account_for_id": "253",
												"account_for_name": "John Doe",
												"booking_id": "253"
											},{
												"item_id": "190",
												"item_type": "payments_linked",
												"item_description": "Payment #190 Allocated to Charge #1218",
												"item_date": "2017-08-08 15:34:00",
												"gl_account_id": -2,
												"gl_account_code": "",
												"gl_account_description": "Unallocated Payments",
												"reconciled_id": "1218",
												"reconciled_type": "charge",
												"payment_type": "cash",
												"payment_type_reference": "",
												"payment_transaction_method": "manual",
												"reconciled_amount": "5.00",
												"reconciled_tax": "0.00",
												"account_id": "347",
												"account_for": "bookings",
												"account_for_id": "253",
												"account_for_name": "John Doe",
												"booking_id": "253"
											},{
												"item_id": "190",
												"item_type": "payments_linked",
												"item_description": "Payment #190 Allocated to Charge #1218",
												"item_date": "2017-08-08 15:34:00",
												"gl_account_id": 8,
												"gl_account_code": "POS",
												"gl_account_description": "POS Items",
												"reconciled_id": "1218",
												"reconciled_type": "charge",
												"payment_type": "cash",
												"payment_type_reference": "",
												"payment_transaction_method": "manual",
												"reconciled_amount": "-5.00",
												"reconciled_tax": "-0.46",
												"account_id": "347",
												"account_for": "bookings",
												"account_for_id": "253",
												"account_for_name": "John Doe",
												"booking_id": "253"
											}],
											"message": ""
										}
									
								
AnchorReporting: Daily Audit Summary

Pull data from the Daily Audit Summary for the dates specified.

Request Notes:

debitor_gl_account can be provided to apply a GL Account to Debtors Ledger result rows

creditor_gl_account can be provided to apply a GL Account to Creditors Ledger result rows

payment_gl_account can be provided to apply a GL Account to Payment/Refund result rows

download_content_typecan be provided to return a url to the report. The value of this parameter can be either csv, pdf, xml or xlsx specifying the type of the file for the report to be created as.

Reporting: Daily Audit Summary Example

Request URL

https://api.newbook.cloud/rest/reports_daily_audit_summary

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"period_from": "2015-08-21 00:00:00",
											"period_to": "2015-08-21 23:59:59"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"report_type": "debtors_raised",
												"gl_account_id": 3,
												"gl_account_code": "A-0002",
												"date": "2017-07-04",
												"amount": -60,
												"description": "Debt Raised to Debtors Ledger"
											},{
												"report_type": "debtors_paid",
												"gl_account_id": 3,
												"gl_account_code": "A-0002",
												"date": "2017-07-04",
												"amount": 20,
												"description": "Debt Paid from Debtors Ledger"
											},{
												"report_type": "accrual_income",
												"gl_account_id": "1",
												"gl_account_code": "A-0003",
												"date": "2017-07-04",
												"tax_amount": 4.55,
												"tax_percentage": 10,
												"tax_bracket": "Full GST",
												"amount": 60,
												"description": "Studio Apartment"
											},{
												"report_type": "cash_income",
												"date": "2017-07-04",
												"description": "Visa Combined",
												"amount": -20,
												"payment_type": "visa"
											}],
											"message": ""
										}
									
								
Request URL

https://api.newbook.cloud/rest/reports_daily_audit_summary

Request JSON (with download_content_type)
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"download_content_type": "csv",
											"period_from": "2015-08-21 00:00:00",
											"period_to": "2015-08-21 23:59:59"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": "https://drive.newbook.cloud/instance_abcdef12345678790/report_file_url.csv",
											"message": ""
										}
									
								
AnchorReporting: Balances Dated

Pull data from the Balances Dated Report.

Request Notes:

period_from - which date to determine the balance as of (inclusive)

natures - determines which types of accounts will be displayed on the list:

  • 0 - Debtors only
  • 1 - Debtors and Creditors
  • 2 - Creditors only

Reporting: Balances Dated Example

Request URL

https://api.newbook.cloud/rest/reports_balances_dated

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"period_from": "2015-08-21",
											"natures": 1
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"account_id": "229",
												"account_for": "bookings",
												"account_for_id": "181",
												"account_for_name": "John Doe",
												"account_balance": 990,
												"0_days": 500,
												"30_days": 490,
												"60_days": 0,
												"90_days": 0
											}],
											"message": ""
										}
									
								
AnchorReporting: Occupancy

Retrieves a list of Categories and their occupancy for the given period.

Request Notes:

In NewBook, each Site has an option "Contribute to Occupancy Reports". It can be Yes or No. When Yes, the Site is factored into the Occupancy Report calculations. When No, it is ignored from the Occupancy Report.
The REST API Occupancy Report will factor all Sites even if their "Contribute to Occupancy Reports" option inside NewBook was set to No.
This behaviour in the REST API can be controlled using a parameter factor_site_contribute_to_occupancy_option as true.

accomm_revenue_only can optionally be provided to return accommodation revenue only. This is disabled by default. Can be 0 or 1.

Response Notes:

This request is one which can return either an array of objects or an object of objects (default) identified by their Category ID. This can be controlled by adding

{"return": "array"}
to your request parameters. When provided, data is returned as requested.

To determine the number of available Sites for a given date, subtract the occupied, maintenance, and allotted values from the available value.

Reporting: Occupancy Example

Request URL

https://api.newbook.cloud/rest/reports_occupancy

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"period_from": "2015-08-01 00:00:00",
											"period_to": "2015-08-03 23:59:59"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"category_id": "1",
												"category_name": "Single Room",
												"occupancy": {
													"2016-01-03": {
														"date": "2016-01-03",
														"available": 5,
														"occupied": 0,
														"maintenance": 0,
														"allotted": 0,
														"revenue_gross": 100.00,
														"revenue_net": 90.91
													}
												}
											}],
											"message": ""
										}
									
								
AnchorReporting: Inventory Items

Pull data from the Inventory Items Report for the dates specified.

Reporting: Inventory Items Example

Request URL

https://api.newbook.cloud/rest/reports_inventory_items

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"period_from": "2015-08-21 00:00:00",
											"period_to": "2015-08-21 23:59:59"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"inventory_item_id": 3,
												"inventory_item_description": "Accommodation",
												"generated_charges": 4,
												"generated_credits": 0,
												"earned_revenue": 80,
												"earned_revenue_ex": 72.73,
												"earned_revenue_tax": 7.27,
												"cost_price": 5
											}],
											"message": ""
										}
									
								
AnchorReporting: Survey Answers

Retrieves a list of Guests and their responses to Survey Questions, based off when the Guest answered.

Request Notes:

survey_id can optionally be provided to limit results to a particular Survey ID

answer_type can optionally be provided to limit results of a particular type of questions - valid options:

  • net_promoter_score
  • one_to_ten
  • text_field
  • enum_field
  • task_text_field
  • multiple_answers
  • multiple_text

active_only can optionally be provided to limit results to active surveys only

Reporting: Survey Answers Example

Request URL

https://api.newbook.cloud/rest/reports_surveys_answers

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"period_from": "2015-08-21 00:00:00",
											"period_to": "2015-08-21 23:59:59",
											"active_only": "1"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"survey_id": "1",
												"question_id": "1",
												"question_value": "How likely is it that you would recommend staying at this park to a friend or relative? (Not likely at all to Extremely likely)",
												"answer_type": "net_promoter_score",
												"answer_id": "1881",
												"question_type": "main",
												"answer_value": "8",
												"booking_id": "11033",
												"guest_id": "1234",
												"guest_firstname": "John",
												"guest_lastname": "Doe"
											}],
											"message": ""
										}
									
								
AnchorReporting: Surveys Completed

Provides a breakdown of Surveys Sent vs Completed.

Request Notes:

period_range can be one of the following:

  • day
  • week
  • month
  • year
  • financial_year
  • custom

period_increment is optional, and is only really required when using custom ranges

active_only can optionally be provided to limit results to active surveys only

Reporting: Surveys Completed Example

Request URL

https://api.newbook.cloud/rest/reports_surveys_completed

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"period_from": "2016-09-27 00:00:00",
											"period_to": "2016-09-27 23:59:59",
											"period_range": "year",
											"period_increment": "default",
											"active_only": "1"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"survey_id": "1",
												"survey_name": "Thank You",
												"survey_results": [{
													"period_label": "January 2016",
													"period_start": "2016-01-01 00:00:00",
													"period_end": "2016-01-31 23:59:59",
													"sent": 322,
													"answered": 41
												},{
													"period_label": "February 2016",
													"period_start": "2016-02-01 00:00:00",
													"period_end": "2016-02-29 23:59:59",
													"sent": 244,
													"answered": 36
												}]
											}],
											"message": ""
										}
									
								
AnchorTasks: List

Retrieve a list of outstanding Tasks from NewBook

Request Notes:

task_type must be an ID returned from Task Types: List.

show_uncomplete is optional and should only be provided when you wish see tasks outstanding from previous dates (before the period_from). The default value is false which shows all outstanding tasks for the current period

created_when is optional and when supplied, restricts the returned tasks to only those which were created on the date given. It references the date the task itself was created, opposed to period_from and period_to which reference the date/s the task is scheduled for

Response Notes:

booking_site_id and booking_site_name are optionally returned when the Task is associated with a Booking

Tasks: List Example

Request URL

https://api.newbook.cloud/rest/tasks_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"period_from": "2016-02-01",
											"period_to": "2016-02-01",
											"task_type": [-1,-2],
											"show_uncomplete": "true",
											"created_when": "2016-02-01"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"task_id": 1894,
												"task_location_id": 47,
												"task_location_type": "accommodation_sites",
												"task_location_name": "Single Room 101",
												"task_description": "Blocked for Maintenance",
												"task_period_from": "2015-12-01 10:00:00",
												"task_period_to": "2015-12-05 14:00:00",
												"task_type": "Maintenance",
												"task_type_id": -2,
												"task_location_occupy": 1
											},{
												"task_id": 1895,
												"task_location_id": 546,
												"task_location_type": "bookings",
												"task_location_name": "Mr John Doe",
												"task_description": "Room Service",
												"task_period_from": "2015-12-10 09:00:00",
												"task_period_to": "2015-12-10 09:00:00",
												"task_type": "Housekeeping",
												"task_type_id": -1,
												"booking_site_id": 47,
												"booking_site_name": "Single Room 101",
											}],
											"message": ""
										}
									
								
AnchorTask Types: List

Retrieve a list of the different Task Types

Task Types: List Example

Request URL

https://api.newbook.cloud/rest/tasks_types_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": -2,
												"name": "Maintenance"
											},{
												"id": -1,
												"name": "Housekeeping"
											},{
												"id": 1,
												"name": "Meeting"
											}],
											"message": ""
										}
									
								
AnchorTasks: Create

Create a new Task.

Request Notes:

location_type is required and must be one of:

  • none
  • accommodation_sites
  • facilities
  • bookings
  • bookings_groups
  • guests
  • companies
  • leads
  • quotes
  • tickets

location_id is required when the location_type is not "none" and must be a valid Booking/Guest/etc ID

location_name when location_type is set to "accommodation_sites" or "facilities" this can be provided instead of location_id and must be a valid Site/Facility Name

location_occupy when location_type is set to "accommodation_sites" this can optionally be provided as "1" to block that Site from availability

type_id is required, a valid list of options can be retrieved from the Task Types: List

description is required

period_from is required

period_to is required

Tasks: Create Example

Request URL

https://api.newbook.cloud/rest/tasks_create

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"location_type": "bookings",
											"location_id": 531,
											"type_id": "1",
											"description": "Chase up Booking Deposit",
											"period_from": "2017-10-31 16:00:00",
											"period_to": "2017-10-31 16:00:00"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"task_id": "44"
											},
											"message": "Created Task"
										}
									
								
AnchorTasks: Update

Mark an individual Task as Started or Completed.

Request Notes:

The only required field for task_update is task_id, however at least 1 other field must be provided in order to update the Task.

period_from must be before period_to

location_type must be one of the following:

  • bookings
  • bookings_groups
  • accommodation_sites
  • facilities
  • companies
  • companies_staff
  • events
  • leads
  • quotes
  • guests
  • activities

Response Notes:

Site information (site_id, site_name, etc) is returned only when the Task associated with a Booking or Site

If the site_status did not change to Clean as expected it means that either the Site is still occupied, or there are other outstanding Housekeeping Tasks to be completed

Tasks: Update Example

Request URL

https://api.newbook.cloud/rest/tasks_update

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"task_id": "1894",
											"started_on": "2016-12-02 16:00:00",
											"completed_on": "2016-12-02 16:30:00",
											"description": "Arrival Clean",
											"location_type": "bookings",
											"location_id": "13047",
											"type_id": "-1",
											"period_from": "2018-01-31 13:00",
											"period_to": "2018-01-31 14:00"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"site_id": "44",
												"site_name": "101",
												"site_status": "Clean",
												"category_name": "Single Room"
											}],
											"message": "Updated Task"
										}
									
								
AnchorTickets: List

Retrieve a list of all Tickets.

Request Notes:

account_id can optionally be provided to limit results to a particular Client Account

Response Notes:

Tickets can have a status and corresponding status_name of the following values:

  • 0: Open
  • 1: Closed
  • 2: Waiting on Client
  • 3: Waiting on Third Party
  • 4: Invalid/Spam

status_when is set to the current timestamp when a Ticket changes status. This is different to updated_when, which will be incremented if textual change is done or a new note is added to the Ticket.

Tickets: List Example

Request URL

https://api.newbook.cloud/rest/tickets_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": "2",
												"account_id": "185",
												"account_for": "guests",
												"account_for_id": "20",
												"account_for_name": "John Doe",
												"queue_id": "1",
												"contact_name": "John Doe",
												"contact_email": "[email protected]",
												"contact_phone": "",
												"created_on": "2017-11-08 11:18:58",
												"updated_on": "2017-11-08 13:41:14",
												"subject": "Hello World",
												"assigned_to": "null",
												"priority": "normal",
												"status": "1",
												"queue_name": "Support",
												"status_name": "Closed",
												"status_when": "2017-11-08 12:58:23"
											}],
											"message": ""
										}
									
								
AnchorTickets: Get

Retrieve a particular Ticket.

Request Notes:

ticket_id is required

Tickets: Get Example

Request URL

https://api.newbook.cloud/rest/tickets_get

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"ticket_id": 2
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"id": "2",
												"account_id": "185",
												"account_for": "guests",
												"account_for_id": "20",
												"account_for_name": "John Doe",
												"queue_id": "1",
												"contact_name": "John Doe",
												"contact_email": "[email protected]",
												"contact_phone": "",
												"created_on": "2017-11-08 11:18:58",
												"updated_on": "2017-11-08 12:41:14",
												"subject": "Hello World",
												"assigned_to": "null",
												"priority": "normal",
												"status": "0",
												"queue_name": "Support",
												"status_name": "Open",
												"content": "...Truncated Ticket History HTML..."
											},
											"message": ""
										}
									
								
AnchorTickets: Create

Create a new Ticket.

Request Notes

account_id is required

queue_id is required, a valid list of options is available from Ticket Queue: List

subject is required

content is required and is expected to be valid HTML

contact_name is required

contact_email is required

Tickets: Create Example

Request URL

https://api.newbook.cloud/rest/tickets_create

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"account_id": 20,
											"subject": "Hello World",
											"content": "...Truncated HTML Content...",
											"contact_name": "John Doe",
											"contact_email": "[email protected]"
										}
									
								
Response JSON
									
										{
											"succes": "true",
											"data": {
												"ticket_id": 2
											},
											"message": "Successfully created Ticket"
										}
									
								
AnchorTickets: Update

Update an existing Ticket.

Request Notes

ticket_id is required

status can optionally be provided, valid options include

  • 0 - Open
  • 1 - Closed
  • 2 - Waiting on Client
  • 3 - Waiting on Third Party
  • 4 - Invalid

priority can optionally be provided, valid options include

  • low - Low
  • normal - Normal
  • medium - Medium
  • high - High

content can optionally be provided to add an additional response to the Ticket, the response will be treated as coming from the client

Tickets: Update Example

Request URL

https://api.newbook.cloud/rest/tickets_update

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"ticket_id": 2,
											"subject": "Hello World",
											"status": 2,
											"content": "...Truncated HTML Content...",
											"contact_name": "John Doe",
											"contact_email": "[email protected]"
										}
									
								
Response JSON
									
										{
											"succes": "true",
											"data": {
												"ticket_id": 2
											},
											"message": "Successfully updated Ticket"
										}
									
								
AnchorTicket Queue: List

Retrieve a list of available Ticket Queues.

Ticket Queue: List Example

Request URL

https://api.newbook.cloud/rest/tickets_queues_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": "1",
												"name": "Support"
											}],
											"message": ""
										}
									
								
AnchorSurveys: List

Retrieves a list of the Surveys set up in the database.

Surveys: List Example

Request URL

https://api.newbook.cloud/rest/surveys_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"survey_id": 1,
												"survey_name": "After Departure",
												"questions": [{
													"question_id": 1,
													"question_name": "How likely is it that you would recommend staying at this park to a friend or relative? (Not likely at all to Extremely likely)",
													"answer_type": "net_promoter_score",
													"answer_required": true,
													"answer_options": [0,1,2,3,4,5,6,7,8,9,10]
												},{
													"question_id": 2,
													"question_name": "Comments",
													"answer_type": "text_field",
													"answer_required": true
												}],
												"initial_question": {
													"question_id": 1,
													"question_name": "How would you rate your stay at our park? (Not likely at all to Extremely likely)",
													"answer_type": "net_promoter_sms",
													"answer_options": [0,1,2,3,4,5,6,7,8,9,10]
												}
											}],
											"message": ""
										}
									
								
AnchorGift Vouchers: List

Pull the list of Gift Vouchers from within NewBook.

Request Notes:

name is optional and when provided it will restrict the results to the matching Gift Voucher

Gift Vouchers: List Example

Request URL

https://api.newbook.cloud/rest/gift_voucher_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"name": "test"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": "7",
												"name": "Testing",
												"description": "Just testing how Gift Vouchers work",
												"amount": "100.00",
												"gl_category_id": "1",
												"display_order": "0",
												"template_id": null,
												"sell_online": "1",
												"redeem_online": "1",
												"active": "1"
											}],
											"message": ""
										}
									
								
AnchorInventory Items: List

Pull the list of Inventory Items from within NewBook.

Request Notes:

name is optional and when provided it will restrict the results to the matching Inventory Items

You can provide a basic booking object named calculate_price_for_booking in the request parameters and NewBook will return a new key in the response, booking_inventory_calculated_price. The calculation factors the cost per occupant so you don't have to implement such logic in your application:

								
									{
										"calculate_price_for_booking": {
											"period_from": "2022-12-02",
											"period_to": "2022-12-03",
											"total": 199.95,
											"adults": 2,
											"children": 1,
											"infants": 0,
											"animals": 0
										}
									}
								
							

If you use this, calculate_price_for_booking.period_from, calculate_price_for_booking.period_to and calculate_price_for_booking.total and at least one of the occupant keys are required for NewBook to return booking_inventory_calculated_price in the response. This is because the duration of the booking and its total cost can impact the price determination when an Inventory Item is configured that way:

								
									{
										"success": "true",
										"data": [{
											...
											"booking_inventory_calculated_price": 14.50
										}],
										"message": ""
									}
								
							

Inventory Items: List Example

Request URL

https://api.newbook.cloud/rest/inventory_items_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"name": "foldaway"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": "1",
												"category_id": null,
												"gl_category_id": "1",
												"gl_account_id": "2",
												"name": "Foldaway Bed",
												"description": "Foldaway Bed",
												"amount": "10.00",
												"unit_amount": "0.00",
												"unit_type": "",
												"unit_category_id": null,
												"repeat_charge_type": "charges",
												"repeat_charge_interval": "week",
												"repeat_charge_interval_multiplier": "1",
												"repeat_charge_guest_visible": "1",
												"repeat_charge_travel_agent_commission": "1",
												"repeat_charge_include_in_stay_cost": "1",
												"repeat_charge_disburse_to_owners": "1",
												"repeat_charge_prorata_end": "1",
												"booking_inventory_item_type": "charges",
												"booking_inventory_calculation_type": "fixed",
												"booking_inventory_calculation_amount": "0.00",
												"booking_inventory_task_type_id": null,
												"booking_inventory_per_adult": "0.00",
												"booking_inventory_per_child": "0.00",
												"booking_inventory_per_infant": "0.00",
												"booking_inventory_per_animal": "0.00",
												"booking_inventory_guest_visible": "0",
												"booking_inventory_travel_agent_commission": "1",
												"booking_inventory_include_in_stay_cost": "1",
												"booking_inventory_disburse_to_owners": "1",
												"booking_inventory_daytype": "once",
												"booking_inventory_interval": "day",
												"booking_inventory_interval_multiplier": "0",
												"booking_inventory_daysofweek": "0",
												"booking_inventory_ignore_other_tariffs": "0",
												"booking_inventory_ignore_period_from": "0",
												"booking_inventory_ignore_period_to": "1",
												"quote_inventory_item_type": "charges",
												"quote_inventory_fixed_commission": null,
												"quote_inventory_guest_visible": "1",
												"subscription_interval": "week",
												"subscription_interval_multiplier": "1",
												"hire_per_adult": "0.00",
												"hire_per_child": "0.00",
												"hire_per_infant": "0.00",
												"hire_per_animal": "0.00",
												"hire_interval": "day",
												"hire_interval_multiplier": "0",
												"tax_free": "0",
												"additional_information": "",
												"cost_price": "0.00",
												"image_uri": "",
												"section_code": "",
												"barcode": "",
												"stock_control": "0",
												"use_stock_serials": "0",
												"low_stock_threshold": "0",
												"push_to_pos": "1",
												"active": "1",
												"online_category_restrictions": [
													"2",
													"7",
													"16"
												]
											}],
											"message": ""
										}
									
								
AnchorDiscounts: List

Pull the list of Discounts from within NewBook.

Request Notes:

name is optional and when provided it will restrict the results to the matching Discounts

Discounts: List Example

Request URL

https://api.newbook.cloud/rest/discount_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"name": "test"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": "4",
												"name": "Test Discount",
												"discount_type": "percentage",
												"discount_amount": "10.00",
												"minimum": "0.00",
												"maximum": "0.00",
												"gl_account_id": "145",
												"gl_category_id": "1",
												"bookings_source_id": null,
												"min_stay": "0",
												"requires_code": "0",
												"per_night": "0",
												"active": "1"
											}],
											"message": ""
										}
									
								
AnchorFacilities: List

Pull the list of active Facilities that are available online from within NewBook.

Response Notes:

facility_status will be either Open or Maintenance. Permanently closed Facilities will not be returned by this request.

category_name and category_id refer to the Facility Category.

additional_information comes from the default Inventory Item for the Facility. For more details of this Inventory Item, the Inventory Items: List request can be used with the inventory_item_name from this data.

Facilities: List Example

Request URL

https://api.newbook.cloud/rest/facilities_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"facility_id": "3",
												"facility_name": "Barbeque Area 1",
												"facility_status": "Open",
												"show_on_maps": 1,
												"opened_on": "2018-08-07",
												"category_id": 1,
												"category_name": "Barbeque Areas",
												"inventory_item_id": 3,
												"inventory_item_name": "Hiring Fee",
												"inventory_item_description": "A description of the fee",
												"additional_information": "A longer description of the hiring fee"
											}],
											"message": ""
										}
									
								
AnchorCustom Fields

Pull a list of Custom Fields configured from within NewBook.

Request Notes:

for must be provided as one of the following options:

  • leads
  • guests
  • bookings

Response Notes:

type will be one of the following options:

  • text
  • number - accepts a numeric value
  • checkbox - accepts 1 for Yes and 0 for No
  • enum_field - accepts a single option from type_options
  • multiple_enum_field - accepts multiple options from type_options
  • date - expecting a date in the format YYYY-MM-DD
  • currency - accepts a numeric value
  • company_lookup - accepts a valid Company ID from the Companies: List

Custom Fields Example

Request URL

https://api.newbook.cloud/rest/custom_fields

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"for": "bookings"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": "1",
												"name": "Special Requirements",
												"tab_name": "Additional Information",
												"type": "text"
											},{
												"id": "2",
												"name": "Wifi Package",
												"tab_name": "Additional Information",
												"type": "enum_field",
												"type_options": {
													"7": "100MB",
													"8": "200MB"
												}
											}],
											"message": ""
										}
									
								
AnchorNotes Types: List

Pull a list of allowed Note Types from within NewBook.

Response Notes:

The note_type_default will be used for Notes: Create if a manual note_type_id is not supplied

Notes Types: List Example

Request URL

https://api.newbook.cloud/rest/notes_types

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"note_type_id": "1",
												"note_type_name": "Information",
												"note_type_default": "1"
											},{
												"note_type_id": "2",
												"note_type_name": "Warning",
												"note_type_default": "0"
											}],
											"message": ""
										}
									
								
AnchorNotes: Create

Add a Note to a Booking, Guest, Lead or Quote.

Request Notes:

note_for must be one of the following values:

  • bookings
  • guests
  • leads
  • quotes

note_for_id corresponds to the particular note_for that this note will be attached to

note_type_id is optional, and will use the System Default if not provided as per the Note Types: List request.

output_message is optional, and will default to true when not provided. This controls whether the note will display at the top of the associated page.

task_list is optional, and will default to false when not provided. This controls whether the note will display on any tasks lists.

check_for_duplicates is optional, and will default to true if not provided.

Notes: Create Example

Request URL

https://api.newbook.cloud/rest/notes_create

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"note_for": "bookings",
											"note_for_id": "350",
											"note_type_id": "1",
											"note_content": "Just some information",
											"output_message": true,
											"task_list": false
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"note_id": "20"
											},
											"message": ""
										}
									
								
AnchorPhone Calls: Import Calls

Push a list of call history to NewBook for importing.

Request Notes:

call_origin is recommended to be the phone extension (these can be allocated to the appropriate Site from the Phones section within NewBook)

call_duration is in seconds

To have the phone calls billed automatically (which is optional), please provide the following parameters:

e.g.

								
									{
										"region": "your_region_here",
										"api_key": "your_api_key_here",
										"autocharge": "true",
										"autocharge_gl_account_id": "2",
										"autocharge_gl_category_id": "2",
										"phone_calls": []
									}
								
							

autocharge_invoice can optionally be provided as "true" to have NewBook create an Invoice for the Phone Call Charges. The Response JSON will have an array of invoice_ids returned in the data section.

Phone Calls: Import Calls Example

Request URL

https://api.newbook.cloud/rest/phone_calls

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"phone_calls": [{
												"call_origin": "101",
												"call_destination": "0756554600",
												"call_description": "Outgoing Call",
												"call_timestamp": "2016-02-12 15:30:00",
												"call_duration": "120",
												"call_cost": "1.45"
											},{
												"call_origin": "101",
												"call_destination": "0756554600",
												"call_description": "Outgoing Call",
												"call_timestamp": "2016-02-12 16:00:00",
												"call_duration": "45",
												"call_cost": "0.80"
											}]
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [],
											"message": "Successfully imported 2 calls"
										}
									
								
AnchorPostMaster Accounts: List

Retrieve the list of PostMaster Accounts.

A PostMaster Account is usually used for recording non-Booking-specific charges i.e. generic income such as a till.

Request Notes:

Send account_breakdown as true to see the balance of each associated Sub Client Account (gl_category)

PostMaster Accounts: List Example

Request URL

https://api.newbook.cloud/rest/postmaster_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": "1",
												"name": "Reception",
												"pos_identifier": "",
												"user_id": "1",
												"account_id": "889",
												"active": "1",
												"account_balance": "0.00",
												"auto_billing_limit": null
											}],
											"message": ""
										}
									
								
AnchorMultiple Charges: Create

Used to record multiple sales to a Client Account in NewBook.

Request Notes:

sales: an array of different sales to record

  • account_id: The Client Account ID retrieved in a previous request
  • gl_category_id: Use the Sub Client Accounts: List to retrieve a list of valid IDs
  • generated_when: The datetime the sale was performed
  • charges: an array of charges for the sale
    • gl_account_code: The GL Account code to record for the Charge. You can optionally supply gl_account_id instead using a valid ID from the GL Accounts: List request
    • tax_free: 1 = Tax Free, 0 = Has Tax

      tax_rates: (optional) Instead of NewBook calculating the Tax Amounts for you, use this parameter to manually provide Tax Amounts

      • 					
        						[
        							{"tax_id":sourced from NewBook,"tax_amount":number},
        							{"tax_id":sourced from NewBook,"tax_amount":number}
        						]
        					
        				
      • tax_id: is based on the response to 3rd Party Tax Rates

    • inventory_item_id (optional): links this Charge to a matching Inventory Item for reporting purposes
    • booking_id (optional): tells NewBook which Booking this Charge is related to, useful for when the Booking is billing to a Company Client Account
  • credits: an array of credits for the sale
    • gl_account_code: The GL Account code to record for the Credit. You can optionally supply gl_account_id instead using a valid ID from the GL Accounts: List request
    • tax_free: 1 = Tax Free, 0 = Has Tax

      tax_rates: (optional) Instead of NewBook calculating the Tax Amounts for you, use this parameter to manually provide Tax Amounts

      • 					
        						[
        							{"tax_id":sourced from NewBook,"tax_amount":number},
        							{"tax_id":sourced from NewBook,"tax_amount":number}
        						]
        					
        				
      • tax_id: is based on the response to 3rd Party Tax Rates

    • inventory_item_id (optional): links this Credit to a matching Inventory Item for reporting purposes
    • booking_id (optional): tells NewBook which Booking this Credit is related to, useful for when the Booking is billing to a Company Client Account
  • payments: an array of payments for the sale
    • type: tells NewBook how the Payment was received - valid options:
      • cash
      • cheque
      • visa
      • mastercard
      • amex
      • diners
      • discover
      • jcb
      • eftpos
      • eft (online banking funds transfer)
      • eurocard
      • bartercard
  • refunds: an array of refunds for the sale
    • type: tells NewBook how the Refund was received - valid options:
      • cash
      • cheque
      • visa
      • mastercard
      • amex
      • diners
      • discover
      • jcb
      • eftpos
      • eft (online banking funds transfer)
      • eurocard
      • bartercard
  • invoice_description (optional): When provided NewBook will create an Invoice with this description for the new charges. The Response JSON will have an array of invoice_ids returned in the data section.
  • invoice_system_template_id (optional): When provided along with invoice_description NewBook will create an Invoice using the specified System Template.

creating an array for credits instead of charges (same options apply e.g. description, amount) will allow a "negative charge" to save - internally NewBook handles this as Credits not negative Charges

creating an array for refunds instead of payments (same options apply e.g. description, amount) will allow for recording monies given back to the Guest

Response Notes:

If the credits array was provided in the request, you will receive a credit_ids array in the response

If the payments array was provided in the request, you will receive a payment_ids array in the response

If the refunds array was provided in the request, you will receive a refund_ids array in the response

Multiple Charges: Create Example

Request URL

https://api.newbook.cloud/rest/pos_sale

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"sales": [{
												"account_id": "889",
												"gl_category_id": "2",
												"generated_when": "2015-09-13 14:00:00",
												"charges": [{
													"description": "Phone Charge Local",
													"gl_account_code": "POS",
													"amount": "3.95",
													"tax_free": "0"
												}],
												"payments": [{
													"description": "Payment received",
													"type": "visa",
													"amount": "8.95"
												}]
											}]
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"charge_ids": [7],
												"payment_ids": [10]
											},
											"message": ""
										}
									
								
AnchorSubscriptions: List (CRM)

Pull a list of Subscriptions from NewBook.

Request Notes:

account_id can optionally be provided to limit results to a particular Client Account

gl_account_id can optionally be provided to limit results to a particular GL Account

include_cancelled can optionally be provided as true to include Cancelled Subscriptions; defaults to false, which will return Active & Stopped Subscriptions.

Subscriptions: List (CRM) Example

Request URL

https://api.newbook.cloud/rest/subscriptions_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"subscription_id": "1",
												"created_when": "2020-01-23 19:56:18",
												"inventory_item_id": null,
												"account_id": "123",
												"account_for": "users",
												"account_for_id": "123",
												"account_for_name": "A Staff Member",
												"description": "Monthly Phone Service",
												"gl_account_id": "1",
												"gl_account_name": "Service Revenue",
												"gl_category_id": "1",
												"gl_category_name": "General",
												"amount": "30.00",
												"status": "Stopped",
												"stopped_when": "2020-06-13 14:56:23"
											},{
												"subscription_id": "2",
												"created_when": "2020-04-11 08:58:56",
												"inventory_item_id": "10",
												"account_id": "10",
												"account_for": "companies",
												"account_for_id": "10",
												"account_for_name": "Bobs IT Services",
												"description": "Yearly Service",
												"gl_account_id": "1",
												"gl_account_name": "Service Revenue",
												"gl_category_id": "1",
												"gl_category_name": "General",
												"amount": "150.00",
												"status": "Active",
												"stopped_when": null
											}],
											"message": ""
										}
									
								
AnchorNotifications: List

Pull a list of Notifications from NewBook.

Request Notes:

staff_id is optional and when provided it will restrict the results to the matching Notifications. You have to know the ID of the particular staff member before running this query. The ID of the staff member can be found in the NewBook web interface

created_when is optional and when supplied, restricts the returned Notifications to only those which were created on the date given

Notifications: List Example

Request URL

https://api.newbook.cloud/rest/notifications_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"staff_id": "38",
											"created_when": "2016-02-01"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": "23",
												"type": "2",
												"message": "<p>hi everybody, make sure you have a good day today!</p><p>- your office manager</p>",
												"all_staff": "1",
												"generated_by": "38",
												"generated_when": "2017-04-20 13:38:59"
											}],
											"message": ""
										}
									
								
AnchorOnline Users: Get

Perform a login check for a NewBook Online User.

Request Notes:

username is required

password is optional, but should be provided if you are using this method for authentication. When provided, if it does not match for the Online User requested, the whole online_users_get request will fail saying no record found.

Online Users: Get Example

Request URL

https://api.newbook.cloud/rest/online_users_get

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"username": "[email protected]",
											"password": "somethingsecret"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"id": "4",
												"for": "guests",
												"for_id": "28",
												"username": "[email protected]",
												"active": "1",
												"account_id": "291"
											},
											"message": ""
										}
									
								
AnchorOnline Users: Create

Create a NewBook Online User.

Request Notes:

username is required and must be an email address. If the provided username already exists, this request will return an error.

password is required. NewBook implements password complexity requirements: at least 8 characters, at least one upper case letter, at least one lower case letter, and at least one number.

for and for_id are required. This is the object associated with the Online User Login. Currently only guests, companies_staff, and travel_agents_staff and owners are supported for options.

Online Users: Create Example

Request URL

https://api.newbook.cloud/rest/online_users_create

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"username": "[email protected]",
											"password": "mypassword",
											"for": "guests",
											"for_id": 28
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"user_id": "4"
											},
											"message": "Successfully created Online User Login"
										}
									
								
AnchorOnline Users: Update

Update a NewBook Online User.

Request Notes:

Either user_id or account_id is required, and can be retrieved using the Online Users: Get request.

If you are updating the password for the Online User, NewBook implements password complexity requirements: at least 8 characters, at least one upper case letter, at least one lower case letter, and at least one number.

username is optional, but if provided must be an email address. If the provided username already exists and isn't specifically for this Online User (identified by user_id or account_id), the whole online_users_update request will fail saying the provided username is already in use.

The Online User for and for_id cannot be updated.

Online Users: Update Example

Request URL

https://api.newbook.cloud/rest/online_users_update

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"user_id": "4",
											"password": "my_updated_password"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": {
												"user_id": "4"
											},
											"message": "Successfully updated Online User Login"
										}
									
								
AnchorDietary Requirements: List

List all Dietary Requirements, for use when adding or updating Guests.

Dietary Requirements: List Example

Request URL

https://api.newbook.cloud/rest/dietary_requirements_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": "1",
												"name": "Gluten Free"
											},{
												"id": "2",
												"name": "Vegetarian"
											}],
											"message": ""
										}
									
								
AnchorUsers: List

Pull a list of active Users.

Request Notes:

Send account_breakdown as true to see the balance of each associated Sub Client Account (gl_category). Not available for Corporate API requests.

Send show_inactive as true to include deactivated Users in the response

Users: List Example

Request URL

https://api.newbook.cloud/rest/users_list

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here",
							"account_breakdown": true
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": [{
								"user_id": "1",
								"user_fullname": "John Smith",
								"user_position": "Receptionist",
								"user_period_from": "null",
								"user_period_to": "null",
								"user_image_uri": "https:\/\/driveau.newbook.cloud\/images\/no_image.png",
								"user_active": true,
								"account_breakdown": {
									"1": {
										"name": "Account",
										"gl_category_id": "1",
										"balance": "0.00"
									}
								}
							}],
							"message": ""
						}
					
				
AnchorUsers: Create

Creates a User. The User will be required to change their password after first login.

Request Notes:

  • username is required
  • password is required, and will be forced to change on first login. This will need to have at least 8 characters, at least one upper case letter, at least one lower case letter, and at least one number
  • firstname is required
  • lastname
  • title
  • date_of_birth must be a valid date if provided, formatted as YYYY-MM-DD
  • email must be a valid email address if provided
  • mobile
  • emergency_contact_name
  • emergency_contact_phone
  • emergency_contact_address
  • emergency_contact_relationship
  • medical_conditions
  • allergies
  • position
  • profile_id must match an existing User Profile ID
  • period_from must be a valid date time if provided
  • period_to must be a valid date time if provided
  • active defaults to true if not provided

Users: Create Example

Request URL

https://api.newbook.cloud/rest/users_create

Request JSON
				
					{
						"region": "your_region_here",
						"api_key": "your_api_key_here",
						"username": "john.smith",
						"firstname": "John",
						"lastname": "Smith",
						"password": "SomethingS3cr3t",
						"date_of_birth": "1983-08-21",
						"email": "[email protected]",
						"mobile": "123456789",
						"emergency_contact_name": "Sally Smith",
						"emergency_contact_phone": "123456788",
						"emergency_contact_address": "123 Some St, Somewhereville",
						"emergency_contact_relationship": "Partner",
						"medical_conditions": "none",
						"allergies": "none",
						"position": "Support",
						"profile_id": -1,
						"active": "true"
					}
				
			
Response JSON
				
					{
						"success": "true",
						"data": {
							"user_id": 3
						},
						"message": ""
					}
				
			
AnchorUsers: Update

Updates an existing User.

Request Notes:

user_id must be provided to update a particular User.

Please see below for a list of optional details that can be updated for a User. At least one of these must be provided.

  • username
  • password - if provided, the User will be required to change their password after next login. This will need to have at least 8 characters, at least one upper case letter, at least one lower case letter, and at least one number
  • firstname
  • lastname
  • title
  • date_of_birth must be a valid date if provided, formatted as YYYY-MM-DD
  • email must be a valid email address if provided
  • mobile
  • emergency_contact_name
  • emergency_contact_phone
  • emergency_contact_address
  • emergency_contact_relationship
  • medical_conditions
  • allergies
  • position
  • profile_id must match an existing User Profile ID
  • period_from must be a valid date time if provided
  • period_to must be a valid date time if provided
  • active - supports values like "true", true, 1.

Users: Update Example

Request URL

https://api.newbook.cloud/rest/users_update

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here",
							"user_id": 3,
							"firstname": "Johnny"
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": {
								"user_id": 3
							},
							"message": ""
						}
					
				
AnchorIncidents: List

Pull a list of incidents.

Request Notes:

id is optional and when provided the REST API will only retrieve an Incident with the matching ID.

search is optional and when provided it will restrict the results to the matching Incidents. It will search the following fields (inclusively) for a match:

  • Incident Location
  • Incident Description
  • User First Name or Last Name
  • Guest First Name or Last Name

period_from and period_to will restrict the results from later or earlier than the specified times respectively. Both can be provided to find results from a specific period.

location_name is returned as null when location_type and location_id are provided.

Incidents: List Example

Request URL

https://api.newbook.cloud/rest/incident_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"search": "Eden"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [{
												"id": "1",
												"type_involved": "guests",
												"description": "A guest slipped over in the shower.",
												"occurred_when": "2019-07-09 18:48:00",
												"location_type": "accommodation_sites",
												"location_id": "1",
												"location_name": null,
												"lodged_when": "2019-07-09 10:50:00",
												"lodged_by": "-2",
												"lodged_by_name": "Mark Williams",
												"users": [
													{
														"id": "1",
														"firstname": "Mark",
														"lastname": "Williams"
													}
												],
												"guests": [
													{
														"id": "1",
														"firstname": "John",
														"lastname": "Wheeler"
													},
													{
														"id": "2",
														"firstname": "Eden",
														"lastname": "Kingston"
													}
												]
											}],
											"message": ""
										}
									
								
AnchorState List

Returns the list of States which Instances can use in their address information, per the set up in Instance Manager.

Request Notes:

If you like, you can supply a country_id to limit the results to the States of that Country.

State List Example

Request URL

https://api.newbook.cloud/rest/state_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"country_id": "13"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data":[{
												"1": "Australian Capital Territory (ACT)",
												"2": "New South Wales (NSW)",
												"3": "Northern Territory (NT)",
												"4": "Queensland (QLD)",
												"5": "South Australia (SA)",
												"6": "Tasmania (TAS)",
												"7": "Victoria (VIC)",
												"8": "Western Australia (WA)"
											}],
											"message": ""
										}
									
								
AnchorCountry List

Returns the list of Countries which Instances can use in their address information, per the set up in Instance Manager.

Country List Example

Request URL

https://api.newbook.cloud/rest/country_list

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data":[{
												"1": "Afghanistan",
												"639": "Åland Islands",
												"7": "Albania",
												"2": "Algeria",
												"3": "American Samoa",
												"4": "Andorra",
												"5": "Angola",
												"640": "Anguilla",
												etc.
											}],
											"message": ""
										}
									
								
AnchorBulk Upload

For each create/update request documented on this page, you can construct a file containing multiple JSON request bodies.
This allows you to perform multiple operations without the overhead of performing multiple HTTP requests.

Request Notes:

bulk_upload_file_path

Construct your file per these instructions, host the file where we will be able to access it, and send its URL as the parameter bulk_upload_file_path.
The file should be formatted as a JSON request body with one request per line. Each line will be individually processed on NewBook servers.
The format of each line should match the NewBook REST API documentation, e.g. when using this method for Guests: Create, each line should be the request documented for Guests: Create.
You can optionally include an external_reference in each line which will be returned in the processed response. The intended use case for this is for mapping between NewBook and your system.
Example file contents for the guests_create request:

								
									{"firstname":"John","lastname":"Doe","street":"Level 2, 9 Ouyan Street","city":"Surfers Paradise","state_name":"QLD","postcode":"4217","country_name":"Australia","contact_phone":"0756554600","contact_email":"[email protected]","notes":"Some notes","membership_type":"2","membership_number":"1234567","membership_expiry":"2023-09-02","date_of_birth":"1980-03-25","equipment":[{"equipment_name":"My Honda","equipment_make":"Honda","equipment_model":"Accord","equipment_type":"1","equipment_length":"5","equipment_width":"2","equipment_height":"2","equipment_registration":"222ABC","equipment_registration_expiry":"2022-12-03"},{"equipment_name":"My Toyota","equipment_make":"Toyota","equipment_model":"Camry","equipment_type":"1","equipment_length":"4","equipment_width":"2","equipment_height":"1"}],"external_reference":"f5a9f8b5-7b91-4c76-aab9-97a55271226e"}
									{"firstname":"Jane","lastname":"Doe","street":"Level 2, 9 Ouyan Street","city":"Surfers Paradise","state_name":"QLD","postcode":"4217","country_name":"Australia","contact_phone":"0756554600","contact_email":"[email protected]","notes":"Some notes","membership_type":"2","membership_number":"1234567","membership_expiry":"2023-09-02","date_of_birth":"1980-03-25","equipment":[{"equipment_name":"My Honda","equipment_make":"Honda","equipment_model":"Accord","equipment_type":"1","equipment_length":"5","equipment_width":"2","equipment_height":"2","equipment_registration":"222ABC","equipment_registration_expiry":"2022-12-03"},{"equipment_name":"My Toyota","equipment_make":"Toyota","equipment_model":"Camry","equipment_type":"1","equipment_length":"4","equipment_width":"2","equipment_height":"1"}],"external_reference":"60cdcd56-41b9-47a4-b982-c85f3ebc6af4"}
									{"firstname":"Bob","lastname":"Smith","street":"Level 2, 9 Ouyan Street","city":"Surfers Paradise","state_name":"QLD","postcode":"4217","country_name":"Australia","contact_phone":"0756554600","contact_email":"[email protected]","notes":"Some notes","membership_type":"2","membership_number":"1234567","membership_expiry":"2023-09-02","date_of_birth":"1980-03-25","equipment":[{"equipment_name":"My Honda","equipment_make":"Honda","equipment_model":"Accord","equipment_type":"1","equipment_length":"5","equipment_width":"2","equipment_height":"2","equipment_registration":"222ABC","equipment_registration_expiry":"2022-12-03"},{"equipment_name":"My Toyota","equipment_make":"Toyota","equipment_model":"Camry","equipment_type":"1","equipment_length":"4","equipment_width":"2","equipment_height":"1"}],"external_reference":"946aebee-2490-454b-9f58-e8257f93551c"}								
							

request_identifier

NewBook will include this value in the eventual POST request sent to the response_endpoint once all the processing has finished (see below for more details).
The intended use case of this is to can help identify which Bulk Upload request has completed, if you were to call the Bulk Upload request multiple times in succession.

response_endpoint

A URL for NewBook to send a POST request once the file from bulk_upload_file_path completes processing.
NewBook will send a POST request with this contents (note the matching request_identifier):

								
									{
										"success": "true",
										"data":{
											"request_identifier": "e03b50a6-9e6f-42de-ab8c-2b4106bbbb71",
											"processed_response_file_path": "https://example.com/path_to_file_containing_processed_responses.json"
										},
										"message": ""
									}
								
							

We don't expect a response to the above - any response will be discarded.
As the file in processed_response_file_path will only be available for 30 minutes, it will need to be retrieved by your system as soon as possible.
The format of this file will have a response for each line provided in the original bulk_upload_file_path.
The file will show a single JSON response per line, the format of which will match the NewBook REST API documentation, e.g. when using this method for Guests: Create, each line will be the response documented for Guests: Create.
On top of this, each line will have a line_number parameter to reflect the line number processed from the bulk_upload_file_path file, as well as an external_reference matching the value from the request data (conditionally - if this was provided).
This is useful if you have unique identifiers in your system and want to keep a reference to their NewBook ID.
Example file contents:

								
									{"success":"true","data":{"id":"1","account_id":"10","line_number":1, "external_reference":"f5a9f8b5-7b91-4c76-aab9-97a55271226e"},"message":"Successfully created Guest"}
									{"success":"true","data":{"id":"2","account_id":"11","line_number":2, "external_reference":"60cdcd56-41b9-47a4-b982-c85f3ebc6af4"},"message":"Successfully created Guest"}
									{"success":"true","data":{"id":"3","account_id":"12","line_number":3, "external_reference":"946aebee-2490-454b-9f58-e8257f93551c"},"message":"Successfully created Guest"}
								
							

Bulk Upload Example

Request URL

Any of the existing Create / Update requests. E.g. https://api.newbook.cloud/rest/guests_create

Request JSON
									
										{
											"region": "your_region_here",
											"api_key": "your_api_key_here",
											"bulk_upload_file_path": "https://example.com/path_to_file.json",
											"request_identifier": "e03b50a6-9e6f-42de-ab8c-2b4106bbbb71",
											"response_endpoint": "https://example.com/endpoint_to_send_processed_response"
										}
									
								
Response JSON
									
										{
											"success": "true",
											"data": [],
											"message": "Pending Processing"
										}
									
								
AnchorCreate Audit Trail (Coming Soon)

Create an Audit Trail Entry (aka change event) for a NewBook table.

Request Notes:

All fields are required and documented below:

  • table the name of the NewBook table that was changed e.g. guests, bookings.
  • row the ID of the Booking/Guest/etc you're recording the change event for.
  • field the name of the NewBook Field that has been changed.
  • old_value the previous value of the field that was changed.
  • user_id the User who modified the record, and should be a valid User ID as per the Users: List
  • modified_when the timestamp the field was changed

Create Audit Trail: Example

Request URL

https://api.newbook.cloud/rest/audit_trail_create

Request JSON
					
						{
							"region": "your_region_here",
							"api_key": "your_api_key_here",
							"table": "guests",
							"row": 1,
							"field": "street",
							"old_value": "9 Ouyan St",
							"user_id": "1",
							"modified_when": "2022-11-01 23:30:00"
						}
					
				
Response JSON
					
						{
							"success": "true",
							"data": {
								"id": 3
							},
							"message": ""
						}