---
title: "Calculate"
method: POST
path: "/connect/wallet/spend/calculate"
tags: ["Wallet"]
---

# Calculate

`POST /connect/wallet/spend/calculate`

This API endpoint allows the calling application to work out the financial value of points based on the rules configured against the points scheme. These points are converted using the floor, ceiling, rate, step, bonus and pointsBack values.

## Headers

- `Accept-Encoding` '''' | ''gzip'' | ''deflate'' | ''gzip,deflate'' | ''deflate,gzip'', string
- `Connection` 'keep-alive' | 'close', string
- `Content-Type` string, string
- `X-EES-AUTH-CLIENT-ID` string, string, required
- `X-EES-AUTH-HASH` string, string, required
- `X-EES-TRANSACTION-ID` string, string
- `X-CUSTOM-SUBSYSTEM-ID` string, string
- `X-CUSTOM-KEY` string, string

## Request body

- object
  - `location` LocationEntity
    - `location` string, string — [Optional] Outlet incoming identifier where Transaction has happened
  - `identity` object, required
    - `identityValue` string, string — The value of the identity to use to find a wallet
  - `pointsValue` integer, nullable, required — The number of points for which to calculate the financial value. Either monetaryValue or pointsValue must be passed in the request.
  - `monetaryValue` integer, nullable, required — The currency value for which to use to calculate the points value. Either monetaryValue or pointsValue must be passed in the request.
  - `overrideTransactionCapabilities` boolean — Allows the calling application to override the response from the state machine and request a response on the spend calculations regardless of the state machine output.
  - `scheme` object — The details of the points scheme to find accounts in the target wallet. Either `id` or `reference` must be passed and not empty
    - `reference` string, string, nullable — The scheme reference to use to lookup a points account in the wallet associated to the identity passed
    - `id` string, string, nullable — The schemeId to use to lookup a points account in the wallet associated to the identity passed.
  - `basket` union, required
    - StandardBasketEntity
      - `type` 'STANDARD', required
      - `summary` object
        - `totalItems` integer, required — Basket Items count
        - `totalBasketValue` integer, required — Total Basket monetary Value after discounts, denominated to a smallest currency unit (e.g. for `USD` this value should be provided in `cents`)
        - `totalDiscountAmount` object
          - `promotions` integer, nullable — Promotions Discount Amount. If basket adjustment adds to discounts, this amount will be added to
          - `staff` integer, nullable — Staff Discount Amount
          - `general` integer, nullable — General Discount Amount
        - `totalQualifyingAmount` object, nullable
          - `points` integer — Basket Monetary Value for Loyalty Points calculations
          - `baseEarn` integer — Basket Monetary Value used for calculating base earn, overriding totalBasketValue. Adheres to basket discounts
          - `promotions` integer — Basket Monetary Value for Promotion Offer selections
          - `discount` integer — Basket Monetary Value for Discount calculations
          - `staff` integer — Basket Monetary Value for Staff Discount or Promotions
        - `totalTaxAmount` integer — Total Tax Amount denominated to a smallest currency unit (e.g. for `USD` this value should be provided in `cents`)
        - `adjustmentRules` AdjustmentRulesEntity
          - `externalAdjustment` boolean — If the object (summary/basket item) has been modified by the POS at all with information we don't know about
          - `externalAdjustmentReason` string — The reason for externalAdjustment
          - `ignore` boolean — Ignore object as if not sent
        - `redemptionChannel` string, string — The redemption channel used for this request
      - `contents` object[], nullable
        - `sku` string, string — Item SKU
        - `upc` string, string — Item SKU
        - `salesKey` 'SALE' | 'REFUND' | 'FULFIL' — `SALE`/`REFUND`/`FULFIL` Flag
        - `description` string, string — Product Name
        - `itemUnitCost` integer — Item Price per unit, denominated to a smaller currency unit
        - `itemUnitMetric` 'LITRES' | 'GRAMS' | 'MILLILITERS' | 'KILOGRAMS' | 'POUNDS' | 'OUNCES' | 'PIECE' | 'EACH' — The metric in which the item is measure (nullable)
        - `itemUnitCount` number — Item Quantity
        - `itemUnitDiscount` integer — Discount per Item
        - `totalUnitCost` integer — Total cost for this item
        - `totalUnitCostAfterDiscount` integer — Total cost for this item after discount (please note this does not take into account whole basket discounts)
        - `taxRate` number, float — Tax Rate (Percentage)
        - `taxAmount` integer — Tax Amount for that item, denominated to a smallest currency unit
        - `qualifies` object, nullable
          - `discount` boolean, required — Determines if the item is eligible for basket level discounting. If false this item will not qualify for basket level discounts but still qualify for product level discounts. However this is possible to override based on the ‘ignorePreviousExcludes’ key on a campaign.
          - `points` boolean, required — Determines if the item is eligible for Base Earn points. If false this item will not qualify for Base Earn points but still qualify for basket and product level discounts.
        - `meta` MetaEntity
          - `key1` string — Meta 1 property, up to 250 characters; up to 750 characters for Key 1 Value
          - `key2` string — Meta 2 property, up to 250 characters; up to 750 characters for Key 2 Value
        - `adjustmentRules` AdjustmentRulesEntity
          - `externalAdjustment` boolean — If the object (summary/basket item) has been modified by the POS at all with information we don't know about
          - `externalAdjustmentReason` string — The reason for externalAdjustment
          - `ignore` boolean — Ignore object as if not sent
        - `relatedContents` object[] — Recursive list of contents related to the parent item with the same schema as this object.
          - `sku` string, string — Item SKU
          - `upc` string, string — Item SKU
          - `salesKey` 'SALE' | 'REFUND' | 'FULFIL' — `SALE`/`REFUND`/`FULFIL` Flag
          - `description` string, string — Product Name
          - `itemUnitCost` integer — Item Price per unit, denominated to a smaller currency unit
          - `itemUnitMetric` 'LITRES' | 'GRAMS' | 'MILLILITERS' | 'KILOGRAMS' | 'POUNDS' | 'OUNCES' | 'PIECE' — The metric in which the item is measure (nullable)
          - `itemUnitCount` number — Item Quantity
          - `itemUnitDiscount` integer — Discount per Item
          - `totalUnitCost` integer — Total cost for this item
          - `totalUnitCostAfterDiscount` integer — Total cost for this item after discount (please note this does not take into account whole basket discounts)
          - `taxRate` number, float — Tax Rate (Percentage)
          - `taxAmount` integer — Tax Amount for that item, denominated to a smallest currency unit
          - `qualifies` object, nullable
            - `discount` boolean, required — Determines if the item is eligible for basket level discounting. If false this item will not qualify for basket level discounts but still qualify for product level discounts. However this is possible to override based on the ‘ignorePreviousExcludes’ key on a campaign.
            - `points` boolean, required — Determines if the item is eligible for Base Earn points. If false this item will not qualify for Base Earn points but still qualify for basket and product level discounts.
          - `meta` MetaEntity
            - `key1` string — Meta 1 property, up to 250 characters; up to 750 characters for Key 1 Value
            - `key2` string — Meta 2 property, up to 250 characters; up to 750 characters for Key 2 Value
          - `adjustmentRules` AdjustmentRulesEntity
            - `externalAdjustment` boolean — If the object (summary/basket item) has been modified by the POS at all with information we don't know about
            - `externalAdjustmentReason` string — The reason for externalAdjustment
            - `ignore` boolean — Ignore object as if not sent
          - `relatedContents` unknown
      - `payment` object[], nullable
        - `tenderType` string, string, required — Tender type - predefined by Eagle Eye
        - `amount` integer, required — Monetary amount of payment in lowest unit of currency
        - `bin` string, string — The bin for the tender
        - `identifier` string, string — An identifying value of what was scanned, could be a token, barcode, gift-card
    - EnrichedBasketEntity
      - `type` 'ENRICHED', required
      - `summary` object, required
        - `totalItems` integer, required — Basket Items count
        - `totalBasketValue` integer, required — Total Basket monetary Value after discounts, denominated to a smallest currency unit (e.g. for `USD` this value should be provided in `cents`)
        - `totalQualifyingAmount` object, nullable
          - `points` integer, nullable — Basket Monetary Value for Loyalty Points calculations
          - `baseEarn` integer — Basket Monetary Value used for calculating base earn, overriding totalBasketValue. Adheres to basket discounts
          - `promotions` integer, nullable — Basket Monetary Value for Promotion Offer selections
          - `discount` integer, nullable — Basket Monetary Value for Discount calculations
          - `staff` integer, nullable — Basket Monetary Value for Staff Discount or Promotions
        - `totalTaxAmount` integer, nullable — Total Tax Amount denominated to a smallest currency unit (e.g. for `USD` this value should be provided in `cents`)
        - `totalDiscountAmount` object
          - `promotions` integer, nullable — Promotions Discount Amount. If basket adjustment adds to discounts, this amount will be added to
          - `staff` integer, nullable — Staff Discount Amount
          - `general` integer, nullable — General Discount Amount
        - `fulfilledBaseEarn` object[] — Records the base earn points rewarded to customer during mid fulfil requests.
          - `targetedAccountId` string, string — EES AIR Account ID.
          - `points` integer — Total value of base earn points rewarded.
        - `adjustmentRules` AdjustmentRulesEntity
          - `externalAdjustment` boolean — If the object (summary/basket item) has been modified by the POS at all with information we don't know about
          - `externalAdjustmentReason` string — The reason for externalAdjustment
          - `ignore` boolean — Ignore object as if not sent
        - `tenderResults` object[]
          - `resourceType` 'CAMPAIGN' — EES Resource Type
          - `resourceId` string, string — EES AIR Resource ID (Campaign ID, Programme ID, Scheme ID)
          - `playOrderPosition` integer, nullable — The exact position the offer was triggered during analysis
          - `success` boolean, nullable
          - `type` 'redeem' | 'createRedeem' — Operation Type
          - `value` integer — Operation Amount
          - `isUnredeemable` boolean — Boolean Flag indicating if this offer should be Unredeemable
          - `relatedAccountIds` string[]
          - `targetedAccountId` string, string — EES AIR Account ID
          - `targetedWalletId` string, string, nullable — EES AIR Wallet ID. Nullable
          - `multiItem` string[]
          - `totalTenderAmount` integer — The amount of tender value in the lowest unit of currency
        - `adjustmentResults` object[]
          - `resourceType` 'CAMPAIGN' — EES Resource Type
          - `resourceId` string, string — EES AIR Resource ID (Campaign ID, Programme ID, Scheme ID)
          - `playOrderPosition` integer, nullable — The exact position the offer was triggered during analysis
          - `success` boolean, nullable
          - `type` 'redeem' | 'createRedeem' — Operation Type
          - `value` integer — Operation Amount
          - `isUnredeemable` boolean — Boolean Flag indicating if this offer should be Unredeemable
          - `relatedAccountIds` string[]
          - `targetedAccountId` string, string — EES AIR Account ID
          - `targetedWalletId` string, string, nullable — EES AIR Wallet ID. Nullable
          - `multiItem` string[]
          - `totalDiscountAmount` integer — The monetary effect of the discount in the lowest unit of currency
          - `totalMatchingUnits` integer — The number of products the adjustment was applied to
          - `instanceId` string, string — A mechanism to distinguish each individual reward that has been given for any account
        - `bounceBackResults` object[]
          - `resourceType` 'CAMPAIGN' — EES Resource Type
          - `resourceId` string, string — EES AIR Campaign Id
          - `playOrderPosition` integer, nullable — The exact position the offer was triggered during analysis
          - `success` boolean, nullable
          - `type` 'redeem'
          - `value` integer — Value of transaction
          - `balances` AccountBalancesEntity — The object of balances. Some balances only apply to certain types of accounts. See notes below on balances.
            - `available` integer — The available balance. This is applicable for all account types, except POINTS and CONTINUITY, which uses its own balance keys. For ECOUPON account type this property will be returned and will be equal to zero.
            - `refundable` integer — The refundable balance. This is applicable for all account types except POINTS and CONTINUITY, but is not used during account creation. For an Account Entity, the amount displayed here is the total refundable balance available. Please note for ECOUPON account type this property will be returned and equal to zero.
            - `totalSpend` integer — The total spend balance. Applicable only to CONTINUITY type Accounts. If totalSpend is not provided on creation, this will be set to 0.
            - `transactionCount` integer — The transaction counter. Applicable only to CONTINUITY type Accounts. If transactionCount is not provided on creation, this will be set to 0.
            - `current` integer — The current balance. Applicable only to accounts of type POINTS and STAMP. If not provided on creation, this will be set to 0.
            - `usable` integer — The usable balance. Applicable only to accounts of type POINTS. If not provided on creation, this will be set to 0.
            - `locked` integer — The locked balance. Applicable only to accounts of type POINTS. If not provided on creation, this will be set to 0.
            - `lifetime` integer — The lifetime balance. Applicable only to accounts of type POINTS and STAMP. If not provided on creation, this will be set to 0.
          - `isRefundable` boolean — Boolean Flag indicating if this offer should be refundable
          - `isUnredeemable` boolean — Boolean Flag indicating if this offer should be Unredeemable
          - `relatedAccounts` string[]
          - `targetAccountId` string, string — EES AIR Account ID
        - `qualifiesResults` object[] — If an offer was buy a pizza and get a free garlic bread, the pizza would have this entity against it
          - `totalMatchingUnits` integer — The number of products forming part of the offer's qualification
          - `totalMatchingSpend` integer — The monetary value this product contributes towards the offer's qualification
          - `instanceId` string, string — The reference back to the offer reward which these qualifiers relate
        - `adjudicationResults` object[]
          - `resourceType` 'CAMPAIGN' | 'PROGRAMME' | 'SCHEME' — EES Resource Type
          - `resourceId` string, string — EES AIR Resource ID (Campaign ID, Programme ID, Scheme ID)
          - `playOrderPosition` integer, nullable — The exact position the offer was triggered during analysis
          - `success` boolean, nullable
          - `type` 'redeem' | 'credit' | 'debit' | 'earn' | 'spend' — Operation Type
          - `value` integer — Operation Amount (please note&#58; value and balances attributes are mutually exclusive)
          - `balances` AccountBalancesEntity — The object of balances. Some balances only apply to certain types of accounts. See notes below on balances.
            - `available` integer — The available balance. This is applicable for all account types, except POINTS and CONTINUITY, which uses its own balance keys. For ECOUPON account type this property will be returned and will be equal to zero.
            - `refundable` integer — The refundable balance. This is applicable for all account types except POINTS and CONTINUITY, but is not used during account creation. For an Account Entity, the amount displayed here is the total refundable balance available. Please note for ECOUPON account type this property will be returned and equal to zero.
            - `totalSpend` integer — The total spend balance. Applicable only to CONTINUITY type Accounts. If totalSpend is not provided on creation, this will be set to 0.
            - `transactionCount` integer — The transaction counter. Applicable only to CONTINUITY type Accounts. If transactionCount is not provided on creation, this will be set to 0.
            - `current` integer — The current balance. Applicable only to accounts of type POINTS and STAMP. If not provided on creation, this will be set to 0.
            - `usable` integer — The usable balance. Applicable only to accounts of type POINTS. If not provided on creation, this will be set to 0.
            - `locked` integer — The locked balance. Applicable only to accounts of type POINTS. If not provided on creation, this will be set to 0.
            - `lifetime` integer — The lifetime balance. Applicable only to accounts of type POINTS and STAMP. If not provided on creation, this will be set to 0.
          - `isRefundable` boolean — Boolean Flag indicating if this offer should be refundable
          - `isUnredeemable` boolean — Boolean Flag indicating if this offer should be Unredeemable
          - `relatedAccounts` string[]
          - `targetedAccountId` string, string — EES AIR Account ID
          - `totalMatchingUnits` integer, nullable — The minimum number of products required to trigger offer
        - `results` EnrichedBasketSummaryResultsEntity
          - `points` object
            - `spend` integer — Total value of points spent during transaction
            - `debit` integer — Total value of points debited during transaction
            - `refund` integer — Total value of points clawed-back during refund transaction
            - `totalPointsTaken` integer — Sum of all negative balance actions (spend + debit + refund)
            - `earn` integer — Total value of points earned during transaction
            - `credit` integer — Total value of points credited during transaction
            - `totalPointsGiven` integer — Sum of all positive balance actions (earn + credit)
            - `totalMonetaryValue` integer — Monetary value of points using Scheme rules
            - `redemptionChannel` string, string — The redemption channel used for this request
        - `redemptionChannel` string, string — The redemption channel used for this request
      - `contents` object[], nullable
        - `sku` string, string — Item SKU
        - `upc` string, string — Item SKU
        - `salesKey` 'SALE' | 'REFUND' | 'FULFIL' — `SALE`/`REFUND`/`FULFIL` Flag
        - `description` string, string — Product Name
        - `itemUnitCost` integer — Item Price per unit, denominated to a smaller currency unit
        - `itemUnitMetric` 'LITRES' | 'GRAMS' | 'MILLILITERS' | 'KILOGRAMS' | 'POUNDS' | 'OUNCES' | 'PIECE' | 'EACH' — The metric in which the item is measure (nullable)
        - `itemUnitCount` number — Item Quantity
        - `itemFulfilmentCount` number, nullable — Number Of Items Fulfilled
        - `itemUnitDiscount` integer — Discount per Item
        - `totalUnitCost` integer — Total cost for this item
        - `totalUnitCostAfterDiscount` integer — Total cost for this item after discount (please note this does not take into account whole basket discounts)
        - `taxRate` number, float — The rate of tax being applied to this item (percentage)
        - `taxAmount` integer — Tax Amount for that item, denominated to a smallest currency unit
        - `qualifies` object, nullable
          - `discount` boolean, required — Determines if the item is eligible for discounting
          - `points` boolean, required — Determines if the item is eligible for points
        - `meta` MetaEntity
          - `key1` string — Meta 1 property, up to 250 characters; up to 750 characters for Key 1 Value
          - `key2` string — Meta 2 property, up to 250 characters; up to 750 characters for Key 2 Value
        - `adjustmentRules` AdjustmentRulesEntity
          - `externalAdjustment` boolean — If the object (summary/basket item) has been modified by the POS at all with information we don't know about
          - `externalAdjustmentReason` string — The reason for externalAdjustment
          - `ignore` boolean — Ignore object as if not sent
        - `adjustmentResults` object[]
          - `resourceType` 'CAMPAIGN' — EES Resource Type
          - `resourceId` string, string — EES AIR Resource ID (Campaign ID, Programme ID, Scheme ID)
          - `playOrderPosition` integer, nullable — The exact position the offer was triggered during analysis
          - `success` boolean, nullable
          - `type` 'redeem' | 'createRedeem' — Operation Type
          - `value` integer — Operation Amount
          - `isUnredeemable` boolean — Boolean Flag indicating if this offer should be Unredeemable
          - `relatedAccountIds` string[]
          - `targetedAccountId` string, string — EES AIR Account ID
          - `targetedWalletId` string, string, nullable — EES AIR Wallet ID. Nullable
          - `multiItem` string[]
          - `totalDiscountAmount` integer — The monetary effect of the discount in the lowest unit of currency
          - `totalMatchingUnits` integer — The number of products the adjustment was applied to
          - `instanceId` string, string — A mechanism to distinguish each individual reward that has been given for any account
        - `tenderResults` object[]
          - `resourceType` 'CAMPAIGN' — EES Resource Type
          - `resourceId` string, string — EES AIR Resource ID (Campaign ID, Programme ID, Scheme ID)
          - `playOrderPosition` integer, nullable — The exact position the offer was triggered during analysis
          - `success` boolean, nullable
          - `type` 'redeem' | 'createRedeem' — Operation Type
          - `value` integer — Operation Amount
          - `isUnredeemable` boolean — Boolean Flag indicating if this offer should be Unredeemable
          - `relatedAccountIds` string[]
          - `targetedAccountId` string, string — EES AIR Account ID
          - `targetedWalletId` string, string, nullable — EES AIR Wallet ID. Nullable
          - `multiItem` string[]
          - `totalTenderAmount` integer — The amount of tender value in the lowest unit of currency
        - `bounceBackResults` object[]
          - `resourceType` 'CAMPAIGN' — EES Resource Type
          - `resourceId` string, string — EES AIR Campaign Id
          - `playOrderPosition` integer, nullable — The exact position the offer was triggered during analysis
          - `success` boolean, nullable
          - `type` 'redeem'
          - `value` integer — Value of transaction
          - `balances` AccountBalancesEntity — The object of balances. Some balances only apply to certain types of accounts. See notes below on balances.
            - `available` integer — The available balance. This is applicable for all account types, except POINTS and CONTINUITY, which uses its own balance keys. For ECOUPON account type this property will be returned and will be equal to zero.
            - `refundable` integer — The refundable balance. This is applicable for all account types except POINTS and CONTINUITY, but is not used during account creation. For an Account Entity, the amount displayed here is the total refundable balance available. Please note for ECOUPON account type this property will be returned and equal to zero.
            - `totalSpend` integer — The total spend balance. Applicable only to CONTINUITY type Accounts. If totalSpend is not provided on creation, this will be set to 0.
            - `transactionCount` integer — The transaction counter. Applicable only to CONTINUITY type Accounts. If transactionCount is not provided on creation, this will be set to 0.
            - `current` integer — The current balance. Applicable only to accounts of type POINTS and STAMP. If not provided on creation, this will be set to 0.
            - `usable` integer — The usable balance. Applicable only to accounts of type POINTS. If not provided on creation, this will be set to 0.
            - `locked` integer — The locked balance. Applicable only to accounts of type POINTS. If not provided on creation, this will be set to 0.
            - `lifetime` integer — The lifetime balance. Applicable only to accounts of type POINTS and STAMP. If not provided on creation, this will be set to 0.
          - `isRefundable` boolean — Boolean Flag indicating if this offer should be refundable
          - `isUnredeemable` boolean — Boolean Flag indicating if this offer should be Unredeemable
          - `relatedAccounts` string[]
          - `targetAccountId` string, string — EES AIR Account ID
        - `qualifiesResults` object[] — If an offer was buy a pizza and get a free garlic bread, the pizza would have this entity against it
          - `totalMatchingUnits` integer — The number of products forming part of the offer's qualification
          - `totalMatchingSpend` integer — The monetary value this product contributes towards the offer's qualification
          - `instanceId` string, string — The reference back to the offer reward which these qualifiers relate
        - `contributionResults` object[], nullable — If an offer was spend £30 get £5 off, this entity would be against each of the products contributing to the £5 off, with their combined `value`s adding up to the £5.
          - `value` integer — The proportional contribution to the discount/points given
          - `instanceId` string, string — The reference back to the offer which these items contributed
        - `adjudicationResults` object[]
          - `resourceType` 'CAMPAIGN' | 'PROGRAMME' | 'SCHEME' — EES Resource Type
          - `resourceId` string, string — EES AIR Resource ID (Campaign ID, Programme ID, Scheme ID)
          - `playOrderPosition` integer, nullable — The exact position the offer was triggered during analysis
          - `success` boolean, nullable
          - `type` 'redeem' | 'credit' | 'debit' | 'earn' | 'spend' — Operation Type
          - `value` integer — Operation Amount (please note&#58; value and balances attributes are mutually exclusive)
          - `balances` AccountBalancesEntity — The object of balances. Some balances only apply to certain types of accounts. See notes below on balances.
            - `available` integer — The available balance. This is applicable for all account types, except POINTS and CONTINUITY, which uses its own balance keys. For ECOUPON account type this property will be returned and will be equal to zero.
            - `refundable` integer — The refundable balance. This is applicable for all account types except POINTS and CONTINUITY, but is not used during account creation. For an Account Entity, the amount displayed here is the total refundable balance available. Please note for ECOUPON account type this property will be returned and equal to zero.
            - `totalSpend` integer — The total spend balance. Applicable only to CONTINUITY type Accounts. If totalSpend is not provided on creation, this will be set to 0.
            - `transactionCount` integer — The transaction counter. Applicable only to CONTINUITY type Accounts. If transactionCount is not provided on creation, this will be set to 0.
            - `current` integer — The current balance. Applicable only to accounts of type POINTS and STAMP. If not provided on creation, this will be set to 0.
            - `usable` integer — The usable balance. Applicable only to accounts of type POINTS. If not provided on creation, this will be set to 0.
            - `locked` integer — The locked balance. Applicable only to accounts of type POINTS. If not provided on creation, this will be set to 0.
            - `lifetime` integer — The lifetime balance. Applicable only to accounts of type POINTS and STAMP. If not provided on creation, this will be set to 0.
          - `isRefundable` boolean — Boolean Flag indicating if this offer should be refundable
          - `isUnredeemable` boolean — Boolean Flag indicating if this offer should be Unredeemable
          - `relatedAccounts` string[]
          - `targetAccountId` string, string — EES AIR Account ID
          - `totalMatchingUnits` integer, nullable — The minimum number of products required to trigger offer
        - `relatedContents` object[] — Recursive list of contents related to the parent item with the same schema as this object.
          - `sku` string, string — Item SKU
          - `upc` string, string — Item SKU
          - `salesKey` 'SALE' | 'REFUND' | 'FULFIL' — `SALE`/`REFUND`/`FULFIL` Flag
          - `description` string, string — Product Name
          - `itemUnitCost` integer — Item Price per unit, denominated to a smaller currency unit
          - `itemUnitMetric` 'LITRES' | 'GRAMS' | 'MILLILITERS' | 'KILOGRAMS' | 'POUNDS' | 'OUNCES' | 'PIECE' — The metric in which the item is measure (nullable)
          - `itemUnitCount` number — Item Quantity
          - `itemFulfilmentCount` number, nullable — Number Of Items Fulfilled
          - `itemUnitDiscount` integer — Discount per Item
          - `totalUnitCost` integer — Total cost for this item
          - `totalUnitCostAfterDiscount` integer — Total cost for this item after discount (please note this does not take into account whole basket discounts)
          - `taxRate` number, float — The rate of tax being applied to this item (percentage)
          - `taxAmount` integer — Tax Amount for that item, denominated to a smallest currency unit
          - `qualifies` object, nullable
            - `discount` boolean, required — Determines if the item is eligible for discounting
            - `points` boolean, required — Determines if the item is eligible for points
          - `meta` MetaEntity
            - `key1` string — Meta 1 property, up to 250 characters; up to 750 characters for Key 1 Value
            - `key2` string — Meta 2 property, up to 250 characters; up to 750 characters for Key 2 Value
          - `adjustmentRules` AdjustmentRulesEntity
            - `externalAdjustment` boolean — If the object (summary/basket item) has been modified by the POS at all with information we don't know about
            - `externalAdjustmentReason` string — The reason for externalAdjustment
            - `ignore` boolean — Ignore object as if not sent
          - `adjustmentResults` object[]
            - `resourceType` 'CAMPAIGN' — EES Resource Type
            - `resourceId` string, string — EES AIR Resource ID (Campaign ID, Programme ID, Scheme ID)
            - `playOrderPosition` integer, nullable — The exact position the offer was triggered during analysis
            - `success` boolean, nullable
            - `type` 'redeem' | 'createRedeem' — Operation Type
            - `value` integer — Operation Amount
            - `isUnredeemable` boolean — Boolean Flag indicating if this offer should be Unredeemable
            - `relatedAccountIds` string[]
            - `targetedAccountId` string, string — EES AIR Account ID
            - `targetedWalletId` string, string, nullable — EES AIR Wallet ID. Nullable
            - `multiItem` string[]
            - `totalDiscountAmount` integer — The monetary effect of the discount in the lowest unit of currency
            - `totalMatchingUnits` integer — The number of products the adjustment was applied to
            - `instanceId` string, string — A mechanism to distinguish each individual reward that has been given for any account
          - `tenderResults` object[]
            - `resourceType` 'CAMPAIGN' — EES Resource Type
            - `resourceId` string, string — EES AIR Resource ID (Campaign ID, Programme ID, Scheme ID)
            - `playOrderPosition` integer, nullable — The exact position the offer was triggered during analysis
            - `success` boolean, nullable
            - `type` 'redeem' | 'createRedeem' — Operation Type
            - `value` integer — Operation Amount
            - `isUnredeemable` boolean — Boolean Flag indicating if this offer should be Unredeemable
            - `relatedAccountIds` string[]
            - `targetedAccountId` string, string — EES AIR Account ID
            - `targetedWalletId` string, string, nullable — EES AIR Wallet ID. Nullable
            - `multiItem` string[]
            - `totalTenderAmount` integer — The amount of tender value in the lowest unit of currency
          - `bounceBackResults` object[]
            - `resourceType` 'CAMPAIGN' — EES Resource Type
            - `resourceId` string, string — EES AIR Campaign Id
            - `playOrderPosition` integer, nullable — The exact position the offer was triggered during analysis
            - `success` boolean, nullable
            - `type` 'redeem'
            - `value` integer — Value of transaction
            - `balances` AccountBalancesEntity — The object of balances. Some balances only apply to certain types of accounts. See notes below on balances.
              - …
            - `isRefundable` boolean — Boolean Flag indicating if this offer should be refundable
            - `isUnredeemable` boolean — Boolean Flag indicating if this offer should be Unredeemable
            - `relatedAccounts` string[]
            - `targetAccountId` string, string — EES AIR Account ID
          - `qualifiesResults` object[] — If an offer was buy a pizza and get a free garlic bread, the pizza would have this entity against it
            - `totalMatchingUnits` integer — The number of products forming part of the offer's qualification
            - `totalMatchingSpend` integer — The monetary value this product contributes towards the offer's qualification
            - `instanceId` string, string — The reference back to the offer reward which these qualifiers relate
          - `adjudicationResults` object[]
            - `resourceType` 'CAMPAIGN' | 'PROGRAMME' | 'SCHEME' — EES Resource Type
            - `resourceId` string, string — EES AIR Resource ID (Campaign ID, Programme ID, Scheme ID)
            - `playOrderPosition` integer, nullable — The exact position the offer was triggered during analysis
            - `success` boolean, nullable
            - `type` 'redeem' | 'credit' | 'debit' | 'earn' | 'spend' — Operation Type
            - `value` integer — Operation Amount (please note&#58; value and balances attributes are mutually exclusive)
            - `balances` AccountBalancesEntity — The object of balances. Some balances only apply to certain types of accounts. See notes below on balances.
              - …
            - `isRefundable` boolean — Boolean Flag indicating if this offer should be refundable
            - `isUnredeemable` boolean — Boolean Flag indicating if this offer should be Unredeemable
            - `relatedAccounts` string[]
            - `targetAccountId` string, string — EES AIR Account ID
            - `totalMatchingUnits` integer, nullable — The minimum number of products required to trigger offer
          - `relatedContents` unknown
      - `payment` object[], nullable — Similar to standardPaymentEntity, except that any _tender_ offers used during adjustment, have an entry injected here, stipulating the tender amount to take off basket
        - `tenderType` string, string, required — Tender type - predefined by Eagle Eye, including a further type of _tenderCoupon_
        - `amount` integer, required — Monetary amount of payment/tender in lowest unit of currency
        - `bin` string, string — The bin for the tender
        - `identifier` string, string — An identifying value of what was scanned, could be a token, barcode, gift-card
        - `accountId` string, string — The EE AIR Account ID (only populated when tender is owned by EE)
      - `analysedDateTime` string, ees-date-time — Basket Analysis Date-Time in ATOM format
  - `options` object
    - `adjudicatePointsSpend` object
      - `includeOpenOffers` boolean — Determine if open Spend Rate Modifier coupons should be included in the analysis

## Response `200`

Response payload from calling the spend calculate endpoint

- SpendCalculateResponse
  - `wallet` WalletEntity
    - `walletId` string, required — Wallet ID
    - `friendlyName` string, required — Friendly Name of the Wallet
    - `status` 'ACTIVE' | 'SUSPENDED' | 'INACTIVE', required — Status of the Wallet.
    - `type` string, required — `TYPE` of that particular wallet. Could be defined per AIR Tenant as part of the Client Onboarding process and then used, if this list is not defined only NULL values are available.
    - `state` string, required — `STATE` of that particular wallet. Could be defined per AIR Tenant as part of the Client Onboarding process and then used, if this list is not defined only NULL values are available.
    - `relationships` WalletRelationshipsEntity, required
      - `parent` string[] — an Array of Wallet IDs that current Wallet should be / is parent
      - `child` string[] — an Array of Wallet IDs that current Wallet should be / is child
      - `associate` string[] — an Array of existing Wallet IDs that current Wallet should be / is associated to
      - `donor` string[] — an Array of existing Wallet IDs that current Wallet is donating into
    - `meta` MetaEntity, required
      - `key1` string — Meta 1 property, up to 250 characters; up to 750 characters for Key 1 Value
      - `key2` string — Meta 2 property, up to 250 characters; up to 750 characters for Key 2 Value
    - `dateCreated` string, date-time, required — Wallet creation date time
    - `lastUpdated` string, date-time, required — Wallet last updated date time
  - `identity` WalletIdentityEntity
    - `identityId` string, required — EES AIR Wallet Identity ID
    - `walletId` string, required — EES AIR Wallet ID
    - `type` string, required — Type of the Identity, list of possible enum values could be defined per Client as part of the Onboarding process.
    - `friendlyName` string, required — Wallet Identity friendly name
    - `value` string, required — Wallet Identity value
    - `safeValue` string, required — Identity Safe Value (e.g. "original value salted and hashed") - safeValue could be than used in external systems like analytics, referencing original identity, provide uniqueness within a retailer, but without exposing sensitive information like card number.
    - `secret` string, required — Wallet Identity secret
    - `dates` DatesEntity, required
      - `start` string, date-time
      - `end` string, date-time
    - `meta` MetaEntity, required
      - `key1` string — Meta 1 property, up to 250 characters; up to 750 characters for Key 1 Value
      - `key2` string — Meta 2 property, up to 250 characters; up to 750 characters for Key 2 Value
    - `state` string, required — Wallet Identity state, list of possible values could be defined and set-up per Client during Onboarding process.
    - `status` 'ACTIVE' | 'DELETED' | 'SUSPENDED' | 'LOST' | 'STOLEN' | 'INACTIVE', required — Identity status
    - `dateCreated` string, date-time, required — Date this identity was created
    - `lastUpdated` string, date-time, required — Date this identity was last updated
    - `mobileWallet` string, required — A url that can be used to add this identity to a mobile wallet (like Apple Wallet and Google Pay)
  - `transactionCapabilities` TransactionCapabilitiesEntity — This object outlines the operations which the customer is allowed to complete in relation to loyalty operations.
    - `loyalty` object, required
      - `earn` boolean — Determines if the wallet allows earning of points.
      - `spend` boolean — Determines if the wallet allows spending of points.
  - `spendAdjudicationResults` SpendAdjudicationResultsEntity
    - `pointsValue` integer — The number of points that are allowed to be spent based on the number passed in.
    - `pointsRemainder` integer — The number of points that cannot be spent due to the available tiers and stepping rules.
    - `monetaryValue` integer — The monetary value of the points that are available to be spent in relation to `pointsValue`. This includes any available bonuses applied.
    - `balanceAfter` SpendBalancesAfterEntity — The object of balanceAfter.
      - `current` integer — The current balance.
      - `usable` integer — The usable balance.
      - `locked` integer — The locked balance.
      - `lifetime` integer — The lifetime balance.
      - `lifetimeSpend` integer — The amount that has been spent on this account it's lifetime.
      - `lifetimeSpendValue` integer — The monetary value of the points that have been spent over the lifetime of this account.
    - `appliedTier` SpendTierEntity
      - `floor` integer — Spend Tier lower limit
      - `ceiling` integer — Spend Tier upper limit
      - `step` integer, nullable — Spend Tier increments that points can be spent in (e.g. if points can be exchanged at 5,000, 10,000, 15,000 and so on, the `step` should be equal 5,000)
      - `rate` number, float, nullable — Spend Tier Exchange Rate (for example if `rate=0.1` would indicate each point is worth 1/10 of smallest currency denomination, i.e. 1/10 of a penny or a cent)
      - `bonus` integer — Spend Tier bonus to be added to the exchange value if this Tier definition is used.
      - `pointsBack` integer, nullable — Spend Tier number of points to be credited back to the points account following a points spend transaction if this Tier definition is used.
    - `operations` SpendOperationsEntity[]
      - `resourceType` 'SCHEME' | 'CAMPAIGN' — The determination if this is a scheme or campaign based operation.
      - `resourceId` string, string — The ID of the campaign or scheme related to this operation.
      - `accountId` string, string — The account against which the determined operation is to be performed.
      - `walletId` string, string — The walletId in which the account resides.
      - `operationType` 'spend' | 'credit' | 'redeem' | 'createRedeem' — The type of operation to apply.
      - `value` integer — The value of the operation to apply.
      - `details` object, nullable
      - `balances` object, nullable — The balances of the account to be adjusted. If the operation type is `spend`, the `current`, `lifetime_spend`, and `lifetime_spend_value` are all required. If the operation is `credit`, the current value is required, if the operation type is `redeem` this key is not required.
        - `current` integer — The adjustment to make to the current balance. This value is a points value.
        - `lifetime_spend` integer — The adjustment to make to the lifetime_spend balance. This value is a points value.
        - `lifetime_spend_value` integer — The adjustment to make to the lifetime_spend_value balance. This value is a monetary value.
    - `analysedDateTime` string, ees-date-time — SpendAdjudicationResults Date-Time in ATOM format
    - `excludedProducts` object — A list of all Scheme Ids which exclude products with their corresponding product identifiers.

## Other responses

- `400` — EES AIR refuse to process that particular Request as there is something wrong with the Request (e.g. Request Payload is unprocessable, Mandatory Request Parameter value is not provided, etc.)
- `401` — EES AIR refuse to process that particular Request due to Authentication error(s). This could be caused by missing one or more of mandatory AUTH headers, invalid Hash calculation, invalid or inactive API Key used, etc.
- `403` — EES AIR refuse to process that particular Request due to Authorisation error(s). Please note nothing is wrong with Authentication nor hash Calculation, it is simply due to lack of permission to perform that particular action (e.g. Issuance Partner attempts to Redeem a Token or Redemption Partner attempts to Issue a Token, etc.)
- `404` — EES AIR refuse to process that particular Request as requested Resource could not be found or referenced Resource is not active.
- `409` — EES AIR understands this request, but refuse to process it, due to present Conflict with the current state of the target resource or because performing this operation would lead to a Conflict within AIR.
- `415` — EES AIR refuse to process that particular Request as requested `Mime-Type` is not supported (Currently only `application/json` is supported
- `429` — EES AIR refuses to process that particular Request as Client's API Requests Limit was exceeded.
- `500` — EES AIR is not able to process that particular Request due to Unexpected Server Error.
- `503` — EES AIR refuses to process that particular Request due to Service(s) being Unavailable (i.e. Scheduled Maintenance)
- `504` — EES AIR refuses to process that particular Request due to Networking Issues

---

[API](https://skmtc.net/eagleeye/apis/wallet-api.md) · [All operations](https://skmtc.net/eagleeye/apis/wallet-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/eagleeye/wallet-api/revisions/90a122bb14cc/schema)
