Skip to main content
BatchCard
Integrations

Shopify Flow Integration

The Shopify Flow integration is available on the Pro plan and above. See pricing

Automate gift cards with Shopify Flow. Issue a gift card as a step in any workflow with the Create gift card for customer action, and react to gift card activity with two triggers, Batch completed and Gift card created.

Because BatchCard ships Flow connectors, it carries the Works with Flow badge on the Shopify App Store.

Read this first. The action has a Send gift card email toggle. If you also build a Klaviyo flow that emails on the BatchCard Gift Card Issued event, leaving this toggle on sends the recipient two emails, one from Shopify and one from Klaviyo. Pick one channel: turn the toggle off when a Klaviyo flow handles the email. See The double-email footgun.

What you'll need

  • A Pro (or Business) BatchCard plan. Below Pro, the action returns a clean error in the Flow run log and creates no card.
  • The Shopify Flow app installed on your store.
  • Nothing to connect or configure in BatchCard. The action and triggers appear in the Flow editor automatically once BatchCard is installed.

The "Create gift card for customer" action

Add Create gift card for customer as a step in any Flow workflow. It creates one gift card for the referenced customer and returns the card's code, id, and balance to later steps in your workflow. The action is HMAC-verified and idempotent on the Flow run id, so a retried workflow step never creates a duplicate card.

Action fields

FieldRequiredWhat it does
CustomerYesThe customer the gift card is created for. BatchCard links the card to this customer in your batch records.
Gift card valueYesThe card amount, in your store's primary currency (for example 25.00).
Personal messageNoAn optional message stored with the card.
Expiration date (YYYY-MM-DD)NoAn optional expiration date. Expiration is a Pro+ feature.
Send gift card emailNoWhether to send Shopify's native gift card email to the customer. See below.

The "Send gift card email" toggle

This toggle controls only Shopify's native gift card email:

  • On: BatchCard attaches the customer to the card so Shopify's native gift card email is sent to them automatically.
  • Off (default): BatchCard creates a silent card. No email is sent. The card is still linked to the customer in your BatchCard records; the customer simply is not emailed by Shopify.

The Send gift card email default is off. A Flow-created card is silent unless you turn the toggle on. Either way, the card and customer link is stored in BatchCard, so the card shows up under the right customer in your batch detail regardless of the toggle.

Flow-created cards always emit the Klaviyo event

If you have connected Klaviyo (see the Klaviyo integration), every Flow-created card also emits the BatchCard Gift Card Issued Klaviyo event, regardless of the Send gift card email toggle. That is how Klaviyo-first merchants get branded gift card emails from a Flow: build a Klaviyo flow off that event, and leave Send gift card email off so Shopify does not also email.

The double-email footgun

Because the Klaviyo event always fires, leaving Send gift card email on while a Klaviyo flow also emails on the BatchCard Gift Card Issued event means the recipient gets two emails, one native Shopify email and one from your Klaviyo flow.

This is your flow design to manage. Pick one channel:

  • Want Shopify's native email? Leave the toggle on and do not email on the event in Klaviyo.
  • Want your branded Klaviyo email? Turn the toggle off and let your Klaviyo flow send it.

The action's Send gift card email field carries this same warning inline in the Flow editor.

When the customer has no email

If the referenced customer has no email address on file and Send gift card email is on, BatchCard still creates the gift card as a silent card and records the delivery as failed (no email) in the batch detail. The Flow workflow run still succeeds. A gift is never blocked by a missing email; you just will not have emailed that recipient. This mirrors how BatchCard handles unresolvable recipients during spreadsheet and URL imports.

Where Flow-created cards live

Flow-created cards are grouped into a monthly rolling batch, one per calendar month, named after that month (for example Shopify Flow — July 2026). Every card the action creates that month appends to that batch, so your batch list stays tidy instead of filling with one-card batches.

Flow-created cards count against your monthly plan limit, exactly like manually created and imported cards. They are part of the same monthly quota.

Limits and failures

The action reports failures as clean, merchant-actionable messages in the Flow run log, never as opaque errors. It does not retry these, and it does not create a card when it fails.

Below Pro. If your plan is below Pro when the action runs, it returns a clear message telling you the feature requires the BatchCard Pro plan or higher. No card is created. Upgrade to Pro to use the action.

Monthly card limit reached. If creating the card would exceed your plan's monthly card limit, the action fails with a clean "Monthly card limit reached. Upgrade your BatchCard plan." message. No card is created. Upgrade your plan (or wait for the next monthly cycle) and the workflow will succeed again. This is also the natural stopping point for an accidental create-on-create loop on a limited tier. See Avoiding create-on-create loops.

Business hourly safety cap. The Business plan has unlimited monthly cards, so there is no monthly quota to stop a runaway workflow. To protect you, cards created through the Flow action specifically are additionally capped per shop, per hour as a safety limit against automation loops. The cap sits well above any legitimate automation. Beyond it, the action returns a "safety limit" message in the run log and creates no card until the hour rolls over. This cap applies only to the Flow action; your normal manual creation, imports, and the triggers are unaffected.

The "Batch completed" trigger

Start a workflow when a gift card batch finishes creating cards. Use it to notify staff, log to a spreadsheet, or branch on the outcome.

When it fires. It fires when a manual, spreadsheet (CSV/XLSX), or URL import batch finishes its creation run, on every terminal state: COMPLETED, PARTIAL, and FAILED. The Status field carries which one, so you can branch (for example, if Status is PARTIAL, notify staff). A fully failed batch fires too, because failure alerts are a real use case.

Honesty rule. This trigger fires when cards are created, not when emails are delivered. The counts and total value are final the moment the batch finishes creating cards. Email delivery is a separate lifecycle with no clean terminal moment, so it is not what this trigger reports.

The monthly "Shopify Flow" batch never fires this trigger. That batch has no single completion moment (cards trickle in all month), and those cards already fire the per-card Gift card created trigger.

Batch completed payload

FieldTypeNotes
Batch IDtextThe batch's id.
Batch nametextThe batch's name.
Cards createdintegerHow many cards were created.
Cards failedintegerHow many cards failed to create.
Total valuetextTotal value of the created cards, as a display string (for example 250.00).
StatustextTerminal state: COMPLETED, PARTIAL, or FAILED. Branch on this.

The "Gift card created" trigger

Start a workflow every time a gift card is created for a customer, no matter where it came from (manual creation, spreadsheet or URL import, or the Flow action itself). Use it to tag the recipient, add them to a segment, or kick off a thank-you sequence.

Honesty rule. Cards without a recipient do not trigger workflows. This trigger fires only for cards linked to a customer, which is what makes it useful for marketing automations. A card created with no customer attached (for example a bulk batch of unassigned codes for physical printing) simply does not fire it.

Full codes are never exposed. The payload carries the masked last 4 of the code only, never the full gift card code. (The action's return value does return the full code, intentionally, for downstream workflow steps, but a trigger payload never does.)

Avoiding create-on-create loops

Because this trigger fires for every customer-linked card, including cards the Flow action creates, it is possible to wire a workflow that triggers on "gift card created" and then creates another gift card, which fires the trigger again, and so on.

On limited tiers (Starter through Pro) such a loop self-terminates: it runs until it hits your monthly card limit, at which point the action returns the clean "Monthly card limit reached" failure and stops creating cards. On Business (unlimited cards), the hourly safety cap on the Flow action is what stops a runaway loop. Still, design workflows so this trigger does not feed straight back into the action.

Gift card created payload

FieldTypeNotes
customer_idcustomer referenceThe customer the card was created for, the marketing-automation key.
Gift card last fourtextMasked last 4 of the code. Never the full code.
ValuetextCard value as a display string (for example 25.00).
Batch IDtextThe batch the card belongs to.

Deploying and testing

Flow connectors release on a separate schedule from the rest of BatchCard, so after a BatchCard update the action and triggers may appear in the Flow editor a short time after the feature is announced. If you do not see Create gift card for customer or the two triggers yet, check back shortly.

To test:

  1. Build a small Flow workflow with the Create gift card for customer action on a Pro+ store.
  2. Run it against a test customer and confirm the card appears in your Shopify Flow monthly batch.
  3. Check whether the recipient was emailed. That depends on your Send gift card email toggle and any Klaviyo flow.

Troubleshooting

The action failed with "Monthly card limit reached." You have hit your plan's monthly card limit. Upgrade your plan or wait for the next cycle. No card was created.

The action failed with a Pro requirement message. The action is Pro+. Your store is on a lower plan. Upgrade to Pro to use it. No card was created.

The action failed with a "safety limit" message (Business). You have created an unusually high number of cards through the Flow action in the last hour, likely a workflow loop. Creation resumes when the hour rolls over. Review the workflow that is calling the action; see Avoiding create-on-create loops.

The recipient got two emails. Your Send gift card email toggle is on and a Klaviyo flow is emailing on the BatchCard Gift Card Issued event. Turn the toggle off, or stop emailing on the event in Klaviyo. See The double-email footgun.

The recipient got no email even though the card was created. If the customer has no email on file, BatchCard creates the card silently and records the delivery as failed (no email); the workflow still succeeds. Otherwise, check that Send gift card email is on (for Shopify's native email) or that your Klaviyo flow is set up (for a Klaviyo email).

My "Gift card created" workflow never runs. The trigger fires only for cards linked to a customer. Cards created with no recipient do not trigger it. Confirm the cards you expect to fire it actually have a customer attached.

My "Batch completed" workflow didn't fire for Flow-created cards. The monthly "Shopify Flow" batch never fires the Batch completed trigger; its cards fire the per-card Gift card created trigger instead. Batch completed fires for manual, spreadsheet (CSV/XLSX), and URL import batches only.

Ready to try this?

Install BatchCard free.

Ready to try this? Install BatchCard free.

Create bulk gift cards from a CSV or form. Set up your first batch in minutes.

Install Free on Shopify

On this page