Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Contents

Purpose

This endpoint is used to get all content on both offers and rewards from a market and environment to a client device (typically a POS or Kiosk terminal). This endpoint needs to be called once per day. After this, the client device saves content on their side and displays to users.

Request Format

Endpoint

GET /loyalty/v2/content

Headers

Bearer token in JWT format as specified in /wiki/spaces/IN/pages/3739288100.

Body

No input needed in the body

Example request

 

Response Format

Success response body

  • 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)

Success response example

{
    "offers": [
        {
            "title": "MEAT FREE MONDAYS VEGAN ROYALE",
            "description": "Vegan Royale for just £2.99. Only on Mondays. Use app code APP903 if using a kiosk.",
            "moreInfo": "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.",
            "image": "https://cdn.sanity.io/images/czqk28jt/prod_bk_gb/aae9c1303b7cea013c984ee647ed7898ce6cfce9-1000x850.png",
            "plu": "9920",
            "type": "offer",
            "rules": [
                {
                    "type": "day-of-week-band"
                friday: false
                monday: true
                saturday: false
                sunday: false
                thursday: false
                tuesday: false
                wednesday: false
                },
                {
                    "type": "service-mode-restrictions"
                CATERING_DELIVERY: true
                CATERING_PICKUP: true
                CURBSIDE: true
                DELIVERY: false
                DRIVE_THRU: true
                EAT_IN: true
                TABLE_SERVICE: true
                TAKEOUT: true
                },
                {
                    "type": "limit"
                interval:day
                maximumRedemptions: 1
                },
            ],
        },
        {
            "title": "WHOPPER WEDNESDAYS SPECIAL OFFER",
            "description": "Whopper for just £1.99. Only on Wednesdays.",
            "moreInfo": "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.",
            "image": "https://cdn.sanity.io/images/czqk28jt/prod_bk_gb/aae9c1303b7cea013c984ee647ed7898ce6cfce9-1000x850.png",
            "plu": "9921",
            "type": "personalizedOffer",
            "rules": [
                {
                    "type": "day-of-week-band"
                friday: false
                monday: false
                saturday: false
                sunday: false
                thursday: false
                tuesday: false
                wednesday: true
                },
                {
                    "type": "service-mode-restrictions"
                CATERING_DELIVERY: true
                CATERING_PICKUP: true
                CURBSIDE: true
                DELIVERY: false
                DRIVE_THRU: true
                EAT_IN: true
                TABLE_SERVICE: true
                TAKEOUT: true
                },
                {
                    "type": "limit"
                interval:day
                maximumRedemptions: 1
                },
            ],
        }
    ],
    "rewards": [
        {
            "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",
            "type": "reward",
            "rules": [
                {
                    "type": "loyaltyPoints",
                    "points": 200,
                }
            ]
        }
    ]
}

Error responses

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

  • No labels