CorvidReference

Events

Events that are fired by actions relating to billing.

Wix billing events are fired on your site's backend when certain events occur related to billing. You can write event handlers that react to these events. Event handler functions receive data that corresponds to the event that fired. Use event handlers to create custom responses to contact events.

To add a billing event handler, add an events.js file to the Backend section of your site if one does not already exist. All event handler functions for your site are defined in this file.

Event handler functions are defined using the following pattern:

 export function <wixAppName>_<eventName>(event) { }

For example, an event handler that handles invoice creation looks like this:

 export function wixBilling_onInvoiceCreated(event) { }

Note that backend events don't work when previewing your site.

Table of Contents

FUNCTIONS

?
Perform actions on an object.
onInvoiceCreated( )An event that fires when an invoice is created.
onInvoiceOverdue( )An event that fires when an invoice is overdue.
onInvoicePaid( )An event that fires when an invoice is paid.
onInvoiceSent( )An event that fires when an invoice is sent.
onPriceQuoteAccepted( )An event that fires when a price quote is accepted.
onPriceQuoteCreated( )An event that fires when a price quote is created.
onPriceQuoteExpired( )An event that fires when a price quote has expired.
onPriceQuoteSent( )An event that fires when a price quote is sent.

onInvoiceCreated( )

An event that fires when an invoice is created.

Description

The onInvoiceCreated() event handler runs when an invoice is created. The received Invoice object contains information about the invoice that was created.

Note

Backend events don't work when previewing your site.

Syntax

function onInvoiceCreated(event: Invoice): void
PARAMETERS
?
Values that you pass to a function.
event
The invoice that was created.

Examples

An event when an invoice is created

// Place this code in the events.js file
// of your site's Backend section.

export function wixBilling_onInvoiceCreated(event) {
  let invoiceId = event.id.id;
  let email = event.customer.email;
}
  
/*  Full event object:
 *
 * {  
 *   "id":{  
 *     "id": "411a5551-b0f6-4826-8a41-ebae2879f857",
 *     "version": 25
 *   },
 *   "status": "Draft",
 *   "number": "0000001",
 *   "title": "My Invoice",
 *   "currency": "USD",
 *   "customer": {  
 *     "contactId": "4f7c6637-0657-4696-a00b-9bc2ae4e035d",
 *     "email": "john.doe@somedomain.com",
 *     "address": {  
 *       "street": "235 W 23rd St",
 *       "city": "New York",
 *       "zip": "10011",
 *       "state": "NY",
 *       "country": "USA"
 *     },
 *     "phone": "5555555555",
 *     "company": "Some Company",
 *     "fullName": "John Doe",
 *     "firstName": "John",
 *     "lastName": "Doe"
 *   },
 *   "dates": {  
 *     "issueDate": 2019-03-13T00:00:00.000Z,
 *     "dueDate": 2019-06-12T00:00:00.000Z
 *   },
 *   "discount": {
 *     "value": 2.5,
 *     "type": "Fixed"
 *   },
 *   "lineItems":[  
 *     {  
 *       "id": "00001",
 *       "name": "Item 1",
 *       "description": "First Item",
 *       "price": 10.5,
 *       "quantity": 3,
 *       "taxes": [
 *         {
 *           "name": "tax name",
 *           "rate": 8.5
 *         }
 *       ]
 *     },
 *     {
 *       "id": "00002",
 *       "name": "Item 2",
 *       "description": "Second Item",
 *       "price": 50,
 *       "quantity": 1,
 *       "taxes": [
 *         {
 *           "name": "tax name",
 *           "rate": 8.5
 *         }
 *       ]
 *     }
 *   ],
 *   "locale": {  
 *     "language": "en"
 *   },
 *   "payments": [{
 *     "id": "4j9q4o00-4205-8q83-003d-3ofd9d8wmf0w",
 *     "type": "offline",
 *     "amount": "25.50",
 *     "date": 2019-03-23T00:00:00.000Z"
 *   }],
 *   "totals": {  
 *     "discountAmount": null,
 *     "taxedAmount": 6.93,
 *     "fees": [],
 *     "subtotal": 81.5,
 *     "total": 88.43
 *   },
 *   "dynamicTotals": {
 *     "paidAmount": 25.50,
 *     "balance": 62.39
 *   },
 *   "taxes": [  
 *     {  
 *       "name": "tax name",
 *       "rate": 8.5,
 *       "taxable": 81.5,
 *       "taxed": 6.93
 *     }
 *   ],
 *   "metadata": {  
 *     "notes": "Some note.",
 *     "legalTerms": "Some legal terms",
 *     "sourceUrl": "http://legalurl.com"
 *   },
 *   "paymentTerms": {  
 *     "termType": "DueOnReceipt",
 *     "termData": "some term data"
 *   }
 * }
 */

onInvoiceOverdue( )

An event that fires when an invoice is overdue.

Description

The onInvoiceOverdue() event handler runs when an invoice is overdue. The received Invoice object contains information about the invoice that is overdue.

Note

Backend events don't work when previewing your site.

Syntax

function onInvoiceOverdue(event: Invoice): void
PARAMETERS
?
Values that you pass to a function.
event
The invoice that is overdue.

Examples

An event when an invoice is overdue

// Place this code in the events.js file
// of your site's Backend section.

export function wixBilling_onInvoiceOverdue(event) {
  let invoiceId = event.id.id;
  let email = event.customer.email;
}
    
/*  Full event object:
 *
 * {  
 *   "id":{  
 *     "id": "411a5551-b0f6-4826-8a41-ebae2879f857",
 *     "version": 25
 *   },
 *   "status": "Overdue",
 *   "number": "0000001",
 *   "title": "My Invoice",
 *   "currency": "USD",
 *   "customer": {  
 *     "contactId": "4f7c6637-0657-4696-a00b-9bc2ae4e035d",
 *     "email": "john.doe@somedomain.com",
 *     "address": {  
 *       "street": "235 W 23rd St",
 *       "city": "New York",
 *       "zip": "10011",
 *       "state": "NY",
 *       "country": "USA"
 *     },
 *     "phone": "5555555555",
 *     "company": "Some Company",
 *     "fullName": "John Doe",
 *     "firstName": "John",
 *     "lastName": "Doe"
 *   },
 *   "dates": {  
 *     "issueDate": 2019-03-13T00:00:00.000Z,
 *     "dueDate": 2019-06-12T00:00:00.000Z
 *   },
 *   "discount": {
 *     "value": 2.5,
 *     "type": "Fixed"
 *   },
 *   "lineItems":[  
 *     {  
 *       "id": "00001",
 *       "name": "Item 1",
 *       "description": "First Item",
 *       "price": 10.5,
 *       "quantity": 3,
 *       "taxes": [
 *         {
 *           "name": "tax name",
 *           "rate": 8.5
 *         }
 *       ]
 *     },
 *     {
 *       "id": "00002",
 *       "name": "Item 2",
 *       "description": "Second Item",
 *       "price": 50,
 *       "quantity": 1,
 *       "taxes": [
 *         {
 *           "name": "tax name",
 *           "rate": 8.5
 *         }
 *       ]
 *     }
 *   ],
 *   "locale": {  
 *     "language": "en"
 *   },
 *   "payments": [{
 *     "id": "4j9q4o00-4205-8q83-003d-3ofd9d8wmf0w",
 *     "type": "offline",
 *     "amount": "25.50",
 *     "date": 2019-03-23T00:00:00.000Z"
 *   }],
 *   "totals": {  
 *     "discountAmount": null,
 *     "taxedAmount": 6.93,
 *     "fees": [],
 *     "subtotal": 81.5,
 *     "total": 88.43
 *   },
 *   "dynamicTotals": {
 *     "paidAmount": 25.50,
 *     "balance": 62.39
 *   },
 *   "taxes": [  
 *     {  
 *       "name": "tax name",
 *       "rate": 8.5,
 *       "taxable": 81.5,
 *       "taxed": 6.93
 *     }
 *   ],
 *   "metadata": {  
 *     "notes": "Some note.",
 *     "legalTerms": "Some legal terms",
 *     "sourceUrl": "http://legalurl.com"
 *   },
 *   "paymentTerms": {  
 *     "termType": "DueOnReceipt",
 *     "termData": "some term data"
 *   }
 * }
 */

onInvoicePaid( )

An event that fires when an invoice is paid.

Description

The onInvoicePaid() event handler runs when an invoice is paid. The received Invoice object contains information about the invoice that was paid.

Note

Backend events don't work when previewing your site.

Syntax

function onInvoicePaid(event: Invoice): void
PARAMETERS
?
Values that you pass to a function.
event
The invoice that was paid.

Examples

An event when an invoice is paid

// Place this code in the events.js file
// of your site's Backend section.

export function wixBilling_onInvoicePaid(event) {
  let invoiceId = event.id.id;
  let email = event.customer.email;
}
  
/*  Full event object:
 *
 * {  
 *   "id":{  
 *     "id": "411a5551-b0f6-4826-8a41-ebae2879f857",
 *     "version": 25
 *   },
 *   "status": "Paid",
 *   "number": "0000001",
 *   "title": "My Invoice",
 *   "currency": "USD",
 *   "customer": {  
 *     "contactId": "4f7c6637-0657-4696-a00b-9bc2ae4e035d",
 *     "email": "john.doe@somedomain.com",
 *     "address": {  
 *       "street": "235 W 23rd St",
 *       "city": "New York",
 *       "zip": "10011",
 *       "state": "NY",
 *       "country": "USA"
 *     },
 *     "phone": "5555555555",
 *     "company": "Some Company",
 *     "fullName": "John Doe",
 *     "firstName": "John",
 *     "lastName": "Doe"
 *   },
 *   "dates": {  
 *     "issueDate": 2019-03-13T00:00:00.000Z,
 *     "dueDate": 2019-06-12T00:00:00.000Z
 *   },
 *   "discount": {
 *     "value": 2.5,
 *     "type": "Fixed"
 *   },
 *   "lineItems":[  
 *     {  
 *       "id": "00001",
 *       "name": "Item 1",
 *       "description": "First Item",
 *       "price": 10.5,
 *       "quantity": 3,
 *       "taxes": [
 *         {
 *           "name": "tax name",
 *           "rate": 8.5
 *         }
 *       ]
 *     },
 *     {
 *       "id": "00002",
 *       "name": "Item 2",
 *       "description": "Second Item",
 *       "price": 50,
 *       "quantity": 1,
 *       "taxes": [
 *         {
 *           "name": "tax name",
 *           "rate": 8.5
 *         }
 *       ]
 *     }
 *   ],
 *   "locale": {  
 *     "language": "en"
 *   },
 *   "payments": [{
 *     "id": "4j9q4o00-4205-8q83-003d-3ofd9d8wmf0w",
 *     "type": "offline",
 *     "amount": "25.50",
 *     "date": 2019-03-23T00:00:00.000Z"
 *   }],
 *   "totals": {  
 *     "discountAmount": null,
 *     "taxedAmount": 6.93,
 *     "fees": [],
 *     "subtotal": 81.5,
 *     "total": 88.43
 *   },
 *   "dynamicTotals": {
 *     "paidAmount": 25.50,
 *     "balance": 62.39
 *   },
 *   "taxes": [  
 *     {  
 *       "name": "tax name",
 *       "rate": 8.5,
 *       "taxable": 81.5,
 *       "taxed": 6.93
 *     }
 *   ],
 *   "metadata": {  
 *     "notes": "Some note.",
 *     "legalTerms": "Some legal terms",
 *     "sourceUrl": "http://legalurl.com"
 *   },
 *   "paymentTerms": {  
 *     "termType": "DueOnReceipt",
 *     "termData": "some term data"
 *   }
 * }
 */

onInvoiceSent( )

An event that fires when an invoice is sent.

Description

The onInvoiceSent() event handler runs when an invoice is sent. The received Invoice object contains information about the invoice that was sent.

Note

Backend events don't work when previewing your site.

Syntax

function onInvoiceSent(event: Invoice): void
PARAMETERS
?
Values that you pass to a function.
event
The invoice that was sent.

Examples

An event when an invoice is sent

// Place this code in the events.js file
// of your site's Backend section.

export function wixBilling_onInvoiceSent(event) {
  let invoiceId = event.id.id;
  let email = event.customer.email;
}
  
/*  Full event object:
 *
 * {  
 *   "id":{  
 *     "id": "411a5551-b0f6-4826-8a41-ebae2879f857",
 *     "version": 25
 *   },
 *   "status": "Sent",
 *   "number": "0000001",
 *   "title": "My Invoice",
 *   "currency": "USD",
 *   "customer": {  
 *     "contactId": "4f7c6637-0657-4696-a00b-9bc2ae4e035d",
 *     "email": "john.doe@somedomain.com",
 *     "address": {  
 *       "street": "235 W 23rd St",
 *       "city": "New York",
 *       "zip": "10011",
 *       "state": "NY",
 *       "country": "USA"
 *     },
 *     "phone": "5555555555",
 *     "company": "Some Company",
 *     "fullName": "John Doe",
 *     "firstName": "John",
 *     "lastName": "Doe"
 *   },
 *   "dates": {  
 *     "issueDate": 2019-03-13T00:00:00.000Z,
 *     "dueDate": 2019-06-12T00:00:00.000Z
 *   },
 *   "discount": {
 *     "value": 2.5,
 *     "type": "Fixed"
 *   },
 *   "lineItems":[  
 *     {  
 *       "id": "00001",
 *       "name": "Item 1",
 *       "description": "First Item",
 *       "price": 10.5,
 *       "quantity": 3,
 *       "taxes": [
 *         {
 *           "name": "tax name",
 *           "rate": 8.5
 *         }
 *       ]
 *     },
 *     {
 *       "id": "00002",
 *       "name": "Item 2",
 *       "description": "Second Item",
 *       "price": 50,
 *       "quantity": 1,
 *       "taxes": [
 *         {
 *           "name": "tax name",
 *           "rate": 8.5
 *         }
 *       ]
 *     }
 *   ],
 *   "locale": {  
 *     "language": "en"
 *   },
 *   "payments": [{
 *     "id": "4j9q4o00-4205-8q83-003d-3ofd9d8wmf0w",
 *     "type": "offline",
 *     "amount": "25.50",
 *     "date": 2019-03-23T00:00:00.000Z"
 *   }],
 *   "totals": {  
 *     "discountAmount": null,
 *     "taxedAmount": 6.93,
 *     "fees": [],
 *     "subtotal": 81.5,
 *     "total": 88.43
 *   },
 *   "dynamicTotals": {
 *     "paidAmount": 25.50,
 *     "balance": 62.39
 *   },
 *   "taxes": [  
 *     {  
 *       "name": "tax name",
 *       "rate": 8.5,
 *       "taxable": 81.5,
 *       "taxed": 6.93
 *     }
 *   ],
 *   "metadata": {  
 *     "notes": "Some note.",
 *     "legalTerms": "Some legal terms",
 *     "sourceUrl": "http://legalurl.com"
 *   },
 *   "paymentTerms": {  
 *     "termType": "DueOnReceipt",
 *     "termData": "some term data"
 *   }
 * }
 */

onPriceQuoteAccepted( )

An event that fires when a price quote is accepted.

Description

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

Note

Backend events don't work when previewing your site.

Syntax

function onPriceQuoteAccepted(event: PriceQuote): void
PARAMETERS
?
Values that you pass to a function.
event
The price quote that was accepted.

Examples

An event when a price quote is accepted

// Place this code in the events.js file
// of your site's Backend section.

export function wixBilling_onPriceQuoteAccepted(event) {
  let invoiceId = event.id.id;
  let email = event.customer.email;
}

/*  Full event object:
 *
 * {  
 *   "id":{  
 *     "id": "411a5551-b0f6-4826-8a41-ebae2879f857",
 *     "version": 25
 *   },
 *   "status": "Accepted",
 *   "number": "0000001",
 *   "title": "My Price Quote",
 *   "currency": "USD",
 *   "customer": {  
 *     "contactId": "4f7c6637-0657-4696-a00b-9bc2ae4e035d",
 *     "email": "john.doe@somedomain.com",
 *     "address": {  
 *       "street": "235 W 23rd St",
 *       "city": "New York",
 *       "zip": "10011",
 *       "state": "NY",
 *       "country": "USA"
 *     },
 *     "phone": "5555555555",
 *     "company": "Some Company",
 *     "fullName": "John Doe",
 *     "firstName": "John",
 *     "lastName": "Doe"
 *   },
 *   "dates": {  
 *     "issueDate": 2019-03-13T00:00:00.000Z,
 *     "validThroughDate": 2019-06-12T00:00:00.000Z
 *   },
 *   "discount": {
 *     "value": 2.5,
 *     "type": "Fixed"
 *   },
 *   "lineItems":[  
 *     {  
 *       "id": "00001",
 *       "name": "Item 1",
 *       "description": "First Item",
 *       "price": 10.5,
 *       "quantity": 3,
 *       "taxes": [
 *         {
 *           "name": "tax name",
 *           "rate": 8.5
 *         }
 *       ]
 *     },
 *     {  
 *       "id": "00002",
 *       "name": "Item 2",
 *       "description": "Second Item",
 *       "price": 50,
 *       "quantity": 1,
 *       "taxes": [
 *         {
 *           "name": "tax name",
 *           "rate": 8.5
 *         }
 *       ]
 *     }
 *   ],
 *   "locale": {
 *     "language": "en"
 *   },
 *   "totals": {
 *     "discountAmount": null,
 *     "taxedAmount": 6.93,
 *     "fees": [],
 *     "subtotal": 81.5,
 *     "total": 88.43
 *   },
 *   "taxes": [
 *     {
 *       "name": "tax name",
 *       "rate": 8.5,
 *       "taxable": 81.5,
 *       "taxed": 6.93
 *     }
 *   ],
 *   "metadata": {
 *     "notes": "Some note.",
 *     "legalTerms": "Some legal terms",
 *     "sourceUrl": "http://legalurl.com"
 *   },
 *   "paymentTerms": {
 *     "termType": "DueOnReceipt",
 *     "termData": "some term data"
 *   }
 * }
 */

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
PARAMETERS
?
Values that you pass to a function.
event
The price quote that was created.

Examples

An event when a price quote is created

// Place this code in the events.js file
// of your site's Backend section.

export function wixBilling_onPriceQuoteCreated(event) {
  let invoiceId = event.id.id;
  let email = event.customer.email;
}
    
/*  Full event object:
 *
 * {  
 *   "id":{  
 *     "id": "411a5551-b0f6-4826-8a41-ebae2879f857",
 *     "version": 25
 *   },
 *   "status": "Draft",
 *   "number": "0000001",
 *   "title": "My Price Quote",
 *   "currency": "USD",
 *   "customer": {  
 *     "contactId": "4f7c6637-0657-4696-a00b-9bc2ae4e035d",
 *     "email": "john.doe@somedomain.com",
 *     "address": {  
 *       "street": "235 W 23rd St",
 *       "city": "New York",
 *       "zip": "10011",
 *       "state": "NY",
 *       "country": "USA"
 *     },
 *     "phone": "5555555555",
 *     "company": "Some Company",
 *     "fullName": "John Doe",
 *     "firstName": "John",
 *     "lastName": "Doe"
 *   },
 *   "dates": {  
 *     "issueDate": 2019-03-13T00:00:00.000Z,
 *     "validThroughDate": 2019-06-12T00:00:00.000Z
 *   },
 *   "discount": {
 *     "value": 2.5,
 *     "type": "Fixed"
 *   },
 *   "lineItems":[  
 *     {  
 *       "id": "00001",
 *       "name": "Item 1",
 *       "description": "First Item",
 *       "price": 10.5,
 *       "quantity": 3,
 *       "taxes": [
 *         {
 *           "name": "tax name",
 *           "rate": 8.5
 *         }
 *       ]
 *     },
 *     {  
 *       "id": "00002",
 *       "name": "Item 2",
 *       "description": "Second Item",
 *       "price": 50,
 *       "quantity": 1,
 *       "taxes": [
 *         {
 *           "name": "tax name",
 *           "rate": 8.5
 *         }
 *       ]
 *     }
 *   ],
 *   "locale": {
 *     "language": "en"
 *   },
 *   "totals": {
 *     "discountAmount": null,
 *     "taxedAmount": 6.93,
 *     "fees": [],
 *     "subtotal": 81.5,
 *     "total": 88.43
 *   },
 *   "taxes": [
 *     {
 *       "name": "tax name",
 *       "rate": 8.5,
 *       "taxable": 81.5,
 *       "taxed": 6.93
 *     }
 *   ],
 *   "metadata": {
 *     "notes": "Some note.",
 *     "legalTerms": "Some legal terms",
 *     "sourceUrl": "http://legalurl.com"
 *   },
 *   "paymentTerms": {
 *     "termType": "DueOnReceipt",
 *     "termData": "some term data"
 *   }
 * }
 */

onPriceQuoteExpired( )

An event that fires when a price quote has expired.

Description

The onPriceQuoteExpired() event handler runs when a price quote has expired. The received PriceQuote object contains information about the price quote that has expired.

Note

Backend events don't work when previewing your site.

Syntax

function onPriceQuoteExpired(event: PriceQuote): void
PARAMETERS
?
Values that you pass to a function.
event
The price quote that has expired.

Examples

An event when a price quote has expired

// Place this code in the events.js file
// of your site's Backend section.

export function wixBilling_onPriceQuoteExpired(event) {
  let invoiceId = event.id.id;
  let email = event.customer.email;
}

/*  Full event object:
 *
 * {  
 *   "id":{  
 *     "id": "411a5551-b0f6-4826-8a41-ebae2879f857",
 *     "version": 25
 *   },
 *   "status": "Expired",
 *   "number": "0000001",
 *   "title": "My Price Quote",
 *   "currency": "USD",
 *   "customer": {  
 *     "contactId": "4f7c6637-0657-4696-a00b-9bc2ae4e035d",
 *     "email": "john.doe@somedomain.com",
 *     "address": {  
 *       "street": "235 W 23rd St",
 *       "city": "New York",
 *       "zip": "10011",
 *       "state": "NY",
 *       "country": "USA"
 *     },
 *     "phone": "5555555555",
 *     "company": "Some Company",
 *     "fullName": "John Doe",
 *     "firstName": "John",
 *     "lastName": "Doe"
 *   },
 *   "dates": {  
 *     "issueDate": 2019-03-13T00:00:00.000Z,
 *     "validThroughDate": 2019-06-12T00:00:00.000Z
 *   },
 *   "discount": {
 *     "value": 2.5,
 *     "type": "Fixed"
 *   },
 *   "lineItems":[  
 *     {  
 *       "id": "00001",
 *       "name": "Item 1",
 *       "description": "First Item",
 *       "price": 10.5,
 *       "quantity": 3,
 *       "taxes": [
 *         {
 *           "name": "tax name",
 *           "rate": 8.5
 *         }
 *       ]
 *     },
 *     {  
 *       "id": "00002",
 *       "name": "Item 2",
 *       "description": "Second Item",
 *       "price": 50,
 *       "quantity": 1,
 *       "taxes": [
 *         {
 *           "name": "tax name",
 *           "rate": 8.5
 *         }
 *       ]
 *     }
 *   ],
 *   "locale": {
 *     "language": "en"
 *   },
 *   "totals": {
 *     "discountAmount": null,
 *     "taxedAmount": 6.93,
 *     "fees": [],
 *     "subtotal": 81.5,
 *     "total": 88.43
 *   },
 *   "taxes": [
 *     {
 *       "name": "tax name",
 *       "rate": 8.5,
 *       "taxable": 81.5,
 *       "taxed": 6.93
 *     }
 *   ],
 *   "metadata": {
 *     "notes": "Some note.",
 *     "legalTerms": "Some legal terms",
 *     "sourceUrl": "http://legalurl.com"
 *   },
 *   "paymentTerms": {
 *     "termType": "DueOnReceipt",
 *     "termData": "some term data"
 *   }
 * }
 */

onPriceQuoteSent( )

An event that fires when a price quote is sent.

Description

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

Note

Backend events don't work when previewing your site.

Syntax

function onPriceQuoteSent(event: PriceQuote): void
PARAMETERS
?
Values that you pass to a function.
event
The price quote that was sent.

Examples

An event when a price quote is sent

// Place this code in the events.js file
// of your site's Backend section.

export function wixBilling_onPriceQuoteSent(event) {
  let invoiceId = event.id.id;
  let email = event.customer.email;
}

/*  Full event object:
 *
 * {  
 *   "id":{  
 *     "id": "411a5551-b0f6-4826-8a41-ebae2879f857",
 *     "version": 25
 *   },
 *   "status": "Sent",
 *   "number": "0000001",
 *   "title": "My Price Quote",
 *   "currency": "USD",
 *   "customer": {  
 *     "contactId": "4f7c6637-0657-4696-a00b-9bc2ae4e035d",
 *     "email": "john.doe@somedomain.com",
 *     "address": {  
 *       "street": "235 W 23rd St",
 *       "city": "New York",
 *       "zip": "10011",
 *       "state": "NY",
 *       "country": "USA"
 *     },
 *     "phone": "5555555555",
 *     "company": "Some Company",
 *     "fullName": "John Doe",
 *     "firstName": "John",
 *     "lastName": "Doe"
 *   },
 *   "dates": {  
 *     "issueDate": 2019-03-13T00:00:00.000Z,
 *     "validThroughDate": 2019-06-12T00:00:00.000Z
 *   },
 *   "discount": {
 *     "value": 2.5,
 *     "type": "Fixed"
 *   },
 *   "lineItems":[  
 *     {  
 *       "id": "00001",
 *       "name": "Item 1",
 *       "description": "First Item",
 *       "price": 10.5,
 *       "quantity": 3,
 *       "taxes": [
 *         {
 *           "name": "tax name",
 *           "rate": 8.5
 *         }
 *       ]
 *     },
 *     {  
 *       "id": "00002",
 *       "name": "Item 2",
 *       "description": "Second Item",
 *       "price": 50,
 *       "quantity": 1,
 *       "taxes": [
 *         {
 *           "name": "tax name",
 *           "rate": 8.5
 *         }
 *       ]
 *     }
 *   ],
 *   "locale": {
 *     "language": "en"
 *   },
 *   "totals": {
 *     "discountAmount": null,
 *     "taxedAmount": 6.93,
 *     "fees": [],
 *     "subtotal": 81.5,
 *     "total": 88.43
 *   },
 *   "taxes": [
 *     {
 *       "name": "tax name",
 *       "rate": 8.5,
 *       "taxable": 81.5,
 *       "taxed": 6.93
 *     }
 *   ],
 *   "metadata": {
 *     "notes": "Some note.",
 *     "legalTerms": "Some legal terms",
 *     "sourceUrl": "http://legalurl.com"
 *   },
 *   "paymentTerms": {
 *     "termType": "DueOnReceipt",
 *     "termData": "some term data"
 *   }
 * }
 */