Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents
stylenone

Purpose

This 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). OTP is always allowed, but Loyalty ID’s may or may not be allowed depending on configuration.

This endpoint should only be called during the first scan. Subsequent scans should call Identify (PUT) instead.

Request Format

Endpoint

POST /loyalty/v2/identify

Headers

We will use the same headers as the Partner API.

Authentication and authorization will use the bearer Bearer token in JWT format , which includes the API key, and identifies the following, based on this documentation: as specified in /wiki/spaces/IN/pages/3739288100

...

Brand (e.g. BK)

...

.

...

...

Sub, which is the integration partner (e.g. NCR, Khumbu)

...

Partner ID, which uniquely identifies the partner configuration which will give us more details if we need.

Body

  • identifier <string>: OTP (6 digit code) or Loyalty ID in UUID format.

  • location: object identifying the location the guest is identifying from.

    • storeId <integer>: uniquely identifies the store where the guest is identifying from.

    • terminalId <string> (optional): identifies the POS or Kiosk terminal used in the restaurant

    • hasLoyalty <boolean> (optional): defaults to true. If false, then no points will be earned or burned for transaction and no rewards can be ordered.

  • content <boolean> (optional): whether the endpoint should return the list of offers and rewards that are visible to this guest. Defaults to false.

Example request

Code Block
{
    "identifier": "123456",
    "location": {
        "storeId": "9999",
        "terminalId": "0", 
        "hasLoyalty": true 
    }
}

Second request

Code Block
PUT /loyalty/v2/identify
{
    "identifier": "123456",
    "contenttransactionId": truexxx
}

Response Format

Success response body

  • transactionId <UUID>: unique identifier of the loyalty transaction created.

  • balances: object that indicates loyalty balance of the user's account

    • amount <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 user

    • created <string>: string that represents that date and time user loyalty account was created

    • id <string>: Loyalty ID of the user in UUID format

    • name <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 product

    • productType <string>: the type of product. In this case it would either be REWARD or OFFER

    • referenceId <string>: unique line ID of the product

  • content: array that indicates all the offer and reward content available for that market

    • TBD

    transactionId <string>: Order ID in UUID format of the loyalty orderincludes all PLUs for offers and rewards in the market

    • plu <string>: PLU of all rewards or offers that should be excluded from showing to that specific user.

Note

Pending to further discuss and validate the above point:

  • Return PLU of all rewards or offers that should be excluded from showing to that specific user

Success response example

Code Block
{
    "transactionId": "f4190848-169d-4c69-9f53-f916318c432b", // uuid of the loyalty order/transaction
    "balances": [
        {
            "amount": 14464,
            "currency": "points"
        }
    ],
    "loyaltyUser": {
        "created": "2021-08-10T12:18:39.180Z",
        "id": "4711fc2a-3a8f-414f-a9e7-44dd5231dca7",
        "name": "Farhan"
    },
    "order": [
        {
            "productId": "Reward PLU2244",
            "quantity": 1,
            "price": 0,
            "productType": "REWARD",
            "referenceId": "0001", 
        },
        {
            "productId": "Offer PLU6688",
            "quantity": 1,
            "price": 500,
            "productType": "OFFER",
            "referenceId": "0002", 
        },
    ],
    "content": [
        { 
         "plu": "8810",    
        },
        { 
         "plu": "8811",    
        },
        { 
         "plu": "8812",    
        },
        { 
         "plu": "8813",    
        },
        { 
         "plu": "8814",    
        },
    "transactionId": "f4190848-169d-4c69-9f53-f916318c432b" // uuid of the loyalty order/transaction    { 
         "plu": "8815",    
        },
        { 
         "plu": "8816",    
        },
        { 
         "plu": "8817",    
        },
        { 
         "plu": "8818",    
        },
        { 
         "plu": "8819",    
        },
    ]
}

Error responses

Info

All error responses use the standard Error Response https://rbictg.atlassian.net/wiki/spaces/RDP/pages/4231725617/Loyalty+API+v1+-+Error+Responses?atl_f=content-tree 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.

  • 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": if the specified identifier was not found.

    • "StoreNotFound": if the specified storeId was not found.