POST /loyalty/{channelLinkId}/programs/retrieve

Path parameters

  • channelLinkId string Required
application/json

Body

  • order object Required

    For the full order schema, please refer to Glossary - Channel Orders

    Hide order attributes Show order attributes object
    • orderType integer(int32)

      The type of the order (Pickup, Delivery, Eat-in)

    • items object
      Hide items attributes Show items attributes object
      • plu string
      • name string
      • price integer(int32)
      • quantity integer(int32)
      • subItems object
    • customer object
      Hide customer attributes Show customer attributes object
      • email string
      • phoneNumber string
      • name string
    • decimalDigits integer(int32)

      number of decimal for the order currency

    • subTotal integer(int32)
    • payment object
      Hide payment attribute Show payment attribute object
      • amount integer(int32)

Responses

  • 200 application/json

    200

    Hide response attributes Show response attributes object
    • programId string
    • title string
    • description string
    • cost integer

      Default value is 0.

    • type string
    • discount integer

      Default value is 0.

    • applicable boolean

      Default value is true.

    • expiresAt string
  • 400 application/json

    400

    Hide response attributes Show response attributes object
    • error string
    • http_code integer

      Default value is 0.

    • description string
POST /loyalty/{channelLinkId}/programs/retrieve
curl \
 --request POST 'https://api.staging.deliverect.com/loyalty/{channelLinkId}/programs/retrieve' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"order":{"items":[{"_id":"620d19e940411b30c49b1005","plu":"BEEF-02","name":"Beef Opor","price":1100,"quantity":1,"deliveryTax":9000,"productType":1}],"payment":{"type":3,"amount":1100},"customer":{"email":"customer@loyalty.com","phoneNumber":"+31201234567"},"subTotal":1100,"orderType":1,"decimalDigits":2}}'
Request examples
{
  "order": {
    "items": [
      {
        "_id": "620d19e940411b30c49b1005",
        "plu": "BEEF-02",
        "name": "Beef Opor",
        "price": 1100,
        "quantity": 1,
        "deliveryTax": 9000,
        "productType": 1
      }
    ],
    "payment": {
      "type": 3,
      "amount": 1100
    },
    "customer": {
      "email": "customer@loyalty.com",
      "phoneNumber": "+31201234567"
    },
    "subTotal": 1100,
    "orderType": 1,
    "decimalDigits": 2
  }
}
{
  "order": {
    "customer": {
      "email": "customer@loyalty.com",
      "phoneNumber": "+31201234567"
    },
    "orderType": 1
  }
}
Response examples (200)
[
    {
        "programId":"1234",
        "title":"$10 off order",
        "description":"Discount amount off the order",
        "cost":100,
        "type":"discount_amount",
        "discount":1000,
        "applicable": true,
        "expiresAt": "2024-12-31 23:59:59.000000",
        "media": null
    
    },
    {
        "programId":"4578",
        "title":"50% off order",
        "description":"Discount percentage off the order.",
        "cost":100,
        "type":"discount_percentage",
        "discount":5000,
        "applicable": true,
        "expiresAt": "2024-12-31 23:59:59.000000",
        "media": null

    
    },
    {
        "programId":"765",
        "title":"Free item",
        "description":"Get an item for free.",
        "cost":200,
        "type":"free_item",
        "itemPLU":"DRN-01",
        "media":{
            "url":"https://program.media/image",
            "mediaType":"image"
        },
        "applicable": true,
        "expiresAt": "2024-12-31 23:59:59.000000"
    },
    {
        "programId":"12456",
        "title":"Buy one get one for free",
        "description":"Order an item and get another one for free.",
        "cost":500,
        "type":"buy_one_get_one_free",
        "itemPLU":"DRN-02",
        "media":{
            "url":"https://program.media/image",
            "mediaType":"image"
        },
        "applicable": false,
        "expiresAt": "2024-12-31 23:59:59.000000"
    },
    {
        "programId": "36996",
        "title": "Coke $5 off",
        "type": "item_discount_amount",
        "applicable": true,
        "description": "$10 off for a single item",
        "cost": 150.0,
        "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/996/original/4b189839dd5c99f7bccee13cdb675af19f9b9d37.jpeg",
            "mediaType": "image"
        },
        "expiresAt": null,
        "discount": 500,
        "itemPLU": "ABC-123",
        "minOrderValue": 1000
    },
    {
        "programId": "36998",
        "title": "Coke 50% off",
        "type": "item_discount_percentage",
        "applicable": true,
        "description": "50% off Coke!",
        "cost": 150.0,
        "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/996/original/4b189839dd5c99f7bccee13cdb675af19f9b9d37.jpeg",
            "mediaType": "image"
        },
        "expiresAt": null,
        "discount": 5000,
        "itemPLU": "ABC-123",
        "minOrderValue": null
    }
]
Response examples (400)
{
    "error": "no active loyalty profile found",
    "http_code": 400,
    "description": "no active loyalty profile found"
}