Galantis interacts with Shopify exclusively through the Shopify Admin GraphQL API, usingDocumentation Index
Fetch the complete documentation index at: https://docs.digifist.com/llms.txt
Use this file to discover all available pages before exploring further.
ShopifySdkService as the internal client. The API is used for four categories of operations: fetching initial and on-demand data, managing webhook subscriptions, polling for abandoned checkouts, and managing app subscriptions through Shopify’s billing system.
What this covers
- How
ShopifySdkServiceworks - The four categories of Shopify Admin API usage
- Specific GraphQL operations per category
- Authentication and per-tenant token management
ShopifySdkService
ShopifySdkService is Galantis’s abstraction layer over the Shopify Admin GraphQL API. All Shopify API calls are routed through this service — application code never constructs raw GraphQL queries or manages access tokens directly.
ShopifySdkService handles:
- Resolving the correct tenant’s encrypted Shopify access token per request
- Constructing authenticated GraphQL requests to
https://{shop}.myshopify.com/admin/api/graphql.json - Handling response parsing and GraphQL error mapping
- Managing pagination for queries that return large result sets
Data fetching
Initial customer and product import
At app installation, Galantis runs a full import of the store’s existing data via paginated GraphQL queries. This populates the Galantis database with all customers, orders, products, and collections that exist at the time of installation. Queries used:customers— fetches all customer records with phone, email, name, tags, marketing consent, and localeorders— fetches order history per customer for segment rule evaluation and Inbox contextproducts— fetches the full product catalog with variants, pricing, images, tags, and collection membershipscollections— fetches all collections and their product associations
after / pageInfo.hasNextPage). Large stores with thousands of customers or products are fetched in batches across multiple queries.
On-demand data fetching
Beyond the initial import,ShopifySdkService is used for targeted data fetches when specific records are needed:
- Fetching a specific customer record when a webhook payload contains only an ID and the full record is needed for context
- Fetching order details for automation condition evaluation when order data is incomplete from the webhook payload
- Re-fetching a product record when a sync error has left a Galantis record inconsistent with Shopify
Webhook management
Galantis registers its webhook subscriptions with Shopify via the Admin GraphQL API during installation and manages them through the same API throughout the app lifecycle. Relevant GraphQL mutations:Abandoned checkout polling
Theread_checkouts permission grants Galantis access to query for incomplete checkout records. Unlike other data types, abandoned checkouts have no real-time webhook — detection requires polling.
GraphQL query pattern:
- Were created within the qualifying recency window
- Have not been completed (
completed_at:null) - Have an associated customer with a WhatsApp phone number
ABANDONED_CHECKOUT automation trigger for the associated customer, subject to frequency cap and consent checks.
See Integrations — Abandoned Checkout for the timing implications and edge cases.
Billing
Galantis uses Shopify’s app billing system for subscription management. All billing operations — creating subscriptions, processing plan changes, handling trial periods — go through the Shopify Admin GraphQL API’s billing mutations and are surfaced to merchants through Shopify’s native billing UI. Relevant billing operations:UpdateSubscriptionController, which calls the appropriate Shopify billing mutation for the new plan configuration. Free trial activation is handled via BillingStartFreeTrialController.
Subscription status changes from Shopify — approvals, cancellations, billing failures — arrive via the app_subscriptions/update webhook and are processed by MonitorBillingSubscriptionsJob.
Error handling
ShopifySdkService maps Shopify GraphQL errors to application-level exceptions with structured error details. Common error categories:
| Error type | Cause | Handling |
|---|---|---|
| Authentication error | Access token expired or revoked | Job fails; surfaces as integration error requiring reinstallation |
Rate limit error (THROTTLED) | Too many API calls in a short period | Exponential backoff retry via queue |
| Resource not found | Record deleted in Shopify before the fetch completed | Record marked as deleted in Galantis |
userErrors in mutation response | Invalid input data | Logged with details; surfaced as a job failure |
Related guides
- Authentication — How ShopifySdkService resolves tenant access tokens
- Integrations — Shopify Webhooks — How webhooks complement the API for data currency
- Integrations — Abandoned Checkout — Full context for the checkout polling mechanism
- Webhooks Reference — Complete payload reference for all Shopify webhooks received