The Generate discount code node automatically creates a unique discount code in your Shopify store, which you then send to the customer on WhatsApp.
Unlike static codes (e.g. WELCOME10) that often end up on coupon sites, dynamic codes are:
Unique: each customer gets their own code, usable only once.
Time-limited: you can set a validity period to create a sense of urgency.
In the automation editor, click Add an Action.
Select Generate discount code.
Place this node right before the message that should contain the code.
Click the node to open its settings.
Kanal generates the code in the PREFIX-XXXXXX format: your prefix, a dash added automatically, then 6 random characters. The default prefix is KANAL. Type your prefix without a dash: PROMO, not PROMO-.
Percentage: from 1 to 100%.
Fixed amount: entered in euros. The discount is always in EUR, whatever your store currency.
Choose how long the customer can use the code: 24 hours, 7 days, 30 days or unlimited. Expiration is calculated in UTC, which means a 1 to 2 hour offset compared with French time.
Keep the automatic option (from the trigger) or choose a specific store if you have several. Save your settings.
These rules are fixed and cannot be changed:
one use in total, once per customer;
valid on all products, for all customers;
combinable with product and shipping discounts, but not with order discounts;
also applied to subscriptions when possible.
Each Generate discount code node creates its own variables, ending with the node ID (e.g. 4e205834b2):
{{variables.voucher_code_ID}}: the generated code (e.g. PROMO-XXXXXX).
{{variables.voucher_value_ID}}: the discount value, shown as "15%" or "10.00 EUR".
{{variables.voucher_expires_ID}}: the expiration date, in DD/MM/YYYY HH:MM format (UTC), or "Unlimited" with no expiration.
Which message should you use?
If a conversation window is open (after a customer message or a click on a template button), connect the node to a Send Message and insert the variables in the text.
Otherwise (Abandoned Cart, Post Purchase), use a Send Template and map its variables to the code with the variable picker.

"Hi! To thank you for your interest, here is a gift just for you:
Your discount code: {{variables.voucher_code_4e205834b2}}
Worth {{variables.voucher_value_4e205834b2}}
Valid until {{variables.voucher_expires_4e205834b2}}. Enjoy!"
When the contact reaches the node, Kanal generates the code and creates it in your Shopify store with the rules above.
The code appears in your Shopify admin, in the Discounts section.
Kanal inserts the code into the WhatsApp message sent to the customer.
If the same contact goes through this node again during the same journey in the flow, they get the same code.
If the code cannot be created, the rest of the flow does not run: no message is sent with an empty code.
Tip: combine this node with a Wait time. For example, wait 1 hour after a cart is abandoned before generating and sending a 10% code valid for 24 hours.