Skip to main content
You recover Shopify abandoned checkouts over iMessage by building four Shopify Flow workflows that call the Tuco API, plus one Tuco goal bot that answers replies. The shopper gets a short text from your own line. If they reply, the bot sends their checkout link. If they order, every pending text is cancelled. No middleware is involved.

What you need

Consent. Workflow 1 only continues for customers whose Shopify SMS marketing state is SUBSCRIBED. Whether that is enough, and whether abandoned-cart texts count as marketing where you sell (TCPA in the US, the Spam Act in Australia, others), is your legal decision. This is not legal advice. Every message in this guide ends with “Reply STOP to opt out.” and Tuco puts STOP repliers on Do Not Contact automatically. See iMessage compliance.
Message limits. Each customer gets at most 3 messages if they never reply: an intro and 2 follow-ups. After that, a 7-day cooldown tag stops a repeat abandoner from restarting the sequence. The cooldown length is the one setting you tune: the Wait 7 days step in Workflow 4.

How it fits together

Why two workflows. The “Customer abandons checkout” trigger cannot call HTTP. It can only add tags and write metafields. So W1 parks the data on the customer, and the tag fires W2. “Customer tags added” allows HTTP, Wait, Remove tag and Update metafield. Why the first text has no link. Tuco refuses a link in the first message to a new contact (400 LINK_IN_FIRST_MESSAGE), and iOS does not make links from unknown senders tappable until they reply. So text 1 asks a question. Links go in the follow-ups, and the bot sends the link the moment the shopper replies. First text. Expect the first text roughly 15 to 20 minutes after a shopper leaves checkout. We measured this once (the Customer abandons checkout trigger fired about 16 minutes after the shopper left checkout in our test). Shopify does not document the timing. Timing. Follow-ups go out 1 day and 3 days after the abandonment. Each is skipped automatically if the shopper replied (Tuco skipIfReplied). All pending texts are cancelled when they order. Sends happen between 09:00 and 20:00 in your shop’s time zone.

Step 1. Create the API key and the Flow secret

  1. In Tuco, go to Settings, then API keys, and create a key named “Shopify Flow”. Copy it once.
  2. In Shopify admin, go to Apps, then Flow, then Settings, then Secrets. Add a secret with handle tuco_api_key and the key as the value. You need the “Manage connections and secrets” staff permission. Flow hides it in run logs.
  3. Every HTTP action below uses two headers: Authorization = Bearer {{secrets.tuco_api_key}} and Content-Type = application/json.

Pasting into Flow: rules that bite

  • No { or } inside {{ ... }}. Flow’s Liquid ends an output tag at the first }. The bodies do all brace cleaning inside {% assign %} tags. Keep this rule if you edit a template.
  • Metafield values are single-line text. Paste with no trailing newline.
  • Click the editor’s first line, then paste. Clicking the panel background makes Flow try to paste steps onto the canvas.
  • Fill the Body before the URL field, then re-check the URL. In testing the URL lost its value when the body was pasted after it.

Step 2. Metafield definitions: not required

Skip creating definitions. The Update customer metafield action writes unstructured metafields: you give it Namespace, Key and Type directly. W2 reads them back through the customer’s metafield list, which needs no definition.

Step 3. Build Workflow 1, “Tuco · 1 · Abandoned checkout → mark”

  1. In Flow, click Create workflow and name it. Trigger: Customer abandons checkout.
  2. Add a Condition with these criteria, joined with AND:
    • abandonment.customerHasNoOrderSinceAbandonment is true
    • customer.defaultPhoneNumber.smsMarketingConsent.state equals SUBSCRIBED (the consent gate). Do not use customer.phone or customer.smsMarketingConsent: Flow lists them as deprecated.
    • A list criterion: None of customer / tags, item Equal to tuco-cooldown
  3. In the “Then” branch, add four Update customer metafield actions. For each, use Namespace tuco, the Key below, Type Single line text, and paste the code into Value.
  4. Last action: Add customer tags with tuco-abandoned-checkout and tuco-cooldown in one action.
  5. Turn the workflow on.
cart_summary uses a for loop and forloop.first, because Flow’s Liquid has no list indexing.

Step 4. Build Workflow 2, “Tuco · 2 · Text the shopper”

  1. Trigger: Customer tags added. Condition: tags contains tuco-abandoned-checkout.
  2. Do not add customer tags anywhere in this workflow. It would loop.
  3. Action: Remove customer tags with tuco-abandoned-checkout. This re-arms W1 for the customer’s next abandonment.
  4. Add four Send HTTP request actions. The easiest way is Import from cURL. Make sure the secret from Step 1 exists first (Flow, then Settings, then Secrets, handle tuco_api_key), because the pasted command refers to {{secrets.tuco_api_key}}. For each action: Send HTTP request, then Import from cURL, paste the whole command below, then Import. Flow fills the method, URL, both headers and the multi-line Liquid body in one go. Then set the 4XX and 5XX dropdowns as listed and re-check the URL and body.
A 4XX means the request is wrong (bad phone, link in a first message, bad key). Retrying the same body never fixes it, so Fail and read the run log. 5XX and 429 are temporary, so Retry. Retries are safe: every /api/messages body carries an idempotencyKey (shopify-ac-<customer id>-<yyyymmdd>-intro, -fu1 or -fu2). Tuco keeps keys for 24 hours and a replay returns the original response. Every W2 body starts with a for mf in customer.metafields loop that reads the four values W1 stored. You do not need the variable picker.
If the Flow run log shows those values empty, use the variable picker instead: Add a variable, then customer, then metafield, then Use an unstructured metafield, namespace tuco, key checkout_url. Replace the matching assign in each body with the Liquid Flow inserts.
Manual fallback. If you cannot import, add each action by hand: method POST, headers Authorization: Bearer {{secrets.tuco_api_key}} and Content-Type: application/json, and the matching body below. Fill the Body before the URL.
The follow-up bodies compute scheduledDate when the workflow runs ("now" | date_plus: "1 day", and 3 days for follow-up 2). skipIfReplied of "2d" and "4d" makes Tuco cancel the queued send if the shopper replied in that window. In follow-up 2, edit the marked discountCode line: it must be a real Shopify discount code, or set it to "" to drop the sentence. The /api/leads/tags call uses customFields, which merges the cart data into the lead (matched by phone). See Add or remove lead tags. The goal bot reads these fields.

Step 5. Build Workflow 3, “Tuco · 3 · Stop when they buy”

  1. Trigger: Order created. Condition: order.customer.defaultPhoneNumber.phoneNumber is not empty.
  2. Send HTTP request, then Import from cURL, with the first command below (POST https://app.tuco.ai/api/messages/cancel-for-lead). 4XX Ignore, 5XX Retry. Cancelling is idempotent: Tuco returns 200 even with nothing pending. See cancel for lead.
  3. Send HTTP request, then Import from cURL, with the second command below (POST https://app.tuco.ai/api/leads/tags). 4XX Ignore (most buyers were never texted, so 404 lead_not_found is normal), 5XX Retry.
Buying does not reset the cooldown on purpose. W3 never removes tuco-cooldown.

Step 6. Build Workflow 4, “Tuco · 4 · Cooldown release”

  1. Trigger: Customer tags added. Condition: tags contains tuco-cooldown.
  2. Action: Wait 7 days. This is the cooldown length.
  3. Action: Remove customer tags with tuco-cooldown. Do not add tags here.

Step 7. Create the goal bot

The bot answers when a lead that carries the tag shopify-abandoned-checkout replies. It reads the stored cart and checkout link from the lead’s custom fields. Create it paused, so it cannot answer anyone until you have tested it. See Create goal bot.
abandoned-checkout.json:
  1. Replace the [MERCHANT: ...] text in the prompt with one discount code and its terms, or write No discount authorised.
  2. Load your shipping, returns and FAQ pages into the Tuco knowledge base. The bot answers product and policy questions only from it. If the knowledge base does not say, the bot says it is not sure and that a teammate will follow up.
  3. Run a simulation. Nothing is sent.
  4. Set the bot to active in Goal bots, or with PATCH /api/goal-bots/{id} and { "status": "active" } (update).
In a live test, a shopper replied and the bot answered: “Here’s the link to finish your checkout: https://shop.example/recover?key=xyz. I’m not sure about shipping to Austin, but a teammate can follow up with you on that.” The link was a placeholder here. The bot sends the real stored link.

Step 8. Test with your own phone

  1. Add a customer for yourself in Shopify with your E.164 phone and SMS marketing set to subscribed.
  2. Start a checkout as that customer (email and phone) and leave. Wait for Shopify to fire “Customer abandons checkout”. The Flow run log shows when. To skip the wait, set the four metafields by hand and add the tag tuco-abandoned-checkout to your customer.
  3. In Flow, open the W2 run log. All four HTTP steps should be green. You get text 1 (no link) inside the send window. Reply “yes”. The bot sends your link.
  4. In Tuco, check that the lead has the tag shopify-abandoned-checkout and the custom fields shopify_checkout_url, shopify_cart_items, shopify_cart_total and shopify_abandoned_at. Two scheduled messages should be pending.
  5. Complete the order. W3 runs, the pending messages are cancelled, and the tag becomes shopify-customer.
When this works, turn on W1 to W4 for everyone and watch the first day’s run logs and replies.

Troubleshooting

Verified in a real store

Tested on 2026-12-04 in a Shopify dev store on a Grow plan.
  • W2 activated and fired. Shopify sent valid JSON: recipientPhone +13054952897 (E.164), a name with quotes escaped correctly, an idempotencyKey such as shopify-ac-31632508289058-20261204-intro, and scheduledDate from "now" | date_plus: "1 day" | date: "%Y-%m-%dT%H:%M:%S%z", for example 2026-12-05T14:49:18+0000. The timezone came from shop.ianaTimezone. The for mf in customer.metafields loop was accepted by the editor and by activation.
  • W1 activated. abandonment.abandonedCheckoutPayload.abandonedCheckoutUrl, lineItems (title, quantity, variantTitle), subtotalPriceSet.presentmentMoney.amount and .currencyCode, and abandonment.customerHasNoOrderSinceAbandonment were all accepted.
  • Update customer metafield, then the Metafield dropdown, then Use an unstructured metafield, then Namespace, Key, Type Single line text and Value. No definition is needed.
  • The Customer abandons checkout trigger fired about 16 minutes after the shopper left checkout in this test. Shopify documents no timing. W1 stored the real recover URL and the items, and the W1 to W2 chain worked end to end.
  • Found and fixed along the way: braces inside { } break Flow’s tokenizer, metafield values must not end in a newline, customer.phone and customer.smsMarketingConsent are deprecated, and an empty cart used to render “your your cart” with a dangling link colon. The follow-ups now handle empty metafields.

Limits and caveats

  • Shopify plan. You need Grow, Advanced or Plus for the HTTP action.
  • Volume. Each Tuco line can start conversations with 50 first-time contacts per day. Add lines for more volume. See pricing.
  • SMS fallback. If a number is not on iMessage, Tuco can fall back to SMS. SMS fallback only reaches numbers in the line’s country, so a US line reaches US numbers. See failures and fallbacks.
  • You write the AI rules. The goal bot prompt is yours to edit and test. Tools that write the rules for you save time, but you give up control over what is said.
  • Consent is yours. Tuco does not decide whether you may text a customer. See iMessage compliance.

Goal bots

How goal bots read lead fields, use the knowledge base and hand off to a person.