> ## Documentation Index
> Fetch the complete documentation index at: https://loyalty-interchange.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Evaluate accrual and available rewards



## OpenAPI

````yaml /api-reference/openapi.yaml post /orders/evaluate
openapi: 3.1.2
info:
  title: Loyalty Interchange Protocol
  version: 0.1.0
  description: Vendor-neutral loyalty transaction API with the foodservice/1.0 profile.
  license:
    name: Apache-2.0
    identifier: Apache-2.0
servers:
  - url: https://loyalty.example.com/lip/v1
security:
  - bearerAuth: []
tags:
  - name: Discovery
  - name: Programs
  - name: Accounts
  - name: Ledger
  - name: Members
  - name: Orders
  - name: Accruals
  - name: Redemptions
  - name: Issued Rewards
paths:
  /orders/evaluate:
    post:
      tags:
        - Orders
      summary: Evaluate accrual and available rewards
      operationId: evaluateOrder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EvaluationRequest'
      responses:
        '200':
          description: Evaluate accrual and available rewards
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EvaluationResponse'
        default:
          $ref: '#/components/responses/Problem'
components:
  schemas:
    EvaluationRequest:
      title: EvaluationRequest
      additionalProperties: false
      type: object
      required:
        - context
        - member_id
        - order
      properties:
        context:
          additionalProperties: false
          type: object
          required:
            - protocol_version
            - profile
            - request_id
            - idempotency_key
            - occurred_at
            - source
          properties:
            protocol_version:
              const: '1.0'
              type: string
            profile:
              const: foodservice/1.0
              type: string
            request_id:
              minLength: 1
              maxLength: 128
              pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
              description: Opaque, stable identifier within the owning system.
              type: string
            idempotency_key:
              minLength: 8
              maxLength: 255
              type: string
            occurred_at:
              format: date-time
              type: string
            source:
              additionalProperties: false
              type: object
              required:
                - system
              properties:
                system:
                  minLength: 1
                  maxLength: 128
                  pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
                  description: Opaque, stable identifier within the owning system.
                  type: string
                instance:
                  minLength: 1
                  maxLength: 128
                  pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
                  description: Opaque, stable identifier within the owning system.
                  type: string
        member_id:
          minLength: 1
          maxLength: 128
          pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
          description: Opaque, stable identifier within the owning system.
          type: string
        order:
          additionalProperties: false
          type: object
          required:
            - order_id
            - scope
            - channel
            - status
            - business_date
            - placed_at
            - lines
            - totals
          properties:
            order_id:
              minLength: 1
              maxLength: 128
              pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
              description: Opaque, stable identifier within the owning system.
              type: string
            order_number:
              minLength: 1
              maxLength: 128
              type: string
            scope:
              additionalProperties: false
              type: object
              required:
                - program_id
                - brand_id
                - merchant_id
                - location_id
              properties:
                program_id:
                  minLength: 1
                  maxLength: 128
                  pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
                  description: Opaque, stable identifier within the owning system.
                  type: string
                brand_id:
                  minLength: 1
                  maxLength: 128
                  pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
                  description: Opaque, stable identifier within the owning system.
                  type: string
                merchant_id:
                  minLength: 1
                  maxLength: 128
                  pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
                  description: Opaque, stable identifier within the owning system.
                  type: string
                location_id:
                  minLength: 1
                  maxLength: 128
                  pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
                  description: Opaque, stable identifier within the owning system.
                  type: string
                franchisee_id:
                  minLength: 1
                  maxLength: 128
                  pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
                  description: Opaque, stable identifier within the owning system.
                  type: string
            member_id:
              minLength: 1
              maxLength: 128
              pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
              description: Opaque, stable identifier within the owning system.
              type: string
            channel:
              anyOf:
                - const: counter
                  type: string
                - const: drive_thru
                  type: string
                - const: kiosk
                  type: string
                - const: web
                  type: string
                - const: mobile
                  type: string
                - const: pickup
                  type: string
                - const: delivery
                  type: string
                - const: catering
                  type: string
                - const: third_party
                  type: string
                - const: other
                  type: string
            status:
              anyOf:
                - const: open
                  type: string
                - const: authorized
                  type: string
                - const: paid
                  type: string
                - const: partially_refunded
                  type: string
                - const: refunded
                  type: string
                - const: voided
                  type: string
            business_date:
              pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}$
              type: string
            placed_at:
              format: date-time
              type: string
            closed_at:
              format: date-time
              type: string
            lines:
              minItems: 1
              type: array
              items:
                additionalProperties: false
                type: object
                required:
                  - line_id
                  - kind
                  - product_id
                  - quantity
                  - unit_price
                  - subtotal
                  - discount
                  - tax
                properties:
                  line_id:
                    minLength: 1
                    maxLength: 128
                    pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
                    description: Opaque, stable identifier within the owning system.
                    type: string
                  kind:
                    anyOf:
                      - const: item
                        type: string
                      - const: modifier
                        type: string
                      - const: fee
                        type: string
                  product_id:
                    minLength: 1
                    maxLength: 128
                    pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
                    description: Opaque, stable identifier within the owning system.
                    type: string
                  sku:
                    minLength: 1
                    maxLength: 128
                    type: string
                  name:
                    minLength: 1
                    maxLength: 255
                    type: string
                  parent_line_id:
                    minLength: 1
                    maxLength: 128
                    pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
                    description: Opaque, stable identifier within the owning system.
                    type: string
                  quantity:
                    minimum: 1
                    type: integer
                  unit_price:
                    additionalProperties: false
                    type: object
                    required:
                      - amount
                      - currency
                    properties:
                      amount:
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                        description: Signed amount in the currency's minor unit.
                        type: integer
                      currency:
                        pattern: ^[A-Z]{3}$
                        type: string
                  subtotal:
                    additionalProperties: false
                    type: object
                    required:
                      - amount
                      - currency
                    properties:
                      amount:
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                        description: Signed amount in the currency's minor unit.
                        type: integer
                      currency:
                        pattern: ^[A-Z]{3}$
                        type: string
                  discount:
                    additionalProperties: false
                    type: object
                    required:
                      - amount
                      - currency
                    properties:
                      amount:
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                        description: Signed amount in the currency's minor unit.
                        type: integer
                      currency:
                        pattern: ^[A-Z]{3}$
                        type: string
                  tax:
                    additionalProperties: false
                    type: object
                    required:
                      - amount
                      - currency
                    properties:
                      amount:
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                        description: Signed amount in the currency's minor unit.
                        type: integer
                      currency:
                        pattern: ^[A-Z]{3}$
                        type: string
                  category_ids:
                    uniqueItems: true
                    type: array
                    items:
                      minLength: 1
                      maxLength: 128
                      pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
                      description: Opaque, stable identifier within the owning system.
                      type: string
                  tags:
                    uniqueItems: true
                    type: array
                    items:
                      maxLength: 64
                      type: string
                  loyalty_eligible:
                    type: boolean
                  metadata:
                    description: >-
                      Non-normative extension data. Consumers must ignore
                      unknown keys.
                    type: object
                    patternProperties:
                      ^(.*)$: {}
            totals:
              additionalProperties: false
              type: object
              required:
                - subtotal
                - discount
                - tax
                - tip
                - service_charge
                - total
              properties:
                subtotal:
                  additionalProperties: false
                  type: object
                  required:
                    - amount
                    - currency
                  properties:
                    amount:
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                      description: Signed amount in the currency's minor unit.
                      type: integer
                    currency:
                      pattern: ^[A-Z]{3}$
                      type: string
                discount:
                  additionalProperties: false
                  type: object
                  required:
                    - amount
                    - currency
                  properties:
                    amount:
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                      description: Signed amount in the currency's minor unit.
                      type: integer
                    currency:
                      pattern: ^[A-Z]{3}$
                      type: string
                tax:
                  additionalProperties: false
                  type: object
                  required:
                    - amount
                    - currency
                  properties:
                    amount:
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                      description: Signed amount in the currency's minor unit.
                      type: integer
                    currency:
                      pattern: ^[A-Z]{3}$
                      type: string
                tip:
                  additionalProperties: false
                  type: object
                  required:
                    - amount
                    - currency
                  properties:
                    amount:
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                      description: Signed amount in the currency's minor unit.
                      type: integer
                    currency:
                      pattern: ^[A-Z]{3}$
                      type: string
                service_charge:
                  additionalProperties: false
                  type: object
                  required:
                    - amount
                    - currency
                  properties:
                    amount:
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                      description: Signed amount in the currency's minor unit.
                      type: integer
                    currency:
                      pattern: ^[A-Z]{3}$
                      type: string
                total:
                  additionalProperties: false
                  type: object
                  required:
                    - amount
                    - currency
                  properties:
                    amount:
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                      description: Signed amount in the currency's minor unit.
                      type: integer
                    currency:
                      pattern: ^[A-Z]{3}$
                      type: string
            tenders:
              minItems: 1
              type: array
              items:
                additionalProperties: false
                type: object
                required:
                  - tender_id
                  - type
                  - amount
                properties:
                  tender_id:
                    minLength: 1
                    maxLength: 128
                    pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
                    description: Opaque, stable identifier within the owning system.
                    type: string
                  type:
                    anyOf:
                      - const: cash
                        type: string
                      - const: card
                        type: string
                      - const: gift_card
                        type: string
                      - const: loyalty
                        type: string
                      - const: third_party
                        type: string
                      - const: other
                        type: string
                  amount:
                    additionalProperties: false
                    type: object
                    required:
                      - amount
                      - currency
                    properties:
                      amount:
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                        description: Signed amount in the currency's minor unit.
                        type: integer
                      currency:
                        pattern: ^[A-Z]{3}$
                        type: string
            metadata:
              description: >-
                Non-normative extension data. Consumers must ignore unknown
                keys.
              type: object
              patternProperties:
                ^(.*)$: {}
    EvaluationResponse:
      title: EvaluationResponse
      additionalProperties: false
      type: object
      required:
        - context
        - evaluation_id
        - member_id
        - order_id
        - estimated_accrual
        - rewards
        - balances
        - expires_at
      properties:
        context:
          additionalProperties: false
          type: object
          required:
            - protocol_version
            - profile
            - request_id
            - processed_at
          properties:
            protocol_version:
              const: '1.0'
              type: string
            profile:
              const: foodservice/1.0
              type: string
            request_id:
              minLength: 1
              maxLength: 128
              pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
              description: >-
                Echoes the request's request_id. On an idempotent replay it
                echoes the replaying request's request_id, not the original.
              type: string
            processed_at:
              format: date-time
              type: string
        evaluation_id:
          minLength: 1
          maxLength: 128
          pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
          description: Opaque, stable identifier within the owning system.
          type: string
        member_id:
          minLength: 1
          maxLength: 128
          pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
          description: Opaque, stable identifier within the owning system.
          type: string
        order_id:
          minLength: 1
          maxLength: 128
          pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
          description: Opaque, stable identifier within the owning system.
          type: string
        estimated_accrual:
          additionalProperties: false
          type: object
          required:
            - unit
            - amount
          properties:
            unit:
              anyOf:
                - const: points
                  type: string
                - const: visits
                  type: string
                - const: stamps
                  type: string
                - const: credits
                  type: string
                - const: custom
                  type: string
            amount:
              type: integer
        estimated_accruals:
          minItems: 1
          type: array
          items:
            additionalProperties: false
            type: object
            required:
              - unit
              - amount
            properties:
              unit:
                anyOf:
                  - const: points
                    type: string
                  - const: visits
                    type: string
                  - const: stamps
                    type: string
                  - const: credits
                    type: string
                  - const: custom
                    type: string
              amount:
                type: integer
        rewards:
          type: array
          items:
            additionalProperties: false
            type: object
            required:
              - reward_id
              - status
              - cost
              - effect
              - funding
            properties:
              reward_id:
                minLength: 1
                maxLength: 128
                pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
                description: Opaque, stable identifier within the owning system.
                type: string
              name:
                minLength: 1
                maxLength: 255
                type: string
              status:
                anyOf:
                  - const: available
                    type: string
                  - const: unavailable
                    type: string
              unavailable_reasons:
                minItems: 1
                type: array
                items:
                  minLength: 1
                  maxLength: 128
                  type: string
              cost:
                additionalProperties: false
                type: object
                required:
                  - unit
                  - amount
                properties:
                  unit:
                    anyOf:
                      - const: points
                        type: string
                      - const: visits
                        type: string
                      - const: stamps
                        type: string
                      - const: credits
                        type: string
                      - const: custom
                        type: string
                  amount:
                    minimum: 0
                    type: integer
              effect:
                anyOf:
                  - additionalProperties: false
                    type: object
                    required:
                      - type
                      - target
                      - amount
                      - allocations
                    properties:
                      type:
                        const: discount
                        type: string
                      target:
                        anyOf:
                          - const: order
                            type: string
                          - const: line
                            type: string
                      amount:
                        additionalProperties: false
                        type: object
                        required:
                          - amount
                          - currency
                        properties:
                          amount:
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                            description: Signed amount in the currency's minor unit.
                            type: integer
                          currency:
                            pattern: ^[A-Z]{3}$
                            type: string
                      allocations:
                        minItems: 1
                        type: array
                        items:
                          additionalProperties: false
                          type: object
                          required:
                            - amount
                          properties:
                            line_id:
                              minLength: 1
                              maxLength: 128
                              pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
                              description: >-
                                Opaque, stable identifier within the owning
                                system.
                              type: string
                            amount:
                              additionalProperties: false
                              type: object
                              required:
                                - amount
                                - currency
                              properties:
                                amount:
                                  minimum: -9007199254740991
                                  maximum: 9007199254740991
                                  description: Signed amount in the currency's minor unit.
                                  type: integer
                                currency:
                                  pattern: ^[A-Z]{3}$
                                  type: string
                  - additionalProperties: false
                    type: object
                    required:
                      - type
                      - max_quantity
                      - max_value
                    properties:
                      type:
                        const: free_item
                        type: string
                      product_ids:
                        minItems: 1
                        uniqueItems: true
                        type: array
                        items:
                          minLength: 1
                          maxLength: 128
                          pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
                          description: Opaque, stable identifier within the owning system.
                          type: string
                      category_ids:
                        minItems: 1
                        uniqueItems: true
                        type: array
                        items:
                          minLength: 1
                          maxLength: 128
                          pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
                          description: Opaque, stable identifier within the owning system.
                          type: string
                      max_quantity:
                        minimum: 1
                        type: integer
                      max_value:
                        additionalProperties: false
                        type: object
                        required:
                          - amount
                          - currency
                        properties:
                          amount:
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                            description: Signed amount in the currency's minor unit.
                            type: integer
                          currency:
                            pattern: ^[A-Z]{3}$
                            type: string
                  - additionalProperties: false
                    type: object
                    required:
                      - type
                      - effect_type
                      - payload
                    properties:
                      type:
                        const: custom
                        type: string
                      effect_type:
                        minLength: 1
                        maxLength: 255
                        type: string
                      payload: {}
              funding:
                minItems: 1
                type: array
                items:
                  additionalProperties: false
                  type: object
                  required:
                    - party_id
                    - party_type
                    - share_bps
                  properties:
                    party_id:
                      minLength: 1
                      maxLength: 128
                      pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
                      description: Opaque, stable identifier within the owning system.
                      type: string
                    party_type:
                      anyOf:
                        - const: brand
                          type: string
                        - const: franchisee
                          type: string
                        - const: location
                          type: string
                        - const: merchant
                          type: string
                        - const: partner
                          type: string
                    share_bps:
                      minimum: 1
                      maximum: 10000
                      type: integer
                    amount:
                      additionalProperties: false
                      type: object
                      required:
                        - amount
                        - currency
                      properties:
                        amount:
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                          description: Signed amount in the currency's minor unit.
                          type: integer
                        currency:
                          pattern: ^[A-Z]{3}$
                          type: string
        balances:
          type: array
          items:
            additionalProperties: false
            type: object
            required:
              - account_id
              - member_id
              - program_id
              - unit
              - amount
              - reserved
              - available
              - as_of
            properties:
              account_id:
                minLength: 1
                maxLength: 128
                pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
                description: Opaque, stable identifier within the owning system.
                type: string
              member_id:
                minLength: 1
                maxLength: 128
                pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
                description: Opaque, stable identifier within the owning system.
                type: string
              program_id:
                minLength: 1
                maxLength: 128
                pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
                description: Opaque, stable identifier within the owning system.
                type: string
              unit:
                anyOf:
                  - const: points
                    type: string
                  - const: visits
                    type: string
                  - const: stamps
                    type: string
                  - const: credits
                    type: string
                  - const: custom
                    type: string
              unit_label:
                minLength: 1
                maxLength: 64
                type: string
              amount:
                type: integer
              reserved:
                minimum: 0
                type: integer
              available:
                type: integer
              as_of:
                format: date-time
                type: string
        expires_at:
          format: date-time
          type: string
    ProblemDetails:
      title: ProblemDetails
      additionalProperties: true
      type: object
      required:
        - type
        - title
        - status
      properties:
        type:
          format: uri-reference
          type: string
        title:
          minLength: 1
          type: string
        status:
          minimum: 400
          maximum: 599
          type: integer
        detail:
          type: string
        instance:
          format: uri-reference
          type: string
        code:
          minLength: 1
          maxLength: 128
          type: string
        errors:
          type: array
          items:
            additionalProperties: false
            type: object
            required:
              - path
              - message
            properties:
              path:
                type: string
              message:
                type: string
  responses:
    Problem:
      description: RFC 9457 problem details
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````