# Add or Update Booking Package

<mark style="color:green;">`POST`</mark> `[PlatformAddress]/api/1.0/venue?action=addOrUpdateBookingPackage`

Adds or updates the details of a venue booking package.

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "success": true,
  "id": 8821,
  "warnings": null
}
```

{% endtab %}

{% tab title="200 " %}

{% endtab %}
{% endtabs %}

### Booking Package

| Property            | Type                               | Required | Description                                                                                                                                                                      |
| ------------------- | ---------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id                  | integer                            | optional | The unique id of the booking package to update. A new booking package will be created if this parameter is not present.                                                          |
| venueId             | integer                            | required | The id of the venue to which the booking package belongs.                                                                                                                        |
| bookingId           | integer                            | required | The id of the booking to which the booking package belongs.                                                                                                                      |
| packageId           | integer                            | required | The id of the venue setup package to which the booking package belongs.                                                                                                          |
| bookingDate         | date                               | optional | Start date of the package. Ignored if `id` is set.                                                                                                                               |
| price               | double                             | optional | The price of the booking package.                                                                                                                                                |
| costcenters         | array of [Costcenter](#costcenter) | optional | The cost centers of the booking package. If "price" not passed this will use calculate the allocation based on setup venue setup package                                         |
| mainSpaceVenueId    | integer                            | optional | The id of the space venue associated with a booking package session. If space is not set within the package session, this value should be provided. Ignored if id is set.        |
| mainSpaceId         | integer                            | optional | The id of the space associated with a booking package session. If space is not set within the package session, this value should be provided. Ignored if id is set               |
| spaceLayoutId       | integer                            | optional | The id of the space layout associated with a booking package session. If space layout is not set within the package session, this value should be provided. Ignored if id is set |
| numberAttendees     | integer                            | optional | The total attendees of the booking package.                                                                                                                                      |
| agreedAttendees     | integer                            | optional | The agreed attendees of the booking package, applicable and required when the venue setting "showAdditionalAttendees" is enabled.                                                |
| expectedAttendees   | integer                            | optional | The expected attendees of the booking package, applicable when the venue setting "showAdditionalAttendees" is enabled.                                                           |
| guaranteedAttendees | integer                            | optional | The guaranteed attendees of the booking package, applicable when the venue setting "showAdditionalAttendees" is enabled.                                                         |
| setAttendees        | integer                            | optional | The set attendees of the booking package, applicable when the venue setting "showAdditionalAttendees" is enabled.                                                                |
| actualAttendees     | integer                            | optional | The actual attendees of the booking package, applicable when the venue setting "showAdditionalAttendees" is enabled.                                                             |
| isAccommIncluded    | integer                            | optional | Whether or not accommodation is included in the booking package.                                                                                                                 |
| smallDescription    | string                             | optional | The small description of the booking package.                                                                                                                                    |

### Example Request

```javascript
{
    "id": 3948,
    "venueId": 1,
    "bookingId": 26806,
    "packageId": 49,
    "price": 1300,
    "bookingDate": "2025-03-22",
    "numberAttendees": 5,
    "isAccommIncluded": true,
    "smallDescription": "test",
    "mainSpaceVenueId": 1,
    "mainSpaceId": 1,
    "spaceLayoutId": 1,
    "costcenters": [
        {
            "id": 1,
            "value": 130,
            "excludedTaxIds": null
        },
        {
            "id": 2,
            "value": 1170,
            "excludedTaxIds": []
        }
    ]
}
```

### Returns

| Property | Description                                                        |
| -------- | ------------------------------------------------------------------ |
| success  | Whether or not the booking package is added/updated to the booking |
| id       | The unique id of the booking package                               |
| warnings | Warning messages that can occur on success                         |

### Throws

| Code                 | Description                        |
| -------------------- | ---------------------------------- |
| Specific Code: 23026 | The booking does not exist         |
| Specific Code: 24458 | The package does not exist         |
| Specific Code: 24459 | The booking package does not exist |
| Specific Code: 24460 | An error has occurred              |
| Specific Code: 24461 | The request contains invalid data  |
| Specific Code: 24462 | The request contains invalid data  |

### Costcenter

| Property       | Type     | Required          | Description                               |
| -------------- | -------- | ----------------- | ----------------------------------------- |
| id             | integer  | required          | The costcenter identifier                 |
| value          | double   | required          | The cost per person for the costcenter    |
| excludedTaxIds | optional | array of integers | The taxe ids excluded from the costcenter |

### Response Warnings

| Value                | Description                                                                                                                                         |
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| packageSessionErrors | One or more sessions of the event template could not be added to the booking. This is usually caused by conflicting reservations on function space. |
| bookingSaveError     | Package(s) was added, but failed to update booking state.                                                                                           |


---

# 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://developer.ivvy.com/venues/getoraddbookingdata/add-or-update-booking-package.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.
