Here's a comprehensive guide to effectively utilizing the promotional coupon webhook:Trigger:#
A user enters a promotional coupon code within the RETM POS app.Notification:#
RETM sends a POST request to your designated notification URL, containing the following request parameters:reward_code: The unique code of the entered coupon.
business_reference: The identifier of the restaurant where the coupon was applied.
Response Structure:#
{
"data":{
"type": "1:for order,2:for product",
"is_percentage": "boolean",
"customer_number": "",
"discount_amount": "",
"max_discount_amount": "0:unlimit",
"allowed_products": [
{
"product_id": "",
"quantity": ""
}
],
"button": {
"label": {
"ar": "string",
"en": "string"
},
"url": "",
"close_modal": "boolean"
}
},
"errors": []
}
Invalid Response (400 BAD REQUEST)
{
"data":[],
"message": "Reward 1234 has been used",
"errors": ["merchant doesn't exist"]
}
Integration Considerations:#
Process coupon data: Extract relevant information from the response to apply discounts, display messages, or guide user actions.
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.