Otter Manager Loyalty Endpoints API

Endpoints to manage loyalty.

OpenAPI Specification

otter-manager-loyalty-endpoints-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Public Account Pairing Endpoints Manager Loyalty Endpoints API
  description: "# Overview\n\nThe API endpoints are developed around [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) principles secure via the OAuth2.0 protocol.\n\nBeyond the entry points, the API also provides a line of communication into your system via [webhooks](https://en.wikipedia.org/wiki/Webhook).\n\nFor testing purposes, we offer a staging environment. Also, more detailed information about the business rules and workflows can be found on the [**Documentation Section**](/docs/)\n\n## Versioning\nEach API is versioned individually, but we follow these rules:\n- Non breaking changes (eg: adding new fields) are added in the current version without previous communication\n- Breaking changes (fields removal, semantic changed or schema update) have the version incremented\n- Users will be notified about new versions and will be given time to migrate (the time will be set on a case by case basis)\n- Once users migrate to the new version, we will deprecate the old ones\n- Once there is a new version for an API, we won't accept new integrations targeting old versions\n\n## API General Definitions\nThe APIs use resource-oriented URLs communicating, primarily, via JSON and leveraging the HTTP headers, [response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status), and verbs.\n\nTo exemplify how the API is to be consumed, consider a fake GET resource endpoint invocation below:\n\n```\ncurl --request GET 'https://{{public-api-url}}/v1/resource/123' \\\n--header 'Authorization: Bearer 34fdabeeafds=' --header 'X-Store-Id: 321'\n```\n\n|      Header      | Description |\n| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n|`Authorization`   | Standard HTTP header is used to associate the request with the originating invoker. The content of this header is a `Bearer` token generated from you client_secret, defined in the [API Auth](#/section/Guides/API-Auth) guide.|\n|`X-Store-Id`      | The ID of the store in your system this call acts on behalf of. |\n\n_All resource endpoints expect the `Authorization` header, the remaining headers are explicitly stated in the individual endpoint documentation section._\n\nWith these headers, the system will:\n - Validate the client token, making sure the call is originating from a trusted source.\n - Validate that the Application has the permission to access the `v1/resource/{id}` resource via the Application's pre-configured scopes.\n - Translate your X-Store-Id to our internal store ID (e.g. `AAA`).\n - Validate and retrieve resource `AAA`, that is associated to your Application via store id `321`.\n\nPOST/PUT methods will look similar to the GET calls, but they'll take in a body in the HTTP request (default to the application/json content-type).\n\n```\ncurl --location --request POST 'https://{{public-api-url}}/v1/resource' \\\n--header 'Authorization: Bearer 34fdabeeafds=' --header 'X-Store-Id: 321'\n--data '{\"foo\": \"bar\"}'\n```\n\n## API Authentication/Authorization\n\n<SecurityDefinitions />\n\n## Webhook\n\nThe Public API is able to send notifications to your system via HTTP POST requests.\n\nEvery webhook is signed using HMAC-SHA256 that is present in the header `X-HMAC-SHA256`, and you can also authenticate the requests using Basic Auth, Bearer Token or HMAC-SHA1 (legacy). Please, refer to [**Webhook Authentication Guide**](/docs/guides-webhook-authentication/) for more details.\n\n_Please work with your Account Representative to setup your Application's Webhook configurations._\n\n```\nExample Base-URL = https://{{your-server-url}}/webhook\n```\n\n### Notification Schema\n\n| **Name**                | **Type** | **Description**                                                      |\n| ------------------------| ---------| -------------------------------------------------------------------- |\n| eventId                 | string   | Unique id of the event.                                              |\n| eventTime               | string   | The time the event occurred.                                         |\n| eventType               | string   | The type of event (e.g. create_order).                               |\n| metadata.storeId        | string   | Id of the store for which the event is being published.              |\n| metadata.applicationId  | string   | Id of the application for which the event is being published.        |\n| metadata.resourceId     | string   | The external identifier of the resource that this event refers to.   |\n| metadata.resourceHref   | string   | The endpoint to fetch the details of the resource.                   |\n| metadata.payload        | object   | The event object which will be detailed in each Webhook description. |\n\n### Notification Request Example\n\n```\ncurl --location --request POST 'https://{{your-server-url}}/webhook' \\\n--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36' \\\n--header 'Authorization: MAC <hash signature>' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n   \"eventId\": \"123456\",\n   \"eventTime\": \"2020-10-10T20:06:02:123Z\",\n   \"eventType\": \"orders.new_order\",\n   \"metadata\": {\n      \"storeId\": \"755fd19a-7562-487a-b615-171a9f89d669\",\n      \"applicationId\": \"e22f94b3-967c-4e26-bf39-9e364066b68b\",\n      \"resourceHref\": \"https://{{public-api-url}}/v1/orders/bf9f1d81-f213-496e-a026-91b6af44996c\",\n      \"resourceId\": \"bf9f1d81-f213-496e-a026-91b6af44996c\",\n      \"payload\": {}\n   }\n}\n```\n\n### Expected Response\n\nThe partner application should return an HTTP 200 response code with an empty response body to acknowledge receipt of the webhook event.\n## Rate Limiting\nPlease, refer to [**Rate Limiting Guide**](/docs/guides-rate-limiting/) for more details.\n\n## Error codes\nThe APIs use standard HTTP status codes to indicate the success or failure of a request. Error codes are divided into two categories: 4XX codes for client-side errors and 5xx codes for server-side errors.\n### 4XX Client-Side Errors\nClient-side errors are indicated by status codes in the 4xx range. These errors are typically the result of a problem with the request made by your application.\nIf a client-side error occurs, our API will return a response that includes an appropriate error message. This message will provide information about the cause of the error. The aim of these messages is to assist you in identifying and resolving the issue.\nFor example, if you submit a request with missing or invalid parameters, you might receive a 400 Bad Request error with a message indicating which parameters were missing or incorrect.\n### 5XX Server-Side Errors\nServer-side errors are represented by status codes in the 5xx range. These errors suggest a problem with our server, not with your application's request.\nServer-side errors are typically transient, meaning they are temporary. If a server-side error occurs, we recommend that the client retries the same request with the exact same parameters.\nFor example, if you get a 500 Internal Server Error, it's possible that our server is suffering a temporary problem. In such cases, retrying the request after a short delay is often successful.\nIf you continually receive server-side errors, reach out to our support team for further assistance."
  version: v1
  license:
    name: Proprietary
  contact:
    name: Kin Lane
    email: kin@apievangelist.com
  x-generated-from: documentation
  x-source-url: https://developer-guides.tryotter.com/api-reference/
  x-last-validated: '2026-06-03'
servers:
- url: https://{public-api-url}/
  description: Otter Public API base URL. The concrete host is provisioned per integration partner/account via your Otter account representative; substitute the value provided during onboarding.
  variables:
    public-api-url:
      default: public-api-url
      description: Account-specific Public API host provided by Otter during onboarding.
tags:
- name: Manager Loyalty Endpoints
  description: Endpoints to manage loyalty.
  x-displayName: Loyalty Manager
paths:
  /manager/loyalty/v1/{source}/user/enrollment-config:
    get:
      tags:
      - Manager Loyalty Endpoints
      summary: Otter Get Enrollment Config for a Loyalty Provider
      description: '`RATE LIMIT: 8 per minute`

        '
      operationId: getEnrollmentConfig
      parameters:
      - $ref: '#/components/parameters/storeIdHeader'
      - $ref: '#/components/parameters/source-2'
      responses:
        '200':
          description: Enrollment config for the loyalty provider.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetEnrollmentConfigResponse'
              examples:
                GetEnrollmentConfig200Example:
                  summary: Default getEnrollmentConfig 200 response
                  x-microcks-default: true
                  value:
                    enrollmentFields:
                    - key: full_name
                      required: true
                      type: FULL_NAME
                      label: First Name and Last Name
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '422':
          $ref: '#/components/responses/422'
      security:
      - OAuth2.0:
        - manager.loyalty
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /manager/loyalty/v1/{source}/user:
    get:
      tags:
      - Manager Loyalty Endpoints
      summary: Otter Get User by Id
      description: '`RATE LIMIT: 8 per minute`

        '
      operationId: getUser
      parameters:
      - $ref: '#/components/parameters/storeIdHeader'
      - $ref: '#/components/parameters/source-2'
      - $ref: '#/components/parameters/id'
      responses:
        '200':
          description: Get user response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetUserResponse'
              examples:
                GetUser200Example:
                  summary: Default getUser 200 response
                  x-microcks-default: true
                  value:
                    userAccount:
                      id: somestring
                      userFields:
                      - {}
                      balances:
                      - {}
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
      security:
      - OAuth2.0:
        - manager.loyalty
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      tags:
      - Manager Loyalty Endpoints
      summary: Otter Create a Loyalty User
      description: '`RATE LIMIT: 8 per minute`

        '
      operationId: createUser
      parameters:
      - $ref: '#/components/parameters/storeIdHeader'
      - $ref: '#/components/parameters/source-2'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUserRequest'
            examples:
              CreateUserRequestExample:
                summary: Default createUser request
                x-microcks-default: true
                value:
                  userFields:
                  - key: full_name
                    value: john doe
        required: true
      responses:
        '200':
          description: Create user response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateUserResponse'
              examples:
                CreateUser200Example:
                  summary: Default createUser 200 response
                  x-microcks-default: true
                  value:
                    user:
                      id: somestring
                      userFields:
                      - {}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '422':
          $ref: '#/components/responses/422'
      security:
      - OAuth2.0:
        - manager.loyalty
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /manager/loyalty/v1/{source}/user/search:
    get:
      tags:
      - Manager Loyalty Endpoints
      summary: Otter Search Loyalty Users
      description: '`RATE LIMIT: 8 per minute`

        '
      operationId: searchUsers
      parameters:
      - $ref: '#/components/parameters/storeIdHeader'
      - $ref: '#/components/parameters/opaquePaginationToken'
      - $ref: '#/components/parameters/limit-3'
      - $ref: '#/components/parameters/source-2'
      - $ref: '#/components/parameters/term'
      responses:
        '200':
          description: Search users response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchUsersResponse'
              examples:
                SearchUsers200Example:
                  summary: Default searchUsers 200 response
                  x-microcks-default: true
                  value:
                    users:
                    - id: somestring
                      userFields:
                      - {}
                    offsetToken: H12MAF2fFaFFFa
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '422':
          $ref: '#/components/responses/422'
      security:
      - OAuth2.0:
        - manager.loyalty
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /manager/loyalty/v1/{source}/rewards/evaluate:
    post:
      tags:
      - Manager Loyalty Endpoints
      summary: Otter Compute Applicable Rewards
      description: '`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 per minute`

        '
      operationId: computeApplicableRewards
      parameters:
      - $ref: '#/components/parameters/storeIdHeader'
      - $ref: '#/components/parameters/source-2'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ComputeApplicableRewardsRequest'
            examples:
              ComputeApplicableRewardsRequestExample:
                summary: Default computeApplicableRewards request
                x-microcks-default: true
                value:
                  userId: someidstring
                  order:
                    id: someidstring
                    currencyCode: USD
                    items:
                    - {}
                    totals: {}
        required: true
      responses:
        '200':
          description: Compute applicable rewards response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ComputeApplicableRewardsResponse'
              examples:
                ComputeApplicableRewards200Example:
                  summary: Default computeApplicableRewards 200 response
                  x-microcks-default: true
                  value:
                    rewards:
                    - id: someidstring
                      type: SUBTOTAL
                      cost: 20
                      costType: POINT
                      trigger: {}
                      subtotal: {}
                      menus:
                      - {}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '422':
          $ref: '#/components/responses/422'
      security:
      - OAuth2.0:
        - manager.loyalty
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /manager/loyalty/v1/{source}/rewards/simulate:
    post:
      tags:
      - Manager Loyalty Endpoints
      summary: Otter Simulate Rewards
      description: '`Show what the effects will be after applying the selected rewards, and start the rewards transaction, only call this when user selected some reward, otherwise skip this call and use redeemAndAccumulateRewards API call.` `RATE LIMIT: 8 per minute`

        '
      operationId: simulateRewards
      parameters:
      - $ref: '#/components/parameters/storeIdHeader'
      - $ref: '#/components/parameters/source-2'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SimulateRewardsRequest'
            examples:
              SimulateRewardsRequestExample:
                summary: Default simulateRewards request
                x-microcks-default: true
                value:
                  userId: someidstring
                  order:
                    id: someidstring
                    currencyCode: USD
                    items:
                    - {}
                    totals: {}
                  selectedRewards:
                  - id: someidstring
                    amount: 19.07
                    menus: {}
        required: true
      responses:
        '200':
          description: Simulate rewards response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimulateRewardsResponse'
              examples:
                SimulateRewards200Example:
                  summary: Default simulateRewards 200 response
                  x-microcks-default: true
                  value:
                    transactionId: someidstring
                    rewardEffect:
                      subtotal: {}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '422':
          $ref: '#/components/responses/422'
      security:
      - OAuth2.0:
        - manager.loyalty
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /manager/loyalty/v1/{source}/rewards/redeem-and-accumulate:
    post:
      tags:
      - Manager Loyalty Endpoints
      summary: Otter Redeem and Accumulate Rewards
      description: '`Redeem existing rewards and accumulate new rewards` `RATE LIMIT: 8 per minute`

        '
      operationId: redeemAndAccumulateRewards
      parameters:
      - $ref: '#/components/parameters/storeIdHeader'
      - $ref: '#/components/parameters/source-2'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RedeemAndAccumulateRewardsRequest'
            examples:
              RedeemAndAccumulateRewardsRequestExample:
                summary: Default redeemAndAccumulateRewards request
                x-microcks-default: true
                value:
                  userId: someidstring
                  order:
                    id: someidstring
                    currencyCode: USD
                    items:
                    - {}
                    totals: {}
                  selectedRewards:
                  - id: someidstring
                    amount: 19.07
                    menus: {}
        required: true
      responses:
        '200':
          description: Redeem and accumulate response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RedeemAndAccumulateRewardsResponse'
              examples:
                RedeemAndAccumulateRewards200Example:
                  summary: Default redeemAndAccumulateRewards 200 response
                  x-microcks-default: true
                  value:
                    transactionId: someidstring
                    rewardEffect:
                      subtotal: {}
                    accumulatedRewards:
                    - amount: 19.07
                      type: POINT
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '422':
          $ref: '#/components/responses/422'
      security:
      - OAuth2.0:
        - manager.loyalty
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /manager/loyalty/v1/{source}/rewards/refund:
    post:
      tags:
      - Manager Loyalty Endpoints
      summary: Otter Refund Rewards
      description: '`RATE LIMIT: 8 per minute`

        '
      operationId: refundRewards
      parameters:
      - $ref: '#/components/parameters/storeIdHeader'
      - $ref: '#/components/parameters/source-2'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefundRewardsRequest'
            examples:
              RefundRewardsRequestExample:
                summary: Default refundRewards request
                x-microcks-default: true
                value:
                  userId: someidstring
                  orderId: someidstring
        required: true
      responses:
        '200':
          description: Refund rewards response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefundRewardsResponse'
              examples:
                RefundRewards200Example:
                  summary: Default refundRewards 200 response
                  x-microcks-default: true
                  value:
                    transactionId: someidstring
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '422':
          $ref: '#/components/responses/422'
      security:
      - OAuth2.0:
        - manager.loyalty
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    ComputeApplicableRewardsResponse:
      type: object
      properties:
        rewards:
          type: array
          description: List of rewards the user can redeem, depending on the reward type, only one of subtotal/menus will be present.
          items:
            $ref: '#/components/schemas/Reward'
      description: Response body for ComputeApplicableRewards API call.
    SelectedMenuReward:
      type: object
      properties:
        entityId:
          type: string
          description: The id of the selected item.
          example: someidstring
      description: Indicates the item the user want to redeem, if reward type is MENUS, this should be present.
    SimulateRewardsResponse:
      type: object
      properties:
        transactionId:
          type: string
          description: The id of the transaction.
          example: someidstring
        rewardEffect:
          type: object
          description: Effect after applying the reward.
          $ref: '#/components/schemas/RewardEffect'
      description: Response body for SimulateRewards API call.
    SearchUsersResponse:
      type: object
      properties:
        users:
          type: array
          description: The users that matches the search condition.
          items:
            $ref: '#/components/schemas/User'
        offsetToken:
          type: string
          description: Opaque token used to fetch the following page. If not set, no more results are available.
          example: H12MAF2fFaFFFa
      description: Response body for SearchUsers API call.
    TriggerMenu:
      type: object
      properties:
        entityId:
          type: string
          description: The id of the entity.
          example: someidstring
        entityType:
          type: string
          description: The type of entity.
          example: ITEM
          enum:
          - ITEM
          - CATEGORY
        minimumPurchaseQuantity:
          type: number
          description: Minimum quantity need to be purchased to activate the trigger.
          example: 1
    Item-2:
      type: object
      properties:
        id:
          type: string
          description: The id of the item in the partner's system.
          example: someidstring
        displayName:
          type: string
          description: Name of the item.
          example: Cheese Burger
        quantity:
          type: number
          description: Quantity of item ordered.
          example: 1
        price:
          type: number
          description: Price of item.
          example: 19.07
        modifiers:
          oneOf:
          - type: array
            description: 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.
            items:
              $ref: '#/components/schemas/Item-2'
          - type: 'null'
    EnrollmentField:
      type: object
      properties:
        key:
          type: string
          description: The key of field, will be used in the Create User API.
          example: full_name
        required:
          type: boolean
          description: Whether this field is required when creating a user.
          example: true
        type:
          type: string
          description: The type of field, frontend can use type to decide which input to use. i.e. use a date picker for DATE type, use a text input for EMAIL/FULL_NAME type.
          example: FULL_NAME
          enum:
          - TEXT
          - NUMBER
          - EMAIL
          - PASSWORD
          - PHONE
          - DATE
          - DATE_TIME
          - URL
          - FULL_NAME
          - ADDRESS
        label:
          type: string
          description: This can be used as the field input's label on the frontend.
          example: First Name and Last Name
    ErrorDetail:
      type: object
      properties:
        attribute:
          type: string
          description: The error attribute.
          example: Order Currency Code
        message:
          type: string
          description: The error detail description.
          example: Order Currency Code must be exactly 3 characters
      description: The error detail response object.
    ErrorMessage:
      type: object
      properties:
        message:
          type: string
          description: The error description.
          example: The request body is invalid.
        details:
          type: array
          description: The error details.
          items:
            $ref: '#/components/schemas/ErrorDetail'
      description: The error response object.
    User:
      type: object
      properties:
        id:
          type: string
          description: The user identifier.
          example: somestring
        userFields:
          type: array
          description: The user info fields.
          items:
            $ref: '#/components/schemas/UserField'
    SimulateRewardsRequest:
      required:
      - userId
      - order
      - selectedRewards
      type: object
      properties:
        userId:
          type: string
          description: The id of the user.
          example: someidstring
        order:
          $ref: '#/components/schemas/Order-2'
        selectedRewards:
          type: array
          description: Selected rewards, currently only support one reward, if multiple rewards are passed it will throw an error.
          items:
            $ref: '#/components/schemas/SelectedReward'
      description: Request body for SimulateRewards API call.
    UserBalance:
      type: object
      properties:
        amount:
          type: number
          description: Balance amount.
          example: 19.07
        type:
          type: string
          description: The type of balance.
          example: POINT
          enum:
          - POINT
          - DOLLAR
    RefundRewardsResponse:
      type: object
      properties:
        transactionId:
          type: string
          description: The transaction id of the refund.
          example: someidstring
      description: Response body for RefundRewardsResponse API call.
    RedeemAndAccumulateRewardsRequest:
      required:
      - userId
      - order
      - selectedRewards
      type: object
      properties:
        userId:
          type: string
          description: The id of the user.
          example: someidstring
        order:
          $ref: '#/components/schemas/Order-2'
        selectedRewards:
          type: array
          description: Selected rewards, currently only support one reward, if multiple rewards are passed it will throw an error.
          items:
            $ref: '#/components/schemas/SelectedReward'
      description: Request body for RedeemAndAccumulateRewards API call.
    SubtotalReward:
      type: object
      properties:
        amount:
          type: number
          description: Discount amount, if it's percentage discount, the percentage amount shown is in basis points, ie 1000 = 10% discount.
          example: 20
        type:
          type: string
          description: The type of discount, absolute or percentage.
          example: ABSOLUTE_DISCOUNT
          enum:
          - ABSOLUTE_DISCOUNT
          - PERCENT_DISCOUNT
    CreateUserRequest:
      required:
      - userFields
      type: object
      properties:
        userFields:
          type: array
          description: The user info fields for the new user.
          items:
            $ref: '#/components/schemas/UserField'
      description: Request body for CreateUser API call.
    Trigger:
      type: object
      properties:
        menus:
          type: array
          description: The item/category preconditions to redeem this reward, for example, buy any drinks to get a free Burger.
          items:
            $ref: '#/components/schemas/TriggerMenu'
      description: The preconditions to redeem this reward, for example, buy Fries to get a free Burger. Nullable, if null, this reward can be unconditionally redeemed.
    CreateUserResponse:
      type: object
      properties:
        user:
          $ref: '#/components/schemas/User'
      description: Response body for CreateUser API call.
    Subtotal:
      type: object
      properties:
        amount:
          type: number
          description: The amount that was discounted.
          example: 19.07
    Totals:
      type: object
      properties:
        subTotal:
          type: number
          description: Order subtotal.
          example: 29.07
        tax:
          type: number
          description: Order tax.
          example: 10
        discount:
          type: number
          description: Order discount.
          example: 9.07
        total:
          type: number
          description: Order total.
          example: 30
    RedeemAndAccumulateRewardsResponse:
      type: object
      properties:
        transactionId:
          type: string
          description: The id of the transaction.
          example: someidstring
        rewardEffect:
          $ref: '#/components/schemas/RewardEffect'
        accumulatedRewards:
          type: array
          description: List of rewards accumulated.
          items:
            $ref: '#/components/schemas/UserBalance'
      description: Response body for RedeemAndAccumulateRewards API call.
    UserField:
      type: object
      properties:
        key:
          type: string
          description: The key of field, this is retrieved from GetEnrollmentConfig API call.
          example: full_name
        value:
          type: string
          description: The value of the field.
          example: john doe
    RewardEffect:
      type: object
      properties:
        subtotal:
          $ref: '#/components/schemas/Subtotal'
      description: Shows how much is deducted from total.
    RefundRewardsRequest:
      required:
      - userId
      - orderId
      type: object
      properties:
        userId:
          type: string
          description: The id of the user.
          example: som

# --- truncated at 32 KB (93 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/otter/refs/heads/main/openapi/otter-manager-loyalty-endpoints-api-openapi.yml