...
transactionId
<string>: unique identifier of the loyalty transaction created in UUID format.balances
: object that indicates loyalty balance of the user's accountamount
<number>: this represents the number of loyalty points the user has. If this QR code was pre-selected with rewards, then this number already has those loyalty points temporarily deducted from total user’s loyalty points balance.currency
<string>: this represents the currency the above amount. Normally set to "points".
loyaltyUser
: object that indicates information about this loyalty usercreated
<string>: string that represents that date and time user loyalty account was createdid
<string>: unique identifier of the loyalty user in UUID formatname
<string>: name of the user that was saved upon account creation
order
: an array that includes objects with the below fields for each product that is in the order basket.productId
<string>: PLU of the product that was pre-selected in the app. This can be an offer or a reward.quantity
<number>: the amount of the above product that is in the loyalty order.price
<number>: the price of the productproductType
<string>: the type of product. In this case it would either beREWARD
orOFFER
referenceId
<string>: unique line ID of the productincentiveId
<string> (optional): Sanity ID of the offer or reward if an offer or reward is pre-selected in the app.
elligibleDiscounts
(optional): an array of any offer or rewards discount that were pre-selected by the user in the app.details
<object> (optional): details of the discount included in the basket.displayName
<string> (optional): name of the offer or reward discount included in the basket.discountValue
<integer> (optional): an integer that represents the value of the discount.subType
<string> (optional): the type of the discount. Discount can only bePERCENTAGE_DISCOUNT
orAMOUNT_DISCOUNT
.type
<string> (optional): the type of the benefit of the discount. This can only beoffer
orreward
.
incentiveId
<string> (optional): Sanity ID of the offer or reward discount.productId
<string>: PLU of the discount that was pre-selected in the app. This can be an offer or a reward.referenceId
<string> (optional): Loyalty Engine ID of the offer or reward discount if an offer or reward discount is pre-selected in the app.
Success response example
Response that does not contain a cart or product level discounts
Code Block |
---|
{
"balances": [
{
"amount": 14464,
"currency": "points"
}
],
"loyaltyUser": {
"created": "2021-08-10T12:18:39.180Z",
"id": "4711fc2a-3a8f-414f-a9e7-44dd5231dca7",
"name": "Farhan"
},
"order": [
{
"productId": "Reward PLU",
"incentiveId": "Sanity ID of Reward"
"quantity": 1,
"price": 0,
"productType": "reward",
"referenceId": "00", // unique line id
},
{
"productId": "Offer PLU",
"incentiveId": "Sanity ID of Offer"
"quantity": 1,
"productType": "offer",
"referenceId": "00", // unique line id
},
],
"transactionId": "f4190848-169d-4c69-9f53-f916318c432b" // uuid of the loyalty order/transaction
} |
Response that contain a cart or product level discount: Cart and Product Level Discounts
Code Block |
---|
{
"balances": [
{
"amount": 14464,
"currency": "points"
}
],
"eligibleDiscounts": [
{
"details": {
"displayName": "20% off order",
"discountValue": 20,
"subtype": "PERCENTAGE_DISCOUNT or AMOUNT_DISCOUNT",
"type": "offer" or "reward"
},
"incentiveId": "$sanityIncentiveId",
"productId": "$incentivePlu",
"referenceId": "$incentiveLoyaltyId"
}
],
"loyaltyUser": {
"created": "2021-08-10T12:18:39.180Z",
"id": "$loyaltyUserId",
"name": "$loyaltyUserName"
},
"order": [],
"transactionId": "$loyaltyTransactionId"
} |
Error responses
Info |
---|
All error responses use the standard Error Responses format. |
...