Creating a Custom Connector for retrieving a single record from Shopify
Hello everyone!
Shopify has become a powerful platform for companies to build their online presence and run their operations in the e-commerce space. Effectively maintaining consumer data is one of the most important aspects of running an online shop. In this article, we’ll show you how to build a custom connection to use a Postman collection to extract a single customer’s information from Shopify. You may easily get client information using this simplified procedure for better customer service and data analysis.
Let’s get started!
Click this link ‘https://documenter.getpostman.com/view/3800273/SWLk55pF’ to get the Postman Collection.
![](https://www.cloudfronts.com/wp-content/uploads/2023/09/image-6.png)
Click ‘Run in Postman’ button, select ‘Postman Desktop App to Import’ and select ‘Open App
![](https://www.cloudfronts.com/wp-content/uploads/2023/09/image-7.png)
Make sure Postman is installed in your device. Once this is imported, you will see the pre-built libraries.
![](https://www.cloudfronts.com/wp-content/uploads/2023/09/image-8.png)
Export the Postman Collection and Select ‘Customer’
![](https://www.cloudfronts.com/wp-content/uploads/2023/09/image-9.png)
Imported the Collection which is exported which is in the swagger.json format
![](https://www.cloudfronts.com/wp-content/uploads/2023/09/image-11.png)
Add an image as the connector icon and description as shown below.
![](https://www.cloudfronts.com/wp-content/uploads/2023/09/image-12.png)
Add the host name and move to the next Section ‘Security’
![](https://www.cloudfronts.com/wp-content/uploads/2023/09/image-13.png)
Select a type of Authentication. Here, in this case, I selected Basic Authentication.
![](https://www.cloudfronts.com/wp-content/uploads/2023/09/image-14.png)
Basic Authentication involves Username and Password. Provide appropriate parameter labels.
![](https://www.cloudfronts.com/wp-content/uploads/2023/09/image-15.png)
We can see the pre-defined Actions as we imported the postman collection. We will be retrieving details of a single customer so select ‘RetrievesASingleCustomer’.
![](https://www.cloudfronts.com/wp-content/uploads/2023/09/image-16.png)
![](https://www.cloudfronts.com/wp-content/uploads/2023/09/image-17.png)
Enter the verb Get request URL to retrieve the single customer detail
Verb: GET, URL: https://{apikey}:{password}@{hostname}/admin/api/2020-10/customers/{customer_id}.json
Paste this:
![](https://www.cloudfronts.com/wp-content/uploads/2023/09/image-18.png)
Here, {customer_id} is the input parameter. So, I have edited and pre-defined the Customer ID value.
![](https://www.cloudfronts.com/wp-content/uploads/2023/09/image-19.png)
Click on Create ‘Custom Connector’
![](https://www.cloudfronts.com/wp-content/uploads/2023/09/image-20.png)
Add a new connection to test the connection.
![](https://www.cloudfronts.com/wp-content/uploads/2023/09/image-21.png)
Enter the API Key as the Username and Admin API Access Token as Password. You will find this in your Shopify environment Developer Options.
![](https://www.cloudfronts.com/wp-content/uploads/2023/09/image-22.png)
A connection is displayed here. If it doesn’t reflect, refresh the Connection.
![](https://www.cloudfronts.com/wp-content/uploads/2023/09/image-23.png)
Add the Customer ID here and click ‘Test Operation’.
![](https://www.cloudfronts.com/wp-content/uploads/2023/09/image-24.png)
Voila, the response is successfully generated.
![](https://www.cloudfronts.com/wp-content/uploads/2023/09/image-25.png)
Hope this helps!