ShareRequisitionListContent Container
The ShareRequisitionListContent container renders the share UI for a requisition list. You can share by email (select company colleagues as recipients) or by copy link (generate a URL recipients use to import the list).
For public lists, set isPublic to true. The container shows a field for entering email addresses and a reusable public link. Recipients do not need an account. They can preview the list and add items to a cart instead of importing it.
Configuration
Section titled “Configuration”| Parameter | Type | Req? | Description |
|---|---|---|---|
requisitionListUid | string | Yes | UID of the requisition list to share. For company shares, the container calls shareRequisitionListByToken to build the copy-link URL. For public shares, it calls getPublicRequisitionListToken instead. Use this same UID when your onSubmit callback calls the email-sharing function. |
isPublic | boolean | No | Set to true to share a public list. The container replaces the company-user selector with a free-text field for comma-separated email addresses, validates each address, and enforces requisition_list_public_share_max_recipients. It also builds the link from requisition_list_public_share_storefront_path and the owner’s public token. Defaults to false. |
isSubmitting | boolean | Yes | Controls the submitting state of the form. Set to true while the share-by-email request is in progress to disable the submit button and prevent duplicate submissions. |
onSubmit | (customerUids: string[]) => Promise<Array<{ message: string; code: string }> | null> | Yes | Called when the user clicks Submit with the selected recipient UIDs. Return null on success or an array of error objects on failure. Typically wraps shareRequisitionListByEmail. When isPublic is true, the array contains the entered email addresses instead of user UIDs, and the callback typically wraps sharePublicRequisitionList. |
currentCustomerEmail | string | No | Email address of the currently authenticated customer. When provided, the container excludes this address from the selectable company recipients so the sender cannot share with themselves. |
routeSharedRequisitionList | (relativeUrl: string) => string | No | Receives the relative share URL (for example, /customer/requisition-list-sharing?requisition_id=<token> from requisition_list_share_storefront_path) and returns the final URL to display. Use this to convert the relative URL to an absolute URL. If you omit this prop, the container uses the relative URL as-is. Example: (relativeUrl) => window.location.origin + relativeUrl |
This container does not expose any customizable slots.
RequisitionListHeader embeds this container in a share modal. When requisition_list_sharing_enabled is true in store configuration, the header shows a Share action button that opens the modal.
The following example renders the container on its own (outside the header modal):
import { render as provider } from '/@dropins/storefront-requisition-list/render.js';import { ShareRequisitionListContent } from '/@dropins/storefront-requisition-list/containers/ShareRequisitionListContent.js';import { shareRequisitionListByEmail } from '/@dropins/storefront-requisition-list/api.js';
await provider.render(ShareRequisitionListContent, { requisitionListUid: 'YOUR_LIST_UID', isSubmitting: false, onSubmit: async (customerUids) => { return shareRequisitionListByEmail('YOUR_LIST_UID', customerUids); }, currentCustomerEmail: 'current.user@example.com', routeSharedRequisitionList: (relativeUrl) => window.location.origin + relativeUrl,})(block);Replace YOUR_LIST_UID with the UID of the list you want to share.
To share a public list, pass isPublic: true and wrap sharePublicRequisitionList:
import { sharePublicRequisitionList } from '/@dropins/storefront-requisition-list/api.js';
await provider.render(ShareRequisitionListContent, { requisitionListUid: 'YOUR_LIST_UID', isPublic: true, isSubmitting: false, onSubmit: async (emails) => { return sharePublicRequisitionList('YOUR_LIST_UID', emails); }, routeSharedRequisitionList: (relativeUrl) => window.location.origin + relativeUrl,})(block);The list must already be public. If it is not, the share request returns a NOT_PUBLIC error.