Welcome to the guide on how to send discounts and promo codes using Retainly. This functionality allows you to automatically send discounts and promo codes to your users. Let’s dive in!
1. Automated Web Hook Creation for Sending Discounts #
Follow these steps to let Retainly automatically create webhooks for your discount sendings:
1. Create a Workflow: Begin with creating a workflow. In this workflow, add the ‘Push discount’ node and access its settings.
2. Setting up the Source: In the Source selector, select the ‘URL’ option. Add the URL of your backend system that will manage the webhook request. Choose the request type (Delete, Get, Post, Put) based on your system setup.
3. Selecting the Discount Period: Choose the discount period either as:
- Till the end of the day.
- Custom settings, where you define how long the discount lasts.
These values will be represented in the webhook as:
"discount_start_date": "timestamp of start date"
"discount_end_date": "timestamp of end date"
4. Setting up the Discount Type:
- Percent: If you choose this option, configure the settings as:
- Discount: Define the discount in percentage.Number of Use: Specify the allowed number of uses for the discount.Priority (Optional): Set a priority number to decide which discount/promo code will be applied first if a customer has multiple.
{
"customer_id": "887274",
"discount_type": "%",
"discount_value": "15",
"discount_start_date": "2023-09-11 14:08:51",
"discount_end_date": "2023-09-13 14:08:51",
"discount_available_tries": "1",
"discount_priority": "1"
}
- Unit: If you choose this option, configure the settings as:
- Currency: Choose the currency for the discount.
- Amount: Define the discount amount.
- Number of Use: Specify the allowed number of uses for the discount.
- Priority (Optional): Set a priority number for the discount/promo code.
Example Request:
{
"customer_id": "887274",
"discount_type": "USD",
"discount_value": "20",
"discount_start_date": "2023-09-14 10:43:03",
"discount_end_date": "2023-09-14 23:59:59",
"discount_available_tries": "2",
"discount_priority": "1"
}
5. Promo Code Activation (Optional): To activate the discount through a promo code, enable the ‘Promo code’ option and select a Promo code template. For guidance on creating promo code templates, you can refer to the detailed guide here.
2. Using Webhook Templates for Sending Discounts #
If you’ve already set up your discounting system and want to use your custom key names, follow these steps:
1. Creating a Webhook Template: Navigate to the ‘Templates’ section in the Sidebar and choose ‘Webhooks’. Click on the ‘create’ button to initiate the webhook template creation.
2. Build the Webhook: Design your webhook request
3. Insert dynamic attributes: For dynamic attributes, refer to the ‘General attributes’ > ‘Discount tab’. Copy and paste the required attribute into your webhook.
4. Integrate with Workflow: Return to your workflow. As done in the URL approach, in the Source selector, choose ‘Webhook’ and then select the webhook template you just created. For a detailed guide on webhook configurations, refer to this page.
5. Finish node settings configuration: The discount configuration does not differ from the URL approach, so follow the steps described above
6. Launch the Workflow: With all the configurations set, launch your workflow. The system will update your webhook with the defined values automatically.
Important Note: While Retainly sends the discount request to the specified URL, the onus of handling these requests lies on your end. If you need assistance, our tech team is always ready to support you.