> For the complete documentation index, see [llms.txt](https://developers.airship.co.uk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.airship.co.uk/basics/contacts/append-booking-data.md).

# Append booking data

### **Overview**

Airship can store full table booking history for each contact.

Having booking data attached to contacts is useful to measure and target recent or lapsed visitors based on their last visit.

### Storing bookings&#x20;

To store booking history, simply append a `bookings` object to your contact as you send it to us. All new and updated bookings can use the same endpoint / payload - Airship will determine if the booking is a New booking, or an Update to an existing booking based on if we have the Booking\_reference stored against another reservation.

| Field           | Notes                                                                                                                                                                                                                                                         |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `source_id`     | <p>1 = Website</p><p>9 = In House</p><p>10 = Third Party</p><p>etc.</p><p></p><p>You can also retrieve booking source IDs from the <code>/booking/sources</code> endpoint.</p>                                                                                |
| `stage_value`   | <p>1 = New </p><p>100 = Complete</p><p>550 = Cancelled</p><p></p><p>You can also retrieve stage values from `booking/stages`  endpoint. We use ranges to represent more granular booking stages, though the three values above satisfy most requirements.</p> |
| `unit_id`       | The unit\_id representing the physical location for which this booking relates.                                                                                                                                                                               |
| `type_name`     | A descriptive value for the booking type, i.e. `Table Booking` or `Drinks table`                                                                                                                                                                              |
| `provider_id`   | This ID is unique per partner. See your airship integration contact to get this ID                                                                                                                                                                            |
| `table_numbers` | <p>If the table numbers are assigned against the booking, then these can be passed in an array<br><br><em>Optional</em></p>                                                                                                                                   |

```javascript
"account_id": 3,
"email: "johnsmith@gmail.com",
//...etc...

"bookings" : [
    {
        "source_id"          : 1, // Website, In-house etc.
        "party_size"         : 10, // how many guests in this booking
        "stage_value"        : 1, // New, complete, cancelled etc 
        "type_name"          : "General Booking", // General booking, Birthday etc.
        "unit_id"            : 67, 
        "party_datetime"     : "2021-04-27 20:30:00", // seated date
        "enquiry_datetime"   : "2021-04-27 21:00:06", // enquiry date
        "deposit_paid"       : 0, // if applicable
        "hpbr_drink"         : 0, // deposit split against drink
        "hpbr_food"          : 0, // deposit split against food
        "hpbr_entertainment" : 0, // deposit split against entertainment
        "booking_reference"  : "4355-GH3TG-AERA", // unique booking reference for booking
        "provider_id"        : 5, // this ID is unique to the partner - see your airship contact
        "table_numbers": [
            "1",
            "24",
            "34"
        ],
        "data": {
            "element_01"     : "juice",   // dynamic field content that can be stored against reservation
        }
        "notes" : [ // optional notes
            {
                "text" : "Test note on bookingID 5",
                "time"  : "2021-04-27 21:00:06"
            }
        ]
    }
]
```

### What are data\_elements?

Data elements can store any alphanumeric string, so are, in effect, placeholders for any custom data you wish to store. Airship can store up to 20 data element fields against a reservation which aren't covered in the native fields.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers.airship.co.uk/basics/contacts/append-booking-data.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
