Major

Automate Shopify-ShipStation Delay Alerts with AI

A Shopify-ShipStation connection moves orders and tracking. Add a governed workflow that spots shipments falling behind and lets support review proactive customer updates before complaints arrive.

Ritvij GautamUpdated
Warehouse worker tapes and labels a parcel at a packing station for a Shopify order.

TL;DR: what you'll build. A Shopify-ShipStation integration moves orders and tracking data between the two systems, but neither tool watches for a shipment that is quietly falling behind schedule. On Major, you build an app that holds each order's fulfillment timeline, a workflow that checks shipment age against the expected delivery window, and an agent that drafts a Gorgias ticket for a human to approve before anything reaches the customer. The ecommerce operations manager who owns fulfillment exceptions ends up with earlier warnings and a reviewed, on-brand message instead of a support queue full of angry "where is my order" tickets.

The business problem and who owns it

Shopify orders flow into ShipStation for label purchase and carrier handoff, then tracking updates are supposed to flow back. That part works out of the box.

What doesn't exist natively is a system that notices when a shipment has gone quiet, compares it to what the customer was promised, and gets ahead of the complaint. That gap belongs to the ecommerce operations manager, the person who owns fulfillment exceptions and usually finds out about a stuck order only when a Gorgias ticket arrives from an angry customer.

The failure pattern is predictable. A carrier scan never happens, a shipment's tracking goes stale for days, a split fulfillment sends half an order out and leaves the other half stranded, or the ShipStation order status drifts out of sync with what Shopify shows the customer. By the time support notices, the customer has already asked where their order is, and the first touch is defensive instead of proactive.

This is one piece of the broader move toward AI agents for ecommerce, which covers the full post-purchase surface, and it sits inside the larger discipline of AI agents for workflow automation, which is where the app-agent-workflow split used here comes from. If you haven't connected Shopify to anything on Major yet, Shopify automation across systems is a good primer on the connector itself before adding this exception layer on top.

The systems involved

Three systems carry this process, each with a different job and a different API shape.

Shopify

Shopify holds the order and the merchant's promise to the customer: order number, line items, and the fulfillment record created when ShipStation (or another fulfillment service) picks it up.

  • Auth: scoped access tokens per app, OAuth for public apps or an admin API access token for custom apps, sent in request headers.
  • API surface: Shopify recommends the GraphQL Admin API for reading and writing the Order, Customer, and Fulfillment objects; the legacy REST Admin API covers the same ground for older integrations.
  • Events: Shopify supports both webhooks and its newer Events system, which reports object and field-level changes on GraphQL resources, so you can be notified on fulfillment status changes instead of only polling.
  • Limits: Shopify documents access scopes per API and rate limiting and pagination depth under its Limits page; check the current cost-based limit for GraphQL before you design a polling loop.
  • Gotcha: GraphQL Admin API calls are billed against a query cost budget, not a flat request count, so a wide query across many orders can burn through your budget faster than a naive request counter would suggest.

ShipStation

ShipStation holds the shipment: the label, the tracking number, and the carrier scan history that tells you whether a package is actually moving.

  • Auth: an API key sent as a header on every request to api.shipstation.com over HTTPS/TLS 1.2 or higher; a missing, invalid, or expired key returns a 401.
  • API surface: the current ShipStation API V2 covers Orders, Shipments, Labels, and Rates (POST /v2/rates), which you won't need for delay monitoring since you're reading shipment and tracking state, not buying labels.
  • Webhooks: not detailed in the saved docs notes for V2; ShipStation's help center references webhook notifications for order and shipment events in a separate integration guide, so confirm current webhook availability before relying on it and default to scheduled polling if it isn't documented for your plan.
  • Limits: rate limits for the V2 API are not published on the pages reviewed for this article; test conservatively and back off on repeated errors rather than assuming a specific ceiling.
  • Gotcha: platform users (merchants on a ShipStation plan, as opposed to standalone API customers) get one active V2 key and no sandbox, so every call is a production call that can incur real cost. Never use a delay-monitoring workflow to test label or rate endpoints.

Gorgias

Gorgias is where the human review and the eventual customer message live, as a ticket assigned to a support owner.

  • Auth: API key over HTTP Basic Auth for private, internal apps; OAuth2 for public apps distributed to other merchants.
  • API surface: the Gorgias API exposes Tickets, Customers, Messages, and an Integrations family that includes the TicketHttpIntegration object, Gorgias's name for an outbound webhook that fires on ticket events.
  • Limits: API-key integrations are capped at 40 requests per 20 seconds; OAuth2 apps get 80 per 20 seconds, per Gorgias's rate limits documentation.
  • Gotcha: creating a ticket is not the same as sending a message. You can create a draft ticket with the proposed text attached and leave it unassigned-to-send until a person approves it, which is exactly the control point this workflow needs.

Think of the data flow like a relay race: Shopify hands off the order, ShipStation carries it through the shipping leg, and Gorgias picks up the baton only when something needs a human. No single runner can see the whole race, which is why the app in the middle has to hold the full timeline.

Architecture diagram showing Shopify and ShipStation data flowing into a Major state app, a decision step, an agent drafting a message, and a Gorgias ticket for human approval

Shopify-ShipStation delay alert architecture on Major

Architecture: app, agent, workflow

Split the build into three pieces that each do one job well.

  • The workflow runs on a schedule (for example hourly), pulls new and in-flight orders from Shopify, pulls matching shipment and tracking state from ShipStation, and applies a deterministic age rule: has it been longer than the expected window since the last tracking event. This is code, not a model decision, so it runs the same way every run.
  • The app holds the order and shipment state: one row per order with its fulfillment ID, ShipStation shipment reference, last tracking event time, risk status, and a dedupe key so the same exception doesn't generate two tickets. The app is also the human's dashboard for reviewing exceptions and approvals.
  • The agent only gets involved once the workflow flags an order as at risk. Its job is judgment: is this actually an exception (a scan genuinely missing) or a false positive (a known carrier delay pattern, or a split shipment where the other half already arrived), and if it's real, draft a plain, accurate message using the order facts the app already has.

This is the predictable-agent pattern: reason once about how to classify and word a delay notice, then let the app's deterministic age check run that logic on every order without spending a model call on orders that are perfectly on time. The agent's reasoning becomes a reusable step, not a per-order re-analysis.

Build it on Major, step by step

  1. Connect the Shopify, ShipStation, and Gorgias connectors. For Shopify, use the official Major connector if listed, scoped to read Orders and Fulfillments (and write access only if you later want Major to update order tags). For ShipStation, set up a custom API connector against api.shipstation.com with the V2 API key held in Major's credential proxy, never embedded in app code. For Gorgias, connect with an API key scoped to Tickets, Customers, and Messages, held the same way. You should see all three connectors listed as active resources with their scopes visible, not the key value itself.
  2. Build the state app with a table named something like order_shipments, holding columns for the Shopify order ID, fulfillment ID, ShipStation shipment ID and tracking number, last tracking event timestamp, expected delivery window, risk status, draft ticket ID, reviewer, and approval timestamp. You should see a table view where you can filter by risk status and see which orders are currently flagged.
  3. Add the agent with a narrow prompt that only fires on flagged rows. A prompt you'd give Major to build it:
"You review one flagged order at a time from the order_shipments table. Given the order's promised delivery window, the last ShipStation tracking event, and whether other packages in a split fulfillment have delivered, decide if this is a genuine delay worth a customer notice. If yes, draft a two-to-three sentence message in our support voice that states the order number, the last known status, and a realistic next step, without promising an exact delivery date we can't back up. Never send the message yourself; only write the draft and set the row's status to 'ready for review'."
  1. Set the workflow trigger to run hourly (or more often during peak shipping periods), pulling recently created and still-open Shopify fulfillments, matching them to ShipStation shipments by order number or tracking reference, and updating the order_shipments table before the age check runs. You should see the table's last-event timestamps refresh after each run.
  2. Test in a sandbox Shopify store or a small set of real orders with read-only Gorgias access first, confirming the agent only flags orders that genuinely pass the age threshold and that no duplicate ticket is created for an order already flagged. You should see exactly one draft ticket per distinct exception, not one per workflow run.
  3. Roll out with permissions: give the ecommerce operations manager and support leads edit access to the app's review queue, restrict the Gorgias write scope to ticket creation (not deletion or bulk actions), and require a named reviewer to approve before a ticket's message is sent to the customer. You should see an audit trail showing who approved each outbound message and when.

A prompt you'd give Major to build the app itself:

"Build an app with a table of Shopify orders joined to their ShipStation shipment state. Show a queue view filtered to orders flagged 'at risk' or 'ready for review,' with the agent's drafted message, a one-click approve button that creates the Gorgias ticket, and a reject button that clears the flag and logs the reason."

Governance and IT control

Every connector credential sits behind Major's credential proxy, scoped to the minimum needed: read-only for Shopify Orders and Fulfillments, read-only for ShipStation Shipments and tracking, and ticket-create-only for Gorgias. No key lives in app code.

Role-based access on the app controls who can see the exception queue and who can approve a send. SSO covers login for the whole team, so individual logins aren't shared across the support desk.

Every table write, every agent draft, and every approval is logged with a timestamp and the acting user or agent, giving you an audit trail for "who told the customer what, and when." That matters here because a wrong promised-delivery date in a customer message is the kind of error that is hard to walk back once sent.

The managed database that holds order_shipments is versioned along with the app, so a bad deploy can be rolled back without losing the exception history that's already accumulated.

Failure handling and edge cases

Shopify and ShipStation both return standard HTTP error codes; a 401 from either means the stored credential expired and needs reconnecting, not a retry loop. Build exponential backoff into the workflow for transient 429 or 5xx responses rather than hammering either API on a fixed schedule.

Partial syncs happen when a workflow run is interrupted mid-batch. Design the state table update as idempotent: re-running the same batch should update the same rows to the same values, not create duplicates, which is why the dedupe key on order and fulfillment ID matters.

Duplicate ticket creation is the most visible failure mode to a customer, so the workflow checks the order's existing draft ticket ID before creating a new Gorgias ticket for the same order. If one already exists and is still pending, it updates that row instead.

Stale tracking data (a carrier feed that hasn't updated in longer than expected) should trigger a lower-confidence flag, not an automatic customer message, since the shipment may already have delivered and just not reported it yet.

The agent must never send a customer-facing message directly. It only drafts and marks a row ready for review; a person in Gorgias decides whether to send, edit, or discard. When the agent isn't confident the order is actually delayed, it should flag for human review rather than guess, and the fallback for any ambiguous signal is always a person, not a best-effort auto-send.

Diagram of the order-to-shipment matching logic, including the dedupe check before a new Gorgias ticket is created

Order-to-shipment state matching and dedupe

What to measure

Track a small set of metrics the operations manager already watches, now visible in one place instead of scattered across three tools.

  • Time to detection: how long after a shipment stalls does the app flag it, compared to how long until a customer complains today.
  • Exceptions caught before complaint: the share of flagged orders where the proactive Gorgias ticket went out before an inbound customer ticket arrived.
  • False positive rate: how often a human reviewer rejects the agent's flagged exception, which tells you whether the age threshold or the agent's judgment needs tuning.
  • Manual touches per exception: how many steps a support agent needs before a message goes out, which should drop once the draft is pre-written and only needs approval.
  • Approval turnaround: how long a drafted ticket sits before a reviewer acts on it, since a stale draft is as useless as no draft at all.

No specific percentage or dollar outcome is claimed here. These are the operational numbers to watch as you tune the age threshold and the agent's prompt over the first few weeks.

Before you go live

  • [ ] Shopify connector scoped to read-only Orders and Fulfillments, confirmed in the credential proxy
  • [ ] ShipStation API key stored in the credential proxy, not in app code, and confirmed as a production key with no sandbox fallback
  • [ ] Gorgias connector scoped to ticket creation only, not bulk delete or account administration
  • [ ] order_shipments table includes a dedupe key and has been tested against a batch with intentionally overlapping orders
  • [ ] Agent prompt tested against at least one known false-positive case (a split fulfillment where only one package is delayed)
  • [ ] A named reviewer owns the approval queue and knows the escalation path for high-risk orders
  • [ ] Workflow schedule and backoff behavior tested against a simulated 429 or 401 response
  • [ ] No customer-facing message sends without a human approval step in Gorgias

More ecommerce AI automation use cases

Start building on Major

Build a stateful Shopify-ShipStation exception app that checks shipment progress and routes reviewed delay drafts into Gorgias, with the judgment calls handled by an agent and the repeatable checks running as code.

Related articles

About the author

Ritvij Gautam is Head of Growth at Major.

Last reviewed November 7, 2026 by Ritvij Gautam.

Frequently asked questions

How do Shopify and ShipStation work together?
ShipStation's Shopify integration imports orders and products from your store, so you can purchase labels and manage fulfillment in one place. Tracking numbers and fulfillment status sync back to Shopify automatically. That native connection moves data between the two systems; it does not independently monitor whether a shipment is falling behind the delivery promise shown to the customer.
Can Shopify ShipStation integration alert customers when a shipment is delayed?
Not on its own. The native integration does not predict or flag delays. You can add a separate monitoring workflow that compares a shipment's last tracking event against the expected delivery window, flags configured stale-status conditions, and creates a reviewed draft message rather than sending anything automatically. The accuracy of any alert depends on how current the carrier's tracking data is.
How can I connect a ShipStation shipment delay to a Gorgias ticket?
Build an app that stores each Shopify order matched to its ShipStation shipment by order number or tracking reference, with a dedupe key so the same exception does not trigger two tickets. When a shipment ages past your threshold, an agent drafts a message and creates a Gorgias ticket for a support owner to review before it reaches the customer. Confirm exact endpoints and fields against the official Gorgias and ShipStation API docs for your account type.
Should an AI agent automatically send shipping-delay emails?
No, not without a human checking it first. The agent's role should be limited to judgment, deciding whether a flagged shipment is a genuine delay and drafting an accurate message, while a deterministic workflow handles the repeatable age checks and a person approves the message before it sends. This keeps a wrong promised date or a misclassified exception from reaching a customer unreviewed.
What data does a Shopify-ShipStation delay monitoring app need to store?
At minimum, the Shopify order ID and fulfillment ID, the matching ShipStation shipment ID and tracking number, the timestamp of the last tracking event, the expected delivery window, a risk status, a dedupe key, and fields for the drafted message, the reviewer, and the approval timestamp. These are Major app fields you define, not vendor-documented API fields.
Is ShipStation's API free to test against before going live?
It depends on the API. The standalone ShipStation API offers a 30-day sandbox trial with mock carriers. Platform users accessing the V2 companion API through their ShipStation account typically have one active production key and no sandbox, so test calls can incur real cost; avoid running label or rate-purchase test calls through a delay-monitoring workflow.