Schema for an ecommerce event in the hybrid flow

interface EcomEvent {
    name: "ecom";
    payloads: {
        action: "impressions" | "add" | "remove" | "view";
        currency: string;
        product?: {
            arrival?: null | string;
            arrival_city_uuid?: null | string;
            departure?: null | string;
            departure_city_uuid?: null | string;
            id: string;
            name: string;
            price: number;
            quantity?: null | number;
        } & {
            arrival?: null
            | string;
            arrival_city_uuid?: null | string;
            departure?: null | string;
            departure_city_uuid?: null | string;
            id: string;
            name: string;
            price: number;
            quantity?: null | number;
        };
        products?: null
        | Product[];
        total?: null | number;
    };
}

Properties

Properties

name: "ecom"

Event name

payloads: {
    action: "impressions" | "add" | "remove" | "view";
    currency: string;
    product?: {
        arrival?: null | string;
        arrival_city_uuid?: null | string;
        departure?: null | string;
        departure_city_uuid?: null | string;
        id: string;
        name: string;
        price: number;
        quantity?: null | number;
    } & {
        arrival?: null
        | string;
        arrival_city_uuid?: null | string;
        departure?: null | string;
        departure_city_uuid?: null | string;
        id: string;
        name: string;
        price: number;
        quantity?: null | number;
    };
    products?: null
    | Product[];
    total?: null | number;
}

Event payloads

Type declaration

  • action: "impressions" | "add" | "remove" | "view"

    Ecom action

  • currency: string

    Ecom currency

  • Optionalproduct?: {
        arrival?: null | string;
        arrival_city_uuid?: null | string;
        departure?: null | string;
        departure_city_uuid?: null | string;
        id: string;
        name: string;
        price: number;
        quantity?: null | number;
    } & {
        arrival?: null
        | string;
        arrival_city_uuid?: null | string;
        departure?: null | string;
        departure_city_uuid?: null | string;
        id: string;
        name: string;
        price: number;
        quantity?: null | number;
    }
  • Optionalproducts?: null | Product[]

    Ecom product list

  • Optionaltotal?: null | number

    Ecom total value