turbot/shopify

GitHub
steampipe plugin install shopifysteampipe plugin install shopify

Shopify + Steampipe

Shopify is an e-commerce platform that allows businesses to create and manage online stores.

Steampipe is an open source CLI to instantly query cloud APIs using SQL.

List Shopify order details:

select
id,
name,
email,
billing_address ->> 'address1' as address,
billing_address ->> 'city' as city,
billing_address ->> 'country' as country,
billing_address ->> 'zip' as zip_code
from
shopify_order;
+---------------+-------+-----------------------------+-----------------+---------+---------+----------+
| id | name | email | address | city | country | zip_code |
+---------------+-------+-----------------------------+-----------------+---------+---------+----------+
| 5367225188647 | #1007 | russel.winfield@example.com | 105 Victoria St | Toronto | Canada | M5C1N7 |
| 5367225057575 | #1003 | russel.winfield@example.com | 105 Victoria St | Toronto | Canada | M5C1N7 |
| 5367225254183 | #1009 | russel.winfield@example.com | 105 Victoria St | Toronto | Canada | M5C1N7 |
| 5367225221415 | #1008 | russel.winfield@example.com | 105 Victoria St | Toronto | Canada | M5C1N7 |
+---------------+-------+-----------------------------+-----------------+---------+---------+----------+

Documentation

Quick start

Install

Download and install the latest Shopify plugin:

steampipe plugin install shopify

Credentials

ItemDescription
CredentialsShopify requires a Shop name and an API token for all requests.
PermissionsAPI tokens have the same permissions as the user who creates them, and if the user permissions change, the token permissions also change.
RadiusEach connection represents a single Shopify Installation.
Resolution1. Credentials explicitly set in a steampipe config file (~/.steampipe/config/shopify.spc)
2. Credentials specified in environment variables, e.g., SHOPIFY_API_TOKEN, SHOPIFY_SHOP_NAME.

Configuration

Installing the latest shopify plugin will create a config file (~/.steampipe/config/shopify.spc) with a single connection named shopify:

Configure your account details in ~/.steampipe/config/shopify.spc:

connection "shopify" {
plugin = "shopify"
# `api_token`: API access token to request data from the Admin API. e.g., `shpat_ab0a4zaa19c3faketoken924176b387d`.
# Please see https://www.shopify.com/partners/blog/17056443-how-to-generate-a-shopify-api-token for more information.
# Can also be set with the SHOPIFY_API_TOKEN environment variable.
# api_token = "shpat_ab0a4zaa19c3faketoken924176b387d"
# `shop_name`: The shop_name parameter is the shop's myshopify domain, e.g. "theshop.myshopify.com", or simply "theshop".
# Can also be set with the SHOPIFY_SHOP_NAME environment variable.
# shop_name = "theshop"
}

Alternatively, you can also use the standard Shopify environment variables to obtain credentials only if other arguments (api_token and shop_name) are not specified in the connection:

export SHOPIFY_API_TOKEN=shpat_ab0a4zaa19c3faketoken924176b387d
export SHOPIFY_SHOP_NAME=theshop

Get involved