Webhooks (beta)

 

Webhook notification is a POST request with JSON in body

List of available events

  1. lead.appointment

  2. lead.call

  3. lead.compare.email

  4. lead.compare.email.follow_up

  5. lead.compare.print

  6. lead.compare.print.follow_up

  7. lead.compare.sms

  8. lead.compare.sms.follow_up

  9. lead.email

  10. lead.email.follow_up

  11. lead.print

  12. lead.print.follow_up

  13. lead.quote

  14. lead.sms

  15. lead.sms.follow_up

  16. order.created

  17. order.checked_out

  18. order.paid

  19. supplier_order.created

Setup

Client can setup a webhook at TC Admin Panel Settings -> Webhooks
First of all you will see this options. So you can add URL and description.

After save you will see full list of options.

Url: Webhook url. TC sends post requests to this url when configured events happen.
Description: Webhook description.
Is active: Webhook activated or not.
Uuid: Webhook Unique identifier
Secret: Keep it secret. Key for signing request.
Events: List of events on which webhook reacts.
Calls: You will see list of last 15 calls. But please note it will be cleared every 30 minutes.

Encoding

  1. Webhook contains base64 encoded HMAC signature which is located in a header X-Tireconnect-Signature

    1. An algorithm sha256 and a secret specified for a webhook [2.6] used for a signature

    2. In general, a signature created following the next steps:

      1. Get a raw request body. Please make sure that the raw body retrieved, it must be a string. This is signature data.

      2. Using the signature data, algorithm sha256 and webhook secret create HMAC message.

      3. Encode result using Base64.

  2. Please do not validate a signature by recreating and simply comparing on your side. Recreate a signature following steps 1i - 1iii and use a special function / method, for example hash_equals for PHP.

Lead Body example

"data": { "notification_uuid": "a9fb7223-2470-44ab-a9fb-18a8f1846166", "webhook_uuid": "97a2328b-d3de-41c9-b7ca-a6f2954e1019", "event_name": "lead.appointment", "data_type": "lead", "data": { "lead_number": "P22453", "type": "Display", "device": "Desktop", "source": "website", "dealer_id": 11615, "dealer_name": "TireConnect Demo (Single location)", "location_id": 15245, "location_name": "TireConnect Demo", "city": "Del City", "province": "Tennessee", "address": "3903 SE 10th Pl", "postal_code": "37201", "created_at": "2023-04-28T15:23:29-04:00", "follow_up": false, "contacted": false, "preferred_time": null, "total_price": 4057.74, "sub_total": 3768.92, "total_tax": 263.82, "discount": null, "rebates": [ { "total_value": 90, "name": "Michelin $90 Offer", "description": "With purchase of 4 tires, please see official terms and conditions for further details" }, { "total_value": 70, "name": "$70 Continental", "description": "$70 Continental" } ], "tires": [ { "brand": "Michelin", "part_number": "48162", "model": "Defender® LTX® M/S", "size": "285/50R20 116H XL", "quantity": 4, "supplier": "ATD", "frb": "b", "price": 315.35, "total_price": 1261.4 } ], "wheels": [ { "brand": "Centerline", "part_number": "847BM-2106819", "model": "847BM LT7", "size": "20X10 6x135 ET-19", "quantity": 4, "supplier": "Catalog", "frb": "b", "price": null, "total_price": null } ], "customer": { "name": null, "phone": null, "email": null, "notes": null }, "vehicle": { "year": 2019, "make": "Toyota", "model": "Tacoma", "trim": "TRD Off-Road" }, "services": [ { "key": "light_truck_mounting", "name": "Install + Balance (Light Truck)", "description": "", "link": "", "logo": null, "type": "service", "tax_group": "labor", "total_price": 100, "total_tax": 7 }, { "key": "shop_supply_fee", "name": "Shop Supply Fee", "description": "", "link": "", "logo": null, "type": "fee", "tax_group": "labor", "total_price": 25, "total_tax": 0 }, { "key": "disposal_fee", "name": "Tire Recycling Fee", "description": "", "link": "", "logo": null, "type": "fee", "tax_group": "labor", "total_price": 16, "total_tax": 1.12 }, { "key": "wheel_alignment", "name": "Wheel Alignment", "description": "Wheel Alignment is a very important for optimal fuel economy and steering performance.", "link": "https://www.google.com/?gws_rd=ssl#q=nitrogen+filled+tires", "logo": null, "type": "service", "tax_group": "labor", "total_price": 149, "total_tax": 10.43 }, { "key": "wheel_installation_kit", "name": "Wheel Installation Kit", "description": "Parts required for wheel installation.", "link": "", "logo": null, "type": "service", "tax_group": "material", "total_price": 60, "total_tax": 4.2 }, { "key": "wheel_installation_", "name": "Wheel Installation ", "description": "Wheel installation service includes removal of the old wheel and mounting of the new one.", "link": "", "logo": null, "type": "service", "tax_group": "labor", "total_price": 160, "total_tax": 11.2 } ] } }

Order Body example

"data": { "notification_uuid": "a9fb7223-2470-44ab-a9fb-18a8f1846166", "webhook_uuid": "97a2328b-d3de-41c9-b7ca-a6f2954e1019", "event_name": "order.checked_out", "data_type": "order", "data": { "city": "New York", "tires": [ { "frb": "b", "size": "205/55R16 91H", "brand": "Bridgestone", "model": "Blizzak WS80", "price": 25, "quantity": 4, "supplier": "TH", "part_number": "013006", "total_price": 100 } ], "status": "incomplete", "wheels": null, "address": "Tire Shop street ", "rebates": [ { "name": "National test", "description": "test", "total_value": 15 } ], "vehicle": { "make": "BMW", "trim": "Base", "year": 2008, "model": "128i" }, "customer": { "name": "oleh qa", "email": "john@doe.com", "notes": "", "phone": "18333492116" }, "discount": { "name": "account discount offer", "description": "test ", "total_value": 50 }, "province": "New York", "services": [ { "key": "disposal_fee", "link": "", "logo": "", "name": "Tire Recycling Fee", "type": "fee", "tax_group": "custom", "total_tax": 0, "description": "", "total_price": 0 }, { "key": "wheel_alignment", "link": "", "logo": "", "name": "Wheel Alignment", "type": "service", "tax_group": "labor", "total_tax": 2, "description": "", "total_price": 50 } ], "dealer_id": 12347, "sub_total": 150, "total_tax": 4, "created_at": "2023-06-15T07:32:57-04:00", "order_time": null, "updated_at": "2023-06-15T07:35:03-04:00", "dealer_name": "New York Shop", "location_id": 14346, "postal_code": "90001", "total_price": 104, "order_number": "T31306", "submitted_at": null, "location_name": "New York Tire Shop", "preferred_time": "2023-06-28 00:00:00", "deposit_payment": 104, "outstanding_balance": 0 } }

Supplier Order Body example

"data": { "notification_uuid": "a9fb7223-2470-44ab-a9fb-18a8f1846166", "webhook_uuid": "97a2328b-d3de-41c9-b7ca-a6f2954e1019", "event_name": "supplier_order.created", "data_type": "supplier_order", "data": { "id": 2629, "tires": { "data": { "items": [ { "brand": "Goodyear", "model": "Eagle Sport All-Season", "price": 53.99, "quantity": 1, "part_number": "109174366", "retail_price": 53.99, "shipping_cost": 0, "price_on_widget": 53.99, "part_number_ordered": "GY 109174366" } ] } }, "branch": "110", "status": 1, "invoice": "16926573", "is_replenishment": false, "order_id": null, "supplier": "tirehub", "dealer_id": 12347, "po_number": "Test PO", "created_at": "2023-06-15T08:37:20-0400", "updated_at": "2023-06-15T08:37:21-0400", "dealer_name": "New York Shop", "location_id": 14346, "status_text": "Successful", "supplier_cid": "TH", "location_name": "New York Tire Shop", "supplier_name": "TireHub", "dealer_location_id": 14346, "request_appointment_id": null } }

notification_uuid: unique identifier of the notification. Each notification has its own unique identifier. TC sends a notification with the same notification_uuid only in case of failing the previous attempt. For example, a request received a response with a code 400 or 502 etc.
webhook_uuid: unique identifier of the webhook
event_name: webhook event name
data_type: a type of data in the data property
data: entity data which has fired the event. In this example above provided a structure of the “lead” entity.