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 {priceQuotes} from 'wix-billing-backend';
2
3export function updatePriceQuote(id) {
4 return priceQuotes.getPriceQuote(id)
5 .then( (result) => {
6 //make some changes
7 result.title = "Updated Title";
8
9 let updateFields = {
10 "title": result.title,
11 "customer": result.customer,
12 "currency": result.currency,
13 "lineItems": result.lineItems,
14 "discount": result.discount,
15 "paymentTerms": result.paymentTerms,
16 "metadata": result.metadata,
17 "dates": result.dates
18 };
19 return priceQuotes.updatePriceQuote(result.id, updateFields);
20 } );
21}