Identify (PUT)

Contents

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

  • balance <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.

  • cart: an array that includes objects with the below fields for each product that is in the order basket.

    • externalreferenceId <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.

    • type <string>: the type of product. It could be Reward , Offer, Item or Combo

    • menuSelections(optional): an array that includes combos or sub-items within the product.

      • externalreferenceId <string>: PLU of the menu selection within the the product that was pre-selected in the app. This can be a combo or item PLU.

      • quantity <number>: the amount of the above product that is in the loyalty order.

      • type <string>: the type of product. It could be Item or Combo

      • menuSelections(optional): an array that includes sub-items within a specific product.

Success response example

  • With an offer and reward pre-selected

{ "balance": 14464, "cart": [ { "externalReferenceId": "2244", "menuSelections": [ { "externalReferenceId": "100-1-1", // item PLU "menuSelections": [], "quantity": 1, "type": "Item" } ], "quantity": 1, "type": "Reward", }, { "externalReferenceId": "1050", // offer PLU "menuSelections": [ { "externalReferenceId": "100-1-1", // combo plu "menuSelections": [ { "externalReferenceId": "101-1-1", // item 1 plu "menuSelections": [], "quantity": 1, "type": "Item" }, { "externalReferenceId": "102-1-1", // item 2 plu "menuSelections": [], "quantity": 1, "type": "Item" }, { "externalReferenceId": "103-1-1", // item 3 plu "menuSelections": [], "quantity": 1, "type": "Item" }, ], "quantity": 1, "type": "Combo" } ], "quantity": 1, "type": "Offer" } ] }

Error responses

All error responses use the standard Loyalty API v1 - Error Responses format.

  • HTTP 400 (Bad Request) if the either identifier or transactionId 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 the code field of the error response:

    • "IdentifierNotFound": the specified identifier has not been found;

    • "TransactionNotFound": the specified transaction has not been found.

  • HTTP 403 (Forbidden): if the specified identifier was generated for a different transactionId or if the identifier is not linked to that specific transactionId.

  • HTTP 409 (Conflict): if there is a conflict between servers

    • "ConnectionLost": if another device was used to create a new transactionId for this user.