Search.../

onPriceQuoteCreated( )

An event that fires when a price quote is created.

Description

The onPriceQuoteCreated() event handler runs when a price quote is created. The received PriceQuote object contains information about the price quote that was created.

Note: Backend events don't work when previewing your site.

Syntax

function onPriceQuoteCreated(event: PriceQuote): void

onPriceQuoteCreated Parameters

NAME
TYPE
DESCRIPTION
event
PriceQuote

The price quote that was created.

Returns

This function does not return anything.

Return Type:

void

Was this helpful?

An event when a price quote is created

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