Skip to content

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

Requisition List Functions

The Requisition List drop-in provides 11 API functions for managing requisition lists and their items, including creating lists, adding/removing products, and managing list metadata.

Version: 1.0.0
FunctionDescription
addProductsToRequisitionListAdds products to a requisition list.
addRequisitionListItemsToCartAdds the chosen items from a requisition list to the logged-in user cart.
createRequisitionListCreates a new requisition list with the name and description provided for a logged-in user.
deleteRequisitionListDeletes a requisition list identified by uid.
deleteRequisitionListItemsDeletes items from a requisition list.
getProductDataReturns details about a product.
getRequisitionListReturns information about the desired requisition list from a logged-in user.
getRequisitionListsReturns the requisition lists from a logged-in user.
getStoreConfigReturns details about the store configuration.
updateRequisitionListUpdates an existing requisition list with the name and description provided for a logged-in user.
updateRequisitionListItemsUpdates the items of an existing requisition list with the quantity and options provided for a logged-in user.

Adds products to a requisition list.

const addProductsToRequisitionList = async (
requisitionListUid: string,
requisitionListItems: Array<RequisitionListItemsInput>
): Promise<RequisitionList | null>
ParameterTypeReq?Description
requisitionListUidstringYesThe unique identifier for the requisition list to which products will be added.
requisitionListItemsArray<RequisitionListItemsInput>YesAn array of product objects to add to the requisition list. Each object includes the product SKU, quantity, and optional configuration like parent SKU for configurable products, selected options (color, size), and entered options (custom text fields).

Emits the requisitionList/data event.

Returns RequisitionList or null.

Adds the chosen items from a requisition list to the logged-in user cart.

const addRequisitionListItemsToCart = async (
requisitionListUid: string,
requisitionListItemUids: Array<string>
): Promise<Array<string> | null>
ParameterTypeReq?Description
requisitionListUidstringYesThe unique identifier for the requisition list containing the items to add to the cart.
requisitionListItemUidsArray<string>YesAn array of requisition list item UIDs to add to the cart. These are the unique identifiers for specific items within the list, not product SKUs.

Does not emit any drop-in events.

Returns Array<string> | null.

Creates a new requisition list with the name and description provided for a logged-in user.

const createRequisitionList = async (
name: string,
description?: string
): Promise<RequisitionList | null>
ParameterTypeReq?Description
namestringYesThe display name for the new requisition list. This helps users identify and organize their lists (for example, Office Supplies Q1, Weekly Inventory Restock).
descriptionstringNoAn optional text description providing additional context about the requisition list’s purpose or contents (for example, Monthly recurring orders for maintenance supplies).

Emits the requisitionList/data event.

Returns RequisitionList or null.

Deletes a requisition list identified by uid.

const deleteRequisitionList = async (
requisitionListUid: string
): Promise<{
items: RequisitionList[];
page_info: any;
status: any;
} | null>
ParameterTypeReq?Description
requisitionListUidstringYesThe unique identifier for the requisition list to delete. This operation is permanent and removes the list and all its items.

Emits the requisitionLists/data event.

Promise<{
items: RequisitionList[];
page_info: any;
status: any;
} | null>

See RequisitionList.

Deletes items from a requisition list.

const deleteRequisitionListItems = async (
requisitionListUid: string,
items: Array<string>,
pageSize: number,
currentPage: number
): Promise<RequisitionList | null>
ParameterTypeReq?Description
requisitionListUidstringYesThe unique identifier for the requisition list from which items will be removed.
itemsArray<string>YesAn array of requisition list item UIDs to remove. These are the unique identifiers returned in the list’s items array, not product SKUs.
pageSizenumberYesThe number of items to return per page in the updated requisition list response.
currentPagenumberYesThe page number for pagination (1-indexed). Used to retrieve a specific page of items after deletion.

Emits the requisitionList/data event.

Returns RequisitionList or null.

Returns details about a product.

function getProductData(skus: string[]): Promise<Product[] | null>
ParameterTypeRequiredDescription
skusstring[]YesAn array of product SKUs to retrieve product details for. Used to fetch product information including prices, stock status, and configuration options.

Returns information about the desired requisition list from a logged-in user,

const getRequisitionList = async (
requisitionListID: string,
currentPage?: number,
pageSize?: number
): Promise<RequisitionList | null>
ParameterTypeReq?Description
requisitionListIDstringYesThe unique identifier for the requisition list to retrieve. Returns the list metadata and all items.
currentPagenumberNoThe page number for pagination (1-indexed). Defaults to page 1 if not specified.
pageSizenumberNoThe number of items to return per page. Controls pagination of the requisition list items.

Emits the requisitionList/data event.

Returns RequisitionList or null.

Returns the requisition lists from a logged-in user.

const getRequisitionLists = async (
currentPage?: number,
pageSize?: number
): Promise<RequisitionList[] | null>
ParameterTypeReq?Description
currentPagenumberNoThe page number for pagination (1-indexed). Used to navigate through multiple pages of requisition lists.
pageSizenumberNoThe number of requisition lists to return per page. Controls how many lists appear on each page.

Emits the requisitionLists/data event.

Returns an array of RequisitionList objects or null.

Returns details about the store configuration.

const getStoreConfig = async (): Promise<any>

Does not emit any drop-in events.

Returns void.

Updates an existing requisition list with the name and description provided for a logged-in user.

const updateRequisitionList = async (
requisitionListUid: string,
name: string,
description?: string,
pageSize?: number,
currentPage?: number
): Promise<RequisitionList | null>
ParameterTypeReq?Description
requisitionListUidstringYesThe unique identifier for the requisition list to update.
namestringYesThe new display name for the requisition list. Updates the list’s title.
descriptionstringNoThe new text description for the requisition list. Updates the list’s purpose or context information.
pageSizenumberNoThe number of items to return per page in the updated requisition list response.
currentPagenumberNoThe page number for pagination (1-indexed) in the updated requisition list response.

Emits the requisitionList/data event.

Returns RequisitionList or null.

Updates the items of an existing requisition list with the quantity and options provided for a logged-in user.

const updateRequisitionListItems = async (
requisitionListUid: string,
requisitionListItems: Array<UpdateRequisitionListItemsInput>,
pageSize: number,
currentPage: number
): Promise<RequisitionList | null>
ParameterTypeReq?Description
requisitionListUidstringYesThe unique identifier for the requisition list containing the items to update.
requisitionListItemsArray<UpdateRequisitionListItemsInput>YesAn array of requisition list items to update. Each object includes the item UID and the fields to modify (such as quantity, selected options, or entered options).
pageSizenumberYesThe number of items to return per page in the updated requisition list response.
currentPagenumberYesThe page number for pagination (1-indexed) in the updated requisition list response.

Emits the requisitionList/data event.

Returns RequisitionList or null.

The following data models are used by functions in this drop-in.

The RequisitionList object is returned by the following functions: addProductsToRequisitionList, createRequisitionList, deleteRequisitionList, deleteRequisitionListItems, getRequisitionList, getRequisitionLists, updateRequisitionList, updateRequisitionListItems.

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