---
title: "SEARCH event"
slug: "search-event-1166468"
abstract: "Describes the event object for a SEARCH event in the Boxever JavaScript Library (Sitecore CDP Stream API)."
---
# SEARCH event

The event object for a SEARCH event must include all the [required attributes for event objects](https://doc.sitecore.com/cdp/en/developers/api/stream-api/bx-js-library-legacy-reference/objects-1166464/event-object.html#UUID-9f8f6e1a-da8b-6bc6-f778-4468525242e9_UUID-97825386-9ff8-1c1e-31fc-a50ce09e734c "Required attributes") plus the following attributes:

| Attribute | Type | Description | Example | Required/optional |
| --- | --- | --- | --- | --- |
| `product_type` | string | The product type the guest searched for.<br><br>This is a custom value of your choice, but note that the value `"FLIGHT"` is reserved by Sitecore CDP. If you set the value to `"FLIGHT"`, you must include [more attributes](https://doc.sitecore.com/cdp/en/developers/api/stream-api/bx-js-library-legacy-reference/objects-1166464/event-object/search-event-1166468.html#UUID-c5a47f51-f2ea-23c5-59da-5e1c19dc7061_para-idm1903320613242670) in the event object. | <ul><li>`"running shoes"`</li><li>`"office supplies"`</li><li>`"FLIGHT"`</li></ul> | Required |
| `product_name` | string | The product name the guest searched for. | <ul><li>`"airSupport"`</li><li>`"M06P-BLK pencil, 0.6mm"`</li><li>`"DUB-LON"`</li></ul> | Required |

If you set the value of `product_type` to `"FLIGHT"`, the event object for a SEARCH event must also include the following attributes:

| Attribute | Type | Description | Example | Required/optional |
| --- | --- | --- | --- | --- |
| `flight_type` | string enum (two-letter, uppercase) | The flight type the guest searched for. | Must be one of:<br><br><ul><li>`"OW"`</li><li>`"RT"`</li></ul><br><br>`"OW"` stands for a one-way flight. `"RT"` stands for a return flight. | Required |
| `origin` | string (three-letter, uppercase) | The [IATA code](https://www.nationsonline.org/oneworld/IATA_Codes/airport_code_list.htm) of the origin the guest searched for. | <ul><li>`"BCN"`</li><li>`"DUB"`</li><li>`"LON"`</li></ul> | Required |
| `destination` | string (three-letter, uppercase) | The [IATA code](https://www.nationsonline.org/oneworld/IATA_Codes/airport_code_list.htm) of the destination the guest searched for. | <ul><li>`"BCN"`</li><li>`"DUB"`</li><li>`"LON"`</li></ul> | Required |
| `start` | string ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)) without the time zone. Format: YYYY-MM-DD’T’hh:mm | The local departure date and time of the flight that the guest searched for. | `"2026-08-21T16:17"` | Required |
| `end` | string ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)) without the time zone. Format: YYYY-MM-DD’T’hh:mm | The local return date and time of the flight that the guest searched for. | `"2026-08-23T07:00"` | Required |
| `adults` | integer | The number of adults of the flight the guest searched for.<br><br>The minimum value is `0`. | `2` | Required |
| `children` | integer | The number of children of the flight the guest searched for.<br><br>The minimum value is `0`. | `2` | Required |
| `infants` | integer | The number of infants of the flight the guest searched for.<br><br>The minimum value is `0`. | `1` | Required |
| `fare_class` | string (title case) | The class of flight the guest searched for. | <ul><li>`"Economy"`</li><li>`"Premium Economy"`</li><li>`"Business"`</li><li>`"First Class"`</li></ul> | Required |
| `fare_family` | string (title case recommended) | The fare family of the flight the guest searched for. | <ul><li>`"Economy Plus"`</li><li>`"Flexi Economy"`</li></ul> | Optional |

## Examples

This example describes an event object for a SEARCH event in an integration that uses the Boxever JavaScript Library. The `browser_id` is set to the value that the `[Boxever.getID()](../../functions-1166463/bx-getid.md "Boxever.getID()")` function returns.

```javascript
const searchEvent = {
    browser_id: Boxever.getID(),
    channel: "WEB",
    type: "SEARCH",
    language: "EN",
    currency: "EUR",
    page: "search results page",
    pos: "myretailsite/ireland",
    product_type: "running shoes",
    product_name: "airSupport"
}

```

This example describes an event object for a SEARCH event in an integration that uses the Boxever JavaScript Library. The `browser_id` is set to the value that the `[Boxever.getID()](../../functions-1166463/bx-getid.md "Boxever.getID()")` function returns. This event object describes a search for a flight.

```javascript
const searchEvent = {
    browser_id: Boxever.getID(),
    channel: "WEB",
    type: "SEARCH",
    language: "EN",
    currency: "EUR",
    page: "search results page",
    pos: "myretailsite/ireland",
    product_type: "FLIGHT",
    product_name: "DUB-LON",
    flight_type: "RT",
    origin: "DUB",
    destination: "LON",
    start: "2026-08-21T16:17",
    end: "2026-08-23T07:00",
    adults: 2,
    children: 2,
    infants: 1,
    fare_class: "Economy",
    fare_family: "Economy Plus"
}

```