Abandoned carts are the largest single conversion-recoverable signal a Shopify store has. Shopify's built-in flow recovers a meaningful share of them with a single email; an agent layer recovers a larger share with segmentation, multi-channel decisioning, and discount discipline. The risk is that an over-eager agent sends three messages and a discount to a shopper who already converted on a different cart.
This walkthrough covers the setup that pairs cleanly with Shopify's native flow. The agent segments, picks the channel, escalates the high-value baskets, and refuses to send to anyone who already bought.
What this agent does
The agent listens to three Shopify webhooks: checkouts/create, checkouts/update, and orders/create. It maintains a per-cart state machine: created → abandoned → in-recovery → recovered or expired.
Once a checkout has been abandoned for the configured window (30 to 60 minutes is common), the agent runs the segmentation rules, picks a channel based on the shopper's segment and consent record, and triggers the matching sequence. If orders/create arrives during the sequence, the agent cancels.
For broader webhook-driven agent patterns, see how to write a prompt for a recurring agent and AI agent for Stripe failed payment recovery.
Segmentation rules
Three signals define the segment.
- Customer history. First-time visitor, returning visitor with no orders, returning customer.
- Basket value. Below median, near median, well above median (the "save this cart" tier).
- Traffic source. Direct, organic search, paid social, email, referral. Affects copy.
Each segment maps to a sequence template (3 to 5 templates total). Vague segmentation produces generic copy; over-fine segmentation produces 30 templates nobody maintains. Three to five is the practical band.
Cadence and channels
A defensible default for a returning customer with email and SMS consent on a near-median basket:
- +1 hour. Email reminder. No discount. Subject references the actual product.
- +24 hours. Email follow-up. Optional discount based on the discount policy below.
- +72 hours. SMS if consented. Short, no discount.
- Next on-site visit. A logged-in cart restoration nudge. Not a popup.
- +7 days. Sequence ends. The agent does not chase further.
For first-time visitors without email opt-in, the agent has nothing to send and respects that boundary. The agent does not buy data, does not match against external sources.
Discount policy
Discounts on every abandon train the customer to abandon. The defensible policy uses three rules:
- Never on the first reminder. The first reminder is informational, not promotional.
- Conditional on the second. Only if basket value crosses a threshold and the customer has not abandoned more than once in the past 30 days.
- Never for high-LTV customers. Repeat purchasers do not need a discount; offering one erodes margin without changing conversion.
Track discount-induced versus non-discount-induced recoveries separately. The agent's policy should evolve with the data, not the other way around.
Consent and compliance
Consent is a hard gate.
- Email. Most jurisdictions allow recovery emails as a legitimate-interest exemption. The unsubscribe link must work; the agent honours it immediately.
- SMS. Explicit opt-in required (TCPA in the US, similar elsewhere). The agent reads the consent record before every send.
- On-site. No consent required for the shopper's own session, but cookie-based personalisation requires the relevant consent banner outcome.
The agent rejects any send for a contact without the right consent record. For broader compliance patterns, see how to give agent access to email safely.
Order dedupe
The single most important rule of this category: the agent must cancel a recovery sequence the moment it detects the shopper has paid. orders/create is the source of truth.
Match by:
- Customer ID. Same Shopify customer.
- Customer email. Same email even if logged out at checkout.
- Cart contents. A close match between abandoned cart line items and the new order's line items.
A pessimistic match (any of the three) cancels the sequence. Sending a recovery message after the shopper has already paid is the failure mode that causes refund requests and one-star reviews.
Common mistakes
- Discount on every cart. Margin erodes; shoppers wait for the discount.
- SMS without explicit opt-in. Regulatory exposure plus an unhappy shopper.
- No order dedupe. Recovery emails to paid customers cause anger.
- Same template for every segment. First-time and returning customers need different copy.
- Ignoring Shopify's native flow. The agent's flow fights the native flow; pick one or layer cleanly.
Frequently asked questions
How does an AI agent recover abandoned Shopify carts?
It listens for the checkouts/create and checkouts/update Shopify webhooks, identifies carts that have not converted within your abandonment window (typically 30 to 60 minutes), segments shoppers by signal (returning vs first-time, basket value, traffic source), and triggers a sequence on the right channel: email for known customers, SMS for opted-in mobile shoppers, on-site notification for the next visit. The agent does not invent the sequence; you configure it.
Is this different from Shopify's built-in abandoned cart recovery?
Shopify's built-in flow sends a single email after a fixed delay. The agent layer adds segmentation (different copy for first-time vs returning), multi-channel decisioning (email vs SMS vs on-site), discount escalation logic (only offer a discount if the basket value justifies it), and the ability to skip outreach for shoppers who already converted on a different cart. It complements Shopify's flow rather than replacing it.
What consent rules apply to abandoned cart messages?
Email recovery messages typically rely on the legitimate-interest exemption available in many jurisdictions, but you must honour unsubscribe links and provide a clear sender identity. SMS recovery requires explicit opt-in (TCPA in the US, similar in most jurisdictions) and the agent must check the consent record before sending. The agent rejects any send to a contact without the right consent record on file.
Should the agent always offer a discount?
No. Discount-on-every-abandon trains shoppers to abandon for the discount and erodes margin. The defensible policy: no discount on the first reminder, optional discount on the second reminder for higher-value baskets only, never a discount for repeat abandoners or shoppers with high lifetime value. The agent reads customer history before offering.
How does the agent know if the shopper already came back and bought?
It listens for the orders/create webhook from Shopify and matches by customer email, customer ID, and recent cart contents. If a matching order has been created since the cart was abandoned, the agent cancels the recovery sequence. Sending a recovery message to someone who has already paid is the most embarrassing failure mode of this category.
Three takeaways before you close this tab
- Segment, then send. Generic copy converts worst.
- Discount discipline. Not every cart. Not every shopper.
- Order dedupe is the single most important rule. Cancel sequences on orders/create.
Sources
- Shopify Dev, "Webhook topics: checkouts and orders", retrieved 2026-05-10, shopify.dev/docs/api/webhooks
- Shopify Help Center, "Abandoned checkout recovery overview", retrieved 2026-05-10, help.shopify.com/abandoned-checkouts
- FCC, "Telephone Consumer Protection Act (TCPA) overview", retrieved 2026-05-10, fcc.gov/tcpa
- Aryan Agarwal, "Gravity ecommerce-agent guardrails", internal v1, May 2026, About