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:
-
Your hash key
-
The current UNIX timestamp converted to GMT
-
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
666635
Quote Name
666634
Full Quote #1
b9e256f0a9c2ea21b21f8e626738e117
2017-10-16 07:00:00
2022-10-26T18:19:01+00:00
Quote Comments
Quote Internal Notes
6
pending
50.00
Discount
6,514.57
2,885.93
50.00
290.83
128.84
GST
407.16
180.37
PST
235080
Jeff
Jeffrey
The Music Industry
Musician
1001 Main Street
Vancouver
BC
British Columbia
CA
Canada
V6H 1H9
555-555-5555
jeff@example.com
81428
Michael
Sales
Michael Sales
sales@example.com
235
ResellerOne
555-444-0000
reseller@quoter.com
CAD
Canadian Dollars
2584221
item_2C7nKWuxai6lPaA0cyEgQSSOvbe
5
Complex Item 1
complex-item-1
fixed_per_unit
false
123.35
123.35
86.35
785.20
0.00
2867
A1 Security Group
24
Software
1
1
2584222
item_2C7nKWuxai6lPaA0cyEgQSSOvbe
2
Complex Item 2
complex-item-2
true
10.00
10.00
5.00
125.43
82.72
2867
A1 Security Group
24
Software
1
2584223
item_2C7nKWuxai6lPaA0cyEgQSSOvbe
1
Support
SUPP-1
percentage
true
126.28
126.28
86.35
63.14
63.14
12
Quoter Software Inc.
20
Support
2584224
item_2C7nKWuxai6lPaA0cyEgQSSOvbe
1
Complex Item 3
complex-item-3
one_time
true
23.80
23.80
12.00
11.90
11.90
2867
A1 Security Group
22
Hardware
1
1
2584225
Null
1
Complex Item 4
complex-item-4
percentage
true
361.96
361.96
150.00
496.40
249.20
2867
A1 Security Group
1235
Tipo di Voce
true
Transaction XML
747
389.76
true
true
once
I-0KCS5PM5CJH7
38
paypal_ipn
CAD
Canadian Dollars
6336
682
630e38e8c2d9a7a039cafe9522286bc9
2012-03-08T13:20:16-08:00
6
ordered
389.76
389.76
0.00
41.76
41.76
HST
1
firstName
lastName
billing@quoter.com
www.quoter.com
CAD
Canadian Dollars
16976
1
Quoter
PA1
one_time
true
0.00
0.00
495.00
495.00
8
Quoter Software Inc.
8
Monthly Services
1
1
true