Skip to content

Requisition List Events and Data

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

Version: 1.2.0
EventDirectionDescription
requisitionList/alertEmits and listensEmitted when an alert or notification is triggered.
requisitionList/dataEmits and listensEmitted when data is available or changes.
requisitionList/initializedEmits and listensEmitted when the component completes initialization.
requisitionLists/dataEmits and listensEmitted when data is available or changes.

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

Emitted when the drop-in shows an alert or notification related to requisition list actions.

RequisitionListActionPayload

See RequisitionListActionPayload for full type definition.

import { events } from '@dropins/tools/event-bus.js';
events.on('requisitionList/alert', (payload) => {
console.log('requisitionList/alert event received:', payload);
// Add your custom logic here
});

Triggered when data is available or changes. It emits and listens for updates to a single requisition list.

RequisitionList | null

See RequisitionList for full type definition.

import { events } from '@dropins/tools/event-bus.js';
events.on('requisitionList/data', (payload) => {
console.log('requisitionList/data event received:', payload);
// Add your custom logic here
});

requisitionList/initialized (emits and listens)

Section titled “requisitionList/initialized (emits and listens)”

Triggered when the component completes initialization.

import { events } from '@dropins/tools/event-bus.js';
events.on('requisitionList/initialized', (payload) => {
console.log('requisitionList/initialized event received:', payload);
// Add your custom logic here
});

Triggered when data is available or changes. It emits and listens for updates to the collection of requisition lists.

RequisitionList[] | null

See RequisitionList for full type definition.

import { events } from '@dropins/tools/event-bus.js';
events.on('requisitionLists/data', (payload) => {
console.log('requisitionLists/data event received:', payload);
// Add your custom logic here
});

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

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;
}

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
}