Skip to main content
Back to docs
Plugins

Shopify plugin

The Flowgration app for Shopify is an embedded Admin app (Polaris UI) that mirrors orders, customers, products and abandoned checkouts into your Flowgration CRM, and handles Shopify's GDPR mandatory webhooks.

Quick start (5 min)

  • Install from the Shopify App Store → search "Flowgration" → Add app. Shopify walks you through the OAuth consent screen.
  • After install, the embedded app opens in Apps → Flowgration inside Shopify admin.
  • Pick one path:
    • I have a Flowgration account → paste an API key from Settings → API keys (must start with sk_live_).
    • I don't have an account yet → click Auto-onboard. The app sends a magic link to the store's primary owner email.
  • Click the magic link. Flowgration creates the org, the user and the starter CRM, then drops you back into the embedded app.
  • The store dashboard turns green and webhooks start flowing within ~10 seconds.

Two ways to connect

Flow A — existing account

Shopify (embedded app)         Flowgration
    │                              │
    │  POST /onboarding/initiate (mode=connect, api_key=sk_live_…)
    ├─────────────────────────────►│
    │                              │ verify key → upsert PluginIntegration
    │ ◄────────────────────────────┤ 200 { review_url, suggested_mappings }
    │
    │  redirect to /app/integrations?integration_id=…
  1. Generate an API key in Flowgration.
  2. Paste it into the embedded app's "Connect existing account" panel.
  3. The app POSTs /api/plugin/onboarding/initiate with mode=connect, platform=shopify, store.url=<myshop>.myshopify.com.
  4. Flowgration upserts the PluginIntegration row and returns a URL to review mappings.

Flow B — auto (magic link)

Shopify              Flowgration               Store owner inbox
   │                     │                            │
   │ POST /onboarding/initiate (mode=auto)            │
   ├────────────────────►│                            │
   │                     │ create PluginOnboarding    │
   │                     ├──── magic-link email ─────►│
   │                     │                            │
   │                     │ ◄── owner clicks link ─────┤
   │                     │ materialize_crm
   │                     │ 302 → /plugin-callback
  1. App scans the shop (counts, currency, primary domain, themes).
  2. POSTs the discovery payload + owner email to /onboarding/initiate.
  3. Owner clicks the one-time link (TTL 24h).
  4. Flowgration creates org + user + CRM, mints an API key, and redirects to /plugin-callback.
  5. The embedded app polls /onboarding/blueprint?token=… and shows the loading screen while the CRM materialises.

Compatibility

  • Shopify Admin API Shopify Admin API version 2024-10 (rotates quarterly; the app bumps the version with each Shopify release window).
  • Embedded app — runs inside the Shopify admin iframe. Polaris UI for visual consistency.
  • App Bridge App Bridge v4 for navigation, toasts and resource pickers.
  • Plan tiers — works on Basic Shopify and above. Shopify Plus features (multi-store, GraphQL Bulk Operations) are not yet exposed; backfill still works via REST.

What gets synced

EventTopicWhen it firesWhat Flowgration does
order.createdorders/createNew order placed (any status)Creates Order + line items, links to Contact
order.updatedorders/updatedOrder editedUpdates Order; diff is written to Activity log
order.cancelledorders/cancelledOrder cancelledMarks Order cancelled, fires journey trigger
order.fulfilledorders/fulfilledFulfilment createdMarks Order fulfilled, fires journey trigger
customer.createdcustomers/createNew customer recordCreates Contact with mapped fields
customer.updatedcustomers/updateCustomer editedUpdates Contact
product.createdproducts/createNew product publishedMirrors product to Flowgration catalog
product.updatedproducts/updateProduct editedUpdates catalog row
product.deletedproducts/deleteProduct deletedSoft-deletes catalog row
cart.abandonedcheckouts/updateCheckout abandoned ≥30 min, email knownFires cart.abandoned trigger for journeys

Each webhook payload is idempotency-keyed by X-Shopify-Webhook-Id, so retries from Shopify (which can repeat for 48h) are deduped.

Discovery

On first connect Flowgration calls Shopify's REST API to read non-PII metadata:

  • Counts — orders.count, customers.count, products.count, abandoned_checkouts.count.
  • Currency — shop's base currency from /shop.json.
  • Themes — the active theme name and version.
  • Primary domain — used as the store identifier on PluginIntegration.

No customer, order or product data is read at this stage — that arrives later via webhooks (and the optional backfill).

Backfill

The integration page has a Backfill button per object (Orders, Customers, Products). It:

  • Uses Shopify REST pagination (250 per page, max page size).
  • Posts each page through the same /sync pipeline as live webhooks.
  • Persists the cursor server-side; if interrupted, resumes from the last cursor on the next click.
  • Deduplicates against PluginEventLog so re-running is safe.

Typical throughput: ~2 000 records/minute within Shopify's REST rate limit (40 calls/burst, 2/sec sustained).

GDPR mandatory webhooks

Shopify requires every public app to implement three webhooks. They are configured in shopify.app.toml and registered automatically on install.

WebhookTriggerWhat Flowgration does
customers/data_requestCustomer requests their dataQueues a job; emails the merchant a JSON export of every Contact + Order + Activity tied to the customer email within 30 days.
customers/redactCustomer requests deletion (30d grace)Wipes PII (first_name, last_name, email, phone, street, city, country, postal_code, job_title, company_name, notes) on the matching Contact. Keeps the row so referencing Orders/Activities don't break.
shop/redactShop uninstalled (48h grace)Wipes the entire PluginIntegration, revokes the API key, and runs customers/redact-style wipe on every Contact that originated from this shop.

All three return HTTP 200 within the Shopify-mandated 5-second window by enqueueing the work and processing it in a worker.

Required scopes

These are the scopes the app requests on install (from shopify.app.toml):

ScopeWhy
read_ordersRead order data for live sync and backfill
read_customersRead customer profiles to create Contacts
write_customersOptional. Used when the merchant grants data_write so Flowgration can push tag/segment updates back to Shopify customers
read_productsMirror product catalog
read_checkoutsDetect abandoned checkouts
read_inventorySurface stock levels in the Flowgration product view
read_fulfillmentsTrack order fulfilment status
read_shippingMap shipping addresses to Contact address fields
read_localesSet Contact language from the order locale
read_marketing_eventsAttribute orders to Flowgration campaigns

The app does not request write_orders, write_products or any financial scope. Refunds and order edits stay inside Shopify.

Troubleshooting

1. App fails to install
  • Shopify's OAuth screen showed scope checkboxes the merchant unchecked. Open Partner Dashboard → App setup → Scopes and compare against the list above.
  • Re-install with all scopes granted.
2. Webhooks not firing
  • A previous app/scopes_update event revoked a scope the webhook depends on. Check the lastScopes column on the PluginIntegration row.
  • Re-grant scopes via /admin/apps/flowgration/grant.
  • Confirm Shopify's webhook status: Settings → Notifications → Webhooks. Failed deliveries are visible there.
3. Orders showing "missing customer"
  • Guest checkouts have no Shopify Customer record. Flowgration falls back to order.customer.email (or order.email) and creates a Contact with that address.
  • If both are absent, the order is dropped with a warning in PluginEventLog. This happens when a merchant disables "require email at checkout" — we recommend against it.
4. Multi-currency stores
  • The webhook payload's currency field is forwarded as-is. The Order row stores the original currency.
  • Flowgration's reporting layer converts to the org's base currency using daily FX rates from openexchangerates.org. Reports show both values.
  • Per-order FX rates are not stored at write-time — if you need point-in-time rates, enable Audit-grade FX under Settings → Currencies (Business plan).
5. App slow on order create
  • Webhooks are processed with the enqueue-then-forward pattern: the HTTP handler returns 200 in <5s after writing to the job queue. Shopify never waits on your CRM.
  • If Shopify's webhook log shows long response times from Flowgration, check https://status.flowgration.com.
6. "App is no longer installed" banner inside Shopify admin
  • The shop's session token expired (Shopify rotates these aggressively). Re-open the app from Apps → Flowgration; App Bridge will refresh the token automatically.
  • If the banner persists, uninstall and reinstall. Re-installation is idempotent — the same PluginIntegration row is reused.
7. Abandoned cart events not firing
  • Shopify only sends checkouts/update if the customer entered an email address at checkout. Guest carts without email are invisible to apps.
  • The 30-min threshold is enforced client-side by Flowgration's worker, not by Shopify. If you see events firing for carts younger than 30 min, that's a different abandoned-cart app.
8. Duplicate Contacts after re-install
  • The shop was uninstalled, the customers/redact job ran, then the app was reinstalled the next day. The redact wiped emails on Contacts → the new sync creates fresh ones because dedup is by email.
  • Use Settings → Duplicates in Flowgration to merge them. Or reinstall within the 48h shop/redact grace window — the redact job won't have run yet.
9. Plus / multi-store — events from store B show up under store A
  • Each shop must connect with its own API key. Reusing one key across multiple stores in mode=connect is supported but experimental.
  • The PluginIntegration row is keyed by (organization_id, platform, store_url), so different <shop>.myshopify.com domains route correctly even on the same key. Same domain = same row.
10. App throws "HMAC mismatch" on every webhook
  • Shopify rotated the shared secret. This happens automatically on app re-install. Flowgration regenerates its copy on the next successful auth callback.
  • If it persists, manually rotate the secret in the Partner Dashboard and click Settings → Refresh secret in the embedded app.

Privacy & data

What leaves your shop

  • Only the events listed in What gets synced, plus customer and order fields covered by the granted scopes.
  • No raw card data (Shopify never sends it).
  • No images or theme files.

Where it goes

Frankfurt, EU (AWS eu-central-1). Frankfurt, EU (AWS eu-central-1). Data never leaves the EU in normal operation.

Retention

  • Webhook events live in PluginEventLog for 90 days then are aggregated.
  • Contact and order data persist until you uninstall the app or the merchant deletes the contact.
  • customers/redact wipes PII immediately; aggregate analytics keep anonymous counters.

Uninstall

From Shopify

Apps → Flowgration → Uninstall. Shopify revokes the OAuth token, fires app/uninstalled, and (after 48h) fires shop/redact.

What gets cleaned

  • In Flowgration (Prisma side): the PluginIntegration row goes to disconnected; the API key is revoked. Synced data is kept until shop/redact arrives, at which point all Contacts and related PII originating from this shop are wiped.
  • In Shopify (server side): all webhook subscriptions are removed. The merchant's customer/order records are untouched — Flowgration never wrote to Shopify.
Reinstallation is idempotent: the next OAuth callback upserts the PluginIntegration row by (organization_id, platform, store_url), preserving mapping config if the grace window hasn't elapsed.