Contents
Purpose
The Identify endpoint is used to identify a guest who scans an identifier generated by the RBI app (which could be an OTP or the Loyalty ID) at a client device (typically a POS or Kiosk terminal). Identification will include any potential rewards/offers that they had pre-selected within the app.
Request Format
Endpoint
POST /loyalty/identify
Headers
As documented here: Loyalty API - Getting Started.
Body
identifier
<string>: OTP (6 digit code) or Loyalty ID in UUID format.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
{ "identifier": "123456", "posVendor": { "operator": "300", // operator id "supportingPos": "POS vendor name (optional field)" "posType": "Kiosk vendor name", "storeId": "9999", "terminal": "0", // terminal id "transactionId": "000000000257" } }
Response Format
Success response body
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 product
Success response example
{ "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 }
Error responses
All error responses use the standard Error Responses format.
HTTP
400 (Bad Request)
if the request body has an incorrect format. In this case, the response will include details about which specific field or fields have an incorrect format:"IdentificationFailed"
: the sent identifier was not correct (e.g. not an OTP code) but complies to a loyalty ID number format, then it’s detected as aLOYALTY_ID
by accident.
HTTP
401 (Unauthorized)
if authentication headers are missing or not valid.HTTP
404 (Not Found)
: in the following scenarios indicated in thecode
field of the error response:"HashSetNotFoundError"
: if the specifiedidentifier
was not found."UserNotFoundError"
: the Loyalty user (specifically the loyalty id) was not found."RewardNotFoundError"
: the reward being pre-selected was not found."OfferNotFoundError"
: the offer being pre-selected was not found.
HTTP
422 (Unprocessable Entity)
if identifier cannot be processed"OrderSelectionStatusUnclaimable"
: the identifier (e.g. OTP) was already used."InvalidIdentifier"
: the identifier was not a valid type."IdentifierTypeDisabled"
: the detected identifier type is not supported in the market.