This post will help you define a process or pipeline for getting your e-commerce related data from Shopify and load it into SQL Data Warehouse for further analysis. We will see how to access and extract your data from Shopify through its API and how to load it into SQL Data Warehouse. This process requires you to write the code to get the data and ensure that this process will run every time new data is generated. Alternatively, you can use products like RudderStack that can handle this kind of problem automatically for you.
What is Shopify?
Shopify is one of the easiest and simplest to use managed e-commerce platforms. It offers an easy way for anyone to create an online store and start selling goods. It natively integrates with services like Stripe and Paypal to make things even easier for potential users of the platform. Shopify also offers a very rich app marketplace, where its users can find powerful extensions and plugins that can enhance their online shops. They have a quite flexible pricing model that can cover the needs of very small to large online shops, you can start with the lite version and as your business grows quite easily, you can jump to a larger plan. Some of the benefits of Shopify are:
- Easy to start. Both the experience the platform offers and the pricing model makes it extremely easy for anyone to set up and run an online shop.
- No technical skills required. As a self-managed SaaS product, Shopify requires minimum technical skills from its users.
- It is hosted. This means that you don’t have to care about where to host your online shop. They offer all the infrastructure and services needed without requiring you to delve into technical details.
- It can be personalized. Although a hosted platform, it can be easily customized to meet your brand.
Additionally, Shopify has succeeded in creating a unique ecosystem of developers who build added value services and extensions on their platform. Of course, such a success was built on top of a well-designed API that exposes the whole platform to the developers. A large number of plug-ins are available that help Shopify users personalize even more their e-shops. At the same time, developers can generate a good income by selling their applications and extensions. This API will also be used in this article to show how we can pull out valuable data from Shopify.
What is Microsoft Azure SQL Data Warehouse?
SQL Data Warehouse is the data warehousing solution that you can use if you are a user of Microsoft Azure. It’s an elastic data warehousing as a service solution, emphasizing its enterprise focus. It also speaks SQL like the previous two solutions, and it supports querying both relational and non-relational data.
It offers a number of enterprise-class features like support for hybrid cloud installations and strong security. It’s probably the less mature solution compared to the two others, though, and it’s still in “Preview” mode although accessible to existing Azure subscribers.
How to Extract my data from Shopify?
Shopify exposes its complete platform to developers through its API. Thousands of developers use it to create applications that are then sold through the Shopify marketplace.
As a Web API following the RESTful architecture principles, it can be accessed through HTTP. As a RESTful API, interacting with it can be achieved by using tools like CURL or Postman or by using http clients for your favorite language or framework. A few suggestions:
Shopify also offers a number of SDKs that are officially supported and maintained by them and that can be used to access their platform for different uses. For example, by using the iOS and Android Buy SDK it is possible to add Shopify checkout capabilities to your mobile application. Other SDKs that are offered are:
Shopify API Authentication
There are two different types of applications in Shopify regarding authentication, private and public apps.
Private apps will only function on individual stores, so you don’t need to authenticate them through Oauth. You can get Private app credentials through your Partner dashboard or by logging into any Shopify admin. You can also use this API key to manipulate your store using the API console without building a fully functional app.
Shopify rate limiting
The API call limit operates using a “leaky bucket” algorithm as a controller. This allows for infrequent bursts of calls and allows your app to continue to make an unlimited amount of calls over time. The bucket size is 40 calls (which cannot be exceeded at any given time), with a “leak rate” of 2 calls per second that continually empties the bucket. If your app averages 2 calls per second, it will never trip a 429 error (“bucket overflow”).
Endpoints and available resources
Shopify exposes 35+ endpoints covering all the possible touchpoints of e-commerce. Some of the most important resources that can be accessed through these endpoints are the following:
- Abandoned checkouts: used to return abandoned checkouts. A checkout is considered abandoned when a customer has entered their billing & shipping info but has yet to complete the purchase.
- ApplicationCharge: Request to charge a shop a one-time fee by issuing this call.
- Article: Operations concerning articles in your Blog.
- Asset: files that make up the theme of a shop.
- Blog: Shopify and the e-commerce features also offer an environment where the merchant can create a Blog for her shop.
- CarrierService: A Carrier Service (also known as a Carrier Calculated Service or Shipping Service) provides real-time shipping rates to Shopify.
- Collect: An object that connects a product to a custom collection.
- Customer: A customer resource instance represents a customer