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 17 API functions for managing negotiable quotes and quote templates, including creating quotes, adding items, managing shipping addresses, and processing quote workflows.

Version: 1.0.0-beta5
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 via GraphQL mutation..
createQuoteTemplateCreates a new negotiable quote template from an existing quote.
deleteQuoteDeletes one or more negotiable quotes.
deleteQuoteTemplatePermanently deletes a negotiable quote template.
duplicateQuoteAPI function for the drop-in..
generateQuoteFromTemplateGenerates a negotiable quote from an accepted quote template.
getQuoteDataFetches negotiable quote data by ID..
getQuoteTemplateDataFetches negotiable quote template data by template ID.
getQuoteTemplatesAn asynchronous function that fetches the list of negotiable quote templates for the authenticated customer using GraphQL and returns the transformed result..
getStoreConfigReturns information about a store’s configuration..
negotiableQuotesAn asynchronous function that fetches the list of negotiable quotes for the authenticated customer using GraphQL and returns the transformed result..
openQuoteTemplateOpens an existing negotiable quote template.
removeNegotiableQuoteItemsRemoves one or more items from a negotiable quote, returns the updated quote data, and emits an event so listeners can react to the change..
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.
setLineItemNoteUpdates (or creates) a buyer note for a specific negotiable quote line item..
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.
uploadFileAPI function for the drop-in..

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 void.

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 via GraphQL mutation.

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

const duplicateQuote = async (
input: DuplicateQuoteInput
): Promise<NegotiableQuoteModel | null>
ParameterTypeReq?Description
inputDuplicateQuoteInputYesInput parameters for retrieving or managing quotes.

Events

Does not emit any drop-in events.

Returns

Returns NegotiableQuoteModel or null.

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

Fetches negotiable quote data by ID.

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

An asynchronous function that fetches the list of negotiable quote templates for the authenticated customer using GraphQL and returns the transformed result.

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

Returns information about a store’s configuration.

const getStoreConfig = async (): Promise<StoreConfigModel>

Events

Does not emit any drop-in events.

Returns

Returns StoreConfigModel.

negotiableQuotes

An asynchronous function that fetches the list of negotiable quotes for the authenticated customer using GraphQL and returns the transformed result.

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, returns the updated quote data, and emits an event so listeners can react to the change.

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

Updates (or creates) a buyer note for a specific negotiable quote line item.

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

API function for the drop-in.

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 quote management drop-in uses several TypeScript interfaces to define data structures:

NegotiableQuoteModel

Represents a negotiable quote with all its properties and relationships.

interface NegotiableQuoteModel {
uid: string;
name: string;
createdAt: string;
salesRepName: string;
expirationDate: string;
updatedAt: string;
status: NegotiableQuoteStatus;
buyer: {
firstname: string;
lastname: string;
};
templateName?: string;
comments?: QuoteComment[];
prices: QuotePrices;
items: NegotiableQuoteCartItem[];
canCheckout: boolean;
canSendForReview: boolean;
}

NegotiableQuoteStatus

Enumeration of possible quote statuses.

enum NegotiableQuoteStatus {
SUBMITTED = 'SUBMITTED',
PENDING = 'PENDING',
UPDATED = 'UPDATED',
OPEN = 'OPEN',
ORDERED = 'ORDERED',
CLOSED = 'CLOSED',
DECLINED = 'DECLINED',
EXPIRED = 'EXPIRED',
DRAFT = 'DRAFT',
}

CustomerModel

Represents customer data and permissions.

interface CustomerModel {
permissions: CustomerPermissions;
}
interface CustomerPermissions {
canRequestQuote: boolean;
canEditQuote: boolean;
canDeleteQuote: boolean;
canCheckoutQuote: boolean;
}

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