Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

Requisition List Data & Events

The Requisition List drop-in uses the event bus to emit and listen to events for communication between drop-ins and external integrations.

Version: latest

Events reference

EventDirectionDescription
requisitionList/redirectEmitsEmitted when a specific condition or state change occurs.
requisitionList/alertEmits and listensTriggered when an alert or notification is triggered.
requisitionList/dataEmits and listensTriggered when data is available or changes.
requisitionLists/dataEmits and listensTriggered when data is available or changes.

Event details

The following sections provide detailed information about each event, including its direction, event payload, and usage examples.

requisitionList/alert (emits and listens)

Triggered when an alert or notification is triggered.

Event payload

RequisitionListActionPayload

See RequisitionListActionPayload for full type definition.

Usage

Listen to this event in your storefront:

import { events } from '@dropins/tools/event-bus.js';
const requisitionListAlertListener = events.on('requisitionList/alert', (data) => {
console.log('requisitionList/alert event received:', data);
// Add your custom logic here
});
// Later, when you want to stop listening
requisitionListAlertListener.off();

requisitionList/data (emits and listens)

Triggered when data is available or changes.

Event payload

RequisitionList | null

See RequisitionList for full type definition.

Usage

Listen to this event in your storefront:

import { events } from '@dropins/tools/event-bus.js';
const requisitionListDataListener = events.on('requisitionList/data', (data) => {
console.log('requisitionList/data event received:', data);
// Add your custom logic here
});
// Later, when you want to stop listening
requisitionListDataListener.off();

requisitionList/redirect (emits)

Emitted when a specific condition or state change occurs.

Event payload

Usage

Listen to this event in your storefront:

import { events } from '@dropins/tools/event-bus.js';
const requisitionListRedirectListener = events.on('requisitionList/redirect', (data) => {
console.log('requisitionList/redirect event received:', data);
// Add your custom logic here
});
// Later, when you want to stop listening
requisitionListRedirectListener.off();

requisitionLists/data (emits and listens)

Triggered when data is available or changes.

Event payload

RequisitionList[] | null

See RequisitionList for full type definition.

Usage

Listen to this event in your storefront:

import { events } from '@dropins/tools/event-bus.js';
const requisitionListsDataListener = events.on('requisitionLists/data', (data) => {
console.log('requisitionLists/data event received:', data);
// Add your custom logic here
});
// Later, when you want to stop listening
requisitionListsDataListener.off();

Data Models

The following data models are used in event payloads for this drop-in.

RequisitionList

Used in: requisitionList/data, requisitionLists/data.

interface RequisitionList {
uid: string;
name: string;
description: string;
updated_at: string;
items_count: number;
items: Item[];
page_info?: PageInfo;
}

RequisitionListActionPayload

Used in: requisitionList/alert.

interface RequisitionListActionPayload {
action: 'add' | 'delete' | 'update' | 'move';
type: 'success' | 'error';
context: 'product' | 'requisitionList';
skus?: string[]; // for product-related actions
message?: string[]; // for uncontrolled/custom messages
}