Quote Management Functions
The Quote Management drop-in provides API functions that enable you to programmatically control behavior, fetch data, and integrate with Adobe Commerce backend services.
| Function | Description |
|---|---|
acceptQuoteTemplate | Accepts a negotiable quote template. |
addQuoteTemplateLineItemNote | Adds a buyer’s note to a specific item in a negotiable quote template. |
addQuoteTemplateShippingAddress | Assigns a shipping address to a negotiable quote template. |
cancelQuoteTemplate | Cancels a negotiable quote template. |
createQuoteTemplate | Creates a new negotiable quote template from an existing quote. |
deleteQuote | Deletes one or more negotiable quotes. |
deleteQuoteTemplate | Permanently deletes a negotiable quote template. |
generateQuoteFromTemplate | Generates a negotiable quote from an accepted quote template. |
getCustomerData | An asynchronous function that fetches and transforms customer data including permissions for quote management operations.. |
getQuoteData | Fetches negotiable quote data by ID.. |
getQuoteTemplateData | Fetches negotiable quote template data by template ID. |
getQuoteTemplates | An asynchronous function that fetches the list of negotiable quote templates for the authenticated customer using GraphQL and returns the transformed result.. |
negotiableQuotes | An asynchronous function that fetches the list of negotiable quotes for the authenticated customer using GraphQL and returns the transformed result.. |
openQuoteTemplate | Opens an existing negotiable quote template. |
removeQuoteTemplateItems | Removes one or more products from an existing negotiable quote template. |
renameNegotiableQuote | Renames a negotiable quote. |
requestNegotiableQuote | Creates a negotiable quote request from a cart. |
sendForReview | Submits a negotiable quote for review by the seller. |
sendQuoteTemplateForReview | Submits a negotiable quote template for review by the seller. |
setShippingAddress | Sets or updates the shipping address for a negotiable quote. |
updateQuoteTemplateItemQuantities | Changes the quantity of one or more items in an existing negotiable quote template. |
uploadFile | API 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>| Parameter | Type | Req? | Description |
|---|---|---|---|
params | AcceptQuoteTemplateParams | Yes | See function signature above |
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>| Parameter | Type | Req? | Description |
|---|---|---|---|
params | AddQuoteTemplateLineItemNoteParams | Yes | See function signature above |
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>| Parameter | Type | Req? | Description |
|---|---|---|---|
params | AddQuoteTemplateShippingAddressParams | Yes | See function signature above |
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>| Parameter | Type | Req? | Description |
|---|---|---|---|
params | CancelQuoteTemplateParams | Yes | See function signature above |
Events
Emits the quote-management/quote-template-data event.
Returns
Returns void.
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>| Parameter | Type | Req? | Description |
|---|---|---|---|
quoteId | string | Yes | See function signature above |
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>| Parameter | Type | Req? | Description |
|---|---|---|---|
quoteUids | string[] | string | Yes | See function signature above |
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>| Parameter | Type | Req? | Description |
|---|---|---|---|
params | DeleteQuoteTemplateParams | Yes | See function signature above |
Events
Emits the quote-management/quote-template-deleted event.
Returns
Returns void.
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>| Parameter | Type | Req? | Description |
|---|---|---|---|
params | GenerateQuoteFromTemplateParams | Yes | See function signature above |
Events
Emits the quote-management/quote-template-generated event.
Returns
Returns void.
getCustomerData
An asynchronous function that fetches and transforms customer data including permissions for quote management operations.
const getCustomerData = async (): Promise<any>Events
Does not emit any drop-in events.
Returns
Returns void.
getQuoteData
Fetches negotiable quote data by ID.
const getQuoteData = async ( quoteId: string): Promise<any>| Parameter | Type | Req? | Description |
|---|---|---|---|
quoteId | string | Yes | See function signature above |
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>| Parameter | Type | Req? | Description |
|---|---|---|---|
templateId | string | Yes | See function signature above |
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>| Parameter | Type | Req? | Description |
|---|---|---|---|
params | GetQuoteTemplatesParams | No | See function signature above |
Events
Emits the quote-management/quote-templates-data event.
Returns
Returns NegotiableQuoteTemplatesListModel.
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>| Parameter | Type | Req? | Description |
|---|---|---|---|
params | NegotiableQuotesParams | No | See function signature above |
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>| Parameter | Type | Req? | Description |
|---|---|---|---|
params | OpenQuoteTemplateParams | Yes | See function signature above |
Events
Emits the quote-management/quote-template-data event.
Returns
Returns void.
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>| Parameter | Type | Req? | Description |
|---|---|---|---|
params | RemoveQuoteTemplateItemsParams | Yes | See function signature above |
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>| Parameter | Type | Req? | Description |
|---|---|---|---|
input | RenameNegotiableQuoteInput | Yes | Input parameters for retrieving or managing quotes. |
Events
Emits the quote-management/quote-renamed event.
Returns
Returns NegotiableQuoteModel or null.
requestNegotiableQuote
Creates a negotiable quote request from a cart. It supports creating both draft and final quote requests, returns the quote data on success, and emits an event for successful requests.
const requestNegotiableQuote = async ( input: RequestNegotiableQuoteInput): Promise<NegotiableQuoteModel | null>| Parameter | Type | Req? | Description |
|---|---|---|---|
input | RequestNegotiableQuoteInput | Yes | Input 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>| Parameter | Type | Req? | Description |
|---|---|---|---|
input | SendForReviewInput | Yes | Input 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 and comment, returns the updated template data on success, and emits an event for successful submissions.
const sendQuoteTemplateForReview = async ( params: SendQuoteTemplateForReviewParams): Promise<any>| Parameter | Type | Req? | Description |
|---|---|---|---|
params | SendQuoteTemplateForReviewParams | Yes | See function signature above |
Events
Emits the quote-management/quote-template-data event.
Returns
Returns void.
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>| Parameter | Type | Req? | Description |
|---|---|---|---|
input | SetShippingAddressInput | Yes | Input 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.
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>| Parameter | Type | Req? | Description |
|---|---|---|---|
params | UpdateQuoteTemplateItemQuantitiesParams | Yes | See function signature above |
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 }>| Parameter | Type | Req? | Description |
|---|---|---|---|
file | File | Yes | See function signature above |
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: renameNegotiableQuote, requestNegotiableQuote, sendForReview, setShippingAddress.
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; 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: NegotiableQuoteCartItem[]; shippingAddresses?: ShippingAddress[]; canCheckout: boolean; canSendForReview: boolean; lockedForEditing?: boolean; canDelete: boolean;}NegotiableQuoteTemplateModel
The NegotiableQuoteTemplateModel object is returned by the following functions: createQuoteTemplate, getQuoteTemplateData.
interface NegotiableQuoteTemplateModel { uid: string; name: string; createdAt: string; updatedAt: string; expirationDate?: string; status: NegotiableQuoteTemplateStatus; salesRepName?: string; buyer: { firstname: string; lastname: string; }; comments?: QuoteTemplateComment[]; history?: QuoteTemplateHistoryEntry[]; prices: { subtotalExcludingTax?: Currency; subtotalIncludingTax?: Currency; subtotalWithDiscountExcludingTax?: Currency; grandTotal?: Currency; appliedTaxes?: { amount: Currency; label: string; }[]; }; items: QuoteTemplateCartItem[]; shippingAddresses?: ShippingAddress[]; referenceDocuments?: { uid: string; name: string; url: string; }[]; // Template-specific fields quantityThresholds?: { min?: number; max?: number; }; canAccept: boolean; canDelete: boolean; canReopen: boolean; canCancel: boolean; canGenerateQuote: 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; }>; };}