# Newbook

Adding Flip.to to your booking engine requires two snippets of code:

* The first is added to [**every page**](#every-page-snippet) of your booking engine.
* The second is added to the [**confirmation page**](#confirmation-page-snippet).

{% hint style="warning" %}
**Before you begin:**

* You'll need your unique IDs, which you should have received by email. If not, ask our [Customer Success team](https://docs.flip.to/support/customer-success).
* You'll also need to sign a Newbook + Flip.to data share agreement. Ask your Newbook point person for the agreement to sign. This will allow our platform to retrieve information about bookings directly from Newbook, while ensuring the integration is stable, secure and compliant.
  {% endhint %}

***

## Every page snippet

The following snippet should be modified to pass in the appropriate values, and should be included in the **\<head>** tag of every page of the booking engine, **including** the confirmation page.

```javascript
<!-- Flip.to - Booking Engine Integration -->
<script>
!function(b,e,i){(b[e]=b[e]||[]).push({flipto:i, event: 'flipto.configuration.load'})}(window,'fliptoDataLayer',{
	bookingEngine: 'Newbook',
	companyCode: 'XX',
	code: 'YYYY',
	language: 'en'
});
</script>
<script async src='https://integration.flip.to/K2X4KDP'></script>
<!-- Flip.to - End Booking Engine Integration -->

```

<table><thead><tr><th width="177">Field</th><th>Description</th></tr></thead><tbody><tr><td>bookingEngine</td><td>The Flip.to string to define the booking engine used.</td></tr><tr><td>companyCode</td><td>The internal Flip.to company code.</td></tr><tr><td>code</td><td>Internal property code used by the booking engine.<br><br>Set your own internal code used by the engine, and let your account manager know this code.</td></tr><tr><td>language</td><td>The language ANSI code the engine currently uses to display text.<br><br>For English use <code>'en'</code>, French <code>'fr'</code>, etc. Refer to the <a href="http://www.loc.gov/standards/iso639-2/php/code_list.php">complete list of language codes</a>. Use the ISO 639-1 Code for the language parameter.<br><br>Optionally, a culture name can be used as well. For example, this can be set to <code>'en-US'</code> or <code>'en_US'</code>.</td></tr></tbody></table>

## Confirmation page snippet

The following snippet should be modified to pass in the appropriate values and should be included in the **\<head>** tag of the confirmation page to run once the guest has completed their reservation.

{% hint style="info" %}
The confirmation page **should include both** the **Every page snippet** and the **Confirmation page snippet** (the order doesn't matter).
{% endhint %}

```javascript
<!--Flip.to - Confirmation Page Start-->
<script>
!function(n,e,w){
    w.eventData={category:'Booking_Engine',action:'Load',value:w.amount};
    (n[e]=n[e]||[]).push({flipto:w,event:'flipto.confirmation.load'});
}(window,'fliptoDataLayer',{
    bookingEngine: 'Newbook',
    companyCode: 'XX',
    code: 'YYYY',
    language: 'en'
});
</script>
<!--Flip.to - Confirmation Page End-->

```

<table><thead><tr><th width="177">Field</th><th>Description</th></tr></thead><tbody><tr><td>bookingEngine</td><td>The Flip.to string to define the booking engine used.</td></tr><tr><td>companyCode</td><td>The internal Flip.to company code.</td></tr><tr><td>code</td><td>Internal property code used by the booking engine.<br><br>Set your own internal code used by the engine, and let your account manager know this code.</td></tr><tr><td>language</td><td>The language ANSI code the engine currently uses to display text.<br><br>For English use <code>'en'</code>, French <code>'fr'</code>, etc. Refer to the <a href="http://www.loc.gov/standards/iso639-2/php/code_list.php">complete list of language codes</a>. Use the ISO 639-1 Code for the language parameter.<br><br>Optionally, a culture name can be used as well. For example, this can be set to <code>'en-US'</code> or <code>'en_US'</code>.</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flip.to/docs/integrations/booking-engines/vendors/newbook.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
