Note |
---|
This document is work in progress |
Contents
Table of Contents | ||
---|---|---|
|
...
This endpoint is used to update a loyalty order at a client device (typically a POS or Kiosk terminal). If the client device states this transaction is pending
PENDING
only reward points of the customer will be temporarily removed of his account. If the client device states this transaction should be claimed
CLAIMED
, this will result in the user earning and redeeming loyalty points.
...
loyaltyId
<string>: Loyalty ID in UUID format.transactionId
<string>: Loyalty order ID in UUID format.channel
<string>: “Restaurant” for In-Restaurant orders.created
<string>: string that represents the current date and time of the requestcreated
<string>: service mode of the order being placed. This can be “EAT_IN”, “TAKEOUT”, ”DRIVE_THRU”.status
<string>: status of the order that indicates if the order is still pending or if it has been completed. This can be “PENDING” for orders not yet completed and “CLAIMED” for orders that were completed.transactionDetails
: object identifying order information from the request (POS or Kiosk):currency
<string>: the currency used in the market.order
: array identifying all products inside the order. each product is an object with these fields:name
<string>: name of the product.price
<number>: price of the product.productId
<string>: PLU of the product.productType
<string>: type of the product. This can be “combo”, “item”, “reward” or “offer”.quantity
<number>: number of times this product was ordered.referenceId
<string>: line ID of producttax
<number>: tax amount attributed to this product.parentReferenceId
<number> (optional): line id of parent product. Only relevant for children products (e.g. a coke drink that was ordered as part of a whopper medium meal combo).
payments
: array with an object identifying payment information of the order:amount
<number>: total cost of the order in cents.type
<string>: type of payment method that was used during payment for order. This can be “CASH”, “CREDIT”, “VISA”, “MASTERCARD”.
posVendor
: object identifying system making the request (POS or Kiosk):transactionId
<string>: the POS transaction identifier.storeId
<integer>: uniquely identifies the store where the guest is identifying from.terminal
<string> (optional): identifies the POS or Kiosk terminal used in the restaurantoperator
<string> (optional): identifies the POS operator (only applicable for orders made on a POS terminal)posType
<string>: identified the type of POS or Kiosk system making the request. This value must have been previously agreed between the vendor and RBI, so that the correct integration configuration is applied. In most cases, this will be set to a value of “Partner”.supportingPos
<string> (optional): in case the posType is “Partner”, this field should be used to identify the POS/Kiosk brand for analytical purposes.
Example request
Code Block |
---|
{ "loyaltyId": "{{loyaltyUserId}}", "transactionId": "{{loyaltyTransactionId}}", "channel": "Restaurant", "created": "2021-05-04T13:39:47Z" "serviceMode": "EatinEAT_IN", "status": "CLAIMED", "transactionDetails": { "currency": "USD", "order": [ { "name": "med whopper combo", "price": 5.00, "productId": "$plu", "productType": "combo", "quantity": 1, "referenceId": "1", // line id "tax": 0 }, { "name": "whopper", "parentReferenceId"?: "1", // line id of parent element (for children entries) "price": 0, "productId": "$plu", "productType": "item", "quantity": 1, "referenceId": "2", // line id "tax": 0 }, { "name": "med fries", "parentReferenceId"?: "1", // line id of parent element (for children entries) "price": 0, "productId": "$plu", "productType": "item", "quantity": 1, "referenceId": "3", // line id "tax": 0 }, { "incentiveId": "$sanityRewardId", "name": "free drink reward", "price": 0, "productId": "$rewardPlu", "productType": "reward", "quantity": 1, "referenceId": "4", // line id "tax": 0 }, { "incentiveId": "$sanityOfferId", "name": "$2.99 chicken sandwich meal", "price": 2.99, "productId": "$offerPlu", "productType": "offer", "quantity": 1, "referenceId": "5", // line id "tax": 0.50 } ], "payments": [ { "amount": 500, "type": "CASH", "ccToken": "optional PAN token" } ], "posVendor": { "operator": "300", // operator / cashier name "posType": "Kiosk vendor name", "storeId": "9999", "terminal": "0", // terminal id "transactionId": "000000000257" // vendor transaction id }, } } |
Response Format
Success response body
transactionId
<UUID>: unique identifier of the loyalty transaction created.
balances
: object that indicates loyalty balance of the user's accountamount
this QR code was pre-selected withpoints
<number>: this represents the number of loyalty points the user has. Ifthe order has a status of “PENDING” and includes rewards, then this number already has those loyalty points temporarily deducted from total user’s loyalty points balance. If the order has a status of “CLAIMED” this is the final point balance of the guest after the order is completed.
currency
<string>
the currency the above amount. Normally set to "points".pointsEarned
<number>: this representsloyaltyUser
: object that indicates information about this loyalty usercreated
<string>: string that represents that date and time user loyalty account was createdid
<string>: Loyalty ID of the 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
pointsRedeemed
<number>: this represents the number of loyalty points the user has. If the order has a status of “PENDING” and includes rewards, then this number is the total loyalty points temporarily deducted from total user’s loyalty points balance. If the order has a status of “CLAIMED” this is the final number of points that were deducted / burned in this order.loyaltyId
<UUID>: Loyalty ID in UUID format.transactionId
<UUID>: unique identifier of the loyalty transaction created.receiptCode
<string>: ?presentation
(optional): object that returns Receipt content information set in Sanity here.footer
<string> (optional): this represents the content that will show in the footer of the receipt: Loyalty API - Receiptsheader
<string>(optional): this represents the content that will show in the header of the receipt: Loyalty API - Receiptsidentifier
<string>(optional): this represents the content that will show in the receipt to identify the order: Loyalty API - ReceiptspointsEarned
<string>(optional): this represents the points earned that will show in the receipt of the loyalty order: Loyalty API - ReceiptstotalPoints
<string>(optional): this represents the total points balance that will show in the receipt of the loyalty order: Loyalty API - Receipts
referenceId
<string>: unique line ID of the productthe number of loyalty points the user has. If the order has a status of “PENDING”, then this number will always be 0 since we don’t update the guests earned loyalty points until the order is completed. If the order has a status of “CLAIMED” this is the total number of points that were earned in this order.
Success response example
Code Block |
---|
{ "balancespoints": [ { "amount": 14464, "currency"pointsEarned": "points" } ]50, "loyaltyUserpointsRedeemed": { "created": "2021-08-10T12:18:39.180Z"750, "idloyaltyId": "4711fc2a-3a8f-414f-a9e7-44dd5231dca7", // uuid of loyalty user "name": "Farhan" }, "order": [ presentation": { "productIdfooter": "RewardCrowns PLU",expire 180 days from last purjchase. At participating U.S. restaurants. Terms "incentiveId": "Sanity ID of Reward" "quantity": 1at bk.com/rewards-terms.", "priceheader": 0, "productType": "reward""Royal Perks", "referenceIdidentifier": "00", // unique line id }, { "productId": "Offer PLUTransaction ID: 07e5c312-9e8e-4e67-8980-f42fc499a142", "incentiveIdpointsEarned": "Sanity ID of Offer"Earned: 50", "quantitytotalPoints": 1, "productType"Balance: "offer14464", }, "referenceIdreceiptCode": "00NCGXOZOIY2RUX5VR", // unique line id }, ], "transactionId": "f419084807e5c312-169d9e8e-4c694e67-9f538980-f916318c432bf42fc499a142" // uuid of the loyalty transaction/order/transaction } |
Error responses
Info |
---|
All error responses use the standard Error Responses format. |
...