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