Shopify Connector in Mule

Minni Jajodia
Another Integration Blog
3 min readSep 13, 2022

What Is a Shopify Connector in Mule?

The MuleSoft Shopify Connector allows you to connect to the e-commerce platform Shopify and achieves seamless integration between your Shopify store and a Mule app using the Mule runtime engine.

Some of the use cases for the Shopify connector in MuleSoft include:

  • Retrieving a new customer’s information
  • Storing information through a client’s Shopify store
  • Managing items when new products are created in Shopify

A Shopify account is a necessary before beginning this walkthrough. During the account creation, you will get credentials as a username and password (Basic Auth Connection Provider) or generate the access token (OAuth2) that will be used to establish the connectivity from MuleSoft.

Connection Types

The Shopify connector uses the following two authentication methods in MuleSoft to connect with the Shopify platform:

  • Basic Auth: uses a username and password for authentication
  • OAuth2: delegates user authentication to the service hosting the user account

Steps for Configuring a Shopify Connector

1. Create a new project in MuleSoft by going to File->New->Mule Project. Give the project a name and click Finish.

2. After creating a Mule project, add the Shopify connector from MuleSoft Exchange. Search and add the latest Shopify connector version, and click Finish.

3. The connector will be downloaded and visible on the Mule palette.

4. Create a global configuration element for the Shopify connector configuration.

a. We can select anything from the two connection types. Here, we will establish the connection using “Basic Auth Connection Provider.”

Provide the details shown below in the configuration:

  • Username: API key from Shopify
  • Password: secret key from Shopify
  • Base URL: store URL from Shopify

Refer to the XML configuration below for the same:

The connection between Shopify and MuleSoft will be successfully established.

Use Cases

MuleSoft’s Shopify connector provides multiple operations or use cases to connect and expose Shopify REST Admin API. One of its most useful operations is the ‘Customer Count’ operation. This operation retrieves the count of customers at your Shopify store.

To demonstrate, we will try to retrieve the customer count on our store from Shopify in MuleSoft:

1. Add an HTTP connector in the message flow and configure it.

2. Add a Customer Count connector after the HTTP connector in the same flow. Configure the customer count connector to use Shopify configuration global element:

3. Save the project and right-click the project folder in the Project Explorer->Run As->Mule Application.

You will get the count of all the customers at your Shopify store.

Conclusion

In this tutorial, we have integrated Shopify with a Mule application, and we can get Shopify data as JSON data in custom applications. We can easily use multiple operations provided by Shopify MuleSoft connector to create, store, analyze, and manipulate data into third-party applications.

--

--

Minni Jajodia
Another Integration Blog

I’m a Mulesoft Certified Developer. Currently working as Associate Consultant @Infosys.