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 that enable you to programmatically control behavior, fetch data, and integrate with Adobe Commerce backend services.

Version: 0.0.1
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.
createQuoteTemplateCreates a new negotiable quote template from an existing quote.
deleteQuoteDeletes one or more negotiable quotes.
deleteQuoteTemplatePermanently deletes a negotiable quote template.
generateQuoteFromTemplateGenerates a negotiable quote from an accepted quote template.
getCustomerDataAn asynchronous function that fetches and transforms customer data including permissions for quote management operations..
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..
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.
removeQuoteTemplateItemsRemoves one or more products from an existing negotiable quote template.
renameNegotiableQuoteRenames a negotiable quote.
requestNegotiableQuoteCreates a negotiable quote request from a cart.
sendForReviewSubmits a negotiable quote for review by the seller.
sendQuoteTemplateForReviewSubmits a negotiable quote template for review by the seller.
setShippingAddressSets or updates the shipping address for 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
paramsAcceptQuoteTemplateParamsYesSee 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>
ParameterTypeReq?Description
paramsAddQuoteTemplateLineItemNoteParamsYesSee 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>
ParameterTypeReq?Description
paramsAddQuoteTemplateShippingAddressParamsYesSee 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>
ParameterTypeReq?Description
paramsCancelQuoteTemplateParamsYesSee 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>
ParameterTypeReq?Description
quoteIdstringYesSee 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>
ParameterTypeReq?Description
quoteUidsstring[] | stringYesSee 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>
ParameterTypeReq?Description
paramsDeleteQuoteTemplateParamsYesSee 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>
ParameterTypeReq?Description
paramsGenerateQuoteFromTemplateParamsYesSee 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>
ParameterTypeReq?Description
quoteIdstringYesSee 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>
ParameterTypeReq?Description
templateIdstringYesSee 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>
ParameterTypeReq?Description
paramsGetQuoteTemplatesParamsNoSee 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>
ParameterTypeReq?Description
paramsNegotiableQuotesParamsNoSee 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>
ParameterTypeReq?Description
paramsOpenQuoteTemplateParamsYesSee 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>
ParameterTypeReq?Description
paramsRemoveQuoteTemplateItemsParamsYesSee 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>
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 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>
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 and comment, returns the updated template data on success, and emits an event for successful submissions.

const sendQuoteTemplateForReview = async (
params: SendQuoteTemplateForReviewParams
): Promise<any>
ParameterTypeReq?Description
paramsSendQuoteTemplateForReviewParamsYesSee 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>
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.


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
paramsUpdateQuoteTemplateItemQuantitiesParamsYesSee 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 }>
ParameterTypeReq?Description
fileFileYesSee 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;
}>;
};
}