# Add or Update Booking Session Beverage

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

Adds or updates the details of a venue booking session beverages. NOTE: The venue must have access to add or update booking session beverage in order to call this api action.

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

```javascript
{
  "success": true,
  "id": 1234
}
```

{% endtab %}

{% tab title="200 " %}

```javascript
{
    "errorCode": 400,
    "message": "The request contains invalid data",
    "specificCode": 24354,
    "additionalMessages": [
        "costcenterId: *Value is required and can't be empty*"
    ]
}
```

{% endtab %}

{% tab title="200 " %}

```javascript
{
  "errorCode": 500,
  "message": "An error has occurred",
  "specificCode": 24353,
  "additionalMessages": []
}
```

{% endtab %}
{% endtabs %}

### Booking Session Beverage

| Property                | Type    | Required | Description                                                                                                                                                                                                                                                      |
| ----------------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id                      | integer | optional | The unique id of the booking session beverage package to update. A new booking session beverage will be created if this parameter is not present.                                                                                                                |
| venueId                 | integer | required | The unique id of the venue to which the booking session beverage package belongs.                                                                                                                                                                                |
| bookingId               | integer | optional | The unique id of the booking to which the new booking session beverage package will be assigned.                                                                                                                                                                 |
| sessionId               | integer | optional | The unique id of the booking session to which the new booking session beverage package will be assigned.                                                                                                                                                         |
| beverageId              | integer | optional | The unique id of the beverage package which is being added to the booking session                                                                                                                                                                                |
| name                    | string  | optional | The booking session beverage package name. Required when adding a new booking session beverage package.                                                                                                                                                          |
| minAttendeesGuaranteed  | integer | optional | The total attendees of the booking session beverage package. Required when adding new booking session beverage package.                                                                                                                                          |
| startTime               | string  | optional | The start time of the booking session beverage package. Format is HH:mm:ss                                                                                                                                                                                       |
| endTime                 | string  | optional | The end time of the booking session beverage package. Format is HH:mm:ss                                                                                                                                                                                         |
| sameAsSessionTime       | boolean | optional | Whether to set the startTime and endTime based on the booking session. When true, the startTime and endTime fields will not be updated.                                                                                                                          |
| includeInPackage        | boolean | optional | Whether or not the booking session beverage package is included in booking package.                                                                                                                                                                              |
| bookingPackageId        | integer | optional | The unique id of the booking package to which the booking session beverage package belongs. Required when includeInPackage is true.                                                                                                                              |
| costcenterId            | integer | optional | The unique id of the cost center to which the booking session beverage package belongs. Required when adding new booking session beverage package.                                                                                                               |
| cost                    | double  | optional | The price of the booking session beverage package. Required when includeInPackage is false.                                                                                                                                                                      |
| excludedTaxIds          | array   | optional | The array of tax Ids which are excluded to apply on the booking session beverage package. Required when includeInPackage is false.                                                                                                                               |
| costPeriod              | integer | optional | The period of the cost of the booking session beverage package. Required when the selected beverage package is hourly. 1 = Hourly, 2 = Daily                                                                                                                     |
| numHours                | float   | optional | The number of hours of the booking session beverage needed. Required when the cost period is hourly. The value must match with one of the hours added in Venue Setup > Beverages > Packages > Hourly Prices. For example, for 3 hours and 45 minutes, pass 3.75. |
| sortOrder               | integer | optional | The sort order of the booking session beverage package.                                                                                                                                                                                                          |
| excludedFromCommissions | boolean | optional | Whether this booking session beverage excluded from commission. Only applicable when booking is commissionable. Default is true.                                                                                                                                 |
| items                   | array   | optional | The array of beverage package items that shoud be added to beverage package. See [Beverage Item](#beverage-item) section for details of each item                                                                                                                |

### Beverage Item

A booking session beverage item is an object with the following details.

| Property | Type    | Required | Description                                                                                    |
| -------- | ------- | -------- | ---------------------------------------------------------------------------------------------- |
| itemId   | integer | required | The unique id of the beverage item                                                             |
| name     | string  | optional | The name of the beverage item. Do not pass it to automatically set the name from setup         |
| quantity | integer | optional | The quantity of the beverage item. Do not pass it to automatically set the quantity from setup |
| price    | double  | optional | The price of the *optional* beverage item.                                                     |

#### Adding/Updating items

While adding you can skip the items parameter, this will add all the non-optional beverge items to the beverage package automatically. Passing items will only add those items to the beverage package including any required non-removable items.

While updating you can skip the items parameter, this will not change any of the items. Passing items will replace the items with the given items. Required non-removable items cannot be removed from the beverage package.


---

# 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-session-beverage.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.
