POST https://webhook.example.com

Headers

  • Content-Type string

    Default value is application/json.

  • Accept string

    Default value is application/json.

  • User-Agent string

    Default value is Deliverect/{version}.

  • X-Server-Authorization-HMAC-SHA256 string

    Default value is {signature}.

application/json

Body

  • order object
  • accountId string

    The merchant's account ID in Deliverect

  • loyaltyProfileId string

    The Id of the profile where the response configuration was stored

  • locationId string

    The location ID related to the merchant's account in Deliverect

  • channelLinkId string

    The channel link ID related to the location of the merchant's account in Deliverect

Responses

  • 200 application/json

    200

  • 400 application/json

    400

POST /loyalty-programs
Request example
{
  "order": {
    "account": "6403c0b9ea6956b6f6970c5b",
    "location": "6403c0baea6956b6f6970c5c",
    "channelLinkId": "6403c0baea6956b6f6970c5c",
    "orderType": 3,
    "customer": {
      "email": "loyalty@customer.com",
      "phoneNumber": "+31201234567",
      "name": "John Doe"
    },
    "items": [
      {
        "plu": "CMB-02",
        "name": "Vegetarian Rames",
        "price": 1700,
        "quantity": 1,
        "subItems": [
          {
            "plu": "VEG-01",
            "name": "Vegetables Sayur Lodeh",
            "price": 0,
            "quantity": 1,
            "subItems": []
          },
          {
            "plu": "VEG-02",
            "name": "Vegetables Mix Tumisan",
            "price": 0,
            "quantity": 1,
            "subItems": []
          }
        ]
      }
    ],
    "discounts": [
      {
        "name": "Amount discount",
        "programId": "1234",
        "type": "discount_amount",
        "amount": 100
      }
    ],
    "subTotal": 1700,
    "discountTotal": -100,
    "paymentAmount": 1600,
    "decimalDigits": 2
  }
}
Response examples (200)
[
    {
        "programId":"1",
        "title":"Discount",
        "description":"Discount amount for the order.",
        "cost":100,
        "type":"discount_amount",
        "discount":100,
        "applicable": true
    },
    {
        "programId":"2",
        "title":"Free item",
        "description":"Get an item for free.",
        "cost": 500,
        "type":"free_item",
        "itemPLU":"DRN-01",
        "media":{
            "url":"https://program.media/image",
            "mediaType":"image"
        },
        "applicable": false
    },
    {
        "programId":"3",
        "title":"Buy one get one for free",
        "description":"Order an item and get another one for free.",
        "cost": 100,
        "type":"buy_one_get_one_free",
        "itemPLU":"DRN-02",
        "media":{
            "url":"https://program.media/image",
            "mediaType":"image"
        },
        "applicable": true
    },
    {
        "programId": "4",
        "title": "50% Order percent off",
        "type": "discount_percentage",
        "applicable": true,
        "description": "Get 50% OFF the order",
        "cost": 200,
        "media": {
            "url": "https://res.cloudinary.com/punchh/image/upload/c_limit,f_auto,fl_lossy,g_center,q_auto/v1/punchhstatic-mothership2/redeemables/redeemable_images/000/036/785/original/dd4c98899742473e80ac703670279794ead73e36.png",
            "mediaType": "image"
        },
        "expiresAt": null,
        "discount": 100,

       
    },
  {
        "programId": "5",
        "title": "Coke $10 off",
        "type": "item_discount_amount",
        "applicable": true,
        "description": "To quench your thirst!",
        "cost": 150,
        "media": {
            "url": "https://image.npg",
            "mediaType": "image"
        },
        "expiresAt": null,
        "discount": 1000,
        "itemPLU": "1282933778"
  },
   {
        "programId":"6",
        "title": "Coke 50% off",
        "type": "item_discount_percentage",
        "applicable": true,
        "description": "To quench your thirst!",
        "cost": 150,
        "media": {
            "url": "https://image.npg",
            "mediaType": "image"
        },
        "expiresAt": null,
        "discount": 5000,
        "itemPLU": "1282933778"
    }

]
Response examples (400)
{}