I need a developer to build a custom app that triggers on fulfillment, generates a unique discount code, adds it to a discount group via the Shopify API, writes it to a customer metafield, and sends an email.
This is standard API work: a fulfillment webhook to trigger it, the discount API to create the code and add it to your group, a metafield write, then the email. Worth deciding before you collect quotes whether the email goes through your existing email tool or straight from the app, and whether the codes need an expiry or usage limit, since those affect the price and are annoying to retrofit later. Let me know.
Order subtotal > = to your minimum (the screenshot uses 50), and the order has a customer.
Create the unique code
Add a “Send Admin API request” action.
its mutation list does not include discountRedeemCodeBulkAdd, so use discountCodeBasicCreate instead. It makes a fresh code discount per order.
In the JSON
set code to something unique like LOYALTY-{{order.customer.id}}-{{order.number}},
add the amount off and a minimum spend,
set endsAt for the 90 day expiry,
appliesOncePerCustomer or usageLimit for single use.
To stack every code under one existing discount instead of a new one for each customer, use the “Send HTTP request” action instead of Admin API (Grow plan or higher). It posts raw GraphQL, so it can call discountRedeemCodeBulkAdd against your existing discount ID.
Install the free Shopify Email app and it adds a “Send email” action to Flow.
Or use your email tool’s Flow connector like Klaviyo or Omnisend.
Note: Shopify Email only sends to customers who opted into marketing. To reach everyone who ordered, send the code transactional instead - post to Postmark (or any transactional email service like postmark) from the “Send HTTP request” action.
Note: it is generic reply based on what information you provided publicly on this forum. I didn’t include any information you had given me over private dm. If u want the solution to include those information as well. Ask here.