Shopify
BUILDING Source · built and tested, not yet verified against production accounts. Contact us before relying on it.
Overview
Section titled “Overview”PortPilot reads your store with Shopify’s GraphQL Admin API bulk operations: Shopify exports each object type to a file in the background, and PortPilot downloads and loads it. This is Shopify’s recommended way to read large datasets and doesn’t use your app’s per-request query budget. After the first sync, only records updated since the last sync are exported.
Features
Section titled “Features”| Feature | Supported | Notes |
|---|---|---|
| Incremental sync | Yes | Records updated since the last sync, via bulk export. |
| Captures deletes | No | Records deleted in the source stay in the destination. |
| Custom fields | No | Metafields aren't synced yet. |
| Table selection | Yes | Choose which tables to sync. |
| New columns added automatically | Yes | Columns that appear in the source are added to the destination table. |
| Re-sync | Yes | A full refresh re-reads every selected table. |
Before you connect
Section titled “Before you connect”- Create a custom app for your store (Shopify admin → Settings → Apps and sales channels →
Develop apps) and give it these Admin API scopes:
read_ordersread_customersread_productsread_inventoryread_all_ordersif you need orders older than 60 days (see gotchas)
- Install the app and copy its Admin API access token (
shpat_…). Shopify shows it once.
Connect
Section titled “Connect”In the app, go to Connectors → New connector → Shopify and click Test connection after filling in:
| Field | Required | Default | Description |
|---|---|---|---|
shop |
Yes | — | Your store’s domain, e.g. mystore.myshopify.com. |
access_token |
Yes | — | Admin API access token. Stored write-only in the data plane’s secret store. |
start_date |
No | all history | YYYY-MM-DD. The first sync reads only records updated on or after this date. |
bulk_timeout_seconds |
No | 21600 |
Cancel and fail an export that hasn’t finished after this many seconds (6 hours). |
Schema
Section titled “Schema”How the tables relate. Each arrow points from a column to the table it references. Only key, reference and cursor columns are shown; the data dictionary below has the rest.
erDiagram
customers ||--o{ orders : "customer (`customer.id` inside the JSON object)"
orders ||--o{ transactions : "orderId"
orders {
string id PK
string updatedAt "cursor"
object customer FK
}
customers {
string id PK
string updatedAt "cursor"
}
products {
string id PK
string updatedAt "cursor"
}
collections {
string id PK
string updatedAt "cursor"
}
inventory_items {
string id PK
string updatedAt "cursor"
}
transactions {
string id PK
string orderId FK
string orderUpdatedAt "cursor"
}
orders
One row per order, in every status.
| Column | Type | Description |
|---|---|---|
idPK | string | Shopify global ID, e.g. gid://shopify/Order/123. |
name | string | Order name shown in the admin, e.g. #1001. |
email | string | Customer email on the order. |
createdAt | string (datetime) | When the record was created. |
updatedAtcursor | string (datetime) | When the record last changed. |
processedAt | string (datetime) | When the order was processed. |
cancelledAt | string (datetime) | When the order was cancelled, if it was. |
closedAt | string (datetime) | When the order was closed, if it was. |
test | boolean | True for test orders. |
tags | array | Tags on the record. |
displayFinancialStatus | string | Payment status, e.g. PAID, REFUNDED. |
displayFulfillmentStatus | string | Fulfillment status, e.g. FULFILLED. |
currencyCode | string | The shop's currency for the order. |
totalPriceSet | object | Order total: {shopMoney: {amount, currencyCode}} in the shop's currency; amount is a string. |
subtotalPriceSet | object | Subtotal before shipping and taxes: {shopMoney: {amount, currencyCode}} in the shop's currency; amount is a string. |
totalTaxSet | object | Total tax: {shopMoney: {amount, currencyCode}} in the shop's currency; amount is a string. |
customer→ customers.id | object | The ordering customer as {id}. |
customers
One row per customer.
| Column | Type | Description |
|---|---|---|
idPK | string | Shopify global ID, e.g. gid://shopify/Order/123. |
firstName | string | First name. |
lastName | string | Last name. |
createdAt | string (datetime) | When the record was created. |
updatedAtcursor | string (datetime) | When the record last changed. |
state | string | Account state, e.g. ENABLED, DISABLED, INVITED. |
tags | array | Tags on the record. |
verifiedEmail | boolean | Whether the email address is verified. |
taxExempt | boolean | Whether the customer is exempt from taxes. |
numberOfOrders | string | Number of orders placed (a string, as Shopify sends it). |
amountSpent | object | Total spent: {amount, currencyCode}. |
defaultEmailAddress | object | Primary email as {emailAddress}. |
products
One row per product.
| Column | Type | Description |
|---|---|---|
idPK | string | Shopify global ID, e.g. gid://shopify/Order/123. |
title | string | Product title. |
handle | string | URL handle. |
status | string | ACTIVE, ARCHIVED or DRAFT. |
vendor | string | Vendor name. |
productType | string | Product type. |
createdAt | string (datetime) | When the record was created. |
updatedAtcursor | string (datetime) | When the record last changed. |
publishedAt | string (datetime) | When it was published to the online store. |
tags | array | Tags on the record. |
collections
One row per collection.
| Column | Type | Description |
|---|---|---|
idPK | string | Shopify global ID, e.g. gid://shopify/Order/123. |
title | string | Collection title. |
handle | string | URL handle. |
updatedAtcursor | string (datetime) | When the record last changed. |
sortOrder | string | How products in the collection are sorted. |
templateSuffix | string | Theme template suffix, if any. |
inventory_items
One row per inventory item (the stocked unit of a variant).
| Column | Type | Description |
|---|---|---|
idPK | string | Shopify global ID, e.g. gid://shopify/Order/123. |
sku | string | Stock keeping unit. |
tracked | boolean | Whether inventory is tracked. |
requiresShipping | boolean | Whether the item needs shipping. |
createdAt | string (datetime) | When the record was created. |
updatedAtcursor | string (datetime) | When the record last changed. |
countryCodeOfOrigin | string | Two-letter country of origin. |
unitCost | object | Unit cost: {amount, currencyCode}. |
transactions
One row per payment transaction on an order.
| Column | Type | Description |
|---|---|---|
idPK | string | Shopify global ID, e.g. gid://shopify/Order/123. |
kind | string | e.g. SALE, AUTHORIZATION, CAPTURE, REFUND. |
status | string | e.g. SUCCESS, FAILURE, PENDING. |
gateway | string | Payment gateway used. |
test | boolean | True for test transactions. |
processedAt | string (datetime) | When the transaction was processed. |
createdAt | string (datetime) | When the record was created. |
amountSet | object | Transaction amount: {shopMoney: {amount, currencyCode}} in the shop's currency; amount is a string. |
orderId→ orders.id | string | ID of the order the transaction belongs to. |
orderUpdatedAtcursor | string (datetime) | When that order last changed (the sync cursor). |
- IDs are Shopify global IDs, e.g.
gid://shopify/Order/123. The numeric ID is the last segment. - Column names are camelCase, as in Shopify’s GraphQL API.
- Money amounts are strings inside their JSON objects. Cast them in your warehouse.
Sync behavior
Section titled “Sync behavior”- First sync: every record of each type (from
start_date, if set). - Later syncs: records whose
updatedAtis at or after the newest value from the previous sync, upserted onid. Transactions are re-read when their order is updated. - Streams are exported one after another.
Common gotchas
Section titled “Common gotchas”- Only 60 days of orders without
read_all_orders. Shopify limits apps to recent orders unless the app has this scope. Request it in the app’s configuration before the first sync, or older orders won’t be replicated. - A missing scope fails the stream. The export ends with
ACCESS_DENIEDand the run fails with that code. Add the scope, reinstall the app and update the token. - Not synced yet: product variants, order line items and fulfillments.
- Deletes aren’t replicated. Deleted products, customers and orders stay in the destination.
- One export at a time. Shopify limits how many bulk operations an app can run on a store at once. If another tool uses bulk operations with the same app, syncs can be throttled. Use a dedicated app for PortPilot.