RETM | REST API
  1. Loyalty Webhooks
RETM | REST API
  • Developer guide
  • New to our DevPortal 🤔
  • Authentication
    • Token
      POST
  • Webhook
    • Overview
    • Invoice Webhooks
      • Webhook Events
      • Invoice Created
    • Orders Webhooks
      • Webhook Events
      • Order Triggeres
    • Menu Webhooks
      • Menu Updates
      • Menu Changed
    • Loyalty Webhooks
      • Promotional Coupon
      • Check Reward
        POST
      • Redeem Reward
        POST
    • Customer webhook
      • Customer Data
      • Customer hook
    • Error webhook
      • Stay Alert to Connectivity Issues
      • Error webhook
  • Orders
    • Orders
      GET
    • Create Order
      POST
    • Cancel Order
      POST
    • Update delivery order status
      POST
  • Menu
    • Categories
      • List Categories
      • Single Categoy
    • Products
      • Products
      • Single Product
      • Simple List
    • Menu
      GET
  • Branches
    • Branches
      GET
  • Devices
    • Devices
      GET
  • Order type
    • Order types
      GET
    • Create order type
      POST
  • Price Lists
    • Price Lists
  • Payment Methods
    • Payment methods
    • Create pay method
  • Order Charges
    • order charges
    • Create order charges
  • Taxes
    • Tax list
    • Create tax
  • Customers
    • Customers
  1. Loyalty Webhooks

Promotional Coupon

Streamline Promotional Coupon Handling with Webhooks#

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:#

Valid Response (2xx OK)
{
    "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.
 }
Invalid Response (400 BAD REQUEST)
{
    "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:#

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.
Modified at 2023-12-25 01:36:26
Previous
Menu Changed
Next
Check Reward
Built with