Promotional Coupon
Streamline Promotional Coupon Handling with Webhooks
Trigger:
Notification:
Response Structure:
{
"data":{
"type": "1:for order,2:for product",
"is_percentage": "boolean", // Indicates whether the discount is a percentage or a fixed amount.
"customer_number": "", // Optional field for customer identification.
"discount_amount": "", //The value of the discount.
"max_discount_amount": "0:unlimit", // The maximum discount allowed (0 represents unlimited).
"allowed_products": [ // Array of product IDs and quantities eligible for the discount (if applicable).
{
"product_id": "",
"quantity": ""
}
],
"button": { // Optional, will perform actions when clicked
"label": { // Text for the button in both Arabic and English.
"ar": "string",
"en": "string"
},
"url": "", // The URL to be triggered when the button is clicked, carrying all parameters as GET.
"close_modal": "boolean" // Boolean indicating whether to close the coupon modal upon button click.
}
},
"errors": [] // An empty array, signifying a successful validation.
}
{
"data":[], // Optional, may contain additional information.
"message": "Reward 1234 has been used", // A human-readable error message.
"errors": ["merchant doesn't exist"] // Array of specific error details.
}
Integration Considerations:
Handle button customization: Respect the provided button configuration for a seamless user experience.
Error handling: Implement robust mechanisms to gracefully manage invalid responses and communicate errors to the user.
Logging: Maintain detailed logs of webhook events for troubleshooting and auditing purposes.
By effectively leveraging this webhook, you'll create a dynamic and user-friendly experience for handling promotional coupons within your RETM integration.
Modified at 2023-12-25 01:36:26