Skip to main content
Blog Featured Article

Integrating Magento 2 With Salesforce

Jothibasu J
January 3, 2018 |

Two Powerful Platforms


Magento is the World’s #1 eCommerce platform and the leading one in the Internet Retailer Top 1000, B2B 300, Europe 500 lists. With this stature, Magento is the linchpin of more than 250,000 merchants across the planet handling over $100 billion in gross merchandise volume.
In addition, 41 out of top 300 B2B commerce companies are powered by Magento Commerce Platform. Moreover, Magento was named as a Leader by Gartner Inc. in the 2017 Magic Quadrant for Digital Commerce. Thanks to the agility, scalability, and extreme flexibility as customer demands and marketplace are changing rapidly.

Salesforce is the #1, fully integrated, CRM platform with extensive functionality for Sales, Customer Service, Digital Marketing, B2B marketing, Financial Services, Analytics, Commerce, Community, Productivity, and IoT. Salesforce is the only Cloud Computing company to achieve a $10 billion revenue run rate as of Aug 2017. That said, Salesforce CRM is the one-stop solution for every commerce needs and it allows you to sell, service, market, and build apps – all from a single platform.


Magento 2 – Salesforce Integration

It’s always been hectic and laborious for eCommerce companies to integrate their CRM (e.g., Salesforce) with their storefront (e.g., Magento 2) in order to access shipping addresses, email ids, phone numbers, history of purchases of a customer, and so on. This article explains a solution to integrate Salesforce with Magento 2 platform to retrieve desired information.

REST, one of the industry standard API feature of Magento 2, is used to integrate with Salesforce for bidirectional information transfer. REST API services allow syncing Customer and Order data into Salesforce. Similarly, Salesforce uses the REST API to send back updates on customer address, product details, and similar data.

Data Services – Salesforce

There are two ways of integrating a new customer into Salesforce: either as Leads or as Contacts. It’s impossible to integrate a new customer as both a lead and a contact.

Note: Before you follow these steps, make sure you have an OAuth Token to connect to Salesforce. Furthermore, steps described here are just the basics and furnished to guide the developer community.


Creating a Lead

To create a new customer under Leads, use below service and example JSON data.

REST URL: Instance_url/services/data/version/sobjects/Lead/

Example Json data:
{“City”: “fremont”, “FirstName”: “David”, “LastName”: “Church”, “Company”: “Dckap Technologies”, “Phone”: “1234567890”, “Country”: “US”, “Email”: “test@dckap.com”}

Mapping fields
salesforce Magento
FirstName firstname
LastName lastname
Email email
City city
State region
Country country_id
Phone telephone
PostalCode postcode

 


[POSTCTA]

Creating a Contact

To create a new customer under Contacts, use the below service and example JSON data.

REST URL: Instance_url/services/data/version/sobjects/Contact/

Example JSON data:

{“City”: “fremont”, “FirstName”: “David”, “AccountName”: “Dckap Technologies” “LastName”: “Church”, “Company”: “Dckap Technologies”, “Phone”: “1234567890”, “Country”: “US”, “Email”: “test@dckap.com”}

Mapping fields
salesforce Magento
FirstName firstname
LastName lastname
AccountName company
Email email
City city
State region
Country country_id
Phone telephone
PostalCode postcode

 


Creating Opportunities

When a new customer is registered in Magento, it will also be created in salesforce under Opportunities.

Service URL: Instance_url/services/data/version/sobjects/Opportunity/

Example JSON data:

{“Name”: “Dckap Technologies”, “Account”: “Dckap Technologies”}

Mapping fields
salesforce Magento
Name company
Account company

 

Hope the article was useful. Please let us know if you have any queries or comments.

Endless integrations with Magento 2 for your eCommerce business is here. Talk to our Magento 2 experts about your integration requirements.

Jothibasu J

Jothibasu is a Senior Software Engineer with 6+ years of experience in PHP and Magento. His interests include playing volleyball during the weekends and watching science fiction movies. He is an active contributor to the Magento StackExchange forum.

More posts by Jothibasu J