This endpoint allows channels to retrieve a list of loyalty programs available to a customer. It supports two different use cases, each requiring a different level of detail in the request payload.
Request Schema and Structure
Field | Type | Required | Description |
|---|---|---|---|
|
| Yes | A unique session identifier to Get programs/validate programs/create order. |
|
| Yes | The order payload. |
|
| Yes | The customer's details. |
|
| No | The customer's full name. |
|
| No | The customer's email address. |
|
| No | The customer's phone number (E.164 standard). |
|
| Yes | The customer's unique ID from the loyalty provider. |
|
| Yes | The type of order. |
|
| No | An empty array. |
For more information on the order schema, see the order schema documentation:
https://developers.deliverect.com/page/channel-orders#/
Response Schema and Structure
| Field | Type | Required | Deprecated | Description |
|---|---|---|---|---|
programId | string | Yes | No | The unique identifier of the loyalty program. |
title | string | Yes | No | The title or display name of the program. |
type | string (enum) | Yes | Yes | The legacy type of the loyalty program. This field is deprecated and will be removed in future versions. |
applicable | boolean | No | No | Indicates if the customer meets the basic requirements for this program. Default is true. |
description | string | No | No | A description of the loyalty program. |
cost | number | No | No | The cost of the program, e.g., the number of loyalty points to redeem. |
media | object | No | No | Media assets associated with the program, such as an image or icon. |
media.mediaType | string | Yes | No | Values may be: image / video |
media.url | string | Yes | No | The url of the resource |
expiresAt | string (ISO 8601) | No | No | The expiration date and time of the program. |
discount | number | No | Yes | The specific discount value. This field is deprecated and its details are now found in the discounts object of the validation endpoint response. |
itemPLU | string | No | Yes | The PLU of the item to which the program applies. This field is deprecated. |
quantity | number | No | Yes | The quantity of items affected by the program. This field is deprecated. |
minOrderValue | number | No | Yes | The minimum order value required for this program to be applicable. This field is deprecated as business rules are now handled by the loyalty provider. |
Case 1: Listing All Available Programs
Use this case to display a list of all potential loyalty programs a customer can access, before they start building their order basket.
Request Payload:
To list all programs, the request payload should include the sessionId and the customer's details.
URL Parameters:
channelLinkId(string): The unique identifier for the channel.
Example Request:
{
"sessionId": "mysessionId123",
"programIds": [],
"order": {
"customer": {
"name": "John Doe",
"email": "[email protected]",
"phoneNumber": "+32121212121",
"loyaltyProviderCustomerId": "{{loyaltyCustomerProviderId}}"
},
"orderType": 2,
"items": []
}
}Response Payload: The response returns a list of all programs the customer has access to. Since no order items are provided, many programs may be marked as not applicable.
The applicable field indicates whether a customer meets the basic requirements for the program to be applied, such as having enough points or the program not being expired. The loyalty partner may perform extra checks to determine which programs can be marked as applicable.
Example Response (Current):
[
{
"programId": "1",
"title": "$2 OFF",
"type": "discount_amount",
"applicable": true,
"description": "",
"cost": 10,
"media": {
"url": "...",
"mediaType": "image"
},
"expiresAt": null,
"discount": 200,
"itemPLU": null,
"quantity": null,
"minOrderValue": 1000
}
]Note: The fields
type,discount,itemPLU,quantity,minOrderValue, andvalidationErrorare deprecated and will be removed in a future version.
Example Response (Future):
[
{
"programId": "15036747082",
"title": "$2 OFF",
"applicable": true,
"description": "",
"cost": 10,
"media": {
"url": "https://res..png",
"mediaType": "image"
},
"expiresAt": null
}
]Case 2: Listing Programs Applicable to a Current Basket
Use this case to show which programs can be successfully applied to the customer's current order.
Request Payload: For this case, the full order payload should be included.
URL Parameters:
channelLinkId(string): The unique identifier for the channel.
Body Parameters:
sessionId(string, required): A unique session identifier.order(object, required): A complete order schema (items, discounts, payment, etc.).
Example Request:
{
"sessionId": "mysessionId123",
"order": {
"customer": {
"name": "{{loyaltyCustomerFirstName}} {{loyaltyCustomerLastName}}",
"email": "{{loyaltyCustomerEmail}}",
"phoneNumber": "{{loyaltyCustomerPhone}}",
"loyaltyProviderCustomerId": "{{loyaltyCustomerProviderId}}"
},
"orderType": 2,
"items": [
{
"plu": "P-TE-zxb3-2",
"name": "Burger",
"price": 10000,
"quantity": 1,
"subItems": [],
"productType": 1
}
],
"payment": {
"amount": 10000
},
"discounts": []
}
}Response Payload:
The response returns a list of all programs, with the applicable field indicating whether they can be applied to the basket.
The applicable field indicates whether a customer meets the basic requirements for the program to be applied, such as having enough points or the program not being expired. The loyalty partner may perform extra checks to determine which programs can be marked as applicable.
Example Response (Current):
[
{
"programId": "1",
"title": "$2 OFF",
"type": "discount_amount",
"applicable": true,
"description": "",
"cost": 10,
"media": {
"url": "...",
"mediaType": "image"
},
"expiresAt": null,
"discount": 200,
"itemPLU": null,
"quantity": null,
"minOrderValue": 1000
}
]Note: The fields
type,discount,itemPLU,quantity, andminOrderValueare deprecated and will be removed in a future version.
Example Response (Future):
[
{
"programId": "15036747082",
"title": "$2 OFF",
"applicable": true,
"description": "",
"cost": 10,
"media": {
"url": "https://res..png",
"mediaType": "image"
},
"expiresAt": null
}
]