Creating a Custom Connector for Shopify in Power Automate (PART 2)

In Part 1, we created a Custom connector for Shopify and added One Action to retrieve customer data.

In this blog we will add more Actions to our Shopify Connector.

Actions:

  • Create Customer
  • Update Customer
  • Retrieve All Products

Steps:

Go to Definition section

Action for Creating Customer

  1. Click on “New Action”
  1. Enter Summary, Description and Operation ID
  1. Go to Request and Click on “Import from sample”
  1. Select the verb and POST request URL, to create a new customer in Shopify
Verb: POST
URL: 
https://{apikey}:{password}@{hostname}/admin/api/2020-10/customers.json
Example: https://ee28cad19:shp_8dba8dffe0c4f@vvyas.myshopify.com/admin/api/2020-10/customers.json

You can copy the sample Body from the Shopify API Developer documentation.

A Request would look like the one given below:

Now let’s change a few things so that the connector is more friendly when someones uses it in a flow.

  • In the Request area, choose body then Edit.
  • In the Parameter area, you now see all the parameters that the API expects to create a new customer.
  • We will make the first name, last name, and email as required.
  • select “first_name” click on more commands(…) and then click on edit.
  • Enter Title and Set “Is required” to “Yes”
  • Click on Back
  • Repeat this for Last name and Email.
  1. Add Response

Go to Response section and click on “+Add default Response”

NOTE: you can add sample response from the Shopify API Documentation

Paste the sample in “Body” and click on Import


  1. Once your Action is ready click on “Update Connector”

Action for Updating Customer

  1. Create a new Action
  2. Enter Summary, Description, and Operation ID
  • Summary: Update Customer
  • Description: Update Customer in Shopify
  • Operation Id: UpdateCustomer
  1. Go to Request and Click on “Import from sample”
  2. Select the verb and PUT the request URL to update customer in Shopify
Verb: PUT
URL: 
https://{apikey}:{password}@{hostname}/admin/api/2020-10/customers/{customer_id}.json
Example: https://ee28cad19:shp_8dba8dffe0c4f@vvyas.myshopify.com/admin/api/2020-10/customers/{customer_id}.json
Here, {Customer_id} is the input parameter.
  1. Add Response

Go to Response section and click on “+Add default Response”

NOTE: You can add a sample response from the Shopify API Documentation

Paste the sample in “Body” and click on Import

Action for Retrieving All Products

  1. Create new Action
  2. Enter Summary, Description, and Operation ID
  • Summary: Retrieve All Products
  • Description: Retrieve All Products
  • Operation Id: RetrieveAllProducts
  1. Go to Request and Click on “Import from a sample”
  2. Select the verb and GET request URL to retrieve all the products
Verb: GET
URL: 
https://{apikey}:{password}@{hostname}/admin/api/2020-10/products.json
Example: https://ee28cad19:shp_8dba8dffe0c4f@vvyas.myshopify.com/admin/api/2020-10/products.json
  1. Add Response

Go to Response section and click on “+Add default Response”

6. Click on “Update Connector” once you add all your actions.

Using Custom Shopify connector in MS Flow.

Go to Custom and select Shopify connector

You can see all the actions

For demo purpose we will create a customer in Shopify

Customer created in Shopify

Snapshots of other actions

Leave a Reply

Your email address will not be published. Required fields are marked *