> ## Documentation Index
> Fetch the complete documentation index at: https://swish.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Integration events

> Reference for all events emitted by Swish, including payload shapes and metadata.

Swish emits events when customers interact with saved items or when product conditions change (back in stock, price drop, low stock). Use these events to trigger automation flows, sync data with marketing platforms, and build custom integrations.

## Event names

| Event | Trigger |
| - | - |
| `product_saved` | A customer saves a product. |
| `product_unsaved` | A customer removes a product from their saved items. |
| `saved_product_back_in_stock` | A previously saved product comes back in stock. |
| `saved_product_low_stock` | A saved product's inventory drops below the low-stock threshold. |
| `saved_product_price_drop` | The price of a saved product decreases. |
| `saved_items_activity` | The customer interacts with saved items. Emitted once per session. |

## Product event payload

Most events emit a `ProductEventPayload` containing a snapshot of the product and the selected variant at the time the event occurred.

```ts theme={null}
interface ProductEventPayload {
  context: Context;
  product: Product;
  variant: ProductVariant | null;
  metadata?: PriceDropMetadata | InventoryMetadata;
}
```

The `variant` field is `null` when the customer saved a product without selecting a specific variant. The `metadata` field is only present on price drop and inventory events.

### Context

The customer's localization context at the time of the event.

```ts theme={null}
interface Context {
  country: string | null;
  language: string | null;
  market: string | null;
}
```

### Product

A snapshot of the product from the Shopify Storefront API.

```ts theme={null}
interface Product {
  id: string;
  availableForSale: boolean;
  onlineStoreUrl: string;
  handle: string;
  productType: string;
  tags: string[];
  title: string;
  category: {
    id: string;
    name: string;
  } | null;
  compareAtPriceRange: {
    maxVariantPrice: {
      amount: string;
      currencyCode: string;
    };
    minVariantPrice: {
      amount: string;
      currencyCode: string;
    };
  };
  featuredImage: {
    altText: string | null;
    url: string;
  } | null;
  priceRange: {
    maxVariantPrice: {
      amount: string;
      currencyCode: string;
    };
    minVariantPrice: {
      amount: string;
      currencyCode: string;
    };
  };
  variantsCount: {
    count: number;
  } | null;
}
```

### ProductVariant

Included when the customer saved a specific variant. Contains pricing, inventory, and option data for that variant.

```ts theme={null}
interface ProductVariant {
  availableForSale: boolean;
  compareAtPrice: {
    amount: string;
    currencyCode: string;
  } | null;
  currentlyNotInStock: boolean;
  id: string;
  image: {
    altText: string | null;
    url: string;
  } | null;
  price: {
    amount: string;
    currencyCode: string;
  } | null;
  selectedOptions: Array<{
    name: string;
    value: string;
  }>;
  sku: string | null;
  title: string;
}
```

## Metadata

Some events include additional context in the `metadata` field. The shape depends on the event type.

### Price drop metadata

Included with `saved_product_price_drop` events.

```ts theme={null}
interface PriceDropMetadata {
  compareAtPriceDifferenceAmount: number | null;
  compareAtPriceDifferencePercent: number | null;
  currencyCode: string;
  newPrice: number;
  oldPrice: number;
  priceChangeAmount: number;
  priceChangePercent: number;
}
```

### Inventory metadata

Included with `saved_product_back_in_stock` and `saved_product_low_stock` events.

```ts theme={null}
interface InventoryMetadata {
  newInventory: number;
  oldInventory: number;
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.