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.
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 provide 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.
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.
URL: https://testapi.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.
Please contact Newbook Support if you are unsure about which Endpoint or Region to use.
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_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.
If a request has an error (missing parameters, invalid requests, server errors, etc.) a response with success set to "false" will be returned.
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).
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.
Return a list of API Keys (Newbook Instances) which your username & password can connect with.
Verify the username, password, and API Key in your possession work as expected.
Retrieve a list of Bookings within the given time period.
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 before the specified period_to date, including Bookings before this date which are not yet Arrived - period_from will be ignored in this case. To limit results to those within the specified dates, please use list_type of arrived and the mode parameter of projected (see above) |
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 |
staying1 | 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 |
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
display_guest_notes is optional and when provided as false, it will ignore any guest notes from the response. Not providing the field will behave the same as providing it as true which will display the full array of the guest notes.
client_account_tax_reconciliation can optionally be provided as true to include the amount of tax based on the reconciliation of payments / refunds. The below client_account_item_breakdown will also need to be provided as true for this to function.
client_account_booking_details can optionally be provided as true to include Booking details for Charges and Credits. The below client_account_item_breakdown will also need to be provided as true for this to function.
client_account_item_breakdown can optionally be provided as true to include all accounting items saved on the Booking Client Account in the Booking response. Please see the Bookings: Get request for an example of the response data.
display_guest_activities can optionally be provided as true to include the Guests Activity Tickets in the Guest response. display_cancelled_guest_activities can also be provided to include Cancelled Activity Tickets. Please see the Guests: Get request for an example of the Guest Activity response data.
display_guest_facility_hires can optionally be provided as true to include the Guests Facility Hires in the Guest response. display_cancelled_guest_facility_hires can also be provided to include Cancelled Facility Hires. Please see the Guests: Get request for an example of the Guest Facility Hire response data.
display_cancelled_booking_activities can optionally be provided as true to include Cancelled Activity Tickets for the Booking.
display_cancelled_booking_facility_hires can optionally be provided as true to include Cancelled Facility Hire for the Booking.
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
The inventory_item array holds all the Inventory Item objects for the Booking.
title can be any string; Newbook does not restrict users to specific titles for Guests
contact_details
tariffs_quoted array of objects shows the quoted tariff for each night
Retrieve the details of a single Booking.
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).
Provide display_guest_notes as false if you wish to ignore the guest notes. Not providing the field will behave the same as providing it as true which will display the full array of the guest notes.
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.
client_account_tax_reconciliation can optionally be provided as true to include the amount of tax based on the reconciliation of payments / refunds. The below client_account_item_breakdown will also need to be provided as true for this to function.
client_account_booking_details can optionally be provided as true to include Booking details for Charges and Credits. The below client_account_item_breakdown will also need to be provided as true for this to function.
client_account_item_breakdown can optionally be provided as true to include all accounting items saved on the Booking Client Account in the Booking response.
e.g.
{
"charges": [
{
"id": "3062",
"account_id": "1796594",
"gl_category_id": "1",
"gl_account_id": "32",
"description": "Standard Rate (2024-10-09)",
"amount": 100,
"tax_free": "0",
"generated_by": "1",
"generated_when": "2024-10-09 11:30:00",
"inventory_item_id": null,
"voided_by": "0",
"voided_when": null,
"link_type": "tariffs_quoted",
"link_type_id": "123",
"link_period_from": "2024-10-09",
"link_period_to": "2024-10-09",
"taxes": [
{
"tax_id": 1,
"tax_name": "GST",
"tax_inclusive": true,
"tax_amount": "9.09"
}
]
}
],
"credits": [
{
"id": "4351",
"account_id": "1796594",
"gl_category_id": "1",
"gl_account_id": "32",
"description": "Discount",
"amount": 5,
"tax_free": "0",
"generated_by": "1",
"generated_when": "2024-10-09 11:30:00",
"inventory_item_id": null,
"voided_by": "0",
"voided_when": null,
"link_type": "discounts_quoted",
"link_type_id": "1024",
"link_period_from": "2024-10-09",
"link_period_to": "2024-10-09",
"taxes": [
{
"tax_id": 1,
"tax_name": "GST",
"tax_inclusive": true,
"tax_amount": 0.45
}
]
}
],
"payments": [
{
"id": "2",
"account_id": "1796594",
"gl_category_id": "1",
"paid_by": "135576",
"transaction_method": "manual",
"transaction_id": null,
"disbursed_booking_id": null,
"disbursed_gl_account_id": null,
"description": "Accommodation",
"amount": 100,
"tendered": 100,
"type": "cash",
"type_id": "4",
"type_reference": "",
"deposit": "0",
"generated_by": "1",
"generated_when": "2024-10-09",
"voided_by": "0",
"voided_when": null,
"credits": [],
"charges": [
{
"link_id": 1,
"charge_id": 3062,
"reconciled_amount": 100,
"timestamp": "2024-10-09",
"voided_when": null
}
]
}
],
"refunds": [
{
"id": "2",
"account_id": "1796594",
"gl_category_id": "1",
"refunded_to": "135576",
"transaction_method": "manual",
"transaction_id": null,
"disbursed_booking_id": null,
"disbursed_gl_account_id": null,
"description": "Refunding Discount Overpayment",
"amount": 5,
"tendered": 5,
"type": "cash",
"type_id": "4",
"type_reference": "",
"generated_by": "1",
"generated_when": "2024-10-09",
"voided_by": "0",
"voided_when": null,
"credits": [
{
"link_id": 1,
"credit_id": 4351,
"reconciled_amount": 5,
"timestamp": "2024-10-09",
"voided_when": null
}
],
"payments": []
}
]
}
display_guest_activities can optionally be provided as true to include the Guests Activity Tickets in the Guest response. display_cancelled_guest_activities can also be provided to include Cancelled Activity Tickets.
e.g.
{
"activities": [
{
"ticket_id": 8,
"activity_id": 2,
"name": "Golf",
"duration": "7",
"duration_interval": "day",
"facility_id": null,
"facility_name": null,
"facility_category_id": null,
"facility_category_name": null,
"configuration_name": "Golf - 18 Holes",
"id": 8,
"period_from": "2024-10-13 09:00:00",
"period_to": "2024-10-13 11:00:00",
"activity_configuration_id": 2,
"for": "guests",
"for_id": 1,
"adults": 2,
"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": 11,
"account_id": null,
"gl_category_id": 1,
"gl_account_id": 1,
"description": "Golf - 18 holes of golf",
"interval": "once",
"interval_multiplier": "1",
"amount": 0,
"per_adult": 80,
"per_child": 40,
"per_infant": 0,
"per_animal": 0,
"tax_free": "0",
"cancelled_when": null,
"cancelled_by": null,
"created_when": "2024-10-02 11:32:00",
"created_by": "-2",
"for_name": "John Doe",
"booking_site_id": null,
"booking_site_name": null,
"booking_category_id": null,
"booking_category_name": null,
"inventory_items": [
{
"ticket_id": "8",
"inventory_item_id": null,
"gl_category_id": null,
"gl_account_id": null,
"description": "Cart Hire",
"interval": "once",
"interval_multiplier": "0",
"amount": "45.00",
"per_adult": "0.00",
"per_child": "0.00",
"per_infant": "0.00",
"per_animal": "0.00",
"tax_free": "0",
"guest_visible": "1",
"charge_id": "351"
}
],
"units": 1,
"calculated_total": 205,
"total_paid": 0,
"payment_status": "Unpaid",
"access_codes": [],
"custom_fields": [],
"payment_plans": []
}
]
}
display_guest_facility_hires can optionally be provided as true to include the Guests Facility Hires in the Guest response. display_cancelled_guest_facility_hires can also be provided to include Cancelled Facility Hires.
e.g.
{
"facilities_hire": [
{
"id": "2",
"facility_id": "2",
"period_from": "2024-10-13 12:00:00",
"period_to": "2024-10-13 13:00:00",
"length": "1 hour",
"amount": "55.00",
"per_adult": "0.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": "51",
"hire_account_for_name": "John Doe",
"hire_account_for": "guests",
"hire_account_balance": "0.00",
"billing_account_for_id": "51",
"billing_account_for_name": "John Doe",
"billing_account_for": "guests",
"billing_account_balance": "55.00",
"inventory_item_id": "2",
"gl_category_id": "1",
"gl_account_id": "9",
"description": "Kayak Hire",
"override_tax_rate_ids": [],
"units": 1
}
]
}
display_cancelled_booking_activities can optionally be provided as true to include Cancelled Activity Tickets for the Booking.
display_cancelled_booking_facility_hires can optionally be provided as true to include Cancelled Facility Hire for the Booking.
Example Booking Detail Attributes on charges, credits, payments, refunds when client_account_booking_details is true.
e.g.
{
"guest_visible": "1",
"discounts_apply": "1",
"booking_id": "1234",
"booking_name": "John Doe",
"booking_status": "Confirmed",
"booking_site_id": "2",
"booking_period_from": "2024-10-09 11:30:00",
"booking_period_to": "2024-10-10 14:00:00",
"booking_reference_id": "",
"activity_booked_id": null
}
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.
Newbook can send a push notification every time a Booking is created or updated.
The endpoint that data is pushed to needs to be configured against the REST API User credentials. This is done by the Newbook Support team. Please contact Newbook Support if you wish to have this configured for your REST API user account.
Only one push notification endpoint can be configured per REST API User per Newbook Instance.
The push notification data is similar to Bookings: Get, but only contains the booking information within the data property.
The push notification is sent as a POST request to the configured endpoint.
Check a particular Site to see if a Guest is currently In-House
site_id or site_name must be provided. If you use site_name it must match character for character.
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.
Advisory Notice
bookings_availability_pricing is designed to be used with most or all of its parameters provided.
Your integration should be making this request LAST, to check the pricing and availability for a specified date range, and Category or Site.
Such a request will be performant. A result will be returned to your integration quickly.
If you make this request without those parameters (to be clear, this is not advised!) the request will not be performant, as Newbook has to analyse availability information for all the Categories and all the Rate Types set up within the Instance.
Such a request will take a long time to return a result. This is not a bug or a defect in the Newbook platform - it is a misuse of this request.
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.
You can provide site_id, category_id and category_type_id parameters.
You can provide length and width parameters to find Sites with matching sizes.
You can provide children, infants and animals as numeric parameters (like the adults parameter).
You can provide the following parameters for detailed Site matching based on particular Equipment Sizes, Equipment Types and/or Slideout Types:
Providing any of the above restricts the results returned.
You can 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 provide 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.
"2024-10-10": {
"label": "Special",
"type_id": "8",
"tariff_id": "45",
"tariff_name": "Special Rate",
"stop_sell": "0",
"minimum_periods": "7",
"maximum_periods": "0",
"base_min_combined": "1",
"base_max_combined": "7",
"tariffs_period_id": "19",
"tariffs_period_name": "All Year",
"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": {
"2024-10-10": 5,
"2024-10-11": 1,
"2024-10-12": 3,
"2024-10-13": 1,
"2024-10-14": 4,
"2024-10-15": 5
},
"sites_message": {
"2024-10-10": "Minimum Advance Days has not been met, so there are no Sites available",
"2024-10-11": "Minimum Advance Days has not been met, so there are no Sites available",
"2024-10-12": "Minimum Advance Days has not been met, so there are no Sites available",
"2024-10-13": "",
"2024-10-14": "",
"2024-10-15": ""
}
"sites_code": {
"2024-10-10": 8,
"2024-10-11": 8,
"2024-10-12": 8,
"2024-10-13": 0,
"2024-10-14": 0,
"2024-10-15": 0
}
"sites_extra_info": {
"2024-10-10": "3",
"2024-10-11": "3",
"2024-10-12": "3",
"2024-10-13": "",
"2024-10-14": "",
"2024-10-15": ""
}
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": "2024-10-10 14:00:00",
"period_to": "2024-10-17 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": "2024-10-10 14:00:00",
"period_to": "2024-10-17 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": [
{
"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",
"discount_id": "1",
"discount_name": "Membership Discount",
"discount_amount": 90.00
}
]
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.
You can provide return_all_membership_discount_pricing_options along with return_membership_discount_pricing. When both are provided as "true", an array will be returned of all membership discount options, including discounts configured with a discount code. This will adjust the membership_discount_pricing array to the following:
"membership_discount_pricing": [
{
"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",
"discounts": [
{
"discount_id": "1",
"discount_code": null,
"discount_name": "Membership Discount",
"discount_amount": 90.00
},
{
"discount_id": "2",
"discount_code": "promo",
"discount_name": "Membership Discount (20%)",
"discount_amount": 120.00
}
]
]
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
}
]
Another parameter you can provide is return_all_adjustment_fees which when "true" will return all available adjustment fees, even the ones that would normally be supressed. These are returned alongside the “adjustment_fees” in a separate key called “all_adjustment_fees” and have the same format only with a memberships key added. The memberships holds an array of the memberships to which the adjustment fee is restricted (with -1 representing a restriction to Non Members). An example of this response is:
"all_adjustment_fees": [
{
"type": "cancellation",
"inventory_item_id": "70",
"gl_category_id": "2",
"gl_account_id": "48",
"description": "Cancellation Fee",
"tax_free": "0",
"override_tax_rate_ids": [],
"start_billing_from": "2023-05-16",
"computed_amount": 30,
"memberships": [
-1,
1,
2
]
}
]
Important: Allotments will only be considered during availability calculations if using daily_mode.
Guaranteed Allotments will reduce site availability in the response unless allotment data below is provided in the request.
You can provide any of the Allotment type IDs to allow the availability calculations to consider guaranteed allotments that you might be booking for. For example, if the Booking was going to be for a Company that has an Allotment setup, you can provide the company_id to include availability from that Allotment in the response.
Parameters you can provide that relate to Allotments:
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_code | Reasoning |
---|---|
0 | No error occurred - a successful result |
1 | Requested parameters were invalid and calculation cannot be done |
2 | The Site is not yet opened, or already closed, over the date range requested |
3 | Newbook has computed there is no availability for the requested parameters |
4 | There is no availability due to a Special Date blocking |
5 | An Allotment takes the last remaining availability |
6 | The Category is configured for Dirty Sites to be exempt from availability, and the Site is dirty, therefore it is unavailable (same-day arrivals only) |
7 | The Instance Setting for Daily Stop Sell Time has passed (same-day arrivals only) |
8 | The Instance Setting Minimum Advance Days for Online Bookings has not been met |
9 | The Instance Setting Maximum Advance Days for Online Bookings has been exceeded |
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_code | Reasoning |
---|---|
0 | No error occurred - a successful result |
1 | Requested parameters were invalid and calculation cannot be done |
2 | The Tariff Minimum Occupants has not been met |
3 | The Tariff Maximum Occupants has been exceeded |
4 | The Tariff Minimum Days in Advance for Bookings has not been met |
5 | The Tariff Maximum Days in Advance for Bookings has been exceeded |
6 | The Tariff Minimum Nights for Bookings has not been met |
7 | The Tariff Maximum Nights for Bookings has been exceeded |
8 | The Tariff is not applicable due to a Special Date blocking |
9 | The Tariff has a Closed to Arrival Override for the days requested - Bookings cannot use this Tariff to arrive on the date requested |
10 | The Tariff has a Closed to Departure Override for the days requested - Bookings cannot use this Tariff to depart on the date requested |
11 | The Tariff has a Stop-Sold Override for the days requested |
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:
adjustment_fees will be returned if they are associated with the Tariff or Category inside Newbook. An example of this response is:
"adjustment_fees": [
{
"type": "cancellation",
"inventory_item_id": "70",
"gl_category_id": "2",
"gl_account_id": "48",
"description": "Cancellation Fee",
"tax_free": "0",
"override_tax_rate_ids": [],
"start_billing_from": "2023-05-16",
"computed_amount": 30
}
]
Note: Providing guests_memberships_id or membership_id in the request will suppress adjustment fees that are restricted to other membership types. Providing neither will suppress adjustment fees that are restricted with membership types other than Non Member.
The above fields are:
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
to your request parameters. When provided, data is returned as requested.{"return": "array"}
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.
You can provide children, infants and animals as numeric parameters (like the adults parameter).
Regarding specifying a Guest:
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.
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
to your request parameters. When provided, data is returned as requested.{"return": "object"}
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.
You can provide the category_id for this request to automatically allocate an available Site from that Category, or manually provide 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 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.
You can provide children, infants and animals as numeric parameters (like the adults parameter).
Regarding specifying a Guest:
Regarding specifying Equipment:
Regarding specifying Repeat Charges:
The following parameters are optional and save onto the Guest:
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:
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}]
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 provide 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
}]
If specified, status must be one of the following (this ordering has no meaning):
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 providing 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.
If specified, suppress_generate_billing must be "true" or "false". This parameter will tell Newbook whether to ignore its default handling in terms of generating Booking billing.
If specified, override_min_stay must be "true" or "false". This parameter will tell Newbook whether to allow a Booking to be placed even if the Minimum Stay Duration is not satisfied.
If specified, additional_guests must follow this format:
[{
"guest_id": sourced from Newbook,
"guest_type": adults, children, infants
"guest_type_id": number
}]
You may provide remote_import as "true" to tell Newbook to simplify the Booking View page inside the PMS (for users). This simplified version of the page will respect items present on the Client Account to denote the total value of the Booking, rather than the normal breakdown of individual billing items/discounts/money received & outstanding. When a user edits such a Booking inside the PMS, they will be prompted to convert the Booking to Newbook financial calculations, or abort the editing process.
The successful response is the same as the Bookings: Get response, with the addition of guest_id and invoice_ids.
Update an existing Booking.
booking_id is required
All other parameters are optional, please see Bookings: Create for more details.
If specified, repeat_charges can update existing repeat charges by including the repeat_charge_id property. When repeat_charge_id is ommitted, a new Repeat Charge will be created.
[{
"repeat_charge_id": sourced from Newbook
fields to update...
}]
Bulk update existing Bookings with a new Market Segment
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).
Bulk update existing Bookings with a new Booking Source.
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.
Pull the list of Booking Sources from within Newbook.
name is optional and when provided it will restrict the results to the matching Booking Sources
show_inactive is optional, default false, and when provided it will include inactive Booking Sources in the response
Create a new Booking Source within Newbook.
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.
Pull the list of Booking Cancellation Reasons from within Newbook.
name is optional and when provided it will restrict the results to the matching Booking Cancellation Reasons
show_inactive is optional, default false, and when provided it will include inactive Booking Cancellation Reasons in the response
Pull the list of Booking Methods from within Newbook.
name is optional and when provided it will restrict the results to the matching Booking Methods
Pull the list of Booking Reasons from within Newbook.
name is optional and when provided it will restrict the results to the matching Booking Reasons
Pull the list of Booking Demographics from within Newbook.
name is optional and when provided it will restrict the results to the matching Booking Demographics
Pull the list of Booking Market Segments from within Newbook.
name is optional and when provided it will restrict the results to the matching Booking Market Segments
No emails will be sent when creating a Group Booking. These will be handled on an individual basis when adding Bookings to the Group.
Regarding specifying a Guest:
The following parameters are optional and save onto the Guest:
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:
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
}]
If specified, status must be one of the following (this ordering has no meaning):
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.
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).
Updates an existing Bookings Group.
booking_group_id is required
All other parameters are optional, please see Bookings Groups: Create for more details.
Retrieve a list of Group Bookings within the given time period.
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 Group 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 before the specified period_to date, including Group Bookings before this date which are not yet Arrived - period_from will be ignored in this case. To limit results to those within the specified dates, please use list_type of arrived and the mode parameter of projected (see above) |
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 |
staying1 | 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 |
all |
returns all Group Bookings, this will be a Paginated List. |
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 Group 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 Group Booking data in the return response will still be present but the Guests array will be empty.
search is optional and when provided it will restrict the results to the matching Guest associated with the Group. It will search their name, contact details (phone, email, etc) and membership details for a match
display_guest_activities can optionally be provided as true to include the Guests Activity Tickets in the Guest response. display_cancelled_guest_activities can also be provided to include Cancelled Activity Tickets. Please see the Guests: Get request for an example of the Guest Activity response data.
display_guest_facility_hires can optionally be provided as true to include the Guests Facility Hires in the Guest response. display_cancelled_guest_facility_hires can also be provided to include Cancelled Facility Hires. Please see the Guests: Get request for an example of the Guest Facility Hire response data.
display_cancelled_group_activities can optionally be provided as true to include Cancelled Activity Tickets for the Group.
display_cancelled_group_facility_hires can optionally be provided as true to include Cancelled Facility Hire for the Group.
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
If the Bookings Groups: 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
The inventory_item array holds all the Inventory Item objects on the Booking.
title can be any string; Newbook does not restrict users to specific titles for Guests
contact_details
Retrieve the details of a single Group Booking.
id must be provided to retrieve the Group Booking.
Send account_breakdown as true to see the balance of each associated Sub Client Account (gl_category).
client_account_tax_reconciliation can optionally be provided as true to include the amount of tax based on the reconciliation of payments / refunds. The below client_account_item_breakdown will also need to be provided as true for this to function.
client_account_item_breakdown can optionally be provided as true to include all accounting items saved on the Group Client Account in the Group response.
e.g.
{
"charges": [
{
"id": "3062",
"account_id": "1796594",
"gl_category_id": "1",
"gl_account_id": "32",
"description": "Standard Rate (2024-10-09)",
"amount": 100,
"tax_free": "0",
"generated_by": "1",
"generated_when": "2024-10-09 11:30:00",
"inventory_item_id": null,
"voided_by": "0",
"voided_when": null,
"link_type": "tariffs_quoted",
"link_type_id": "123",
"link_period_from": "2024-10-09",
"link_period_to": "2024-10-09",
"taxes": [
{
"tax_id": 1,
"tax_name": "GST",
"tax_inclusive": true,
"tax_amount": 9.09
}
]
}
],
"credits": [
{
"id": "4351",
"account_id": "1796594",
"gl_category_id": "1",
"gl_account_id": "32",
"description": "Discount",
"amount": 5,
"tax_free": "0",
"generated_by": "1",
"generated_when": "2024-10-09 11:30:00",
"inventory_item_id": null,
"voided_by": "0",
"voided_when": null,
"link_type": "discounts_quoted",
"link_type_id": "1024",
"link_period_from": "2024-10-09",
"link_period_to": "2024-10-09",
"taxes": [
{
"tax_id": 1,
"tax_name": "GST",
"tax_inclusive": true,
"tax_amount": 0.45
}
]
}
],
"payments": [
{
"id": "2",
"account_id": "1796594",
"gl_category_id": "1",
"paid_by": "135576",
"transaction_method": "manual",
"transaction_id": null,
"disbursed_booking_id": null,
"disbursed_gl_account_id": null,
"description": "Accommodation",
"amount": 100,
"tendered": 100,
"type": "cash",
"type_id": "5",
"type_reference": "",
"deposit": "0",
"generated_by": "1",
"generated_when": "2024-10-09",
"voided_by": "0",
"voided_when": null,
"credits": [],
"charges": [
{
"link_id": 1,
"charge_id": 3062,
"reconciled_amount": 100,
"timestamp": "2024-10-09",
"voided_when": null
}
]
}
],
"refunds": [
{
"id": "2",
"account_id": "1796594",
"gl_category_id": "1",
"refunded_to": "135576",
"transaction_method": "manual",
"transaction_id": null,
"disbursed_booking_id": null,
"disbursed_gl_account_id": null,
"description": "Refunding Discount Overpayment",
"amount": 5,
"tendered": 5,
"type": "cash",
"type_id": "5",
"type_reference": "",
"generated_by": "1",
"generated_when": "2024-10-09",
"voided_by": "0",
"voided_when": null,
"credits": [
{
"link_id": 1,
"credit_id": 4351,
"reconciled_amount": 5,
"timestamp": "2024-10-09",
"voided_when": null
}
],
"payments": []
}
]
}
Example Booking Detail Attributes on charges, credits, payments, refunds when client_account_booking_details is true.
e.g.
{
"guest_visible": "1",
"discounts_apply": "1",
"booking_id": "1234",
"booking_name": "John Doe",
"booking_status": "Confirmed",
"booking_site_id": "2",
"booking_period_from": "2024-10-09 11:30:00",
"booking_period_to": "2024-10-10 14:00:00",
"booking_reference_id": "",
"activity_booked_id": null
}
display_guest_activities can optionally be provided as true to include the Guests Activity Tickets in the Guest response. display_cancelled_guest_activities can also be provided to include Cancelled Activity Tickets. Please see the Guests: Get request for an example of the Guest Activity response data.
display_guest_facility_hires can optionally be provided as true to include the Guests Facility Hires in the Guest response. display_cancelled_guest_facility_hires can also be provided to include Cancelled Facility Hires. Please see the Guests: Get request for an example of the Guest Facility Hire response data.
display_cancelled_group_activities can optionally be provided as true to include Cancelled Activity Tickets for the Group.
display_cancelled_group_facility_hires can optionally be provided as true to include Cancelled Facility Hire for the Group.
The returned data from this request is identical to Bookings Groups: List but for the specific Group alone.
If no such Group ID exists, the success response parameter will be "false" and no data will be returned.
List Bookings Rule Templates.
name (string) optional, filters results by name.
show_inactive (boolean) optional, when provided with a truthy value it will include inactive Bookings Rule Templates in the response.
An array of objects will be returned. Each object will contain the following parameters.
If type is set to inventory_items:
If type is set to deposit_rules:
If type is set to adjustment_fees:
Retrieve a single Bookings Rule Template.
See the List description for details on the object parameters that will be returned.
Creates a new Bookings Rule Template.
The following parameters are required.
Please see below for a list of optional details that can be provided.
If type is set to inventory_items:
If type is set to deposit_rules:
If type is set to adjustment_fees:
Updates an existing Bookings Rule Template.
If type is set to inventory_items:
If type is set to deposit_rules:
If type is set to adjustment_fees:
Additional parameters are defined in Bookings Rule Templates: Create.
Retrieve a list of configured Rates based on the provided parameters.
All available fields for this request are optional
id (array of ints) optional - This is an array of Rate IDs to restrict the response to.
has_inventory_items (boolean) optional - This will restrict the response to Rates with / without Inventory Items. Not providing this field will show all Rates regardless of their Inventory Items.
master_rate_id (string | array of ints) optional - This is an array of Master Rate IDs to filter the Rates to those configured to have the provided Master Rate associated with the Rate. This also supports providing the following values:
applied_after (date - yyyy-mm-dd) optional - This is a date to show all Rates that have applications after this particular date. The Rates shown are inclusive of this particular date.
applied_before (date - yyyy-mm-dd) optional - This is a date to show all Rates that have applications before this particular date. The Rates shown are inclusive of this particular date.
category_id (array of ints) optional - This is an array containing Category IDs to restrict the response to only Rates applied to any of these particular Categories.
rate_type_id (array of ints) optional - This is an array containing Rate Type IDs to restrict the response to only Rates applied to those particular Rate Types
per_person (boolean) optional - This will restrict the response to Rates that either are or are not a per-person rate. Omitting this field will result in all Rates showing regardless of whether they are a per-person rate.
allow_site_selection (boolean) optional - This will restrict the response to Rates that have / don't have site selection enabled on Newbook Online. This field can also be omitted to not restrict the filtering
show_inactive (boolean) optional, default false - If false, or not specified, inactive Rates are not included.
id (int) required
show_inactive (boolean) optional, default true - If false and the id belongs to an inactive Rate, a validation error is returned.
using_master (string - enum) required - It can be any of the following options:
master_id (int) required if using_master = dependant
, otherwise this cannot be provided - When provided, this will need to be an ID of an existing Rate configured as a Master Rate.
master_type (string - enum) required if using_master = dependant
, otherwise this cannot be provided - When provided, this will need to be one of the following options:
master_amount (float) required if using_master = dependant
, otherwise this cannot be provided - When provided, this will need to be a float which is used in conjunction with master_type to determine how the dependant rates pricing differs from the associated master rate.
name (string) required - It is the name of the rate you are creating and has a maximum length of 200 characters
dynamic (string - enum) required - This will need to be one of the following options:
dynamic_min (float) optional, default: 0.00 - Lower bound for dynamic pricing. Rates will never be lower than this.
dynamic_max (float) optional, default: 0.00 - Upper bound for dynamic pricing. Rates will never be higher than this.
dynamic_base (float | null) optional, default: null - Used to calculate revenue lost or earned on the Dynamic Pricing Report by comparing this Rates Dynamic Base against its Dynamic Minimum/Maximum.
dynamic_method (enum - string) optional, default: "linear" - What formula to use to calculate the rate
dynamic_occupancy (enum - string) optional, default: "category" - Which Occupancy Percentage should be used to work out the Dynamic Pricing formula.
dynamic_occupancy_min (float) optional, default: 0.00 - The level of occupancy as a percentage from 0.00 to 100.00 at which dynamic pricing will start to increase prices from dynamic_min. If the occupancy level is below this percentage, dynamic_min will be used.
base_day_based (int - enum) required - This controls the format of the pricing on the rate and needs to be one of the following options:
base_day_based_occupancy (string - enum) required if base_day_based = 3 - This can be one of the following options:
additionals_day_based (string - enum) required - This controls the format of the additional occupant pricing on the rate and needs to be one of the following options:
active (boolean) optional, default: true - This states whether the rate is active. This will default to true if not provided.
extras_combined (boolean) optional, default: false - This states whether your rate is configured to charge based on combined occupants or individual occupants.
base_adult (int) required if extras_combined = false
- This is the number of adults included in the base pricing on the rate.
base_child (int) optional, default: 0 - This is the number of children included in the base pricing on the rate.
base_infant (int) optional, default: 0 - This is the number of infants included in the base pricing on the rate.
base_animal (int) optional, default: 0 - This is the number of animals included in the base pricing on the rate.
base_combined (int) required if extras_combined = true
- This is the number of combined occupants included in the base pricing on the rate.
per_person (boolean) required - This controls whether the rate allows standard base pricing, or only specific pricing per occupant.
minimum_charge_per_period (float) optional, default: 0.00 - This specifies the minimum amount the rate will charge per night.
base_min_combined (int) optional, default: 0 - This controls the minimum number of guests required to book the rate. This will default to 0, which means it won't limit bookings based on occupants.
base_max_combined (int) optional, default: 0 - This controls the maximum number of guests required to book the rate. This will default to 0, which means it won't limit bookings based on occupants. This must be equal or greater than base_min_combined if it's not 0
min_days_in_advance (int) optional, default: 0 - This controls the minimum number of days in advance a booking needs to be made to use this rate. 0 means there is no restriction in place.
max_days_in_advance (int) optional, default: 0 - This controls the maximum number of days in advance a booking needs to be made to use this rate. 0 means there is no restriction in place. This must be equal or greater than min_days_in_advance if it's not 0
minimum_periods (int) optional, default: 1 - This controls the minimum number of nights a booking has to stay to be valid for the rate.
maximum_periods (int) optional, default: 0 - This controls the maximum number of nights a booking can stay to be valid for the rate. 0 means there is no limit. This must be equal or greater than minimum_periods if it's not 0
invoice_control (boolean) optional, default: false - This controls whether Bookings on this rate should automatically raise Invoices for Quoted Tariffs for each period specified in the below controls.
invoice_interval_multiplier (int) available if invoice_control = true
, default: 0. This along with the invoice_interval controls how many days / weeks are invoiced at a time.
invoice_interval (string - enum) available if invoice_control = true
, default: "day". This along with invoice_interval_multiplier controls the number of days / weeks to group the invoices into. This can be one of the following options:
system_template_invoices (int | null) optional, default: null. This references an invoice system template ID which is used when invoices are raised through the invoice_control setting. null which will result in the Category default being used.
system_template_receipts (int | null) optional, default: null. This references a receipt system template ID which is used when receipts are generated for bookings on this rate. This is only available when invoice_control is true. null will result in the Category default being used.
base_max_adults (int | null) optional, default: null - This specifies the maximum number of adults allowed on a booking to be able to book this rate. null means that there is no limit.
base_max_children (int | null) optional, default: null - This specifies the maximum number of children allowed on a booking to be able to book this rate. null means that there is no limit.
base_max_infants (int | null) optional, default: null - This specifies the maximum number of infants allowed on a booking to be able to book this rate. null means that there is no limit.
base_max_animals (int | null) optional, default: null - This specifies the maximum number of animals allowed on a booking to be able to book this rate. null means that there is no limit.
stop_sell_occupancy_percentage (int) optional, default: 0 - This which states at what occupancy percentage this rate should be stop-sold. 0 will disable this setting.
stop_sell_occupancy_calculation (string - enum) optional, default: "category" - This relates to the stop_sell_occupancy_percentage option and controls what the occupancy calculation is based on. This can be one of the following:
reset_night_counter (boolean) optional, default: true. This determines whether the night counter resets when switching rate periods.
pre_auth_amount (float) optional, default: 0.00. This specifies the dollar amount / percentage to pre-auth for a booking at checkin. This pairs with the pre_auth_type to determine how the amount is determined.
pre_auth_type (string - enum) available if pre_auth_amount is provided, default: "percentage" - This determines how the amount entered in pre_auth_amount is used. This can be one of the following options:
special_deal (int - enum) optional - This controls how the rate appears on Newbook Online. This can be one of the following options:
first_deposit_required (boolean) optional, default: true - This controls whether the booking requires a deposit payment upfront when booking on Newbook Online.
allow_cancellations (int | null) optional, default: null - This controls how many days before arrival a booking can be cancelled on Newbook Online. null means that cancellations are disabled on Newbook Online for this rate.
allow_modifications (int | null) optional, default: null - This controls how many days before arrival a booking can be modified on Newbook Online. null means that modifications are disabled on Newbook Online for this rate.
site_selection_allowed (boolean) optional, default: false - This controls whether bookings on this rate can choose their site on Newbook Online.
site_selection_inventory_item_id (int | null) optional, default: null - This references the ID of an existing Inventory Item in the system. This inventory item is used for the billing of any site selection fees.
site_selection_fee (float) optional, default: 0.00 - This specifies the charge amount for the site selection fee. This pairs with the site_selection_fee_type to determine how the fee is charged.
site_selection_fee_type (string - enum) available if site_selection_fee is provided, default: "per_night" - This controls how the site_selection_fee is charged. This can be one of the following options:
inclusions (string - html) optional, default: "" - This is some text description to specify what is included in the rate. This is shown on Newbook Online. This supports basic html to help format the display.
period_amounts (array of objects) required if using_master is not dependant and base_day_based is not 5 - This will need to be provided as an array with the format provided below. The format changes based on base_day_based. This changes in the following ways
"period_amounts": [
{
"id": 1,
"amount": 150.00,
"dynamic_min": 100.00,
"dynamic_max": 220.00,
"minimum_periods": 1,
"charge_additionals": 1,
"remove": 0
},
{
"id": 2,
"amount": 130.00,
"dynamic_min": 100.00,
"dynamic_max": 220.00,
"minimum_periods": 1,
"charge_additionals": 1,
"remove": 0
}
]
additionals required - This will need to be provided as an array with the format provided below. The format changes based on additionals_day_based. This changes in the following ways
"additionals": [
{
"id": 1,
"adult_amount": 30.00,
"child_amount": 20.00,
"infant_amount": 10.00,
"animal_amount": 5.00,
"remove": 0
},
{
"id": 2,
"adult_amount": 25.00,
"child_amount": 15.00,
"infant_amount": 5.00,
"animal_amount": 0.00,
"remove": 0
}
]
load_from_master (object) available if using_master = 'dependant'. This is an object that maps each field to a boolean of whether they are loaded from the master rate or not.
"load_from_master": {
"base_adult":true,
"base_child":true,
"base_infant":true,
"base_animal":true,
"base_combined":true,
"extras_combined":true,
"minimum_charge_per_period":true,
"base_min_combined":true,
"base_max_adults":true,
"base_max_combined":true,
"base_max_children":true,
"base_max_infants":true,
"base_max_animals":true,
"min_days_in_advance":true,
"stop_sell_occupancy_percentage":true,
"max_days_in_advance":true,
"stop_sell_occupancy_calculation":true,
"minimum_periods":true,
"reset_night_counter":true,
"maximum_periods":true,
"pre_auth_amount":true,
"pre_auth_type":true,
"invoice_control":true,
"invoice_interval_multiplier":true,
"invoice_interval":true,
"system_template_invoices":true,
"system_template_receipts":true,
"special_deal":true,
"first_deposit_required":true,
"allow_cancellations":true,
"allow_modifications":true,
"site_selection_allowed":false,
"site_selection_inventory_item_id":false,
"site_selection_fee":false,
"site_selection_fee_type":false,
"inclusions":false
}
discounts - This is an array of rate discounts
"discounts": [
{
"id": 1,
"applies_after": 3,
"applies_every": 1,
"applies_retroactively": false,
"base_type": "Percentage Total",
"base_amount": 20.00,
"additional_type": "Percentage Total",
"additional_amount": 20.00,
"cm_code": "",
"remove": 0
}
]
inventory_item_template_id (int | null) optional, default: null - If it's an int it's the ID of an existing Booking Rule Template, otherwise inventory_items will be used
inventory_items (array of objects) available if inventory_item_template_id != null
- This will need to be provided as an array of the inventory item details as shown below:
"inventory_items": [
{
"id": 1,
"inventory_item_id": "100",
"description": "Breakfast",
"gl_category_id": 1,
"gl_account_id": 20,
"display_task_list": [
-6
],
"guest_visible": true,
"travel_agent_commission": false,
"include_in_stay_cost": 1,
"include_in_deposit": 1,
"include_in_payment_plan": true,
"discounts_apply": true,
"refundable": true,
"disburse_to_owners": false,
"item_type": "charges",
"qty": 1,
"amount": 20.00,
"per_adult": 0,
"per_child": 0,
"per_infant": 0,
"per_animal": 0,
"calculation_type": "fixed",
"tax_free": false,
"daytype": "once",
"ignore_other_tariffs": 0,
"remove": false
},
]
deposit_template_id (int | null) optional, default: null - If it's an int it's the ID of an existing Booking Rule Template, otherwise deposits will be used.
deposits (array of objects) - available if deposit_template_id != null
- This will need to be provided as an array of deposits as shown below:
"deposits": [
{
"id": 1,
"due_days": "0",
"due_type": "after",
"days_in_advance": "0",
"deposit_type": "percentage",
"deposit_amount": 20,
"minimum": 100.00,
"maximum": 200.00,
"offline_deposit": true,
"online_deposit": true,
"remove": false
}
]
due_type = before | after
- Specifies the number of days before or after the Booking arrival date that the deposit is due.date
- Specifies the date the deposit is due.adjustment_fee_template_id (int | null) optional, default: null - If it's an int it's the ID of an existing Booking Rule Template, otherwise adjustment_fees will be used
adjustment_fees (array of objects) available if adjustment_fee_template_id != null
- This will need to be provided as an array of the adjustment fees as shown below:
"adjustment_fees": [
{
"id": 1,
"type": "cancellation",
"inventory_item_id": 125,
"description": "Cancellation Fee",
"gl_category_id": 1,
"gl_account_id": 34,
"within_days": 7,
"within_type": "booking_arriving",
"amount_type": "percentage",
"amount": 50.00,
"tax_free": false,
"remove": false
}
]
id (int) required
All other parameters are optional, please see Rates: Create for more details.
Returns a list of active Rate Periods.
show_inactive is optional and when provided with a truthy value, it will include inactive Rate Periods in the response.
Creates a Rate Period.
The following parameters are optional:
Returns a Rate Period.
tariffs_period_id (int) ID of the Tariff Period to be returned.
Updates an existing Rate Period.
tariffs_period_id (int - required) ID of the Rate Period to update.
Please see below for a list of optional details that can be updated on the Rate Period. At least one of these must be provided.
Creates a Rate Override
When a parameter is optional and not included, or set to null in the request, the original Rate value will not be overridden.
When using_master has the value of master
When using_master has the value of standalone
Pull the list of Rate Types from within Newbook.
name is optional and when provided it will restrict results to the matching Rate Types
show_inactive is optional, default false, and when provided with a truthy value, it will include inactive Rate Types in the response.
Create a new Rate Type.
name must be provided. This is the name of the Site.
The following parameters are optional:
Retrieve an existing Rate Type record.
tariff_type_id must be provided to retrieve the details of a particular Rate Type.
The returned data from this request is identical to Rate Types: List but for a specific Rate Type alone.
If no such Rate Type exists, the success response parameter will be "false" and no data will be returned.
Update a Rate Type.
tariff_type_id is required to advise which Rate Type you are updating.
remove can be included in the user_profile_restrictions, available_discounts and los_gl_accounts objects, this flag will remove an existing association with matching ID if set to 1.
All other parameters are optional, and are defined in Rate Types: Create.
Lists Rate Applications.
Create a new Rate Application.
Retrieve an existing Rate Application.
The returned data from this request is identical to Rate Applications: List but for a specific Rate Type alone.
If no such Rate Type exists, the success response parameter will be "false" and no data will be returned.
Update a Rate Application.
Returns a list of active Rate Periods.
show_inactive is optional and when provided with a truthy value, it will include inactive Rate Periods in the response.
Creates a Rate Period.
The following parameters are optional:
Returns a Rate Period.
tariffs_period_id (int) ID of the Tariff Period to be returned.
Updates an existing Rate Period.
tariffs_period_id (int - required) ID of the Rate Period to update.
Please see below for a list of optional details that can be updated on the Rate Period. At least one of these must be provided.
Pull the list of Discounts from within Newbook.
name is optional and when provided it will restrict the results to the matching Discounts
Create a new Discount.
The following parameters are required:
The following parameters are optional:
Retrieve an existing Discount record.
discount_id must be provided to retrieve the details of a particular Discount.
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.
Update a Discount.
discount_id is required to advise which Discount you are updating.
All other parameters are optional, and are defined in Discounts: Create.
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.
activity_id can be provided as an array to limit the response to particular Activities.
facility_id the ID of the Facility this Activity occurs in (see Facilities: List)
activity_configurations the list of configurations for an Activity.
configuration_online indicates whether an Activity configuration is available from Newbook Online.
Possible Values | Definition |
---|---|
0 | No |
1 | All Carts |
2 | Standalone Cart Only |
Returns Activity availability and pricing for the requested dates/occupants.
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, and 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.
Each activity_configurations object shows included_occupants, extra_occupants and max_occupants:
Using the Create Ticket request will validate the parameters you provide against the above logic.
inventory_items provides an array of Sub-Inventory Items that are chargeable for the 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:
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_code | Reasoning |
---|---|
0 | No error occurred - a successful result |
1 | The Activity Participant limit has been exceeded for this Timeslot |
2 | The Activity Ticket Participant limit has been exceeded |
3 | The Activity requires at least 1 participant |
Returns a list of Booked Activities aka Tickets.
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 and 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.
booking_site_id, booking_site_name, booking_category_id, and booking_category_name will only have data when the Activity Ticket is linked to a Booking, otherwise these fields will be null.
Book an Activity / Create an Activity Ticket.
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 and 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.
You will receive a ticket_id when the request successfully books an Activity.
Update an Activity Ticket.
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.
You will receive the same ticket_id when the request successfully updates the Activity Ticket.
Retrieve the HTML markup required to print a PDF version of the Activity Ticket.
Pull the list of active Allotments that are available online from within Newbook.
show_inactive (boolean) is optional and when provided with a truthy value, it will include inactive Allotments in the response.
for (string) is optional and when provided it will restrict the results to the matching value.
for_id (int) is optional and when provided it will restrict the results to the matching for_id.
period_from (date) is optional and when provided will include allotments with a period_to on or after this date.
period_to (date) is optional and when provided will include allotments with a period_from on or before this date.
Creates an Allotment.
The following parameters are required:
The following parameters are optional:
Returns an existing Allotment record.
allotment_id must be provided to retrieve the details of a particular Allotment.
Updates an existing Allotment.
allotment_id must be provided to update a particular Allotment.
All other parameters are optional, and are defined in Allotments: Create.
Creates an Allotment Override.
The following parameters are required:
At least one, or more, of the following parameters are required:
Returns a list of active Facility Categories.
show_inactive is optional, default false, and when provided with a truthy value, it will include inactive Facility Categories in the response.
Creates a Facility Category.
The following parameters are required:
The following parameters are optional:
Returns an existing Facility Category record.
facility_category_id must be provided to retrieve the details of a particular Facility Category.
Updates an existing Facility Category.
facility_category_id must be provided to update a particular Facility Category.
Please see below for a list of optional details that can be updated on the Facility Category. At least one of these must be provided.
All other parameters are optional, and are defined in Facility Categories: Create.
Returns a list of active Facility Features.
show_inactive is optional, default false, and when provided with a truthy value, it will include inactive Facility Features in the response.
Updates an existing Facility Feature.
facility_feature_id must be provided to update a particular Facility Feature.
Please see below for a list of optional details that can be updated on the Facility Feature. At least one of these must be provided.
Pull the list of active Facilities that are available online from within Newbook.
show_inactive is optional, default false, and when provided with a truthy value, it will include inactive Facilities in the response.
hireable_only is optional, default true, which enforces returning only those Facilities configured as able to be hired online.
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.
Creates a Facility.
The following parameters are required:
The following parameters are optional:
Returns an existing Facility record.
facility_id must be provided to retrieve the details of a particular Facility.
The field override_category_features (boolean) is non-editable and is set to True when Features are linked to the Facility directly.
Updates an existing Facility.
facility_id must be provided to update a particular Facility.
All other parameters are optional, and are defined in Facilities: Create.
Returns the Facility Hire Availability and Pricing for the requested dates.
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, and animals can be optionally provided for hiring the Facility, as these may affect pricing.
Availability is returned per Facility. For each Facility, the below explains the response keys:
Returns a list of Facility Hires.
All of the below are optional -
facility_ids can be provided as an array to limit the response to particular Facilities.
for and 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.
Returns an existing Facility Hire record.
hire_id must be provided to retrieve the details of a particular Facility Hire.
Create a Facility Hire.
facility_id is the ID of the Facility to be hired (see Facilities: List)
hireable_only is optional, default true, which enforces hiring only those Facilities configured as able to be hired online. You can provide it as false to force the API to let you Hire a Facility not otherwise configured for this.
adults is required however children, infants, and animals can be optionally provided for hiring the Facility, as these may affect pricing.
for and 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
}
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
}
]
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.
Update a Facility Hire.
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.
Pull the list of Inventory Items from within Newbook.
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": "2024-10-09",
"period_to": "2024-10-10",
"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": ""
}
Create a new Inventory Item.
The following parameters are required:
The following parameters are optional:
The type parameter must be from the following list:
[
{
"date": "2024-10-09",
"amount": "25.00",
"type": "fixed_amount"
},
{
"date": "2024-11-09",
"amount": "10.00",
"type": "dec_percentage"
}
]
Retrieve an existing Inventory Item record.
inventory_item_id must be provided to retrieve the details of a particular Inventory Item.
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.
Update an Inventory Item.
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.
[
{
"id": 4,
"remove": true
},
{
"id": 5,
"date": "2024-11-09",
"amount": "10.00",
"type": "fixed_amount"
}
]
Retrieve/search the Guest database.
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 provided, restricts the returned Guests to only those which were created on the date given
staff_id is optional and when provided, restricts the returned Leads to those assigned to that User (see Users: List)
sort_ascending is optional and when provided as true, sorts the Guests by ID ascending. Defaults to false (sort the Guests by ID descending).
show_inactive_equipment (boolean) Send as true to include inactive Guest Equipment in the response.
Send account_breakdown as true to see the balance of each associated Sub Client Account (gl_category)
client_account_tax_reconciliation can optionally be provided as true to include the amount of tax based on the reconciliation of payments / refunds. The below client_account_item_breakdown will also need to be provided as true for this to function.
client_account_booking_details can optionally be provided as true to include Booking details for Charges and Credits. The below client_account_item_breakdown will also need to be provided as true for this to function.
client_account_item_breakdown can optionally be provided as true to include all accounting items saved on the Guest Client Account in the Guest response. Please see the Guests: Get request for an example of the response data.
display_guest_activities can optionally be provided as true to include the Guests Activity Tickets in the Guest response. display_cancelled_guest_activities can also be provided to include Cancelled Activity Tickets. Please see the Guests: Get request for an example of the Guest Activity response data.
display_guest_facility_hires can optionally be provided as true to include the Guests Facility Hires in the Guest response. display_cancelled_guest_facility_hires can also be provided to include Cancelled Facility Hires. Please see the Guests: Get request for an example of the Guest Facility Hire response data.
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 membership service_id and level can optionally be null when no Membership Service or Membership Service Level are connected to the Membership.
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
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
Create a Guest to use for placing Bookings, Availability Emails, Online Logins, and more.
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 provide update_existing_details as "false".
Alternatively you can manage the Contact Details in more depth as an array:
"contact_details": [
{
"id": 1,
"type": "phone",
"content": "0756554600",
"notes": "Office landline",
"allow_transactional": "1",
"allow_marketing": "1",
"remove": 0
},
{
"id": 2,
"type": "email",
"content": "support@newbook.cloud",
"notes": "Work email address",
"allow_transactional": "1",
"allow_marketing": "0",
"remove": 0
}
]
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:
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
}
]
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:
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:
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.
The returned data from this request is identical to Guests: List but for the newly created Guest alone
Retrieve an existing Guest record.
client_account_booking_details can optionally be provided as true to include Booking details for Charges and Credits. The below client_account_item_breakdown will also need to be provided as true for this to function.
Example response when client_account_item_breakdown is true:
{
"charges": [
{
"id": "3062",
"account_id": "1796594",
"gl_category_id": "1",
"gl_account_id": "32",
"description": "Standard Rate (2024-10-09)",
"amount": 100,
"tax_free": "0",
"generated_by": "1",
"generated_when": "2024-10-09 11:30:00",
"inventory_item_id": null,
"voided_by": "0",
"voided_when": null,
"link_type": "tariffs_quoted",
"link_type_id": "123",
"link_period_from": "2024-10-09",
"link_period_to": "2024-10-09",
"taxes": [
{
"tax_id": 1,
"tax_name": "GST",
"tax_inclusive": true,
"tax_amount": "9.09"
}
]
}
],
"credits": [
{
"id": "4351",
"account_id": "1796594",
"gl_category_id": "1",
"gl_account_id": "32",
"description": "Discount",
"amount": 5,
"tax_free": "0",
"generated_by": "1",
"generated_when": "2024-10-09 11:30:00",
"inventory_item_id": null,
"voided_by": "0",
"voided_when": null,
"link_type": "discounts_quoted",
"link_type_id": "1024",
"link_period_from": "2024-10-09",
"link_period_to": "2024-10-09",
"taxes": [
{
"tax_id": 1,
"tax_name": "GST",
"tax_inclusive": true,
"tax_amount": 0.45
}
]
}
],
"payments": [
{
"id": "2",
"account_id": "1796594",
"gl_category_id": "1",
"paid_by": "135576",
"transaction_method": "manual",
"transaction_id": null,
"disbursed_booking_id": null,
"disbursed_gl_account_id": null,
"description": "Accommodation",
"amount": 100,
"tendered": 100,
"type": "cash",
"type_id": "4",
"type_reference": "",
"deposit": "0",
"generated_by": "1",
"generated_when": "2024-10-09",
"voided_by": "0",
"voided_when": null,
"credits": [],
"charges": [
{
"link_id": 1,
"charge_id": 3062,
"reconciled_amount": 100,
"timestamp": "2024-10-09",
"voided_when": null
}
]
}
],
"refunds": [
{
"id": "2",
"account_id": "1796594",
"gl_category_id": "1",
"refunded_to": "135576",
"transaction_method": "manual",
"transaction_id": null,
"disbursed_booking_id": null,
"disbursed_gl_account_id": null,
"description": "Refunding Discount Overpayment",
"amount": 5,
"tendered": 5,
"type": "cash",
"type_id": "4",
"type_reference": "",
"generated_by": "1",
"generated_when": "2024-10-09",
"voided_by": "0",
"voided_when": null,
"credits": [
{
"link_id": 1,
"credit_id": 4351,
"reconciled_amount": 5,
"timestamp": "2024-10-09",
"voided_when": null
}
],
"payments": []
}
]
}
display_guest_activities can optionally be provided as true to include the Guests Activity Tickets in the Guest response. display_cancelled_guest_activities can also be provided to include Cancelled Activity Tickets.
e.g.
{
"activities": [
{
"ticket_id": 8,
"activity_id": 2,
"name": "Golf",
"duration": "7",
"duration_interval": "day",
"facility_id": null,
"facility_name": null,
"facility_category_id": null,
"facility_category_name": null,
"configuration_name": "Golf - 18 Holes",
"id": 8,
"period_from": "2024-10-13 09:00:00",
"period_to": "2024-10-13 11:00:00",
"activity_configuration_id": 2,
"for": "guests",
"for_id": 1,
"adults": 2,
"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": 11,
"account_id": null,
"gl_category_id": 1,
"gl_account_id": 1,
"description": "Golf - 18 holes of golf",
"interval": "once",
"interval_multiplier": "1",
"amount": 0,
"per_adult": 80,
"per_child": 40,
"per_infant": 0,
"per_animal": 0,
"tax_free": "0",
"cancelled_when": null,
"cancelled_by": null,
"created_when": "2024-10-02 11:32:00",
"created_by": "-2",
"for_name": "John Doe",
"booking_site_id": null,
"booking_site_name": null,
"booking_category_id": null,
"booking_category_name": null,
"inventory_items": [
{
"ticket_id": "8",
"inventory_item_id": null,
"gl_category_id": null,
"gl_account_id": null,
"description": "Cart Hire",
"interval": "once",
"interval_multiplier": "0",
"amount": "45.00",
"per_adult": "0.00",
"per_child": "0.00",
"per_infant": "0.00",
"per_animal": "0.00",
"tax_free": "0",
"guest_visible": "1",
"charge_id": "351"
}
],
"units": 1,
"calculated_total": 205,
"total_paid": 0,
"payment_status": "Unpaid",
"access_codes": [],
"custom_fields": [],
"payment_plans": []
}
]
}
display_guest_facility_hires can optionally be provided as true to include the Guests Facility Hires in the Guest response. display_cancelled_guest_facility_hires can also be provided to include Cancelled Facility Hires.
e.g.
{
"facilities_hire": [
{
"id": "2",
"facility_id": "2",
"period_from": "2024-10-13 12:00:00",
"period_to": "2024-10-13 13:00:00",
"length": "1 hour",
"amount": "55.00",
"per_adult": "0.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": "51",
"hire_account_for_name": "John Doe",
"hire_account_for": "guests",
"hire_account_balance": "0.00",
"billing_account_for_id": "51",
"billing_account_for_name": "John Doe",
"billing_account_for": "guests",
"billing_account_balance": "55.00",
"inventory_item_id": "2",
"gl_category_id": "1",
"gl_account_id": "9",
"description": "Kayak Hire",
"override_tax_rate_ids": [],
"units": 1
}
]
}
Example Booking Detail Attributes on charges, credits, payments, refunds when client_account_booking_details is true.
e.g.
{
"guest_visible": "1",
"discounts_apply": "1",
"booking_id": "1234",
"booking_name": "John Doe",
"booking_status": "Confirmed",
"booking_site_id": "2",
"booking_period_from": "2024-10-09 11:30:00",
"booking_period_to": "2024-10-10 14:00:00",
"booking_reference_id": "",
"activity_booked_id": null
}
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.
Update an existing Guest.
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):
To update an existing Equipment for this Guest (optional):
Retrieves a list of Guest ID's that have been deleted from Newbook.
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
Pull the list of Memberships from within Newbook.
name is optional and when provided it will restrict the results to the matching Memberships
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
Grant a Membership to one of the connected Membership Types to an existing Guest
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.
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 be reversed, so please ensure you are merging the correct guests.
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.
Retrieve a list of transactions made by Members, including details such as tax amounts and booking details.
Only transactions related to Bookings where a Guest Membership was used will be returned.
membership_type_id (int, required) An existing Membership Type ID to retrieve transactions for.
period_from (datetime, defaults to today).
period_to (datetime, defaults to today).
transaction_types (array, one or more of charges/credits/payments/refunds, defaults to all).
include_booking_details (boolean, defaults to true) This can be optionally provided and set as false to limit results to not show the booking details.
include_taxes (boolean, defaults to false) This can be optionally provided to include the tax amounts of each transaction.
booking_status (array, defaults to all) This can be optionally provided to limit results to a list of particular Booking Statuses.
When booking_status is provided, the period_from and period_to parameters are used to find Bookings that reached one of the provided statuses within the date range. All transactions related to the matching Bookings will be returned.
When booking_status is NOT provided, the period_from and period_to parameters are used to find any transactions that were generated within the date range.
Each Transaction Type details its Transactions in an array.
Retrieve a list of Accommodation Categories including all the stored information about the Category.
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
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.
Create a new Accommodation Category.
The following parameters are required:
The following parameters are optional:
Retrieve an existing Accommodation Category record.
category_id must be provided to retrieve the details of a particular Accommodation Category.
The returned data from this request is identical to Accommodation Categories: List but for a specific Accommodation Category alone.
If no such Accommodation Category exists, the success response parameter will be "false" and no data will be returned.
Update an Accommodation Category.
category_id is required to advise which Accommodation Category you are updating.
All other parameters are optional, and are defined in Accommodation Categories: Create.
Retrieve the list of possible Accommodation Features in Newbook.
Pull the list of possible Sites from Newbook.
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
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.
Retrieve/update the Status of a particular Site in Newbook.
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:
message will be filled only when site_status is updated
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.
Pull the information for a specific Site in Newbook.
site_id is a required parameter and needs to be the ID of the Site you are looking up.
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.
Create a new site for a particular Category.
name must be provided. This is the name of the Site.
category_id must be provided. This needs to be a valid Category ID as per the Category: List.
Please see below for a list of optional details that can be provided for the Site.
Update the details of a particular site inside of Newbook.
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.
Returns a list of active Site Sizes.
show_inactive is optional, default false, and when provided with a truthy value, it will include inactive Site Sizes in the response.
site_count is the number of active Sites that the Site Size is associated with.
Creates a Site Size.
Updates an existing Site Size.
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.
Retrieve the list of Companies for recording non-Booking-specific charges.
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 provided, 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)
Retrieve the list of Company Types for limiting the Company List.
Update a particular Company
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 provide update_existing_details as "false".
Alternatively you can manage the Contact Details in more depth as an array:
"contact_details": [
{
"id": 1,
"type": "phone",
"content": "0756554600",
"notes": "Office landline",
"allow_transactional": "1",
"allow_marketing": "1",
"remove": 0
},
{
"id": 2,
"type": "email",
"content": "support@newbook.cloud",
"notes": "Work email address",
"allow_transactional": "1",
"allow_marketing": "0",
"remove": 0
}
]
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:
Retrieve the list of Companies Staff for recording non-Booking-specific charges.
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 provided, 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)
Update a particular Company Staff
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 provide update_existing_details as "false".
Alternatively you can manage the Contact Details in more depth as an array:
"contact_details": [
{
"id": 1,
"type": "phone",
"content": "0756554600",
"notes": "Office landline",
"allow_transactional": "1",
"allow_marketing": "1",
"remove": 0
},
{
"id": 2,
"type": "email",
"content": "support@newbook.cloud",
"notes": "Work email address",
"allow_transactional": "1",
"allow_marketing": "0",
"remove": 0
}
]
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:
Retrieve the list of Travel Agents for recording non-Booking-specific charges.
name is optional and when provided it will restrict the results to the matching Travel Agents
created_when is optional and when provided, 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)
Retrieve a list of Events within the given time period.
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 |
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)
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.
The inventory_item array holds all the Inventory Item objects on the Event.
Retrieve the details of a single Event.
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)
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 response account_breakdown is prefixed as event_account_breakdown to disambiguate against the other keys.
Retrieve/search the Leads database.
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 provided, restricts the returned Leads to only those which were created on the date given
staff_id is optional and when provided, restricts the returned Leads to those assigned to that User (see Users: List)
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)
contact_details and custom_fields are arrays which will be empty when no data of that type is available
Create a Lead within Newbook.
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 provide update_existing_details as "false".
Alternatively you can manage the Contact Details in more depth as an array:
"contact_details": [
{
"id": 1,
"type": "phone",
"content": "0756554600",
"notes": "Office landline",
"allow_transactional": "1",
"allow_marketing": "1",
"remove": 0
},
{
"id": 2,
"type": "email",
"content": "support@newbook.cloud",
"notes": "Work email address",
"allow_transactional": "1",
"allow_marketing": "0",
"remove": 0
}
]
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:
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:
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
}
]
Update an existing Lead within Newbook.
lead_id is required
All other parameters are optional, please see Leads: Create for more details.
Retrieve Activity History for an existing Lead within Newbook.
lead_id is required
Retrieves the list of available Lead Categories.
Retrieves the list of available Lead Interests.
Retrieves the list of available Lead Sources.
Create a new Lead Source within Newbook.
Retrieves the list of available Lead Statuses.
The IDs of the Lead Statuses in the example here are negative; these are defaults Newbook creates
Retrieves the list of available Lead Types.
Retrieve the list of Security Gates configured within Newbook
Retrieve the list of Security Areas configured within Newbook.
security_gates contains the list of Gates the Security Area is authorised for.
Retrieve the Access Codes valid within the current 48 hour window (+ and - 24 hours).
created_when is optional and when provided, 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.
The booking data fields are returned if the access_code given is related to a Booking
Searches Access Codes valid within the current 48 hour window (+ and - 24 hours).
search_term when numeric will search the access code id and when it contains letters will search the car rego details for all access codes
fuzzy_search_length is an optional parameter that can only be used on alpha-numeric search terms (e.g. not all numbers) and will specify the number of characters the car rego can be different by
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.
The booking data fields are returned if the access_code given is related to a Booking
search_term_difference will be the number of characters this Access Code is different from search_term
Records access history for particular Access Codes and their Bookings.
access_history an array of individual access attempts, containing:
Returns access history for particular Access Codes.
Can be provided any combination of the below filters to limit results:
Pull the list of GL Accounts from within Newbook.
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, default false, and when provided with a truthy value, it will include inactive GL Accounts in the response.
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)
Creates a GL Account.
Updates an existing GL Account.
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.
Pull the list of GL Account Groups from within Newbook.
show_inactive is optional, default false, 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.
Creates a GL Account Group.
Updates an existing GL Account Group.
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.
Pull the list of Sub Client Accounts (aka GL Categories) from within Newbook.
Retrieve a list of Client Accounts.
for (optional): An array of the type of Client Account to return
account_breakdown, client_account_tax_reconciliation and client_account_item_breakdown can optionally be provided to return additional information about the Client Account. Please see Clients Accounts: Get for more details.
Retrieve a particular Client Account.
account_id: The Account ID to query
Send account_breakdown as true to see the balance of each associated Sub Client Account (gl_category)
e.g.
{
"account_breakdown": [
{
"name": "Accommodation",
"gl_category_id": "1",
"balance": "0.00"
},
{
"name": "Extras",
"gl_category_id": "2",
"balance": "12.00"
}
]
}
client_account_tax_reconciliation can optionally be provided as true to include the amount of tax based on the reconciliation of payments / refunds. The below client_account_item_breakdown will also need to be provided as true for this to function.
client_account_item_breakdown can optionally be provided as true to include all accounting items saved on the Group Client Account in the Group response.
Example response when client_account_item_breakdown is true:
{
"charges": [
{
"id": "3062",
"account_id": "1796594",
"gl_category_id": "1",
"gl_account_id": "32",
"description": "Standard Rate (2024-10-09)",
"amount": 100,
"tax_free": "0",
"generated_by": "1",
"generated_when": "2024-10-09 11:30:00",
"inventory_item_id": null,
"voided_by": "0",
"voided_when": null,
"link_type": "tariffs_quoted",
"link_type_id": "123",
"link_period_from": "2024-10-09",
"link_period_to": "2024-10-09",
"taxes": [
{
"tax_id": 1,
"tax_name": "GST",
"tax_inclusive": true,
"tax_amount": "9.09"
}
]
}
],
"credits": [
{
"id": "4351",
"account_id": "1796594",
"gl_category_id": "1",
"gl_account_id": "32",
"description": "Discount",
"amount": 5,
"tax_free": "0",
"generated_by": "1",
"generated_when": "2024-10-09 11:30:00",
"inventory_item_id": null,
"voided_by": "0",
"voided_when": null,
"link_type": "discounts_quoted",
"link_type_id": "1024",
"link_period_from": "2024-10-09",
"link_period_to": "2024-10-09",
"taxes": [
{
"tax_id": 1,
"tax_name": "GST",
"tax_inclusive": true,
"tax_amount": 0.45
}
]
}
],
"payments": [
{
"id": "2",
"account_id": "1796594",
"gl_category_id": "1",
"paid_by": "135576",
"transaction_method": "manual",
"transaction_id": null,
"disbursed_booking_id": null,
"disbursed_gl_account_id": null,
"description": "Accommodation",
"amount": 100,
"tendered": 100,
"type": "cash",
"type_id": "4",
"type_reference": "",
"deposit": "0",
"generated_by": "1",
"generated_when": "2024-10-09",
"voided_by": "0",
"voided_when": null,
"credits": [],
"charges": [
{
"link_id": 1,
"charge_id": 3062,
"reconciled_amount": 100,
"timestamp": "2024-10-09",
"voided_when": null
}
]
}
],
"refunds": [
{
"id": "2",
"account_id": "1796594",
"gl_category_id": "1",
"refunded_to": "135576",
"transaction_method": "manual",
"transaction_id": null,
"disbursed_booking_id": null,
"disbursed_gl_account_id": null,
"description": "Refunding Discount Overpayment",
"amount": 5,
"tendered": 5,
"type": "cash",
"type_id": "4",
"type_reference": "",
"generated_by": "1",
"generated_when": "2024-10-09",
"voided_by": "0",
"voided_when": null,
"credits": [
{
"link_id": 1,
"credit_id": 4351,
"reconciled_amount": 5,
"timestamp": "2024-10-09",
"voided_when": null
}
],
"payments": []
}
]
}
Example Booking Detail Attributes on charges, credits, payments, refunds when client_account_booking_details is true.
e.g.
{
"guest_visible": "1",
"discounts_apply": "1",
"booking_id": "1234",
"booking_name": "John Doe",
"booking_status": "Confirmed",
"booking_site_id": "2",
"booking_period_from": "2024-10-09 11:30:00",
"booking_period_to": "2024-10-10 14:00:00",
"booking_reference_id": "",
"activity_booked_id": null
}
Used to charge to a Client Account.
account_id: The Client Account ID retrieved in a previous request
generated_by (int, optional): The User ID to set who generated the charge. Defaults to the User ID making the 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:
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
link_type (optional): tells Newbook which item this charge is linked to:
link_type_id (required when link_type is provided): tells Newbook the ID of the associated link_type provided as specified above
link_period_from (optional): This is only used when the link_type/link_type_id is provided. This states the applicable start date of the link formatted as YYYY-MM-DD
link_period_to (optional): This is only used when the link_type/link_type_id is provided. This states the applicable end date of the link formatted as YYYY-MM-DD
If payment_type was provided in the request, you will receive a payment_id in the response
Used to retrieve a list of Charges
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:
period_from + period_to: Can optionally be provided together to find Charges raised or voided within that time period.
Retrieve a particular Charge
id (int) the Charge ID to retrieve (required)
The other filtering parameters per Charges: List apply here but are optional.
Void a particular Charge
id (int, required) the Charge ID to void.
voided_description (string, optional) a note to apply to the Charge for the voided reason.
voided_by (int, optional): The User ID to set who voided the Charge. Defaults to the User ID making the request.
Used to add negative charges to a Client Account (not to be used for payments - that is a separate request).
account_id: The Client Account ID retrieved in a previous request
generated_by (int, optional): The User ID to set who generated the credit. Defaults to the User ID making the 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:
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
link_type (optional): tells Newbook which item this credit is linked to:
link_type_id (required when link_type is provided): tells Newbook the ID of the associated link_type provided as specified above
link_period_from (optional): This is only used when the link_type/link_type_id is provided. This states the applicable start date of the link formatted as YYYY-MM-DD
link_period_to (optional): This is only used when the link_type/link_type_id is provided. This states the applicable end date of the link formatted as YYYY-MM-DD
If refund_type was provided in the request, you will receive a refund_id in the response
Used to retrieve a list of Credits
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:
period_from + period_to: Can optionally be provided together to find Credits raised or voided within that time period.
Retrieve a particular Credit
id (int) the Credit ID to retrieve (required)
The other filtering parameters per Credits: List apply here but are optional.
Void a particular Credit
id (int, required) the Credit ID to void.
voided_description (string, optional) a note to apply to the Credit for the voided reason.
voided_by (int, optional): The User ID to set who voided the Credit. Defaults to the User ID making the request.
Used to calculate Transaction Fees for the requested Payment Type
amount (required): The amount to calculate transaction fee.
type (required): Please see the Payment Types request for a list of valid types.
Used to add payments to a Client Account.
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_by (int, optional): The User ID to set who generated the payment. Defaults to the User ID making the request.
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.
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:
* 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).
Used to retrieve a list of Payments
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:
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"
You can run the Payments Types request to get the list of possible Payment Types.
transaction_method can be one of the following:
Retrieve a particular Payment
id (int) the Payment ID to retrieve (required)
The other filtering parameters per Payments: List apply here but are optional.
Void a particular Payment
id (int, required) the Payment ID to void.
voided_description (string, optional) a note to apply to the Payment for the voided reason.
voided_by (int, optional): The User ID to set who voided the Payment. Defaults to the User ID making the request.
Creates a Payments Reconciliation that links a Payment to Charges and/or Credits
The following parameters are required:
The following parameters are optional:
In the below example the payment would require an amount of $10 to balance.
Pull a list of Payment / Refund Types from Newbook.
Used to add refunds to a Client Account.
account_id: The Client Account ID retrieved in a previous request
generated_by (int, optional): The User ID to set who generated the refund. Defaults to the User ID making the 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
Used to retrieve a list of Refunds
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:
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"
You can run the Payments Types request to get the list of possible Refund Types.
transaction_method can be one of the following:
Retrieve a particular Refund
id (int) the Refund ID to retrieve (required)
The other filtering parameters per Refunds: List apply here but are optional.
Void a particular Refund
id (int, required) the Refund ID to void.
voided_description (string, optional) a note to apply to the Refund for the voided reason.
voided_by (int, optional): The User ID to set who voided the Refund. Defaults to the User ID making the request.
Creates a Refunds Reconciliation that links a Refund to Credits and/or Payments
The following parameters are required:
The following parameters are optional:
In the below example the refund would require an amount of $100 to balance.
Used to retrieve Tax Rates that can be used when creating Charges / Credits with custom Tax Amounts.
third_party (boolean, optional, default true): When true, only return 3rd Party Tax Rates. When false, all tax rates will be returned.
tax_name (string): The tax rate name.
tax_display_name (string): Will return the optional Display Name configured on the tax rate, or will mimic the Name field if no Display Name is configured.
Used to retrieve a list of Quotes
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:
period_from + period_to: Can optionally be provided together to find Invoices generated or voided within that time period.
Used to retrieve the PDF content for a Quote.
Used to retrieve a list of Invoices
id (int) a specific Invoice ID to retrieve (optional)
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:
invoiced_to: Can optionally filter the list by one or more Client Account ID's Invoiced To.
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).
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"
fetch_items_booking_details can optionally be provided as true to include Booking details for Charges and Credits. The below fetch_items will also need to be provided as true for this to function.
fetch_items can optionally be provided as true to include all Charges and Credits saved on the Invoice.
Example response when fetch_items is true:
{
"items": [
{
"id": "3062",
"type": "charges",
"account_id": "1796594",
"gl_category_id": "1",
"gl_account_id": "32",
"description": "Standard Rate (2024-10-09)",
"amount": 100,
"tax_free": "0",
"generated_by": "1",
"generated_when": "2024-10-09 11:30:00",
"inventory_item_id": null,
"voided_by": "0",
"voided_when": null,
"link_type": "tariffs_quoted",
"link_type_id": "123",
"link_period_from": "2024-10-09",
"link_period_to": "2024-10-09",
"taxes": [
{
"tax_id": 1,
"tax_name": "GST",
"tax_inclusive": true,
"tax_amount": "9.09"
}
]
},
{
"id": "4351",
"type": "credits",
"account_id": "1796594",
"gl_category_id": "1",
"gl_account_id": "32",
"description": "Discount",
"amount": 5,
"tax_free": "0",
"generated_by": "1",
"generated_when": "2024-10-09 11:30:00",
"inventory_item_id": null,
"voided_by": "0",
"voided_when": null,
"link_type": "discounts_quoted",
"link_type_id": "1024",
"link_period_from": "2024-10-09",
"link_period_to": "2024-10-09",
"taxes": [
{
"tax_id": 1,
"tax_name": "GST",
"tax_inclusive": true,
"tax_amount": 0.45
}
]
}
]
}
Retrieve a particular Invoice
id (int) the Invoice ID to retrieve (required)
The other filtering parameters per Invoices: List apply here but are optional.
Used to retrieve the PDF content for an Invoice.
Used to retrieve a list of Receipts
id (int) a specific Receipt ID to retrieve (optional)
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:
receipted_to: Can optionally filter the list by one or more Client Account ID's Receipted To.
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"
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.
Retrieve a particular Receipt
id (int) the Receipt ID to retrieve (required)
The other filtering parameters per Receipts: List apply here but are optional.
Used to retrieve the PDF content for a Receipt.
Retrieve a list of available Contact Templates for sending.
return_all_types is optional, and will default to false when not provided.
type will always be "body" or "sms", unless return_all_types is true, which can be one of the following:
bind the type of object the template can be sent to e.g. bookings, guests, etc
Send a Contact Template.
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
Used to create new Contact Templates
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:
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
Used to retrieve a Contact Template
Retrieve a contact template by providing its id
Returns all fields, even if they were not provided when the template was created
Update an existing Contact Template.
id is required, all other fields are optional
The other fields are the same as those provided in Contact Templates: Create
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
Retrieve a list of available System Templates.
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
Used to create new System Templates
name, description and content are required, the rest are optional.
If email_subject is left blank then name will be used instead.
Valid fields:
Used to retrieve a System Template
Retrieve a system template by providing its id
Returns all fields, even if they were not provided when the template was created
Used to update a System Template
Any field except ID can be updated
last_updated is set to the time that the request is processed
Valid fields:
Used to create an historical entry for an email sent.
All fields except for the real_recipient_type and real_recipient_id are required and documented below:
Used to create an historical entry for an sms sent.
All fields except for the real_recipient_type and real_recipient_id are required and documented below:
Retrieve a list of contact documents for a given recipient.
You can either provide recipient_type and recipient_id, or ids, or all of them.
recipient_type (string) required if recipient_id is provided - Entity type, this determines what the recipient_id field references.
"bookings"
: Contact Documents linked to a Booking ID"bookings_groups"
: Contact Documents linked to a Booking Group ID"events"
: Contact Documents linked to an Event ID"guests"
: Contact Documents linked to a Guest ID"companies"
: Contact Documents linked to a Company ID"companies_staff"
: Contact Documents linked to a Company Staff ID"travel_agents"
: Contact Documents linked to a Travel Agency ID"travel_agents_staff"
: Contact Documents linked to a Travel Agent Staff ID"quotes"
: Contact Documents linked to a Quote ID"subscriptions"
: Contact Documents linked to a Subscription ID"invoices"
: Contact Documents linked to an Invoice ID"receipts"
: Contact Documents linked to a Receipt ID"clients_accounts"
: Contact Documents linked to a Client Account ID"access_codes"
: Contact Documents linked to an Access Code ID"owners"
: Contact Documents linked to an Owner ID"gift_vouchers_codes"
: Contact Documents linked to a Gift Voucher ID"users"
: Contact Documents linked to an User ID"leads"
: Contact Documents linked to a Lead ID"purchase_orders"
: Contact Documents linked to a Purchase Order ID"availability_emails"
: Contact Documents linked to an Availability Email ID"activities_bookings"
: Contact Documents linked to an Activity ID"tickets"
: Contact Documents linked to a Ticket ID"tasks"
: Contact Documents linked to a Task ID"facilities_hire"
: Contact Documents linked to a Facility Hire ID"appointments"
: Contact Documents linked to an Appointment ID"jobs"
: Contact Documents linked to a Job IDrecipient_id (int) required if recipient_type is provided - ID of the recipient.
ids (array of ints) required if both recipient_type and recipient_id are not provided - Contact Documents IDs to limit the list to specific set of Contact Documents.
Create a Contact Document for a recipient from a contact template.
data_type (string) required - Entity type, this determines what the data_id field references.
"bookings"
: Contact Documents linked to a Booking ID"bookings_groups"
: Contact Documents linked to a Booking Group IDdata_id (int) required - ID of the recipient.
template_id (int) required - ID of the Contact Template to create the Contact Document from.
duplicate (bool) optional, default: false - If false and the recipient already has a Contact Document created from the same Contact Template, that existing Contact Template is returned instead, otherwise a new Contact Document is created.
If the Contact Document is already signed, this signature will be discarded without any errors.
contact_document_id (int) required - ID of the Contact Document to add a signature to.
first_name (string) required - First name of the person singing.
last_name (string) required - Last name of the person singing.
signature_image (string) required - The image data in base64 encoded PNG format, starting with "data:image/png;base64,". E.g.: "data:image/png;base64,BASE64_ENCODED_PNG_IMAGE_DATA"
.
signed_long (float | null) optional, default null - Longitude of geo location where singing took place.
signed_lat (float | null) optional, default null - Latitude of geo location where singing took place.
Pull data showing a wide range of information about the Instance.
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
Pull data from the Earned Revenue Report for the dates specified.
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
Pull data from the Transaction Flow Report for the dates specified.
Pull data from the Reconciliation Report for the dates specified.
Pull data from the Daily Audit Summary for the dates specified.
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.
Pull data from the Balances Dated Report.
period_from - which date to determine the balance as of (inclusive)
natures - determines which types of accounts will be displayed on the list:
Retrieves a list of Categories and their occupancy for the given period.
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.
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
to your request parameters. When provided, data is returned as requested.{"return": "array"}
To determine the number of available Sites for a given date, subtract the occupied, maintenance, and allotted values from the available value.
Pull data from the Inventory Items Report for the dates specified.
Retrieves a list of Guests and their responses to Survey Questions, based off when the Guest answered.
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:
active_only can optionally be provided to limit results to active surveys only
Provides a breakdown of Surveys Sent vs Completed.
period_range can be one of the following:
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
List Software Mappings.
Creates a new Software Mapping.
Retrieve a single Software Mapping.
Updates an existing Software Mapping.
List Special Dates.
Creates a new Special Date.
Retrieve a single Special Date.
Updates an existing Special Date.
Retrieve a list of outstanding Tasks from Newbook
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 provided, 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
booking_site_id and booking_site_name are optionally returned when the Task is associated with a Booking
Retrieve a list of the different Task Types
Create a new Task.
location_type is required and must be one of:
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
Mark an individual Task as Started or Completed.
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:
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
Retrieve a list of all Tickets.
account_id can optionally be provided to limit results to a particular Client Account
Tickets can have a status and corresponding status_name of the following values:
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.
Create a new Ticket.
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
Update an existing Ticket.
ticket_id is required
status can optionally be provided, valid options include
priority can optionally be provided, valid options include
content can optionally be provided to add an additional response to the Ticket, the response will be treated as coming from the client
Retrieve a list of available Ticket Queues.
Add a Note to an entity within the system (e.g. Booking, Guest, Lead or Quote).
for must be one of the following values:
for_id corresponds to the particular for that this note will be attached to
type_id is optional, and will use the System Default if not provided as per the Note Types: List request.
content the note content.
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.
user_id is optional, and will default to the api user if not provided. This sets the author for the note.
created_when is optional, and will default to the current timestamp if not provided. This sets the Creation timestamp for the Note.
This request still accepts the following parameters in place of the preferred parameters - as described above, with the "note_" prefix removed:
Updates an existing Note for an entity within the system (e.g. Booking, Guest, Lead or Quote).
id (integer) an existing Note to update
for must be one of the following values:
remove (boolean) optional, deactivates the existing note when set to true.
All other parameters are optional, please see Notes: Create for more details.
The value of for and for_id cannot be updated to point to a new entity within the system.
Retrieves a list of the Surveys set up in the database.
Pull the list of Gift Vouchers from within Newbook.
name is optional and when provided it will restrict the results to the matching Gift Voucher
Pull the list of Inventory Items from within Newbook.
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": "2024-10-09",
"period_to": "2024-10-10",
"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": ""
}
Pull the list of Discounts from within Newbook.
name is optional and when provided it will restrict the results to the matching Discounts
Pull a list of Custom Fields configured from within Newbook.
for must be provided as one of the following options:
type will be one of the following options:
Pull a list of allowed Note Types from within Newbook.
The note_type_default will be used for Notes: Create if a manual note_type_id is not provided
Push a list of call history to Newbook for importing.
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.
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.
Send account_breakdown as true to see the balance of each associated Sub Client Account (gl_category)
Used to record multiple sales to a Client Account in Newbook.
sales: an array of different sales to record
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
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
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
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
Pull a list of Subscriptions from Newbook.
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.
Pull a list of Notifications from Newbook.
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 provided, restricts the returned Notifications to only those which were created on the date given
Perform a login check for a Newbook Online User.
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.
Create a Newbook Online User.
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.
Update a Newbook Online User.
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.
List all Dietary Requirements, for use when adding or updating Guests.
Pull a list of active Users.
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
Retrieve the details for an existing User.
user_id is required, an existing User ID.
Send account_breakdown as true to see the balance of each associated Sub Client Account (gl_category). Not available for Corporate API requests.
Creates a User. The User will be required to change their password after first login.
Updates an existing User.
user_id must be provided to update a particular User.
Please see the Users: Create request for the parameter explanations.
List Client Account Profiles.
Retrieve a single Client Account Profile.