Get Loyalty Programs Run in API Explorer
Ask AI
Body
-
For the full order schema, please refer to Glossary - Channel Orders
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
Request example
{
"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"
}