Search.../

updatePriceQuote( )

Updates an existing price quote.

Description

The updatePriceQuote() function returns a Promise that resolves to the updated price quote's ID and version when the price quote is updated.

If the existing price quote contains information that is not included in the updated price quote, that information is lost. For example, if a price quote contains metadata information, but when updating the quote no metadata information is sent, the updated quote will not have any metadata.

Note: The customer listed on the price quote must be an existing site contact or member.

Syntax

function updatePriceQuote(id: IdAndVersion, priceQuoteInfo: PriceQuoteInfo, [fieldMask: Array<string>]): Promise<Response>

updatePriceQuote Parameters

NAME
TYPE
DESCRIPTION
id
IdAndVersion

ID and version of the price quote to update.

priceQuoteInfo
PriceQuoteInfo

The data used to update a price quote.

fieldMask
Optional
Array<string>

Fields to update in the price quote. If not specified, all fields update.

One of:

  • "customer"
  • "lineItems"
  • "number"
  • "locale"
  • "discount"
  • "title"
  • "currency"
  • "issueDate"
  • "dueDate"
  • "taxes"
  • "totals.total"
  • "totals.subtotal"
  • "totals.subtotal"
  • "totals.fees"
  • "metadata.notes"
  • "metadata.legalTerms"
  • "metadata.sourceUrl"
  • "metadata.sourceProperties"
  • "metadata.source"
  • "metadata.sourceRefId"

Returns

Fulfilled - ID and version of the created price quote.

Return Type:

Promise<Response>
NAME
TYPE
DESCRIPTION
id
IdAndVersion

ID and version information.

Was this helpful?

Update an existing price quote

Copy Code
1import { Permissions, webMethod } from 'wix-web-module';
2import { priceQuotes } from 'wix-billing-backend';
3
4export const updatePriceQuote = webMethod(Permissions.Anyone, (id) => {
5 return priceQuotes.getPriceQuote(id)
6 .then((result) => {
7 //make some changes
8 result.title = "Updated Title";
9
10 let updateFields = {
11 "title": result.title,
12 "customer": result.customer,
13 "currency": result.currency,
14 "lineItems": result.lineItems,
15 "discount": result.discount,
16 "paymentTerms": result.paymentTerms,
17 "metadata": result.metadata,
18 "dates": result.dates
19 };
20 return priceQuotes.updatePriceQuote(result.id, updateFields);
21 });
22});