Skip to main content
Integrate with Webhooks
Mike Walsh avatar
Written by Mike Walsh
Updated over 6 months ago

Quoter can be integrated with your own web server via Webhooks. Found under Settings > Integrations, Webhooks are generic and will push data from Quoter as events occur to a web server of your choice, where you can handle and send to your respective third party application via API.

Here's an overview of how the integration works:

  • Based on the Applies To options configured when setting up the webhook, each time a Quote, Person, or Payment is created or updated in Quoter, the record will be sent via HTTP POST to the URL specified upon configuration.

  • The URL format is up to you, for example it could be https://webhook.site/6fe16afd-866e-4cdf-8fb4-091cfbc8dd27

  • The records can be sent in JSON or XML, depending on the Format selected during setup.

  • An optional Hash Key may be specified during setup which is used to send an MD5 hash for you to verify the authenticity of the posted data.

Triggers

Person Webhook

The Person Webhook

Data Flow Diagram

Payload

The payload will be sent as a POST form data with the header Content-Type: application/x-www-form-urlencoded. The form fields sent are hash, timestamp, and data.

In the Integration Setting page, you can choose if you want the data to be formatted in JSON or XML.

Example Payload in JSON

Calculating Hash Key

Using your hash key, which is a shared secret that only our server and yours know, we will calculate an MD5 hash that will allow you to verify the authenticity of the request. The MD5 hash is calculated by concatenating the following elements:

  1. Your hash key

  2. The current UNIX timestamp converted to GMT

  3. The string representation of the data being sent

In addition to the data, both the hash and the current timestamp will be passed as POST parameters to your URL. In your own code, you'll be able to verify that the request is valid by calculating your own hash and comparing it to the one provided.

PHP Example

// Verify that the hash parameter is valid by comparing it to our own calculation.
if ( md5('HASH_KEY'.$_POST['timestamp'].$_POST['data']) == $_POST['hash'] )
{
  // As an additional security measure, verify that the different between the current
  // timestamp and the timestamp parameter is less than 5 minutes (300 seconds).
  if ( (int)gmdate('U') - (int)$_POST['timestamp'] <= 300 )
  {
// The request is valid.
  }
}

Payload Data Examples

Shown below are examples of what data is sent by Quoter, in the two available formats (JSON or XML):


Notes on Quote Data:

  • "item_id" is the internal Quoter Item ID. This will be "Null" for any item that doesn't exist in the Quoter Items table.

  • "won_date" is stored when a Quote moves to a status of Accepted, Ordered or Fulfilled. It is ISO 8601, timezone is UTC.

Quote JSON

{
"id": "666634",
"name": "Quote Name",
"parent_quote_id": null,
"revision": null,
"number": "Full Quote #1",
"uuid": "9629b1c6d4c1d824732d949606e474f6",
"expiry_date": "2017-10-16 20:14:09",
"won_date":"2022-10-26T18:19:01+00:00",
"comments": "Quote Comments",
"internal_notes": "Quote Internal Notes",
"grace_period": "0",
"recurring_time_period": "6",
"status": "pending",
"discount": {
"amount": "50.00",
"recurring": 0,
"percentage": null,
"description": "Discount"
},
"total": {
"upfront": "6,514.57",
"recurring": "2,885.93",
"one_time_margin_dollars": "1,003.00",
"one_time_margin_percent": "66.60",
"recurring_margin_dollars": "507.00",
"recurring_margin_percent": "66.70"
},
"shipping": "50.00",
"taxes": [
{
"upfront": "290.83",
"recurring": "128.84",
"name": "GST",
"rate": "0"
},
{
"upfront": "407.16",
"recurring": "180.37",
"name": "PST",
"rate": "0"
}
],
"person": {
"id": "235080",
"first_name": "Jeff",
"last_name": "Jeffrey",
"organization": "The Music Industry",
"title": "Musician",
"addresses": {
"billing": {
"line1": "1001 Main Street",
"line2": "",
"city": "Vancouver",
"state": {
"code": "BC",
"name": "British Columbia"
},
"country": {
"code": "CA",
"name": "Canada"
},
"postal_code": "V6H 1H9"
},
"shipping": null
},
"telephone_numbers": {
"work": "555-555-5555",
"mobile": null,
"fax": null
},
"email_address": "jeff@example.com",
"website": null
},
"quote_owner": {
"id": "81428",
"first_name": "Michael",
"last_name": "Sales",
"full_name": "Michael Sales",
"email": "sales@example.com"
},
"reseller": {
"id": "235",
"name": "ResellerOne",
"phone": "555-444-0000",
"email": "reseller@quoter.com"
},
"currency": {
"code": "CAD",
"name": "Canadian Dollars "
},
"form": {
"id": "6271",
"slug": "complex-quote-form",
"title": "Complex Quote Form"
},
"custom_fields": null,
"line_items": [
{
"id": "2584216",
"item_id":"item_2C7nKWuxai6lPaA0cyEgQSSOvbe",
"quantity": "5",
"name": "Complex Item 1",
"sku": "complex-item-1",
"pricing_structure": "fixed_per_unit",
"recurring": "false",
"base_price": "123.35",
"base_unit_price": "123.35",
"unit_cost": "86.35",
"total": {
"upfront": "927.51",
"recurring": "0.00"
},
"supplier": {
"id": "2867",
"public_id": "sup_2DGb0dVL6pGCjrVP7WpB3EUxXN7",
"name": "A1 Security Group"
},
"type": {
"id": "24",
"public_id": "cat_2DDmpp0fx1NuwNfE6vnGexa7Qwl",
"name": "Software"
},
"manufacturer": {
"id": "29",
"public_id": "manu_266vSNL6Ga8vrIMnqsUrDP6S78x",
"name": "Apple"
},
"is_optional": true,
"is_optional_selected": true,
"options": [
{
"name": "Complex Option Set 2",
"values": [
{
"sku": null,
"name": "Option 1",
"base_amount": "4.2382",
"cost": "1.25",
"amount_type": "percentage_item_options"
}
]
},
{
"name": "Complex Option Set 1",
"values": [
{
"sku": null,
"name": "Option 1",
"base_amount": "23.2342",
"cost": "10.00",
"amount_type": "price"
}
]
}
],
"custom_fields": null
},
{
"id": "2584217",
"item_id":"item_2C7nKWuxai6lPaA0cyEgQSSOvbe",
"quantity": "2",
"name": "Complex Item 2",
"sku": "complex-item-2",
"pricing_structure": null,
"recurring": "true",
"base_price": "10.00",
"base_unit_price": "10.00",
"unit_cost": "5.00",
"total": {
"upfront": "168.15",
"recurring": "82.72"
},
"supplier": {
"id": "2867",
"public_id": "sup_2DGb0dVL6pGCjrVP7WpB3EUxXN7",
"name": "A1 Security Group"
},
"type": {
"id": "24",
"public_id": "cat_2DDmpp0fx1NuwNfE6vnGexa7Qwl",
"name": "Software"
},
"manufacturer": {
"id": "29",
"public_id": "manu_266vSNL6Ga8vrIMnqsUrDP6S78x",
"name": "Apple"
},
"is_optional": true,
"is_optional_selected": false,
"options": [
{
"name": "Complex Option Set 1",
"values": [
{
"sku": null,
"name": "Option 1",
"base_amount": "10.6789",
"cost": "5.00",
"amount_type": "price"
}
]
}
],
"custom_fields": null
},
{
"id": "2584218",
"item_id":"item_2C7nKWuxai6lPaA0cyEgQSSOvbe",
"quantity": "1",
"name": "Support",
"sku": "SUPP-1",
"pricing_structure": "percentage",
"recurring": "true",
"base_price": "126.27",
"base_unit_price": "126.27",
"unit_cost": "76.35",
"total": {
"upfront": "63.14",
"recurring": "63.14"
},
"supplier": {
"id": "2867",
"public_id": "sup_2DGb0dVL6pGCjrVP7WpB3EUxXN7",
"name": "A1 Security Group"
},
"type": {
"id": "24",
"public_id": "cat_2DDmpp0fx1NuwNfE6vnGexa7Qwl",
"name": "Software"
},
"manufacturer": {
"id": "29",
"public_id": "manu_266vSNL6Ga8vrIMnqsUrDP6S78x",
"name": "Apple"
},
"is_optional": false,
"is_optional_selected": false,
"options": null,
"custom_fields": null
},
{
"id": "2584219",
"item_id":"item_2C7nKWuxai6lPaA0cyEgQSSOvbe",
"quantity": "1",
"name": "Complex Item 3",
"sku": "complex-item-3",
"pricing_structure": "one_time",
"recurring": "true",
"base_price": "23.80",
"base_unit_price": "23.80",
"unit_cost": "10.00",
"total": {
"upfront": "11.90",
"recurring": "11.90"
},
"supplier": {
"id": "2867",
"name": "A1 Security Group"
},
"type": {
"id": "22",
"name": "Hardware"
},
"is_optional": true,
"is_optional_selected": true,
"options": null,
"custom_fields": null
},
{
"id": "2584220",
"item_id":"Null",
"quantity": "1",
"name": "Complex Item 4",
"sku": "complex-item-4",
"pricing_structure": "percentage",
"recurring": "true",
"base_price": "361.96",
"base_unit_price": "361.96",
"unit_cost": "150.00",
"total": {
"upfront": "496.40",
"recurring": "249.20"
},
"supplier": {
"id": "2867",
"name": "A1 Security Group"
},
"type": {
"id": "1235",
"name": "Tipo di Voce"
},
"is_optional": false,
"is_optional_selected": false,
"options": [
{
"name": "Complex Option Set 1",
"values": [
{
"sku": null,
"name": "Option 2",
"base_amount": "41.2000",
"cost": "20.00",
"amount_type": "price"
}
]
}
],
"custom_fields": null
}
],
"new": "true"
}

Quote XML

<?xml version="1.0" encoding="UTF-8"?>
<quote>
<id>666635</id>
<name>Quote Name</name>
<parent_quote_id>666634</parent_quote_id>
<number>Full Quote #1</number>
<uuid>b9e256f0a9c2ea21b21f8e626738e117</uuid>
<expiry_date>2017-10-16 07:00:00</expiry_date>
<won_date>2022-10-26T18:19:01+00:00</won_date>
<comments>Quote Comments</comments>
<internal_notes>Quote Internal Notes</internal_notes>
<recurring_time_period>6</recurring_time_period>
<status>pending</status>
<discount>
<amount>50.00</amount>
<description>Discount</description>
</discount>
<total>
<upfront>6,514.57</upfront>
<recurring>2,885.93</recurring>
</total>
<shipping>50.00</shipping>
<taxes>
<tax>
<upfront>290.83</upfront>
<recurring>128.84</recurring>
<name>GST</name>
</tax>
<tax>
<upfront>407.16</upfront>
<recurring>180.37</recurring>
<name>PST</name>
</tax>
</taxes>
<person>
<id>235080</id>
<first_name>Jeff</first_name>
<last_name>Jeffrey</last_name>
<organization>The Music Industry</organization>
<title>Musician</title>
<addresses>
<billing>
<line1>1001 Main Street</line1>
<city>Vancouver</city>
<state>
<code>BC</code>
<name>British Columbia</name>
</state>
<country>
<code>CA</code>
<name>Canada</name>
</country>
<postal_code>V6H 1H9</postal_code>
</billing>
</addresses>
<telephone_numbers>
<work>555-555-5555</work>
</telephone_numbers>
<email_address>jeff@example.com</email_address>
</person>
<quote_owner>
<id>81428</id>
<first_name>Michael</first_name>
<last_name>Sales</last_name>
<full_name>Michael Sales</full_name>
<email>sales@example.com</email>
</quote_owner>
<reseller>
<id>235</id>
<name>ResellerOne</name>
<phone>555-444-0000</phone>
<email>reseller@quoter.com</email>
</reseller>
<currency>
<code>CAD</code>
<name>Canadian Dollars</name>
</currency>
<form>
<id>6271</id>
<slug>complex-quote-form</slug>
<title>Complex Quote Form</title>
</form>
<line_items>
<line_item>
<id>2584221</id>
<item_id>item_2C7nKWuxai6lPaA0cyEgQSSOvbe</item_id>
<quantity>5</quantity>
<name>Complex Item 1</name>
<sku>complex-item-1</sku>
<pricing_structure>fixed_per_unit</pricing_structure>
<recurring>false</recurring>
<base_price>123.35</base_price>
<base_unit_price>123.35</base_unit_price>
<unit_cost>86.35</unit_cost>
<total>
<upfront>785.20</upfront>
<recurring>0.00</recurring>
</total>
<supplier>
<id>2867</id>
<name>A1 Security Group</name>
</supplier>
<type>
<id>24</id>
<name>Software</name>
</type>
<is_optional>1</is_optional>
<is_optional_selected>1</is_optional_selected>
<options>
<option>
<name>Complex Option Set 2</name>
<values>
<value>
<name>Option 1</name>
<base_amount>5.2278</base_amount>
<amount_type>price</amount_type>
</value>
</values>
</option>
<option>
<name>Complex Option Set 1</name>
<values>
<value>
<name>Option 1</name>
<base_amount>23.2342</base_amount>
<amount_type>price</amount_type>
</value>
</values>
</option>
</options>
</line_item>
<line_item>
<id>2584222</id>
<item_id>item_2C7nKWuxai6lPaA0cyEgQSSOvbe</item_id>
<quantity>2</quantity>
<name>Complex Item 2</name>
<sku>complex-item-2</sku>
<recurring>true</recurring>
<base_price>10.00</base_price>
<base_unit_price>10.00</base_unit_price>
<unit_cost>5.00</unit_cost>
<total>
<upfront>125.43</upfront>
<recurring>82.72</recurring>
</total>
<supplier>
<id>2867</id>
<name>A1 Security Group</name>
</supplier>
<type>
<id>24</id>
<name>Software</name>
</type>
<is_optional>1</is_optional>
<options>
<option>
<name>Complex Option Set 1</name>
<values>
<value>
<name>Option 1</name>
<base_amount>10.6789</base_amount>
<amount_type>price</amount_type>
</value>
</values>
</option>
</options>
</line_item>
<line_item>
<id>2584223</id>
<item_id>item_2C7nKWuxai6lPaA0cyEgQSSOvbe</item_id>
<quantity>1</quantity>
<name>Support</name>
<sku>SUPP-1</sku>
<pricing_structure>percentage</pricing_structure>
<recurring>true</recurring>
<base_price>126.28</base_price>
<base_unit_price>126.28</base_unit_price>
<unit_cost>86.35</unit_cost>
<total>
<upfront>63.14</upfront>
<recurring>63.14</recurring>
</total>
<supplier>
<id>12</id>
<name>Quoter Software Inc.</name>
</supplier>
<type>
<id>20</id>
<name>Support</name>
</type>
</line_item>
<line_item>
<id>2584224</id>
<item_id>item_2C7nKWuxai6lPaA0cyEgQSSOvbe</item_id>
<quantity>1</quantity>
<name>Complex Item 3</name>
<sku>complex-item-3</sku>
<pricing_structure>one_time</pricing_structure>
<recurring>true</recurring>
<base_price>23.80</base_price>
<base_unit_price>23.80</base_unit_price>
<unit_cost>12.00</unit_cost>
<total>
<upfront>11.90</upfront>
<recurring>11.90</recurring>
</total>
<supplier>
<id>2867</id>
<name>A1 Security Group</name>
</supplier>
<type>
<id>22</id>
<name>Hardware</name>
</type>
<is_optional>1</is_optional>
<is_optional_selected>1</is_optional_selected>
</line_item>
<line_item>
<id>2584225</id>
<item_id>Null</item_id>
<quantity>1</quantity>
<name>Complex Item 4</name>
<sku>complex-item-4</sku>
<pricing_structure>percentage</pricing_structure>
<recurring>true</recurring>
<base_price>361.96</base_price>
<base_unit_price>361.96</base_unit_price>
<unit_cost>150.00</unit_cost>
<total>
<upfront>496.40</upfront>
<recurring>249.20</recurring>
</total>
<supplier>
<id>2867</id>
<name>A1 Security Group</name>
</supplier>
<type>
<id>1235</id>
<name>Tipo di Voce</name>
</type>
<options>
<option>
<name>Complex Option Set 1</name>
<values>
<value>
<name>Option 2</name>
<base_amount>41.2000</base_amount>
<amount_type>price</amount_type>
</value>
</values>
</option>
</options>
</line_item>
</line_items>
<new>true</new>
</quote>

Transaction XML

<?xml version="1.0" encoding="utf-8"?>
<transaction>
<id>747</id>
<amount>389.76</amount>
<payment>true</payment>
<valid>true</valid>
<interval>once</interval>
<transaction_id>I-0KCS5PM5CJH7</transaction_id>
<processor>
<id>38</id>
<label>PayPal</label>
<type>paypal_ipn</type>
</processor>
<currency>
<code>CAD</code>
<name>Canadian Dollars </name>
</currency>
<quote>
<id>6336</id>
<number>682</number>
<uuid>630e38e8c2d9a7a039cafe9522286bc9</uuid>
<expiry_date>2012-03-08T13:20:16-08:00</expiry_date>
<recurring_time_period>6</recurring_time_period>
<status>ordered</status>
<total>
<upfront>389.76</upfront>
<recurring>389.76</recurring>
</total>
<shipping>0.00</shipping>
<taxes>
<tax>
<upfront>41.76</upfront>
<recurring>41.76</recurring>
<name>HST</name>
</tax>
</taxes>
<person>
<id>1</id>
<first_name>firstName</first_name>
<last_name>lastName</last_name>
<addresses/>
<telephone_numbers/>
<email_address>billing@quoter.com</email_address>
<website>www.quoter.com</website>
</person>
<currency>
<code>CAD</code>
<name>Canadian Dollars </name>
</currency>
<form>
<id>23</id>
<slug>quote-manager-basic</slug>
<title>Quoter</title>
</form>
<line_items>
<line_item>
<id>16976</id>
<quantity>1</quantity>
<name>Quoter</name>
<sku>PA1</sku>
<pricing_structure>one_time</pricing_structure>
<recurring>true</recurring>
<base_price>0.00</base_price>
<base_unit_price>0.00</base_unit_price>
<total>
<upfront>495.00</upfront>
<recurring>495.00</recurring>
</total>
<supplier>
<id>8</id>
<name>Quoter Software Inc.</name>
</supplier>
<type>
<id>8</id>
<name>Monthly Services</name>
</type>
<is_optional>1</is_optional>
<is_optional_selected>1</is_optional_selected>
<options>
<option>
<name>Monthly Plan</name>
<values>
<value>
<sku>Basic</sku>
<name>Basic -Monthly</name>
<base_amount>129.00</base_amount>
<amount_type>price</amount_type>
</value>
</values>
</option>
</options>
</line_item>
</line_items>
</quote>
<new>true</new>
</transaction>

Did this answer your question?