Identify (PUT)
Contents
- 1 Purpose
- 2 Request Format
- 2.1 Endpoint
- 2.2 Headers
- 2.3 Body
- 2.4 Example request
- 3 Response Format
Purpose
This endpoint is used when a guest 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), when the guest has already been identified. This endpoint must be used after Identify (POST) has been called during the first scan.
Request Format
Endpoint
PUT /loyalty/v2/identify
Headers
Bearer token in JWT format as specified in https://rbictg.atlassian.net/wiki/spaces/IN/pages/3739288100.
Body
identifier
<string>: OTP (6 digit code) or Loyalty ID in UUID format.transactionId
<UUID>: unique identifier of the transaction.
Example request
{
"identifier": "123456",
"transactionId": "f4190848-169d-4c69-9f53-f916318c432b"
}
Response Format
Success response body
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".
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"
}
],
"order": [
{
"productId": "2244",
"quantity": 1,
"price": 0,
"productType": "REWARD",
"referenceId": "01",
},
{
"productId": "6688",
"quantity": 1,
"price": 500,
"productType": "OFFER",
"referenceId": "02",
},
]
}
Error responses
All error responses use the standard https://rbictg.atlassian.net/wiki/spaces/RDP/pages/4676420076 format.
HTTP
400 (Bad Request)
if the eitheridentifier
ortransactionId
are not included with the request body, or if these parameters have an incorrect format.HTTP
401 (Unauthorized)
if the bearer token is missing or not valid.HTTP
404 (Not Found)
: in the following scenarios indicated in thecode
field of the error response:"CodeNotFound"
: the specified identifier has not been found;"TransactionNotFound"
: the specified transaction has not been found.
HTTP
403 (Forbidden)
: if the specifiedidentifier
was generated for a differenttransactionId
.