Integrate Agile CRM with Magento 2 use Webhook

Agile CRM is a CRM software with Sales & Marketing Automation, which is suitable for small businesses. Agile CRM supports online stores to manage customers as well as update shopping trend of customers. That helps business owners determine their development direction. In order to help store owners of Magento 2 use Agile CRM for stores easily, Mageplaza developed Webhook extension to integrate Agile CRM with Magento 2.

What Is Webhook?

Webhook is basically user-defined HTTP callbacks which are triggered by specific events. When a trigger event occurs in the source site, the webhook sees the events, collect the data and sends it to the URL in the form of an HTTP request.

Table Of Content

Entities of Magento which Webhook supports

  • Customer
  • Order
  • Invoice
  • Shipment
  • Credit Memo
  • Product
  • Category
  • Abandoned Cart

Entities which Agile CRM supports

  • Contacts
  • Companies
  • Deals
  • Notes
  • Tasks
  • Events
  • Track/Milestones

    How To Integrate Agile CRM With Magento 2 With Webhook

    Instructions For Registering And Using Agile CRM

    Access to here, click the GET STARTED button to start registering, complete the registration form Instructions For Registering And Using Agile CRM 1 After completing the information, click the Get Started button to finish registering process/ registration.

    These Fields Of Agile CRM

    To view the latest fields of Freshsales, you can click here

    Instructions For Creating Hook

    How to create a new lead in Freshsales via Magento 2

Required fields:

  • First name
  • Last name

Optional fields:

  • Image
  • Company
  • Title
  • Email
  • Phone
  • Website
  • Address

In this part, I will give detail instructions on how to configure Webhook which helps Magento 2 integrate with Agile CRM.

From the Admin Panel, go to System > Webhook > Manage Hooks, select Add New on the right corner, then you will see many options including New Order, New Customer, Update Customer, Delete Customer, etc.

Step 1: Fill all information in the General Information tab How to create a new lead in Freshsales via Magento 2 image 1

Step 2: Enter the data on the Action tab

How to create a new lead in Freshsales via Magento 2 image 2 How to create a new lead in Freshsales via Magento 2 image 3

Note:

Payload URL: https://domain.agilecrm.com/dev/api/contacts, with {domain} is the Agile CRM’s domain which you registered.

  • Authentication = Basic:
  • Username: email which you registered Agile CRM
  • Password: your password of Agile CRM’s account Body: With methods such as POST or PUT, you need to add content to the content section to send a request. Click Insert Variable to select the variable
  • When creating Hook with customers in Magento, integrated with Agile CRM will be a contact. Body section with POST needs to be inserted with content below:
{
    "star_value": "4",
    "lead_score": "92",
    "tags": [
        "Lead",
        "Likely Buyer"
    ],
"properties": [
        {
            "type": "SYSTEM",
            "name": "first_name",
            "value": ""
        },
        {
            "type": "SYSTEM",
            "name": "last_name",
            "value": ""
        },
        {
            "name": "email",
            "value": "",
            "subtype": "work"
        },
        {
            "name": "phone",
            "value": "8888888888",
            "subtype": "work"
        },
         {
            "name": "address",
            "value": "{\"address\":\"Motor City 120 street\",\"city\":\"Detroit\",\"state\":\"Michigan\",\"zip\":\"48201\",\"country\":\"US\",\"countryname\":\"United States\"}"
        }
    ]
}

Note: If you want to get any data field, you need to change the value of this data field with variable coming from Insert Variable.

The results of creating a hook:

How to create a new lead in Freshsales via Magento 2 image 4 Once some events in Store such as adding new customer, new order, etc occurs, the data will be saved on Hook Logs:

How to create a new lead in Freshsales via Magento 2 image 5

Click Select > View to redirect to View log page, in order to view the data information:

How to create a new lead in Freshsales via Magento 2 image 6

The Result Shown In Agile CRM:

The Result Shown In Freshsales

These Available Body Templates

New Deals

POST Method: End point: dev/api/opportunity

Required fields:

  • name
  • expected_value
  • probability
  • milestone
  • Optional fields:
  • close_date
  • contact_ids
  • custom_data
  • name
  • value

Body Template:

{
    "name": "Deal-Tomato",
    "expected_value": "500",
    "probability": "75",
    "close_date": 1455042600,
    "milestone": "Proposal",
    "contact_ids": [
        "5758948741218304"
    ],
    "custom_data": [
        {
            "name": "Group Size",
            "value": "10"
        }
    ]
}

If you want to get any data field, you need to change the value of this field with variable coming from Insert Variable.

Conclusion

We have instructed you how to register Agile CRM and create Hook when using Webhook Extension of Mageplaza as well as how to integrate Webhook with Agile CRM. Besides, you can view more functions for your store here.

Explore Mageplaza Webhook for Magento 2 now!






Back Ask Mageplaza

magento-2-tutorial
webhook