Versions Compared

Key

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

...

Rewards are an item benefit that can be redeemed in exchange for points (and sometimes money + points). Read more about it here: /wiki/spaces/HELP/pages/4921819186 .

Reward with an item

Expand
titleRBI Partner API
Code Block
"cart": [
  {
    "menuSelections": [
      {
        "id": "7ee7338a-a016-47c6-aef6-3783d40c003e", // Reward Sanity id
        "externalReferenceId": "123", // Reward constant plu defined in Sanity
        "quantity": 1,
        "price": {
          "amount": 0,
          "currency": "SAR",
        }
        "type": "Reward", 
        "menuSelections": [
          {
            "externalReferenceId": "51056", // item constant plu
            "id": "item_1862", // item Sanity id
            "menuSelections": [],
            "price": {
                "amount": 2495, // normal price
                "currency": "SAR"
          },
            "quantity": 1,
            "type": "Item"
          }
        ]
      }
    ]
  }
]

...

Expand
titleOracle TS Gen 2 (Commit call)
Code Block
"cart": {
{
    "
menuSelections
header": 
[
{
 
{
       "
externalReferenceId
orgShortName": "
8351
{{OrgShortName}}",
// reward
 
plu
       "
id
locRef": "
43b4cf07-79c9-4aff-98d1-bce9cf2d890f
{{LocRef}}",
//reward
 
sanity
 
id
      
"
menuSelections
rvcRef": 
[
{{RvcRef}},
        "idempotencyId": "{{$guid}}",
  
{
      "orderTypeRef": 9,
        
"
externalReferenceId
checkEmployeeRef": 
"8350", // combo plu
{{check_employee_ref}}
    },
    "menuItems": [],
    
"
id
comboMeals": 
"43b4cf07-79c9-4aff-98d1-bce9cf2d890f", //combo sanity id
[
        {
            "
menuSelections
comboMealId": 
[
51002003, // Cheeseburger reward
            "comboItem": {
   
{
             "menuItemId": 51002003, // Cheeseburger reward PLU
      
"externalReferenceId": "10059",
          "definitionSequence": 1,
                "
id
quantity": 
"item_1852",
1
            },
            "
menuSelections
mainItem": 
[],
{
                
"price
"menuItemId": 
{
1002003, // A la carte cheeseburger
                
"amount
"definitionSequence": 
0
1,

                
"currency
"quantity": 
"SAR"
1
            },
           
},
 "sideItems": []
        }
    
],
    
"
quantity
tenders": 
1,
[
        {
            
"
type
tenderId": 
"Item"
901 // payment method ID. Pay at Counter for this 
example.
        }
,

    ]
}
Info

In Oracle, we use a separate combo for reward items so that we can set up a different price (0) vs the single item ALC. Alternatively, we could create a new priceSequence set to 0 for each definitionSequence , and then re-use the single item.

Note

Oracle can only handle up to 10,000 combos.

Reward with an item + premium modifier

Expand
titleRBI Partner API
Code Block
"cart": [
  {
    "menuSelections": [
      {
        "id": "7ee7338a-a016-47c6-aef6-3783d40c003e", // Reward Sanity id
        "externalReferenceId": "123", // Reward constant plu defined in Sanity
        "quantity": 1,
        "price": {
          "amount": 0,
          "currency": "SAR",
        }
        "type": "Reward", 
        "menuSelections": [
          {
            "externalReferenceId": "51056", // item constant plu
            "id": "item_1862", // item Sanity id
            "menuSelections": [],
            "price": {
                "amount": 2495, // normal price
                "currency": "SAR"
          },
            "quantity": 1,
            "type": "Item"
          }
        ]
      }
    ]
  }
]
Expand
titleOracle TS Gen 2 (Commit call)
Code Block

Reward with a combo

Expand
titleRBI Partner API
Code Block
"cart": {
  "menuSelections": [
    {
      "externalReferenceId": "8351", // reward plu
      "id": "43b4cf07-79c9-4aff-98d1-bce9cf2d890f", //reward sanity id
        "menuSelections": [
            {
                "externalReferenceId": "8350", // combo plu
                "id": "43b4cf07-79c9-4aff-98d1-bce9cf2d890f", //combo sanity id
                "menuSelections": [
                    {
                        "externalReferenceId": "10059",
                        "id": "item_1852",
                        "menuSelections": [],
                        "price": {
                            "amount": 0,
                            "currency": "SAR"
                        },
                        "quantity": 1,
                        "type": "Item"
                    },
                    {
                        "externalReferenceId": "80007",
                        "id": "4f99db1e-128a-4e53-b23b-dffc0fedf636",
                        "menuSelections": [],
                        "price": {
                            "amount": 0,
                            "currency": "SAR"
                        },
                        "quantity": 1,
                        "type": "Item"
                    },
                    {
                        "externalReferenceId": "80001",
                        "id": "16f482db-2f13-4476-88d3-d2eec26057f3",
                        "menuSelections": [],
                        "price": {
                            "amount": 0,
                            "currency": "SAR"
                        },
                        "quantity": 1,
                        "type": "Item"
                    },
                    {
                        "externalReferenceId": "
80007
141139",
                        "id": "
4f99db1e-128a-4e53-b23b-dffc0fedf636
141139",
                        "menuSelections": [],
                        "price": {
                            "amount": 0,
                            "currency": "SAR"
                        },
                        "quantity": 1,
                        "type": "Item"
                    }
,

                ],
         
{
       "price": {
                "
externalReferenceId
amount": 
"80001"
300, // original price of combo
                
"
id
currency": "
16f482db-2f13-4476-88d3-d2eec26057f3",
SAR"
                 },
           
"menuSelections":
 
[],
     "quantity": 1,
                 "type": "
price
Combo"
:

  
{
               }
             
"amount":
 
0
],
              "price": {
              "
currency
amount": 
"SAR"
0, // final price of the reward
              "currency": "SAR"
    
},
          },
              "quantity": 1,

              "type": "
Item
Reward"
            
}
,

        ]
    
},
Expand
titleOracle TS Gen 2 (Commit call)
Code Block
languagejson
{
    "header": {
        "orgShortName": "{{OrgShortName}}",
        "
externalReferenceId
locRef": "
141139
{{LocRef}}",
        "rvcRef": {{RvcRef}},
        
"id
"idempotencyId": "
141139
{{$guid}}",
        "orderTypeRef": 9,
        "checkEmployeeRef": {{check_employee_ref}},
        "
menuSelections
language": 
[]
"es-ES",
        "Accept-Language": "es-ES"        
    },
    "
price
menuItems": 
{
[],
    "comboMeals": 
[
        {
            "
amount
comboMealId": 
0
51001504,
            "comboItem": {
                "
currency
menuItemId": 
"SAR"
51001504,
                
},
"definitionSequence": 1,
                "quantity": 1
,

            },
            "
type
mainItem": 
"Item"
{
                "menuItemId": 1001003,
  
}
              
]
"definitionSequence": 1,
                "
price
quantity": 
{
1
            },
            "
amount
sideItems": [
300,
 
//
 
original
 
price
 
of
 
combo
           {
     
"currency":
 
"SAR"
              "menuItemId": 1013201,
  
},
                  "
quantity
definitionSequence": 1,
                    "
type
quantity":
"Combo"
 1
                },
      
}
          {
     
],
               "
price
menuItemId":
{
 2102002,
                    "
amount
definitionSequence": 
0
1,
//
 
final
 
price
 
of
 
the
 
reward
               "
currency
quantity": 1
 
"SAR"
               }
,

            ]
 
"quantity":
 
1,
      }
    ],
    "
type
tenders": 
"Reward"
[
        {
            
}
"tenderId": 901
        }
]
    ]
}
,

 

Reward with a cart discount

Code Block
languagejson
"payload": {
    "number": "5803",
    "fees": [
        {
            "total": {
                "amount": 19,
                 "currency": "EUR"
             },
            "type": "BAG_FEE"
        }
     ],
     "serviceMode": "DELIVERY",
     "channel": "WHITELABEL_DELIVERY",
    "callbackUrl": "https://euw3-staging-bk-partners-api.rbictg.com/api/v1/orders/60c1983c-8cbc-4aa8-9486-c55fa78566f5/price/callback",
    "id": "60c1983c-8cbc-4aa8-9486-c55fa78566f5",
    "orderDiscounts": [
        {
            "type": "amount",
             "value": 200
        }
     ],
    "storeId": "12349",
    "cart": {	
         "menuSelections": [
             {
                "externalReferenceId": "502633",
                 "quantity": 1,
                "price": {
                    "amount": 645,
                    "currency": "EUR"
                },
                 "id": "item_11107",
                 "type": "Item"
             }
        ]
    }
 }

Reward with a product discount

Code Block
languagejson
{
    "payload": {
        "number": "5807",
        "fees": [
            {
                "total": {
                    "amount": 19,
                    "currency": "EUR"
                },
                "type": "BAG_FEE"
            }
        ],
        "serviceMode": "DELIVERY",
        "channel": "WHITELABEL_DELIVERY",
        "callbackUrl": "https://euw3-staging-bk-partners-api.rbictg.com/api/v1/orders/781f28e9-d6bb-4c8e-9ea6-e65a2e7c3764/price/callback",
        "id": "781f28e9-d6bb-4c8e-9ea6-e65a2e7c3764",
        "orderDiscounts": [
            {
                "plu": "948348",
                "type": "percentage",
                "value": 50
            }
        ],
        "storeId": "12349",
        "cart": {
            "menuSelections": [
                {
                    "externalReferenceId": "948348",
                    "quantity": 1,
                    "menuSelections": [
                        {
                            "externalReferenceId": "502633",
                            "quantity": 1,
                            "price": {
                                "amount": 0,
                                "currency": "EUR"
                            },
                            "id": "item_11107",
                            "type": "Item"
                        }
                    ],
                    "price": {
                        "amount": 645,
                        "currency": "EUR"
                    },
                    "id": "fbdead97-5acb-4d1c-a5fe-5794ece61aaa",
                    "type": "Reward"
                }
            ]
        }
    }
}

...