---
title: "Compute applicable rewards"
method: POST
path: "/manager/loyalty/v1/{source}/rewards/evaluate"
tags: ["manager_loyalty_endpoints"]
---

# Compute applicable rewards

`POST /manager/loyalty/v1/{source}/rewards/evaluate`

## Request

- Base URL: `https://partners.tryotter.com`
- URL: `https://partners.tryotter.com/manager/loyalty/v1/{source}/rewards/evaluate`
- Auth: OAuth 2
  - Authorization code: `/v1/auth/oauth2/authorize`
  - Client credentials
  - Token URL: `/v1/auth/token` scopes: `manager.loyalty`
- TypeScript: <https://skmtc.dev/cloudkitchens/apis/otter-api/docs/manager/loyalty/v1/:source/rewards/evaluate/post.ts> (a function with typed inputs; its response is checked against the schema)

`Supply both userId and order to get a list of applicable rewards for an order. Supply only userId to get a list of rewards the user can redeem` Rate limit: 8 requests per minute.

## Path parameters

- `source` string, required: Loyalty provider source

## Headers

- `X-Store-Id` string, required: The unique identifier of the store in your app. This ID, along with the `Application ID`, will be used to match the correct store when performing operations. It cannot be longer than 255 characters and must only contain printable ASCII characters. During on-boarding, this ID will be similar to `onboarding:905bb725-b141-4a9b-832a-1f254f772c94` (where the UUID is the Internal Store ID). During off-boarding, this field will be filled with the last known Store ID, or with an empty string, in case none is found. In that case, please fall back to the provided `internalStoreId` (a.k.a. Sku-Sku ID).

## Request body

- ComputeApplicableRewardsRequest: Request body for ComputeApplicableRewards API call.
  - `userId` string, required: The id of the user.
  - `order` Order2
    - `id` string: The id of the order in the partner's system.
    - `currencyCode` string: Currency code.
    - `items` Item2[]: The ordered items in the order.
      - `id` string: The id of the item in the partner's system.
      - `displayName` string: Name of the item.
      - `quantity` number: Quantity of item ordered.
      - `price` number: Price of item.
      - `modifiers` Item2[]: The modifiers of an item, such as size(small, medium, large), modifier share the same model as item, just in case we have nested modifiers.
    - `totals` Totals
      - `subTotal` number: Order subtotal.
      - `tax` number: Order tax.
      - `discount` number: Order discount.
      - `total` number: Order total.

## Response `200`

Compute applicable rewards response.

- ComputeApplicableRewardsResponse: Response body for ComputeApplicableRewards API call.
  - `rewards` Reward[]: List of rewards the user can redeem, depending on the reward type, only one of subtotal/menus will be present.
    - `id` string: The id of the reward.
    - `type` 'SUBTOTAL' | 'MENUS': The type of reward.
    - `cost` number: Cost of the reward, nullable, if null this reward can only be redeem once.
    - `costType` 'POINT' | 'DOLLAR': The type of cost, nullable, if null this reward can only be redeem once.
    - `trigger` Trigger: The preconditions to redeem this reward, for example, buy Fries to get a free Burger. Nullable, if null, this reward can be unconditionally redeemed.
      - `menus` TriggerMenu[]: The item/category preconditions to redeem this reward, for example, buy any drinks to get a free Burger.
        - `entityId` string: The id of the entity.
        - `entityType` 'ITEM' | 'CATEGORY': The type of entity.
        - `minimumPurchaseQuantity` number: Minimum quantity need to be purchased to activate the trigger.
    - `subtotal` SubtotalReward
      - `amount` number: Discount amount, if it's percentage discount, the percentage amount shown is in basis points, ie 1000 = 10% discount.
      - `type` 'ABSOLUTE_DISCOUNT' | 'PERCENT_DISCOUNT': The type of discount, absolute or percentage.
    - `menus` MenusReward[]: Item rewards, user can select from one of the items.
      - `entityId` string: The id of the entity, currently it's the item id.
      - `amount` number: Discount amount, if it's percentage discount, the percentage amount shown is in basis points, ie 1000 = 10% discount.
      - `type` 'ABSOLUTE_DISCOUNT' | 'PERCENT_DISCOUNT': The type of discount, absolute or percentage.

## Other responses

- `400`: The request is malformed.
- `401`: Invalid authorization.
- `403`: Authorization not valid for the requested resource.
- `422`: The request body is not valid.

---

[API](https://skmtc.dev/cloudkitchens/apis/otter-api.md) - [All operations](https://skmtc.dev/cloudkitchens/apis/otter-api/llms.txt) - [OpenAPI document](https://skmtc.dev/cloudkitchens/apis/otter-api/revisions/4c868194a467?raw)
