---
title: "Send a Discount Code by Instagram DM Until the Sale Ends"
titleOverride: "Instagram DM Keyword Replies for Time-Limited Discount Codes"
pubDate: 2026-12-02
minutesToRead: 8
description: "Set up an Instagram DM keyword auto-reply that sends a discount code during your sale. After the cutoff, it answers follow-ups without repeating the code."
author:
  name: Piotr Grudzień
  image: /blog-assets/authors/piotr_grudzien.jpg
image:
  url: /blog-assets/posts/instagram-dm-keyword-offer-code_bg.webp
  alt: "A porcelain mixing dish beside two Instagram replies. One gives DISH15. The next explains that the sale has ended."
tags: [tutorials]
articleCta:
  title: "Try it with one offer from your shop"
  subtitle: "Pick a keyword, a checkout code and a closing time for the sale."
  button: "Create your practice Agent"
  href: https://app.quickchat.ai/register
faq:
  - question: "How do I send a discount code when someone DMs an Instagram keyword?"
    answer: "Connect an Instagram Business or Creator account to Quickchat AI. Put the keyword in the Main Prompt and the code in a Procedure. Give the Procedure two time conditions so the Agent receives the offer instructions only during the sale."
  - question: "Can I schedule Instagram DM replies in my shop’s time zone?"
    answer: "Enter an opening and closing timestamp with an explicit offset, or use UTC. Quickchat compares the instants. For example, 18:00 in Warsaw on 30 November 2026 is 17:00 UTC. Use the offset that applies on the actual sale date."
  - question: "What happens to an Instagram discount code the shopper already received?"
    answer: "The old message stays in Instagram. The next reply can explain that the code is unavailable. Set the same expiry, eligible item and discount in your store to control whether the shopper can redeem a saved code at checkout."
  - question: "Will commenting the keyword on an Instagram post trigger this reply?"
    answer: "This setup starts when a shopper sends a direct message to the shop. Put “DM WELLWEEK” in the caption so people know to open the conversation. A keyword in a public comment needs a separate comment-to-DM workflow."
  - question: "Does Instagram’s 24-hour messaging window extend the discount?"
    answer: "No. Instagram’s messaging window governs when the business can reply. Everyone in this campaign shares the opening and closing times set in Quickchat and in the shop’s checkout promotion."
howto:
  - name: "Choose the keyword, item and deadline"
    text: "Pick the offer, set the same limits in checkout and write the opening and closing instants with an explicit time-zone offset."
  - name: "Give the Agent its Instagram instructions"
    text: "Create a practice Agent, then put the keyword and the outside-window reply in Identity under Main Prompt."
  - name: "Keep the code inside a time-limited Procedure"
    text: "Select When metadata matches. Use the built-in current timestamp in both rows. Include the opening instant and exclude the closing instant."
  - name: "Test the code on both sides of the deadline"
    text: "Send the keyword in AI Preview, then ask for the code again in the same conversation after the cutoff. Check the single-item restriction and an unrelated question too."
  - name: "Read the delivered replies in Instagram"
    text: "Connect the shop’s Professional account and send both messages from a separate shopper account. Match the Instagram thread with Quickchat AI Inbox."
---

A watercolorist spots a porcelain mixing dish on Instagram. The caption says **“DM WELLWEEK for 15% off.”** She sends `wellweek` and gets the code. Later, with the dish in her cart and the old reply on her phone, she asks **“Is it still good?”**

Build an Instagram DM keyword auto-reply in Quickchat AI that gives her the code while the sale is open. Quickchat checks its own clock for every reply, including a follow-up that leaves out the keyword. At the closing instant the Agent stops receiving the offer instructions.

<figure class="tutorial-context tutorial-compact" style="--capture-width: 45rem; --capture-ratio: 1440 / 672; --phone-ratio: 780 / 952" id="instagram-replies">

<picture><source media="(max-width: 30rem)" srcset="/blog-assets/posts/wellweek/replies-mobile.webp" width="780" height="952">![The shopper’s Instagram chat shows DISH15 in the 17:22 reply. At 22:55, the same shop says no code is available and gives the sale dates.](https://quickchat.ai/_astro/replies.D2MXwYg0_Kccgt.webp)</picture>

<figcaption><span>For this Instagram test, the shop closed the offer at 18:00 in Warsaw on 1 December (17:00 UTC). The shopper can still see DISH15 in the earlier reply.</span></figcaption>
</figure>

You’ll need a Quickchat AI account with credits for test replies, an Instagram **Business or Creator** account you manage, and a second Instagram account to play the shopper. Start with a practice Agent and a test shop. You can try the conversation in Quickchat before connecting Instagram. Commercial use requires a paid plan. [Quickchat AI plans](https://quickchat.ai/docs/pricing-and-plans)

## 1. When should an Instagram DM include the discount code?

WELLWEEK studio sells a five-well porcelain mixing dish for watercolor. Its example promotion gives **15% off a single dish bought online**. Sets have their own price. The shop wants the code in a reply sent at 16:59:59 UTC on the last day. One second later, a shopper reopening the thread should get the dates of the sale.

1. Pick a keyword someone can type on a phone. Our caption says **DM WELLWEEK**. The code they receive is a different word, `DISH15`.
2. Set up a promotion in your shop with that code, eligible item, percentage and closing time. The checkout decides whether an old code still works. For a trial run, use a test store or a code with no value.
3. Write down the opening and closing instants. For your first run, use today and a cutoff several minutes in the future so you can receive both replies. In our example they are `2026-11-23T00:00:00Z` and `2026-11-30T17:00:00Z`. The `Z` means UTC. At a Warsaw shop the closing instant is `2026-11-30T18:00:00+01:00`. Both forms describe the same moment. Check the offset for the sale date, especially around a change of clocks.

<figure class="tutorial-context tutorial-compact" style="--capture-width: 45rem; --capture-ratio: 1440 / 504; --phone-ratio: 780 / 516">

<picture><source media="(max-width: 30rem)" srcset="/blog-assets/posts/wellweek/timeline-mobile.webp" width="780" height="516">![An illustrated timeline for the 15% WELLWEEK sale. The first instant on 23 November is included. The instant the clock reaches 17:00 UTC on 30 November is outside the offer.](https://quickchat.ai/_astro/timeline.C6UL0es6_lkd1H.webp)</picture>

<figcaption><span>The code becomes available at opening. At the exact closing instant, Quickchat leaves the sale instructions out of the Agent’s reply context.</span></figcaption>
</figure>

## 2. How does the Agent recognize an Instagram keyword and its follow-ups?

Put the keyword and the reply style in the Agent’s **Main Prompt**. A shopper can ask again without typing `WELLWEEK` twice. Keep the code and terms for the Procedure in step 3 so that the Main Prompt never supplies a code by itself.

1. Create a Quickchat AI account. Use the new Agent or open the Agent switcher and choose **Add new AI Agent → Set up manually**. In **AI Agent → Identity**, name it **WELLWEEK studio**. [Create a Quickchat AI account](https://app.quickchat.ai/register)
2. Under **AI Persona**, open **Main Prompt**. Paste the instructions below and save. Replace the two human-readable dates when you change the sale window.

<figure class="tutorial-context tutorial-compact" style="--capture-width: 45rem; --capture-ratio: 1440 / 852; --phone-ratio: 780 / 910">

<picture><source media="(max-width: 30rem)" srcset="/blog-assets/posts/wellweek/identity-mobile.webp" width="780" height="910">![The WELLWEEK studio Main Prompt on the Identity page tells the Agent how to answer follow-up questions about the sale.](https://quickchat.ai/_astro/identity.Cy8Qq16S_Z2mRRfA.webp)</picture>

<figcaption><span>The Main Prompt stays with the Agent for every reply. Keep the keyword and the fallback dates here so an early or late shopper still gets an answer.</span></figcaption>
</figure>

<details class="tutorial-artifact">
<summary>Copy the Main Prompt for WELLWEEK studio</summary>

```text
You answer Instagram DMs for WELLWEEK studio, an art-supply shop. Treat WELLWEEK in any letter case as a request for the offer. A later question such as “Is it still good?” in the same thread also counts. Give a discount code only if the offer instructions active for this reply provide one. Never take a code from an earlier message, including one the shopper quotes. If the offer instructions are inactive, say that no code is available now and give the scheduled window from 23 November 2026 at 00:00 UTC until 30 November 2026 at 17:00 UTC. Keep replies short. For unrelated questions, answer only what you know.
```

</details>

The fallback gives the full scheduled window. It works both for an early shopper who arrives before the first day and for a late shopper who has the old code in the thread.

## 3. How do you turn the discount code on and off automatically?

Put the code in **one Procedure**. Choose **When metadata matches** so Quickchat checks the opening and closing times before it gives the Agent those instructions. The shop’s clock decides whether the Procedure is active. The shopper’s message decides whether the active offer is relevant. [How Procedures work](https://quickchat.ai/docs/ai-agent/procedures#schedule-a-promotion)

1. Open **AI Agent → Procedures → New procedure**. Name it `WELLWEEK offer`.

<figure class="tutorial-context tutorial-compact" style="--capture-width: 45rem; --capture-ratio: 1440 / 856; --phone-ratio: 780 / 692">

<picture><source media="(max-width: 30rem)" srcset="/blog-assets/posts/wellweek/procedure-entry-mobile.webp" width="780" height="692">![Procedures is selected in the sidebar. The New procedure button appears at the top of the page.](https://quickchat.ai/_astro/procedure-entry.CDd2meQW_Z1RLc9S.webp)</picture>

<figcaption><span>Open Procedures in the same Agent where you saved the Main Prompt. New procedure opens an editor for one set of instructions.</span></figcaption>
</figure>

2. Under **When should the AI use it?**, choose **When metadata matches**. This tells Quickchat to evaluate your two conditions on every reply.

<figure class="tutorial-context tutorial-compact" style="--capture-width: 45rem; --capture-ratio: 1440 / 958; --phone-ratio: 780 / 940">

<picture><source media="(max-width: 30rem)" srcset="/blog-assets/posts/wellweek/mode-mobile.webp" width="780" height="940">![The WELLWEEK offer editor with the automatic When metadata matches option selected.](https://quickchat.ai/_astro/mode.D9CSjOe4_ZvkdXK.webp)</picture>

<figcaption><span>The selected option activates this Procedure whenever all conditions match. Next, add the first condition under it.</span></figcaption>
</figure>

3. Choose **Add condition**. In **Metadata key**, open the braces picker and select **Built-in → current_timestamp**. The field should read `{{current_timestamp}}`, including both pairs of braces. [Quickchat’s built-in variables](https://quickchat.ai/docs/ai-agent/variables)

<figure class="tutorial-context tutorial-compact" style="--capture-width: 45rem; --capture-ratio: 1440 / 678; --phone-ratio: 780 / 890">

<picture><source media="(max-width: 30rem)" srcset="/blog-assets/posts/wellweek/picker-mobile.webp" width="780" height="890">![The condition field picker shows current_timestamp under Built-in.](https://quickchat.ai/_astro/picker.CFrg3EDH_Kbeff.webp)</picture>

<figcaption><span>Choose the timestamp from Built-in. Quickchat supplies the value when it prepares each reply.</span></figcaption>
</figure>

4. Choose **is at least** and enter `2026-11-23T00:00:00Z`. Add another condition, pick the same built-in timestamp, choose **is less than**, and enter `2026-11-30T17:00:00Z`. Quickchat requires both rows to match.

| Metadata key | Comparison | Value in this example |
| --- | --- | --- |
| `{{current_timestamp}}` | **is at least** | `2026-11-23T00:00:00Z` |
| `{{current_timestamp}}` | **is less than** | `2026-11-30T17:00:00Z` |

<figure class="tutorial-context tutorial-compact" style="--capture-width: 45rem; --capture-ratio: 1440 / 582; --phone-ratio: 780 / 864">

<picture><source media="(max-width: 30rem)" srcset="/blog-assets/posts/wellweek/conditions-mobile.webp" width="780" height="864">![Two native conditions on current_timestamp. The first reads is at least the opening timestamp, and the second reads is less than the closing timestamp.](https://quickchat.ai/_astro/conditions.DYT7OlpB_Z1tPQgL.webp)</picture>

<figcaption><span>Read the rows together. The first includes the instant the shop opens the offer. The second excludes the instant it closes.</span></figcaption>
</figure>

5. Paste the following in **Instructions**. Keep the Procedure enabled and choose **Save**. When you run your own sale, replace the code, eligible item, discount and deadline here.

<details class="tutorial-artifact">
<summary>Copy the instructions for the WELLWEEK offer</summary>

```text
When a shopper asks for WELLWEEK or follows up about this sale, offer 15% off a single five-well porcelain mixing dish bought online. Give DISH15 as the checkout code. Sets are excluded. Say the offer ends on 30 November 2026 at 17:00 UTC. If they ask about a set, explain which item qualifies. Skip the offer on unrelated questions.
```

</details>

<figure class="tutorial-context tutorial-compact" style="--capture-width: 45rem; --capture-ratio: 1440 / 852; --phone-ratio: 780 / 934">

<picture><source media="(max-width: 30rem)" srcset="/blog-assets/posts/wellweek/instructions-mobile.webp" width="780" height="934">![The WELLWEEK offer’s Instructions field, the Enable switch and Save in the Quickchat Procedure editor.](https://quickchat.ai/_astro/instructions.B230n-_n_Anr5w.webp)</picture>

<figcaption><span>The code lives next to the eligible product and exclusions. The Agent receives those instructions together while both conditions match.</span></figcaption>
</figure>

The Agent can now answer which dish qualifies. If you also want it to check a shopper’s size against current inventory, connect the product catalog separately. [Checking Shopify inventory in Instagram DMs](https://quickchat.ai/post/instagram-dm-shopify-size-chart)

<details class="tutorial-reference">
<summary>Set up the Main Prompt and Procedure with ChatGPT or Claude</summary>

Connect your Quickchat account to either assistant. Paste this request along with the two instruction blocks above and your own opening and closing timestamps. The shop owner signs in to Instagram in step 5. [Account setup guide](https://quickchat.ai/docs/manage-with-ai) · [Quickchat AI for ChatGPT](https://chatgpt.com/plugins/plugin_asdk_app_6a4656c688748191be4c5247fb0d5dfc) · [Quickchat AI for Claude](https://claude.ai/directory/connectors/app-quickchat-ai)

```text
Find my WELLWEEK studio practice Agent in Quickchat AI and confirm the Agent with me.
Use my opening and closing timestamps, including their UTC offsets. Put those dates in the supplied Main Prompt and save it.
On this Agent, update the Procedure named WELLWEEK offer, or create it once if it is missing. If several match, ask which one to update.
Select When metadata matches. Require both conditions together.
  {{current_timestamp}} is at least my opening timestamp
  {{current_timestamp}} is less than my closing timestamp
Use my closing time in the supplied offer instructions. Keep the code in this Procedure only. Save the instructions and enable the Procedure with both conditions in place.
Read back the saved Main Prompt, offer instructions and both conditions with their timestamps. Ask before running a test that uses credits.
```

</details>

<a id="test-follow-up"></a>

## 4. How do you test an expired code in the same Instagram conversation?

The revealing test is the second message. The first reply still contains the code, and the shopper’s clock still says “before five.” A new reply should follow the shop’s cutoff even with both pieces of conversation history in view.

1. In **WELLWEEK offer**, set the opening a few minutes in the past and the cutoff several minutes ahead. Put that test window in the Main Prompt and the matching deadline in the Procedure instructions. Save both changes.
2. Open **AI Preview**, start a new conversation and send `wellweek`. Check that the reply gives `DISH15`, 15%, the single-dish restriction and the right UTC deadline.
3. Wait until the **server cutoff**. Stay in the same thread and send `Is it still good? It’s before five here.` Inspect just the new reply. It should say the code is unavailable and give the schedule. The earlier reply remains visible.

<figure class="tutorial-context tutorial-compact" style="--capture-width: 45rem; --capture-ratio: 1440 / 678; --phone-ratio: 780 / 910">

<picture><source media="(max-width: 30rem)" srcset="/blog-assets/posts/wellweek/local-thread-mobile.webp" width="780" height="910">![A local Quickchat AI Inbox conversation for the practice shop. The first reply gives the code. The next reply in the same thread says it is unavailable.](https://quickchat.ai/_astro/local-thread.mdMBhr_S_Z1BIjRP.webp)</picture>

<figcaption><span>This conversation ran through Quickchat’s local Instagram handler with the platform clock set on either side of the cutoff. The first reply still contains the code. The second leaves it out.</span></figcaption>
</figure>

**One comparison changes the result at exactly 17:00.** We replayed the same follow-up at the cutoff with the closing row set to **is at most**. The Agent still offered `DISH15`. We restored **is less than** and replayed it at the identical instant with the same earlier messages. The new reply said “No code is available now.” This is why the closing row uses a strict comparison.

<figure class="tutorial-context tutorial-compact" style="--capture-width: 45rem; --capture-ratio: 1440 / 730; --phone-ratio: 780 / 856">

<picture><source media="(max-width: 30rem)" srcset="/blog-assets/posts/wellweek/cutoff-test-mobile.webp" width="780" height="856">![Two saved Quickchat simulation replies at the identical closing instant. The inclusive cutoff still gives DISH15. The strict cutoff withholds it.](https://quickchat.ai/_astro/cutoff-test.Dp6lgY8c_1Hq4nH.webp)</picture>

<figcaption><span>Both runs used the same earlier reply and the same clock. Including the cutoff allowed one last code at exactly 17:00. The strict cutoff removed it.</span></figcaption>
</figure>

4. Try `Can I use WELLWEEK on a set?` while the sale is open. The reply should explain that only a single dish qualifies. In a fresh chat, try `How much does the dish cost?` The Agent has no price in this setup and should keep the coupon out of the answer. To repeat these opening questions, open **Conversations → Testing → Create Dataset → Paste messages**. Put `---` on its own line between each message, choose **Create**, then **Run → Start Run**. Each dataset message starts a fresh conversation. [Testing conversations in Quickchat AI](https://quickchat.ai/docs/conversations/testing)

<figure class="tutorial-context tutorial-compact" style="--capture-width: 45rem; --capture-ratio: 1440 / 754; --phone-ratio: 780 / 852">

<picture><source media="(max-width: 30rem)" srcset="/blog-assets/posts/wellweek/testing-mobile.webp" width="780" height="852">![Quickchat AI’s Testing page with the WELLWEEK dataset, its opening messages and the Run control.](https://quickchat.ai/_astro/testing.22C7K41u_YNCuH.webp)</picture>

<figcaption><span>Each dataset message starts a new conversation. Test the returning shopper separately so the old code is still present in the thread.</span></figcaption>
</figure>

<figure class="tutorial-context tutorial-compact" style="--capture-width: 45rem; --capture-ratio: 1440 / 702; --phone-ratio: 780 / 810">

<picture><source media="(max-width: 30rem)" srcset="/blog-assets/posts/wellweek/eligibility-mobile.webp" width="780" height="810">![Saved Quickchat replies to the set and price questions. One explains that only a single dish qualifies. The other says the Agent has no price.](https://quickchat.ai/_astro/eligibility.BwtbdP8N_ZrgF9M.webp)</picture>

<figcaption><span>The sale was open for both questions. The single-dish restriction belongs in the offer answer. An unrelated price question drew a short answer without a coupon.</span></figcaption>
</figure>

## 5. How do you verify that the replies actually reach Instagram?

Use the shop account to connect the channel and a different account to receive its messages. Give yourself a fresh test window in the Agent before you start, and note the cutoff on your phone in local time.

1. In the shop’s Agent, go to **External Apps → Instagram → Connect to Instagram**. Check which Professional account Instagram is using before you authorize **Access and manage messages**. In Quickchat, confirm the displayed **@username** and that **Enable Instagram** is on. [Connect the Instagram channel](https://quickchat.ai/docs/channels/instagram)

<figure class="tutorial-context tutorial-compact" style="--capture-width: 45rem; --capture-ratio: 1440 / 900; --phone-ratio: 780 / 780">

<picture><source media="(max-width: 30rem)" srcset="/blog-assets/posts/wellweek/connect-mobile.webp" width="780" height="780">![Quickchat’s Connect to Instagram button, Instagram’s Allow screen and the shop’s channel showing Connected and Enabled.](https://quickchat.ai/_astro/connect.D5ldnag7_Z1R9kE.webp)</picture>

<figcaption><span>If the shop has authorized Quickchat before, Instagram asks whether to keep sharing. Choose Allow. When Quickchat shows “Waiting for your first DM,” switch to the shopper’s account.</span></figcaption>
</figure>

2. On your phone, switch to the shopper account, open the shop’s profile and tap **Message**. Send `wellweek` during the test window. Check the item, code and deadline in the reply delivered to Instagram.
3. After the cutoff, open the **same Instagram thread** and ask `Is it still good?`. Read the new reply. Open **Conversations → Inbox** in Quickchat and match the shopper’s two messages and the replies. [See the two replies on the shopper’s phone](#instagram-replies). [Instagram auto-replies and Inbox](https://quickchat.ai/post/instagram-ai-chatbot-answer-dms)
4. In **Details**, check that **Channel** shows **Instagram**. Under the reply sent after the deadline, select **Why AI said that**.

<figure class="tutorial-context tutorial-compact" style="--capture-width: 45rem; --capture-ratio: 1440 / 848; --phone-ratio: 780 / 768">

<picture><source media="(max-width: 30rem)" srcset="/blog-assets/posts/wellweek/instagram-inbox-mobile.webp" width="780" height="768">![The Instagram channel, the 10:55 PM reply and its explanation in Quickchat AI Inbox.](https://quickchat.ai/_astro/instagram-inbox.Cb0v5gub_28KJm5.webp)</picture>

<figcaption><span>The shop’s reply at 22:55 appears as 10:55 PM in Inbox. Under Fields used, the explanation lists Main Prompt.</span></figcaption>
</figure>

When you’re ready to put **DM WELLWEEK** on a post, restore the sale dates in both places in Quickchat, and check the promotion in your store with one eligible dish, a set and an expired code. Someone who saved the post will have a way to find out what still applies.

## Instagram DM keyword and discount code FAQ

### How do I send a discount code when someone DMs an Instagram keyword?

Connect an Instagram Business or Creator account to Quickchat AI. Put the keyword in the Main Prompt and the code in a Procedure. Give the Procedure two time conditions so the Agent receives the offer instructions only during the sale.

### Can I schedule Instagram DM replies in my shop’s time zone?

Enter an opening and closing timestamp with an explicit offset, or use UTC. Quickchat compares the instants. For example, 18:00 in Warsaw on 30 November 2026 is 17:00 UTC. Use the offset that applies on the actual sale date.

### What happens to an Instagram discount code the shopper already received?

The old message stays in Instagram. The next reply can explain that the code is unavailable. Set the same expiry, eligible item and discount in your store to control whether the shopper can redeem a saved code at checkout.

### Will commenting the keyword on an Instagram post trigger this reply?

This setup starts when a shopper sends a direct message to the shop. Put “DM WELLWEEK” in the caption so people know to open the conversation. A keyword in a public comment needs a separate comment-to-DM workflow.

### Does Instagram’s 24-hour messaging window extend the discount?

No. Instagram’s messaging window governs when the business can reply. Everyone in this campaign shares the opening and closing times set in Quickchat and in the shop’s checkout promotion.
