I have setup discounts in dashboard, and I'm using dynamic link setup, the idea is to have n number of discount code for affiliate marketing, but 1) generating discount code is not enough ig because i'm using dynamic link so i must hardcode the discount id and discount code in the code itself?? I dont think this is the case, or is it? so any time i generate a new code, i must put that in the code??
Cause as of now, even though my codes are active it doesn't give the option to put the coupon codes in the payment wall. How do i tackle it?
#Discount Code in dynamic link setup.
1 messages · Page 1 of 1 (latest)
To effectively implement discount codes in your dynamic link setup without hardcoding each discount ID and code, you can follow these steps:
-
Dynamic Discount Code Handling: Instead of hardcoding discount codes, consider creating a system where you can dynamically retrieve and apply discount codes based on user input. You can use the Dodo Payments API to fetch active discount codes and their IDs when generating the payment link.
-
API Integration: Use the API to create and manage discount codes. When you generate a dynamic payment link, you can include the discount code as a query parameter. This way, you can easily update or add new discount codes without changing your codebase.
-
Frontend Implementation: On your frontend, create an input field for users to enter their discount code. When the user submits the code, validate it against the active codes using the API. If valid, you can apply the discount to the total amount before redirecting to the payment page.
-
Checkout Page Configuration: Ensure that your checkout page is configured to accept discount codes. If the option is not appearing, check your integration settings to ensure that the discount feature is enabled for your payment links.
-
Testing: Test the entire flow to ensure that users can enter discount codes and that the discounts are applied correctly during the checkout process.
By implementing these steps, you can manage discount codes dynamically without the need to hardcode them each time you create a new one. If you continue to face issues with the discount code not appearing on the payment wall, it may be beneficial to reach out to Dodo Payments support for further assistance.