Skip to content

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

Quote Management Functions

The Quote Management drop-in provides API functions for managing negotiable quotes and quote templates, including creating quote requests, working with quote templates, managing items and quantities, and handling attachments.

Version: 1.0.0
FunctionDescription
acceptQuoteTemplateAccepts a negotiable quote template.
addQuoteTemplateLineItemNoteAdds a buyer’s note to a specific item in a negotiable quote template.
addQuoteTemplateShippingAddressAssigns a shipping address to a negotiable quote template.
cancelQuoteTemplateCancels a negotiable quote template.
closeNegotiableQuoteCloses one or more negotiable quotes and emits success or error events with operation results.
createQuoteTemplateCreates a new negotiable quote template from an existing quote.
deleteQuoteDeletes one or more negotiable quotes.
deleteQuoteTemplatePermanently deletes a negotiable quote template.
duplicateQuoteCreates a copy of a negotiable quote and emits an event with the duplicated quote data.
generateQuoteFromTemplateGenerates a negotiable quote from an accepted quote template.
getQuoteDataRetrieves negotiable quote details by ID and emits an event with the latest quote data.
getQuoteTemplateDataFetches negotiable quote template data by template ID.
getQuoteTemplatesRetrieves the list of negotiable quote templates for the authenticated customer and emits an event with the template list.
getStoreConfigRetrieves store configuration used by Quote Management.
negotiableQuotesRetrieves the list of negotiable quotes for the authenticated customer.
openQuoteTemplateOpens an existing negotiable quote template.
removeNegotiableQuoteItemsRemoves one or more items from a negotiable quote and emits an event with the updated quote data.
removeQuoteTemplateItemsRemoves one or more products from an existing negotiable quote template.
renameNegotiableQuoteRenames a negotiable quote.
requestNegotiableQuoteCreates a new negotiable quote request from the current cart.
sendForReviewSubmits a negotiable quote for review by the seller.
sendQuoteTemplateForReviewSubmits a negotiable quote template for review by the seller.
setLineItemNoteSets a note for a specific negotiable quote line item and emits events with the updated quote data.
setShippingAddressSets or updates the shipping address for a negotiable quote.
updateQuantitiesUpdates the quantities of items in a negotiable quote.
updateQuoteTemplateItemQuantitiesChanges the quantity of one or more items in an existing negotiable quote template.
uploadFileUploads a file attachment and returns a key for associating the file with a quote or quote template.

acceptQuoteTemplate

Accepts a negotiable quote template. This action finalizes the acceptance of a quote template from the buyer’s side, returns the updated template data on success, and emits an event for successful acceptance.

const acceptQuoteTemplate = async (
params: AcceptQuoteTemplateParams
): Promise<any>
ParameterTypeReq?Description
paramsAcceptQuoteTemplateParamsYesAn object of type `AcceptQuoteTemplateParams` containing the template UID and acceptance details. See the type definition for available fields.

Events

Emits the quote-management/quote-template-data event.

Returns

Returns NegotiableQuoteModel.

addQuoteTemplateLineItemNote

Adds a buyer’s note to a specific item in a negotiable quote template. This allows buyers to provide additional information or special instructions for individual line items.

const addQuoteTemplateLineItemNote = async (
params: AddQuoteTemplateLineItemNoteParams
): Promise<any>
ParameterTypeReq?Description
paramsAddQuoteTemplateLineItemNoteParamsYesAn object of type `AddQuoteTemplateLineItemNoteParams` containing the template UID, item UID, and note text to add to a specific line item.

Events

Emits the quote-management/quote-template-data event.

Returns

Returns void.

addQuoteTemplateShippingAddress

Assigns a shipping address to a negotiable quote template. This can be either a previously-defined customer address (by ID) or a new address provided with full details.

const addQuoteTemplateShippingAddress = async (
params: AddQuoteTemplateShippingAddressParams
): Promise<any>
ParameterTypeReq?Description
paramsAddQuoteTemplateShippingAddressParamsYesAn object of type `AddQuoteTemplateShippingAddressParams` containing the template UID and shipping address details (street, city, region, postal code, country).

Events

Emits the quote-management/quote-template-data event.

Returns

Returns void.

cancelQuoteTemplate

Cancels a negotiable quote template. This action allows buyers to cancel a quote template they no longer need, with an optional comment to provide the reason for cancellation. Returns the updated template data on success and emits an event for successful cancellation.

const cancelQuoteTemplate = async (
params: CancelQuoteTemplateParams
): Promise<any>
ParameterTypeReq?Description
paramsCancelQuoteTemplateParamsYesAn object of type `CancelQuoteTemplateParams` containing the template UID to cancel. This moves the quote template to canceled status.

Events

Emits the quote-management/quote-template-data event.

Returns

Returns void.

closeNegotiableQuote

Closes one or more negotiable quotes and emits success or error events with operation results.

const closeNegotiableQuote = async (
input: CloseNegotiableQuoteInput
): Promise<CloseNegotiableQuoteResult>
ParameterTypeReq?Description
inputCloseNegotiableQuoteInputYesInput parameters for retrieving or managing quotes.

Events

Emits the following events: quote-management/negotiable-quote-close-error, quote-management/negotiable-quote-closed.

Returns

Returns CloseNegotiableQuoteResult.

createQuoteTemplate

Creates a new negotiable quote template from an existing quote. Returns the newly created template data on success and emits an event with the template data and user permissions.

const createQuoteTemplate = async (
quoteId: string
): Promise<NegotiableQuoteTemplateModel | null>
ParameterTypeReq?Description
quoteIdstringYesThe unique identifier for the negotiable quote to convert into a reusable template. Creates a template that can be used to generate similar quotes in the future.

Events

Emits the quote-management/quote-template-data event.

Returns

Returns NegotiableQuoteTemplateModel or null.

deleteQuote

Deletes one or more negotiable quotes. Deleted quotes become invisible from both the Admin and storefront. On success, it emits an event with the deleted quote UIDs.

const deleteQuote = async (
quoteUids: string[] | string
): Promise<DeleteQuoteOutput>
ParameterTypeReq?Description
quoteUidsstring[] | stringYesOne or more negotiable quote unique identifiers to delete. Can be a single UID string or an array of UIDs for batch deletion. This permanently removes the quotes.

Events

Emits the following events: quote-management/negotiable-quote-delete-error, quote-management/negotiable-quote-deleted.

Returns

Returns DeleteQuoteOutput.

deleteQuoteTemplate

Permanently deletes a negotiable quote template. This action removes the template from the system, returns a success result, and emits an event for successful deletion. This operation is irreversible.

const deleteQuoteTemplate = async (
params: DeleteQuoteTemplateParams
): Promise<any>
ParameterTypeReq?Description
paramsDeleteQuoteTemplateParamsYesAn object of type `DeleteQuoteTemplateParams` containing the template UID to delete. This permanently removes the quote template.

Events

Emits the quote-management/quote-template-deleted event.

Returns

Returns void.

duplicateQuote

Creates a copy of a negotiable quote and emits an event with the duplicated quote data.

Signature

function duplicateQuote(input: DuplicateQuoteInput): Promise<NegotiableQuoteModel | null>

Parameters

ParameterTypeRequiredDescription
inputDuplicateQuoteInputYesInput parameters for retrieving or managing quotes.

Returns

Returns Promise<NegotiableQuoteModel | null>.

Events

Emits the quote-management/quote-duplicated event.


generateQuoteFromTemplate

Generates a negotiable quote from an accepted quote template. This creates a new quote based on the template’s configuration and items.

const generateQuoteFromTemplate = async (
params: GenerateQuoteFromTemplateParams
): Promise<any>
ParameterTypeReq?Description
paramsGenerateQuoteFromTemplateParamsYesAn object of type `GenerateQuoteFromTemplateParams` containing the template UID and any customization parameters. Creates a new negotiable quote based on the template structure.

Events

Emits the quote-management/quote-template-generated event.

Returns

Returns void.

getQuoteData

Retrieves negotiable quote details by ID and emits an event with the latest quote data.

const getQuoteData = async (
quoteId: string
): Promise<any>
ParameterTypeReq?Description
quoteIdstringYesThe unique identifier for the negotiable quote to retrieve. Returns complete quote details including items, prices, history, comments, and negotiation status.

Events

Emits the quote-management/quote-data event.

Returns

Returns void.

getQuoteTemplateData

Fetches negotiable quote template data by template ID. Returns the transformed template data on success and emits an event with the template data and user permissions.

const getQuoteTemplateData = async (
templateId: string
): Promise<NegotiableQuoteTemplateModel | null>
ParameterTypeReq?Description
templateIdstringYesThe unique identifier for the quote template to retrieve. Returns template details including structure, items, and configuration settings.

Events

Emits the quote-management/quote-template-data event.

Returns

Returns NegotiableQuoteTemplateModel or null.

getQuoteTemplates

Retrieves the list of negotiable quote templates for the authenticated customer and emits an event with the template list.

const getQuoteTemplates = async (
params: GetQuoteTemplatesParams = {}
): Promise<NegotiableQuoteTemplatesListModel>
ParameterTypeReq?Description
paramsGetQuoteTemplatesParamsNoAn optional object of type `GetQuoteTemplatesParams` containing pagination and filter criteria (currentPage, pageSize, filter). Omit to retrieve all templates with default pagination.

Events

Emits the quote-management/quote-templates-data event.

Returns

Returns NegotiableQuoteTemplatesListModel.

getStoreConfig

Retrieves store configuration used by Quote Management.

const getStoreConfig = async (): Promise<StoreConfigModel>

Events

Does not emit any drop-in events.

Returns

Returns StoreConfigModel.

negotiableQuotes

Retrieves the list of negotiable quotes for the authenticated customer.

const negotiableQuotes = async (
params: NegotiableQuotesParams = {}
): Promise<NegotiableQuotesListModel>
ParameterTypeReq?Description
paramsNegotiableQuotesParamsNoAn optional object of type `NegotiableQuotesParams` containing pagination and filter criteria (currentPage, pageSize, filter). Omit to retrieve all negotiable quotes with default pagination.

Events

Does not emit any drop-in events.

Returns

Returns NegotiableQuotesListModel.

openQuoteTemplate

Opens an existing negotiable quote template. This action allows buyers to reopen a quote template for viewing or editing, returns the updated template data on success, and emits an event with the template data.

const openQuoteTemplate = async (
params: OpenQuoteTemplateParams
): Promise<any>
ParameterTypeReq?Description
paramsOpenQuoteTemplateParamsYesAn object of type `OpenQuoteTemplateParams` containing the template UID to open or activate. This makes the template available for generating quotes.

Events

Emits the quote-management/quote-template-data event.

Returns

Returns void.

removeNegotiableQuoteItems

Removes one or more items from a negotiable quote and emits an event with the updated quote data.

const removeNegotiableQuoteItems = async (
input: RemoveNegotiableQuoteItemsInput
): Promise<NegotiableQuoteModel | null>
ParameterTypeReq?Description
inputRemoveNegotiableQuoteItemsInputYesInput parameters for the operation.

Events

Emits the quote-management/quote-items-removed event.

Returns

Returns NegotiableQuoteModel or null.

removeQuoteTemplateItems

Removes one or more products from an existing negotiable quote template. This allows you to delete items from a template by providing their unique identifiers.

const removeQuoteTemplateItems = async (
params: RemoveQuoteTemplateItemsParams
): Promise<any>
ParameterTypeReq?Description
paramsRemoveQuoteTemplateItemsParamsYesAn object of type `RemoveQuoteTemplateItemsParams` containing the template UID and an array of item UIDs to remove from the template.

Events

Emits the quote-management/quote-template-data event.

Returns

Returns void.

renameNegotiableQuote

Renames a negotiable quote. It supports renaming quotes with or without a comment explaining the reason for the rename, returns the updated quote data on success, and emits an event for successful renames.

const renameNegotiableQuote = async (
input: RenameNegotiableQuoteInput
): Promise<NegotiableQuoteModel | null>
ParameterTypeReq?Description
inputRenameNegotiableQuoteInputYesInput parameters for retrieving or managing quotes.

Events

Emits the quote-management/quote-renamed event.

Returns

Returns NegotiableQuoteModel or null.

requestNegotiableQuote

Creates a new negotiable quote request from the current cart. This initiates the quote negotiation workflow, converting cart items into a quote that can be reviewed and negotiated by the seller.

const requestNegotiableQuote = async (
input: RequestNegotiableQuoteInput
): Promise<NegotiableQuoteModel | null>
ParameterTypeReq?Description
inputRequestNegotiableQuoteInputYesInput parameters for retrieving or managing quotes.

Events

Emits the quote-management/negotiable-quote-requested event.

Returns

Returns NegotiableQuoteModel or null.

sendForReview

Submits a negotiable quote for review by the seller. It supports submitting quotes with or without a comment, returns the updated quote data on success, and emits an event for successful submissions.

const sendForReview = async (
input: SendForReviewInput
): Promise<NegotiableQuoteModel | null>
ParameterTypeReq?Description
inputSendForReviewInputYesInput parameters for the operation.

Events

Emits the quote-management/quote-sent-for-review event.

Returns

Returns NegotiableQuoteModel or null.

sendQuoteTemplateForReview

Submits a negotiable quote template for review by the seller. It supports submitting templates with optional name, comment, and reference document links, returns the updated template data on success, and emits an event for successful submissions.

const sendQuoteTemplateForReview = async (
params: SendQuoteTemplateForReviewParams
): Promise<any>
ParameterTypeReq?Description
paramsSendQuoteTemplateForReviewParamsYesAn object of type `SendQuoteTemplateForReviewParams` containing the template UID and optional review notes. Submits the template for review by the seller or approver.

Events

Emits the quote-management/quote-template-data event.

Returns

Returns void.

setLineItemNote

Sets a note for a specific negotiable quote line item and emits events with the updated quote data.

const setLineItemNote = async (
input: SetLineItemNoteInput
): Promise<NegotiableQuoteModel | null>
ParameterTypeReq?Description
inputSetLineItemNoteInputYesInput parameters for the operation.

Events

Emits the following events: quote-management/line-item-note-set, quote-management/quote-data.

Returns

Returns NegotiableQuoteModel or null.

setShippingAddress

Sets or updates the shipping address for a negotiable quote. It supports setting the address using either a saved customer address ID or by providing new address data. Returns the updated quote data on success and emits an event for successful updates.

const setShippingAddress = async (
input: SetShippingAddressInput
): Promise<NegotiableQuoteModel | null>
ParameterTypeReq?Description
inputSetShippingAddressInputYesInput parameters for the operation.

Examples

additionalInput: {
vat_id: 'GB123456789',
custom_attribute: 'value',
delivery_instructions: 'Leave at door'
}

Events

Emits the quote-management/shipping-address-set event.

Returns

Returns NegotiableQuoteModel or null.

updateQuantities

Updates the quantities of items in a negotiable quote. It validates input, transforms the request to GraphQL format, returns the updated quote data on success, and emits an event for successful updates.

const updateQuantities = async (
input: UpdateQuantitiesInput
): Promise<NegotiableQuoteModel | null>
ParameterTypeReq?Description
inputUpdateQuantitiesInputYesInput parameters for the operation.

Events

Emits the quote-management/quantities-updated event.

Returns

Returns NegotiableQuoteModel or null.

updateQuoteTemplateItemQuantities

Changes the quantity of one or more items in an existing negotiable quote template. This allows updating item quantities, including optional min/max quantity constraints when the template uses min/max quantity settings.

const updateQuoteTemplateItemQuantities = async (
params: UpdateQuoteTemplateItemQuantitiesParams
): Promise<any>
ParameterTypeReq?Description
paramsUpdateQuoteTemplateItemQuantitiesParamsYesAn object of type `UpdateQuoteTemplateItemQuantitiesParams` containing the template UID and an array of item quantity updates (item UID and new quantity for each item).

Events

Emits the quote-management/quote-template-data event.

Returns

Returns void.

uploadFile

Uploads a file attachment and returns a key for associating the file with a quote or quote template.

const uploadFile = async (
file: File
): Promise<{ key: string }>
ParameterTypeReq?Description
fileFileYesThe File object to upload and attach to a quote. Supports specification documents, purchase orders, or any supporting files that provide context for quote requests.

Events

Emits the quote-management/file-upload-error event.

Returns

Returns { key: string }.

Data Models

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

NegotiableQuoteModel

The NegotiableQuoteModel object is returned by the following functions: duplicateQuote, removeNegotiableQuoteItems, renameNegotiableQuote, requestNegotiableQuote, sendForReview, setLineItemNote, setShippingAddress, updateQuantities.

interface NegotiableQuoteModel {
uid: string;
name: string;
createdAt: string;
salesRepName: string;
expirationDate: string;
updatedAt: string;
status: NegotiableQuoteStatus;
isVirtual: boolean;
buyer: {
firstname: string;
lastname: string;
};
email?: string;
templateName?: string;
totalQuantity: number;
comments?: {
uid: string;
createdAt: string;
author: {
firstname: string;
lastname: string;
};
text: string;
attachments?: {
name: string;
url: string;
}[];
}[];
history?: NegotiableQuoteHistoryEntry[];
prices: {
appliedDiscounts?: Discount[];
appliedTaxes?: Tax[];
discount?: Currency;
grandTotal?: Currency;
grandTotalExcludingTax?: Currency;
shippingExcludingTax?: Currency;
shippingIncludingTax?: Currency;
subtotalExcludingTax?: Currency;
subtotalIncludingTax?: Currency;
subtotalWithDiscountExcludingTax?: Currency;
totalTax?: Currency;
};
items: CartItemModel[];
shippingAddresses?: ShippingAddress[];
canCheckout: boolean;
canSendForReview: boolean;
lockedForEditing?: boolean;
canDelete: boolean;
canClose: boolean;
canUpdateQuote: boolean;
readOnly: boolean;
}

NegotiableQuoteTemplateModel

The NegotiableQuoteTemplateModel object is returned by the following functions: createQuoteTemplate, getQuoteTemplateData.

interface NegotiableQuoteTemplateModel {
id: string;
uid: string;
name: string;
createdAt: string;
updatedAt: string;
expirationDate?: string;
status: NegotiableQuoteTemplateStatus;
salesRepName: string;
buyer: {
firstname: string;
lastname: string;
};
comments?: QuoteTemplateComment[];
history?: NegotiableQuoteHistoryEntry[];
prices: {
subtotalExcludingTax?: Currency;
subtotalIncludingTax?: Currency;
subtotalWithDiscountExcludingTax?: Currency;
grandTotal?: Currency;
appliedTaxes?: {
amount: Currency;
label: string;
}[];
};
items: CartItemModel[];
shippingAddresses?: ShippingAddress[];
referenceDocuments?: {
uid: string;
name: string;
identifier?: string;
url: string;
}[];
// Template-specific fields
quantityThresholds?: {
min?: number;
max?: number;
};
canAccept: boolean;
canDelete: boolean;
canReopen: boolean;
canCancel: boolean;
canSendForReview: boolean;
canGenerateQuoteFromTemplate: boolean;
canEditTemplateItems: boolean;
}

NegotiableQuoteTemplatesListModel

The NegotiableQuoteTemplatesListModel object is returned by the following functions: getQuoteTemplates.

interface NegotiableQuoteTemplatesListModel {
items: NegotiableQuoteTemplateListEntry[];
pageInfo: {
currentPage: number;
pageSize: number;
totalPages: number;
};
totalCount: number;
paginationInfo?: PaginationInfo;
sortFields?: {
default: string;
options: Array<{
label: string;
value: string;
}>;
};
}

NegotiableQuotesListModel

The NegotiableQuotesListModel object is returned by the following functions: negotiableQuotes.

interface NegotiableQuotesListModel {
items: NegotiableQuoteListEntry[];
pageInfo: {
currentPage: number;
pageSize: number;
totalPages: number;
};
totalCount: number;
paginationInfo?: PaginationInfo;
sortFields?: {
default: string;
options: Array<{
label: string;
value: string;
}>;
};
}

StoreConfigModel

The StoreConfigModel object is returned by the following functions: getStoreConfig.

interface StoreConfigModel {
quoteSummaryDisplayTotal: number;
quoteSummaryMaxItems: number;
quoteDisplaySettings: {
zeroTax: boolean;
subtotal: QuoteDisplayAmount;
price: QuoteDisplayAmount;
shipping: QuoteDisplayAmount;
fullSummary: boolean;
grandTotal: boolean;
};
useConfigurableParentThumbnail: boolean;
quoteMinimumAmount: number | null;
quoteMinimumAmountMessage: string | null;
}