Docs
Connectors

Shopify connector

Commerce platform for products, customers, orders, inventory, and fulfillment.

View Markdown

Use this as an implementation starting point: adapt the worked example to the requested dataset and the source documentation. See Custom API for the shared SDK pattern and document-upload workflow.

What this connector is for

Commerce platform for products, customers, orders, inventory, and fulfillment.

A connector owns access to the source. Separate syncs shape selected resources into tables for analysis and downstream transformations using the Python SDK.

Data and tables you can pull

These are representative dataset families to consider, not a claim that the worked example implements every resource. Access, fields, and availability depend on the source account, product edition, and permissions. Use the vendor reference to select concrete resources.

Suggested tableOne row represents
productsa product
product_variantsa product variant
customersa customer
ordersa order
inventory_levelsa inventory level
fulfillmentsa fulfillment

Relationships and extraction considerations

Use Shopify GraphQL IDs to join products, variants, inventory, and orders. Nested connections can require their own pagination. Orders and protected customer data may require additional scopes/approval. The example reads products through the GraphQL Admin API and propagates GraphQL errors.

Connecting to Shopify

Uses an Admin API access token with read_products. Uses GraphQL rather than legacy REST resources. Provide a supported quarterly API version; API throttling errors propagate to the platform.

Additional resources may require additional scopes. Connection settings belong to the connector; dataset filters and resource selection belong to each sync. See the CLI workflow for registration and configuration.

Connection settings used by the example

SettingRequirementPurpose
access_tokenRequired; secretPlatform-supplied access token. Refresh or rotate before expiry.
shopRequiredStore subdomain without .myshopify.com.
api_versionRequiredSupported quarterly version, e.g. 2026-10.

requirements.in

Save these dependencies in requirements.in alongside connector.py; the example includes packages used by its sync. Install the published vortexify package for local development. Keep sync-specific dependencies in the sync's own requirements.in when splitting the implementation into separate resources.

vortexify==0.1.1
httpx>=0.27,<1
pandas>=2,<3

No separately installed database driver is needed by this HTTP example.

Worked example: sync products

products — Full read using the API's native pagination.

The complete files below implement only this example resource. They illustrate the current SDK signatures, a separate preview, bounded DataFrame output, and source-specific extraction. They do not establish complete source coverage. Live credentials and platform ingestion have not been used to validate this guide.

With default paths, place the connector files in connectors/shopify/ and sync files in connectors/shopify/syncs/products/. Use your project configuration if it specifies different paths.

Connection schema: config.json

This file contains a JSON Schema, not actual credential values. Provide those through platform configuration.

{
  "type": "object",
  "properties": {
    "access_token": {
      "type": "string",
      "title": "Access Token",
      "description": "Platform-supplied access token. Refresh or rotate before expiry.",
      "minLength": 1,
      "x-vortexify-secret": true,
      "order": 0
    },
    "shop": {
      "type": "string",
      "title": "Shop",
      "description": "Store subdomain without .myshopify.com.",
      "minLength": 1,
      "order": 1
    },
    "api_version": {
      "type": "string",
      "title": "Admin API Version",
      "description": "Supported quarterly version, e.g. 2026-10.",
      "minLength": 1,
      "order": 2
    }
  },
  "required": [
    "access_token",
    "shop",
    "api_version"
  ]
}

Connector: connector.py

import httpx
from vortexify import Column, Connector, DiscoveredTable


class ShopifyConnector(Connector):
    vendor_domain = "shopify.com"

    def client(self):
        if self._client is None or self._client.is_closed:
            self._client = httpx.Client(
                base_url="https://"
                + self.config["shop"]
                + ".myshopify.com/admin/api/"
                + self.config["api_version"]
                + "/",
                headers={"X-Shopify-Access-Token": self.config["access_token"]},
                timeout=60,
                follow_redirects=False,
            )
        return self._client

    def check(self) -> bool:
        cfg = self.config
        page_size = 1
        path = "graphql.json"
        body = {
            "query": "query($first:Int!,$after:String){products(first:$first,after:$after){nodes{id title handle status updatedAt} pageInfo{hasNextPage endCursor}}}",
            "variables": {"first": page_size, "after": None},
        }
        response = self.client().post(path, json=body)
        response.raise_for_status()
        payload = response.json()
        if payload.get("errors"):
            raise ValueError("GraphQL error: " + json.dumps(payload["errors"]))
        return True

    def discover(self) -> list[DiscoveredTable]:
        return [
            DiscoveredTable(
                name="products",
                schema=[
                    Column(name="id", type="string"),
                    Column(name="title", type="string"),
                    Column(name="handle", type="string"),
                    Column(name="status", type="string"),
                    Column(name="updated_at", type="timestamp"),
                    Column(name="document", type="string"),
                ],
            )
        ]

    def close(self) -> None:
        if self._client is not None:
            try:
                self._client.close()
            finally:
                self._client = None

Sync schema: syncs/products/config.json

{
  "type": "object",
  "properties": {},
  "required": []
}

Sync: syncs/products/sync.py

from collections.abc import Iterator
from math import isfinite
import json
import pandas as pd
from vortexify import Sync


class ShopifyProductsSync(Sync):

    def preview(self) -> pd.DataFrame:
        cfg = self.connector.config
        page_size = 100
        path = "graphql.json"
        body = {
            "query": "query($first:Int!,$after:String){products(first:$first,after:$after){nodes{id title handle status updatedAt} pageInfo{hasNextPage endCursor}}}",
            "variables": {"first": page_size, "after": None},
        }
        response = self.client.post(path, json=body)
        response.raise_for_status()
        payload = response.json()
        if payload.get("errors"):
            raise ValueError("GraphQL error: " + json.dumps(payload["errors"]))
        records = payload["data"]["products"]["nodes"]
        if not isinstance(records, list) or any(
            (not isinstance(record, dict) for record in records)
        ):
            raise ValueError(
                "Unexpected API record shape; refusing a partial successful sync"
            )
        records = records[:100]
        rows = []
        for record in records:
            row = {
                "id": record.get("id"),
                "title": record.get("title"),
                "handle": record.get("handle"),
                "status": record.get("status"),
                "updated_at": record.get("updatedAt"),
                "document": json.dumps(record, ensure_ascii=False, default=str),
            }
            rows.append(
                {
                    key: (
                        json.dumps(value, ensure_ascii=False, default=str)
                        if isinstance(value, (dict, list))
                        else value
                    )
                    for key, value in row.items()
                }
            )
        return pd.DataFrame(
            rows,
            columns=["id", "title", "handle", "status", "updated_at", "document"],
            dtype=object,
        )

    def extract(
        self, *, avg_row_size_bytes: float | None = None
    ) -> Iterator[pd.DataFrame]:
        memory_mib = self.compute.memory if self.compute else None
        memory_mib = memory_mib if memory_mib is not None and memory_mib > 0 else 1024
        target_bytes = min(16 * 1024 * 1024, max(1, memory_mib * 1024 * 1024 // 20))
        batch_size = 100
        if avg_row_size_bytes is not None:
            if not isfinite(avg_row_size_bytes) or avg_row_size_bytes <= 0:
                raise ValueError("avg_row_size_bytes must be finite and positive")
            batch_size = max(1, int(target_bytes / max(1.0, avg_row_size_bytes) / 4))
        batch_size = min(batch_size, 250)
        cfg = self.connector.config
        page_size = batch_size
        path = "graphql.json"
        body = {
            "query": "query($first:Int!,$after:String){products(first:$first,after:$after){nodes{id title handle status updatedAt} pageInfo{hasNextPage endCursor}}}",
            "variables": {"first": page_size, "after": None},
        }
        seen_pages = set()
        while True:
            response = self.client.post(path, json=body)
            response.raise_for_status()
            payload = response.json()
            if payload.get("errors"):
                raise ValueError("GraphQL error: " + json.dumps(payload["errors"]))
            records = payload["data"]["products"]["nodes"]
            if not isinstance(records, list) or any(
                (not isinstance(record, dict) for record in records)
            ):
                raise ValueError(
                    "Unexpected API record shape; refusing a partial successful sync"
                )
            rows = []
            for record in records:
                row = {
                    "id": record.get("id"),
                    "title": record.get("title"),
                    "handle": record.get("handle"),
                    "status": record.get("status"),
                    "updated_at": record.get("updatedAt"),
                    "document": json.dumps(record, ensure_ascii=False, default=str),
                }
                rows.append(
                    {
                        key: (
                            json.dumps(value, ensure_ascii=False, default=str)
                            if isinstance(value, (dict, list))
                            else value
                        )
                        for key, value in row.items()
                    }
                )
            for start in range(0, len(rows), batch_size):
                yield pd.DataFrame(
                    rows[start : start + batch_size],
                    columns=[
                        "id",
                        "title",
                        "handle",
                        "status",
                        "updated_at",
                        "document",
                    ],
                    dtype=object,
                )
            info = payload["data"]["products"]["pageInfo"]
            if not info["hasNextPage"]:
                break
            next_token = info["endCursor"]
            if not next_token or next_token in seen_pages:
                raise ValueError("Invalid Shopify cursor")
            seen_pages.add(next_token)
            body["variables"]["after"] = next_token

Running and extending the example

Register the connector before the sync and commit each resource separately:

vortexify create connector shopify
vortexify create sync shopify/products

Edit the files, inspect vortexify status, and use the CLI guide to commit and configure them. Registration alone does not run extraction or deploy the connector.

Preview must run with a fresh connector and disposable state. The extraction implementation determines full/incremental behavior; merely setting a mode does not implement change capture. API/driver failures propagate unless explicitly handled in the code. Check source limits and single-record/response sizes as well as output batch size.

Sources and further reading