Versions Compared

Key

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

...

Table of Contents
stylenone

Purpose

This endpoint is used to add items to the basket of an existing Loyalty transaction, either by scanning pre-selected offers/rewards, or by using the client app’s user interface.

  • Add and remove offers/rewards to the basket of an existing Loyalty transaction, either by scanning pre-selected offers/rewards, or by using the client app’s user interface.

  • Validate an entire basket

Request Format

Endpoint

PUT /loyalty/v2/updateBasketupdate

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)

...

Region (e.g. UK)

...

.

...

...

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

Body

  • transactionId <UUID>: unique identifier of the Loyalty transaction to be updated.

  • <TBC - scan code><TBC - basket cart contents>

Example request

Code Block
{
    "transactionId": "f4190848-169d-4c69-9f53-f916318c432b",
    "code":
992342
}

Response Format

Content from this point onwards has not been updated.
Warning
Warning

Content in example request missing an example order payload.

Note

2 examples to be added:

  • one including full order to be validated

  • another example including just an offer/reward to be updated and validated

Response Format

Success response body

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

    amount

    points <number>: this represents the number of loyalty points the user has.

    If this QR code was pre-selected with rewards, then

    The order has a status of “PENDING” and includes rewards, so this number already has those loyalty points temporarily deducted from total user’s loyalty points balance.

  • currency <string>

    pointsEarned <number>: 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

    • title <string>: title of the reward or offer as was set in Sanity.

    • description <string>: description of the reward or offer as was set in Sanity.

    • moreInfo <string>: disclaimer of the reward or offer as was set in Sanity.

    • image <link>: url of the image of the reward or offer as was set in Sanity.

    • plu <string>: PLU of the reward or offer as was set in Sanity for the pos vendor of the integration

    • rules: array containing all rules inside offer or reward if applicable (e.g. 200 loyalty points needed to use the reward, offer only available on Wednesdays)

  • transactionId <string>: Order ID in UUID format of the loyalty ordernumber of loyalty points the user has earned. The order has a status of “PENDING”, so this number will always be 0 since we don’t update the guests earned loyalty points until the order is completed.

  • pointsRedeemed <number>: this represents the number of loyalty points the user has redeemed. The order has a status of “PENDING” and includes rewards, so this number is the total loyalty points temporarily deducted from total user’s loyalty points balance.

  • loyaltyId <string>: unique identifier of the loyalty user in UUID format.

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

  • receiptCode <string>: autogenerated code for easy lookup of the order via support tool

  • 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 v1 - Receipts

    • header <string>(optional): this represents the content that will show in the header of the receipt: Loyalty API v1 - Receipts

    • identifier <string>(optional): this represents the content that will show in the receipt to identify the order: Loyalty API v1 - Receipts

    • pointsEarned <string>(optional): this represents the points earned that will show in the receipt of the loyalty order: Loyalty API v1 - Receipts

    • totalPoints <string>(optional): this represents the total points balance that will show in the receipt of the loyalty order: Loyalty API v1 - Receipts

Success response example

Code Block
{
    "balances": [
        {
            "amount"points": 14464,
    
       "currencypointsEarned": "points"
        }
    ]50,
    "loyaltyUserpointsRedeemed": {
        "created": "2021-08-10T12:18:39.180Z"750,
        "idloyaltyId": "4711fc2a-3a8f-414f-a9e7-44dd5231dca7", 
       "name": "Farhan"
    },
    "order": [
        {
            "productId": "2244",
            "quantity": 1,
            "price": 0,
            "productType": "REWARD",
            "referenceId": "01", 
        },
        {
            "productId": "6688",
            "quantity": 1,
            "price": 500,
            "productType": "OFFER",
            "referenceId": "02", 
        },
    ],
    "content": [
        {
            "title": "Small Fries Reward",
            "description": "Order this reward and get free small fries",
            "moreInfo": "Contains allergens",
            "image": "https://cdn.sanity.io/images/czqk28jt/staging_bk_gb/fc7c2a73e7a9bf14f3e3401bedcc090c4f421c67-1333x1333.png",
            "plu": "8810", 
            "rules": [
              {
                "type": "loyaltyPoints",
                "points": 200,
              } 
            ],
        },
        {
            "title": "MEAT FREE MONDAYS VEGAN ROYALE",
            "description": "Vegan Royale for just £2.99. Only on Mondays. Use app code APP903 if using a kioskfooter": "Crowns expire 180 days from last purjchase. At participating U.S. restaurants. Terms at bk.com/rewards-terms.",
            "moreInfoheader": "Not valid in conjunction with any other offer. One voucher per transaction. Valid only in the UK. Subject to availability. Voucher valid at participating restaurants only.  Not valid at Burger King motorway service locations, airports train stations and holiday parks. © 2023 Burger King Europe GmbH. All rights reserved.",
   My Burger King",
        "imageidentifier": "https://cdn.sanity.io/images/czqk28jt/prod_bk_gb/aae9c1303b7cea013c984ee647ed7898ce6cfce9-1000x850.png",
            "plu": "9920"Transaction ID: 07e5c312-9e8e-4e67-8980-f42fc499a142",
             "rulespointsEarned": [
              {
                "type": "day-of-week-band"
                friday:false
                monday:true
                saturday:false
                sunday:false
                thursday:false
                tuesday:false
                wednesday:false
              },
      "Earned: 50",
       {                 "type"totalPoints": "service-mode-restrictions"
                CATERING_DELIVERY:true
                CATERING_PICKUP:true
                CURBSIDE:true
                DELIVERY:false
                DRIVE_THRU:true
                EAT_IN:true
                TABLE_SERVICE:true
                TAKEOUT:true
              },
              {
      Balance: 14464"
    },
         "typereceiptCode": "limit"
                interval:day
                maximumRedemptions:1
              },  
            ],
        },
    ]NCGXOZOIY2RUX5VR",
    "transactionId": "f419084807e5c312-169d9e8e-4c694e67-9f538980-f916318c432bf42fc499a142" // uuid of the loyalty order/transaction
}

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 403 (Forbidden): if the specified identifier is not valid.

  • HTTP 404 (Not Found): if the specified storeId was not found.