Versions Compared

Key

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

...

Table of Contents
stylenone

Overview

This documentation explains how customers can redeem discounts in The Loyalty API supports discounts redeemable at the restaurant. Discounts can order-level % discount, order-level $ off, product-level % discount, and product-level $ off. Below we show the calls that vendors need to make to loyalty in order to be able to complete a successful in restaurant order with discounts.

Identify (POST)

Use Case: Successfully identify the loyalty user along with any potential rewards/offers that they had pre-selected within the app.

Endpoint URL: https://{reg}-{env}-{brand}-loyalty-middleware.rbictg.com/loyalty/identify

Variation: Unlike US markets, EMEA markets will need Loyalty to support cart level discount offers or rewards such as 10% off or $10 off. In order to tell the Kiosk what they need to discount, we will provide an eligibleDiscounts field for be:

  • Order or product level

  • Percentage based (e.g. 10% off) or value based (e.g. £10 off)

This document explains how Loyalty API endpoints must be used to redeem discounts.

Identify

When a guest scans an identification code on a POS or Kiosk, they may pre-select offers or rewards that contain a discount. In that case, the Loyalty API v1 - Identify endpoint will return an eligibleDiscounts field on the response. This will contain the type of discount (% or value amount), and the actual amount, ie.g. e 10 | or 20, etc.Expected Request Payload:

Example request

Code Block
{
    "identifier": "$6digitCode or $loyaltyId",
     "posVendor": {
        "operator": "$operatorId",
        "posType": "$posVendorName",
        "storeId": "$rbiStoreId",
        "supportingPos": "POS vendor name (optional field)", // vendor to return plu for
        "terminal": "$terminalNumber",
        "transactionId": "$posTransactionId"
    }
}

...

Example response

Code Block
{
    "balances": [
        {
            "amount": 14464,
            "currency": "points"
        }
    ],
    "eligibleDiscounts": [
        {
            "details": {
                "displayName": "20% off order",
                "discountValue": 20,
                "subtype": "PERCENTAGE_DISCOUNT or AMOUNT_DISCOUNT",
                "type": "offer" or "reward"
            },
            "incentiveId": "$sanityIncentiveId",
            "productId": "$incentivePlu",
            "referenceId": "$incentiveLoyaltyId"
        }
    ],
    "loyaltyUser": {
        "created": "2021-08-10T12:18:39.180Z",
        "id": "$loyaltyUserId",
        "name": "$loyaltyUserName"
    },
    "order": [],
    "transactionId": "$loyaltyTransactionId"
}

...

Transaction Update

...

Use Case: Kiosk sends this transaction request with the order details to update the loyalty transaction. If the Kiosk states this transaction should be claimed, this will result in the user earning and redeeming eligible points.

Endpoint URL: https://{reg}-{env}-{brand}-loyalty-middleware.rbictg.com/loyalty/transaction/pos/{loyaltyTransactionId}

...

If a guest includes discounts in their order, the POS or kiosk devices must send an appliedDiscounts field when calling the Loyalty API v1 - Update endpoint to commit a Loyalty transaction with a status of CLAIMED. The appliedDiscounts field is used to specify that the discount has actually been applied.

In addition, we will also expect Kiosk the Update endpoint expects POS/Kiosk devices to already apply the discount when calculating each line entry’s price. This means if a 10% discount was applied, the price of each entry should have 10% less than their actual value, and if a $10 £10 discount was applied, each line entry’s price should have an equal portion of $10 £10 deducted. We The Loyalty API will respect any exemptions that included in the Kiosk makesrequest, i.e If a Kiosk POS or kiosk device states they don’t want to discount alcohol line entries, there will be no validation or assertions done on by the Loyalty side API to block this from happening.Expected Request Payload:

Example request

Code Block
{
    "channel": "Restaurant",
    "created": "2021-05-04T13:39:47Z",
    "loyaltyId": "$loyaltyUserId",
    "serviceMode": "$serviceMode",
    "status": "CLAIMED",
    "transactionDetails": {
        "appliedDiscounts": [
            {
                "details": {
                    "displayName": "20% off order",
                    "discountValue": 20,
                    "subtype": "PERCENTAGE_DISCOUNT or AMOUNT_DISCOUNT",
                    "type": "offer" or "reward"
                },
                "incentiveId": "$sanityIncentiveId",
                "productId": "$incentivePlu",
                "referenceId": "$incentiveLoyaltyId"
            }
        ],
        "currency": "USD",
        "order": [
            {
                "name": "med whopper combo",
                "price": 4.00,
                "productId": "$plu",
                "productType": "combo",
                "quantity": 1,
                "referenceId": "3",
                "tax": 0
            },
            {
                "name": "whopper",
                "parentReferenceId": "1",
                "price": 0,
                "productId": "$plu",
                "productType": "item",
                "quantity": 1,
                "referenceId": "4",
                "tax": 0
            },
            {
                "name": "med fries",
                "parentReferenceId": "1",
                "price": 0,
                "productId": "$plu",
                "productType": "item",
                "quantity": 1,
                "referenceId": "5",
                "tax": 0
            },
            {
                "incentiveId": "$sanityRewardId",
                "price": 0,
                "productId": "$rewardPlu",
                "productType": "reward",
                "quantity": 1,
                "referenceId": "3",
                "tax": 0
            }               
        ],
        "payments": [
            {
                "amount": 500,
                "type": "$paymentMethod",
                "ccToken"?: "$panToken"
            }
        ],
        "posVendor": {
            "operator": "$operatorId",
            "posType": "$posVendorName",
            "storeId": "$rbiStoreId",
            "supportingPos": "POS vendor name (optional field)", // vendor to return plu for
            "terminal": "$terminalNumber",
            "transactionId": "$posTransactionId"
        }
    },
    "transactionId": "$loyaltyTransactionId"
}

...

Example response

Code Block
 {
    "loyaltyId": "$loyaltyUserId",
    "points": 14464,
    "pointsEarned": 50,
    "pointsRedeemed": 750,
    "transactionId": "$loyaltyTransactionId"
}

...