Search.../

getPriceQuote( )

Gets an existing price quote by ID.

Description

The getPriceQuote() function returns a Promise that resolves to the price quote with the specified ID.

Syntax

function getPriceQuote(id: string): Promise<PriceQuote>

getPriceQuote Parameters

NAME
TYPE
DESCRIPTION
id
string

The ID of the price quote to get.

Returns

Fulfilled - The price quote with the given ID.

Return Type:

Promise<PriceQuote>
NAME
TYPE
DESCRIPTION
id
IdAndVersion

ID and version of the price quote.

status
string

Status of the price quote. One of:

  • "Draft"
  • "Sent"
  • "Processing"
  • "Accepted"
  • "Rejected"
  • "Expired"
  • "Void"
  • "Deleted"
  • "Invoiced"
number
string

Number of the price quote, unique within your site.

title
string

Title of the price quote.

currency
string

Currency code.

locale
Locale

Locale information.

customer
Customer

Customer listed on the price quote.

lineItems
Array<LineItem>

Line items listed on the price quote.

discount
Discount

Discount included in the price quote.

paymentTerms
PaymentTerms

Payment terms.

taxes
Array<CalculatedTax>

List of taxes calculated based on the line items.

totals
TotalPrice

Total values.

metadata
MetaData

Additional metadata included in the price quote.

companyId
string

Price quote company ID.

invoiceId
string

Price quote invoice ID, when converting price quote to invoice.

dates
PriceQuoteDates

Dates associated with the price quote.

Was this helpful?

Get a price quote by ID

Copy Code
1import {priceQuotes} from 'wix-billing-backend';
2
3export function getPriceQuote(id) {
4 return priceQuotes.getPriceQuote(id);
5}
6
7/* Promise resolves to:
8 *
9 * {
10 * "id":{
11 * "id": "411a5551-b0f6-4826-8a41-ebae2879f857",
12 * "version": 25
13 * },
14 * "status": "Draft",
15 * "number": "0000001",
16 * "title": "My Price Quote",
17 * "currency": "USD",
18 * "customer": {
19 * "contactId": "4f7c6637-0657-4696-a00b-9bc2ae4e035d",
20 * "email": "john.doe@somedomain.com",
21 * "address": {
22 * "country": "USA",
23 * "subdivision": "NY",
24 * "city": "New York",
25 * "postalCode": "10011",
26 * "streetAddress": {
27 * "value": "235 W 23rd St",
28 * "type": "Name"
29 * },
30 * "addressLine": "someStreet",
31 * "formatted": "235 W 23rd St, New York, NY 10011, USA"
32 * },
33 * "billingAddress": {
34 * "country": "USA",
35 * "streetAddress": {
36 * "value": "235 W 23rd St",
37 * "type": "Name"
38 * },
39 * "addressLine": "235 W 23rd St, New York, NY 10011, USA",
40 * "postalCode": "10011",
41 * "subdivision": "NY",
42 * "city": "New York",
43 * "formatted": "235 W 23rd St, New York, NY 10011, USA"
44 * },
45 * "shippingAddress": {
46 * "country": "USA",
47 * "streetAddress": {
48 * "value": "235 W 23rd St",
49 * "type": "Name"
50 * },
51 * "addressLine": "235 W 23rd St, New York, NY 10011, USA",
52 * "postalCode": "10011",
53 * "subdivision": "NY",
54 * "city": "New York",
55 * "formatted": "235 W 23rd St, New York, NY 10011, USA"
56 * },
57 * "phone": "5555555555",
58 * "company": "Some Company",
59 * "companyId": "Some Company Id",
60 * "fullName": "John Doe",
61 * "firstName": "John",
62 * "lastName": "Doe"
63 * },
64 * "dates": {
65 * "issueDate": 2019-03-13T00:00:00.000Z,
66 * "validThroughDate": 2019-06-12T00:00:00.000Z,
67 * "lastSeenDate": 2019-03-14T00:00:00.000Z
68 * },
69 * "discount": {
70 * "value": 2.5,
71 * "type": "Fixed"
72 * },
73 * "lineItems":[
74 * {
75 * "id": "00001",
76 * "name": "Item 1",
77 * "description": "First Item",
78 * "price": 10.5,
79 * "quantity": 3,
80 * "taxes": [
81 * {
82 * "name": "tax name",
83 * "rate": 8.5,
84 * "code": "tax code"
85 * }
86 * ]
87 * },
88 * {
89 * "id": "00002",
90 * "name": "Item 2",
91 * "description": "Second Item",
92 * "price": 50,
93 * "quantity": 1,
94 * "taxes": [
95 * {
96 * "name": "tax name",
97 * "rate": 8.5,
98 * "code": "tax code"
99 * }
100 * ]
101 * }
102 * ],
103 * "locale": {
104 * "language": "en"
105 * },
106 * "totals": {
107 * "discountAmount": null,
108 * "taxedAmount": 6.93,
109 * "fees": [],
110 * "subtotal": 81.5,
111 * "total": 88.43
112 * },
113 * "taxes": [
114 * {
115 * "name": "tax name",
116 * "rate": 8.5,
117 * "taxable": 81.5,
118 * "taxed": 6.93,
119 * "code": "tax code"
120 * }
121 * ],
122 * "metadata": {
123 * "notes": "Some note",
124 * "legalTerms": "Some legal terms",
125 * "sourceUrl": "http://legalurl.com",
126 * "source": "Some source",
127 * "sourceRefId": "Some source ref id"
128 * },
129 * "paymentTerms": {
130 * "termType": "DueOnReceipt",
131 * "termData": "some term data"
132 * },
133 * "companyId": "Some company id",
134 * "wasSent": true
135 * }
136 */