Shopping cart

Integrate Capsule CRM with Magento 2

Capsule CRM is a simple and smart CRM which helps you build better customers relationship, increase store’ sales, and save your time. To help Magento 2 stores take enormous advantages of Capsule, Mageplaza develops Webhook extension which allows Magento 2 to integrate with Capsule CRM.

What Is Webhook?

Webhook is a helpful tool which allows online stores to configure to send an API request to a configurable destination (URL) such as other servers or applications in cases trigger events including new order, customer login, abandoned carts, etc occur. As a result, store owners can instantly update important notifications and have suitable activities shortly.

Table of Content

These entities of Magento which Webhook supports:

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

These entities which Capsule CRM supports:

  • Party
  • Opportunity
  • Case
  • Task
  • Entries
  • Track

How To Integrate Capsule CRM With Magento 2 With Webhook

Instructions For Registering And Using Capsule CRM

Access to here, then click the Sign up button, choose a plan you to suit your business

Instructions For Registering And Using Capsule CRM image 1

Fill in all fields with information, then click the CREATE ACCOUNT button

Instructions For Registering And Using Capsule CRM image 2

Please check your email associated with your Capsule account for the email from Capsule.

Instructions For Registering And Using Capsule CRM image 3

Open this email and click on the link which is marked with a red arrow, as the above image, to start your login process.

Instructions For Registering And Using Capsule CRM image 4

After login your Capsule CRM account successfully, please click on your account icon on the top right corner of the screen > select My Preferences

Instructions For Registering And Using Capsule CRM image 5

Then select API Authentication Tokens > Click the Generate new API token button to generate one new API token for your account.

Instructions For Registering And Using Capsule CRM image 6

These Fields Of Capsule CRM

To view the latest fields of Capsule CRM, you can click here

Instructions For Creating Hook

How to create a new party in Capsule CRM via Magento 2

Required fields

  • type (There are 2 values: organisation and person)
  • name (for organisation)
  • firstName/lastName (for person)

Optional fields:

  • title
  • jobTitle
  • organisation (for person)
  • about
  • createdAt (read only)
  • updatedAt (read only)
  • lastContactedAt (read only)
  • addresses
    • id (read only)
    • type (Accepted values are: Home, Postal, Office)
    • street
    • city
    • state
    • country
    • zip
  • phoneNumbers
    • id (read only)
    • type
    • number (Required)
  • websites
    • id (read only)
    • service (Required)
    • address
    • type
    • url
  • emailAddresses
    • id (read only)
    • type
    • address (Required)
  • pictureURL (read only)
  • tags
    • id (read only)
    • name (Required)
  • description
  • fields
    • id (read only)
    • value (Required)
    • definition (Required)
      • id (read only)
      • name (read only)
  • owner
    • id (read only)
    • username
    • name
  • team
    • id (read only)
    • name

In this part, I will give detail instructions on how to configure Webhook which helps Magento 2 integrate with Capsule 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

Instructions For Creating Hook step 1

Step 2: Enter the data on the Action tab

Instructions For Creating Hook step 2 Instructions For Creating Hook step 2 image 2

Notes:

  • Payload URL:
  • Header: Click the Add button to add the value of Name and Value. You need to fill the Name - Value pairs, as below:
    • Name: Authorization, Value: Bearer {token} where: {token} is found according to the instruction in part 1.
    • Name: Accept, Value: application/json
  • Body: With POST or PUT method, you need to add content on the Content section to send the request. Click Insert Variable to choose variable.
    • For example: You have a new_customer hook in Magento 2. Now, you want a new person will come up compatibly in Capsule CRM when you add a new customer in Magento 2. To make it, you need to insert the following content into the body section:
{
  "party": {
    "type": "person",
    "firstName": "",
    "lastName": "",
    "emailAddresses": [
      {
        "type": null,
        "address": ""
      }
    ]
  }
}

The result of creating a hook:

Instructions For Creating Hook image 3

When Add new customer event occurs in Magento, the information data will be saved in Hook Logs.

Instructions For Creating Hook image 4

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

Instructions For Creating Hook image 5

The Result Shown In Capsule CRM:

The Result Shown In Capsule CRM

Conclusions

In this tutorial, we introduce how to register Capsule CRM, create Hook with Mageplaza Webhook Magento2, and integrate Capsule CRM with Magento 2. In addition, you can refer to other useful extensions for your store.

Explore Webhook For Magento 2





Back Ask Mageplaza

magento-2-tutorial
webhook