Thiio's Webhook configuration

Purpose:

The purpose of this walkthrough is to help you set up your Generic Thiio Webhook within the CRM

 

Pre Requisites:

CRM Access

Structure for payload:

A valid payload would look like this:

mceclip0.png

Text for easy copy:

{ "event": "order", "source": "Thiio Custom", "contact": { "first_name": "John", "last_name": "Doe", "email": "john.doe@example.com" }, "phone": { "country": "US", "number": "+15124713434" }, "billing_address": { "first_name": "John", "last_name": "Doe", "line1": "11801 Stonehollow Drive", "line2": "line two", "city": "Austin", "state": "TX", "zip_code": "78758", "country": "US" }, "shipping_address": { "first_name": "John", "last_name": "Doe", "line1": "11801 Stonehollow Drive", "line2": "line two", "city": "Austin", "state": "TX", "zip_code": "78758", "country": "US" }, "order": { "id": 123, "type": "success", "user_id": 10, "date": "yyyy-mm-dd h:m:s", "shipping": 10, "taxes": 10, "total": 120, "items": [ { "name": "Product one", "title": "Product one Red", "quantity": 1, "price": 50 }, { "name": "Product two", "title": "Product two White", "quantity": 1, "price": 50 } ] } }

 

In the event field we put "order" if you want to create the lead from an order or put "customer" if you want to create from the creation of a customer in your system

mceclip1.png

Text for easy copy:

event: required | string | "order" or "customer"

 

The source field will be used to identify the leads within our CRM

Text for easy copy:

source: required | string max 255

 

Text for easy copy:

contact:
first_name: required | string max 255
last_name: required | string max 255
email: required | valid email | string max 255

 

Text for easy copy:

phone:
country: required | string max 3 // 2 Digit-Code, if not send we will use +1
number: required

 

Address fields can be optional, country and state fields have validations

 

Text for easy copy:

country: required | string | must be 2 or 3 digits
state: required | string | must be 2 or 3 digits

 

Text for easy copy:

order:
id: required | string max 255,
type: required | string max 255 | Values 'success', 'pending', 'void', 'refund'
date: required | string | format "yyyy-mm-dd h:m:s",
user_id: required | string max 255,
shipping: nullable | decimal,
taxes: nullable | decimal,
total: required | decimal,
items: required | array | min 1 object

 

Method: POST

EndPoint:  Copy the url we get in CMR Configuration point 4

Required fields

 

CRM Configuration

 

  • We go to the integrations tab within the CRM and or press the button to add an integration

 

  • in the search engine we place "thiio" and press configure

  • We place the name with which we want to identify the integration and press save

  • Once the integration is configured, we copy the url of the webhook and we will be able to send the requests to this url

  • From this view you can also activate or deactivate the integration with the switch and pressing save

 

You will get a response like this

Text for easy copy:

{ "success": true, "msg": "received successfully", "err": "", "data": { "event": "order", "source": "Thiio Custom", "contact": { "first_name": "John", "last_name": "Doe", "email": "john.doe@example.com" }, "phone": { "country": "US", "number": "+15124713434" }, "billing_address": { "first_name": "John", "last_name": "Doe", "line1": "11801 Stonehollow Drive", "line2": "line two", "city": "Austin", "state": "TX", "zip_code": "78758", "country": "US" }, "shipping_address": { "first_name": "John", "last_name": "Doe", "line1": "11801 Stonehollow Drive", "line2": "line two", "city": "Austin", "state": "TX", "zip_code": "78758", "country": "US" }, "order": { "id": 123, "type": "success", "user_id": 10, "date": "yyyy-mm-dd h:m:s", "shipping": 10, "taxes": 10, "total": 120, "items": [ { "name": "Product one", "title": "Product one Red", "quantity": 1, "price": 50 }, { "name": "Product two", "title": "Product two White", "quantity": 1, "price": 50 } ] } } }

Or if it fails it will be like this

Text for easy copy:

{

"success": false,

"msg": "an error occurred",

"err": "WebforceCustomExternalException | the event field is required"

}

 

Checklist:

  • Access to CRM