openapi: 3.1.0
info:
  title: Dynamic Monetization APIs
  description: APIs to perform Dynamic Monetization activity.
  version: '1.0'
servers:
  - url: >-
      https://{siteID}.flexnetoperations.{domainExtension}/dynamicmonetization/api
    description: Dynamic Monetization API URL
    variables:
      siteID:
        default: siteID
        description: Site ID for your Dynamic Monetization instance.
      domainExtension:
        default: com
        description: Domain extension for your Dynamic Monetization instance.
  - url: >-
      https://{siteID}.flexnetoperations.{domainExtension}/dynamicmonetization/floating/api
    description: Dynamic Monetization API URL
    variables:
      siteID:
        default: siteID
        description: Site ID for your Dynamic Monetization instance.
      domainExtension:
        default: com
        description: Domain extension for your Dynamic Monetization instance.
tags:
  - name: Authorization
    description: APIs to manage authorization keys.
    x-displayName: Authorization
  - name: Instances
    description: >-
      APIs to manage Dynamic Monetization instances, which host the line items
      belonging to customers.
    x-displayName: Instances
  - name: Line Items
    description: APIs to manage line items mapped to an instance.
    x-displayName: Line Items
  - name: Rules of Access
    description: >-
      APIs to manage rules of access for Dynamic Monetization instances. Rules
      of access are used to control the way the counts of an elastic line item
      are used in an access request.
    x-displayName: Rules of Access
  - name: Rate Tables
    description: >-
      APIs to manage rate tables. Rate tables are used to define the price of
      items (how many tokens are charged per item).
    x-displayName: Rate Tables
  - name: Sessions
    description: APIs for elastic access within the context of a session.
    x-displayName: Sessions
  - name: Non-Session Access Request
    description: APIs for elastic access without a session.
    x-displayName: Non-Session Access Request
  - name: Configuration
    description: >
      APIs for managing configuration values that control how customers can
      access and consume line items.<br><br>

      Available values:
        - <b>timezone.tolerant</b>
            - Allows a line item to be used up to 12 hours before its start date (UTC) and up to 12 hours after its end date (UTC), therefore making it tolerant to all time zones.
            - Supported values: true (enabled) and false (disabled).
            - Default: false
    x-displayName: Configuration
paths:
  /v1.0/administration-keys:
    put:
      tags:
        - Authorization
      operationId: producer-admin-key-upload
      summary: Save a producer administration key
      description: >-
        Adds or updates a public key which can be used by a producer user to
        make Dynamic Monetization API requests. Allow 10 minutes for the key to
        be available to authorize requests.
      security:
        - AdministrationAccess: []
      requestBody:
        description: The request payload.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthKeyRequest'
      responses:
        '200':
          $ref: '#/components/responses/200'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /v1.0/administration-keys/{keyId}:
    delete:
      tags:
        - Authorization
      operationId: delete-producer-admin-key
      summary: Delete a producer administration key
      description: >-
        Deletes a specified producer administration key. Pass the ID of the key
        that you want to delete as a path parameter. It may take up to 10
        minutes for the key to be fully removed after calling the API.
      security:
        - AdministrationAccess: []
      parameters:
        - $ref: '#/components/parameters/KeyId'
      responses:
        '200':
          $ref: '#/components/responses/200'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          description: >-
            Forbidden. It is not possible to delete the last administration key.
            There must always be at least one key present.
        '404':
          $ref: '#/components/responses/404'
  /v1.0/client-keys:
    put:
      tags:
        - Authorization
      operationId: client-key-upload
      summary: Save a client key
      description: >-
        Adds or updates a public key which can be used by a client user to make
        Dynamic Monetization API requests. Allow 10 minutes for the key to be
        available to authorize requests.
      security:
        - AdministrationAccess: []
      requestBody:
        description: The request payload.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthKeyRequest'
      responses:
        '200':
          $ref: '#/components/responses/200'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /v1.0/client-keys/{keyId}:
    delete:
      tags:
        - Authorization
      operationId: delete-client-key
      summary: Delete a client key
      description: >-
        Deletes a specified client key. Pass the ID of the key that you want to
        delete as a path parameter. It may take up to 10 minutes for the key to
        be fully removed after calling the API.
      security:
        - AdministrationAccess: []
      parameters:
        - $ref: '#/components/parameters/KeyId'
      responses:
        '200':
          $ref: '#/components/responses/200'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
  /v1.0/public-keys:
    get:
      tags:
        - Authorization
      operationId: get-public-keys
      summary: Get a list of public keys
      description: Gets a list of administration and client public keys.
      security:
        - AdministrationAccess: []
      parameters:
        - name: next
          in: query
          description: >-
            Enter the next page value returned by the response to the previous
            GET /public-keys request to get the next batch of public keys.
          required: false
          schema:
            type: integer
            minimum: 0
        - name: size
          in: query
          description: Number of keys to fetch.
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
      responses:
        '200':
          description: OK. The request succeeded in its entirety.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KeyPageInfoResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /v1.0/instances/{instanceId}/line-items:
    get:
      tags:
        - Line Items
      servers:
        - url: >-
            https://{siteID}.flexnetoperations.{domainExtension}/dynamicmonetization/provisioning/api
          description: Dynamic Monetization API URL
          variables:
            siteID:
              default: siteID
              description: Site ID for your Dynamic Monetization instance.
            domainExtension:
              default: com
              description: Domain extension for your Dynamic Monetization instance.
      summary: Get a list of line items
      description: >-
        Returns a list of line items mapped to instances owned by a producer's
        customer accounts.
      operationId: getActivationsForInstance
      security:
        - AdministrationAccess: []
        - ClientAccess: []
      parameters:
        - $ref: '#/components/parameters/InstanceId'
      responses:
        '200':
          description: List of line items for the instance ID.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ProvisionedLineItem'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
    put:
      tags:
        - Line Items
      servers:
        - url: >-
            https://{siteID}.flexnetoperations.{domainExtension}/dynamicmonetization/provisioning/api
          description: Dynamic Monetization API URL
          variables:
            siteID:
              default: siteID
              description: Site ID for your Dynamic Monetization instance.
            domainExtension:
              default: com
              description: Domain extension for your Dynamic Monetization instance.
      summary: Map a line item to an instance
      description: >
        Maps a line item to an instance. The first time

        this API is called, the payload details will be stored, 

        and reported in a GET line-item

        request. If the line item is already mapped, then the details stored

        will be entirely replaced.


        This method is intended for use if you do not use FlexNet Operations as
        your back office, 

        so that you can configure your upstream system (e.g. a CRM or back
        office) 

        to create line items in Dynamic Monetization for your end customers. 

        (If you use FlexNet Operations as your back office, but use this method
        directly 

        to provision line items that do not exist in FlexNet Operations, then
        those line items 

        will not be reflected in FlexNet Operations.)
      operationId: addActivation
      security:
        - AdministrationAccess: []
      parameters:
        - $ref: '#/components/parameters/InstanceId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProvisionedLineItem'
        required: true
      responses:
        '200':
          description: Returned when a line item is successfully updated.
          content:
            application/json:
              schema:
                type: string
        '201':
          description: Returned when a line item is successfully created.
          content:
            application/json:
              schema:
                type: string
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
  /v1.0/instances/{instanceId}/line-items/{lineItemId}:
    get:
      tags:
        - Line Items
      servers:
        - url: >-
            https://{siteID}.flexnetoperations.{domainExtension}/dynamicmonetization/provisioning/api
          description: Dynamic Monetization API URL
          variables:
            siteID:
              default: siteID
              description: Site ID for your Dynamic Monetization instance.
            domainExtension:
              default: com
              description: Domain extension for your Dynamic Monetization instance.
      summary: Get a specific line item by ID
      description: >-
        Returns information about a specific line item. Pass the line item ID
        for which you require information as a path parameter.
      operationId: getLineItemById
      security:
        - AdministrationAccess: []
        - ClientAccess: []
      parameters:
        - $ref: '#/components/parameters/InstanceId'
        - $ref: '#/components/parameters/LineItemId'
      responses:
        '200':
          description: The requested line item was found and returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProvisionedLineItem'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
    delete:
      tags:
        - Line Items
      servers:
        - url: >-
            https://{siteID}.flexnetoperations.{domainExtension}/dynamicmonetization/provisioning/api
          description: Dynamic Monetization API URL
          variables:
            siteID:
              default: siteID
              description: Site ID for your Dynamic Monetization instance.
            domainExtension:
              default: com
              description: Domain extension for your Dynamic Monetization instance.
      summary: Delete a line item by its ID
      description: >
        Deletes a line item given its ID.


        This method is intended for use if you do not use FlexNet Operations as
        your back office, 

        so that you can manage line items in Dynamic Monetization for your end
        customers. 

        (If you use FlexNet Operations as your back office, but use this method
        directly to remove 

        line items that exist in FlexNet Operations, then those line items'
        representation in 

        FlexNet Operations will not be affected.)
      operationId: deleteLineItem
      security:
        - AdministrationAccess: []
      parameters:
        - $ref: '#/components/parameters/InstanceId'
        - $ref: '#/components/parameters/LineItemId'
      responses:
        '204':
          description: Line item was successfully un-mapped from the instance.
        '403':
          description: >-
            Forbidden. Line item must be in an OBSOLETE state before it can be
            deleted.
        '404':
          description: >-
            Line item is either not mapped to the instance, the instance does
            not exist, or the line item itself does not exist.
  /v1.0/instances/{instanceId}/line-items/{lineItemId}/actions:
    post:
      tags:
        - Rules of Access
      servers:
        - url: >-
            https://{siteID}.flexnetoperations.{domainExtension}/dynamicmonetization/api
          description: Dynamic Monetization API URL
          variables:
            siteID:
              default: siteID
              description: Site ID for your Dynamic Monetization instance.
            domainExtension:
              default: com
              description: Domain extension for your Dynamic Monetization instance.
      summary: Create a list of actions and allocations for a line item
      description: Creates an ordered list of actions to be taken when a condition is met.
      operationId: createActions
      security:
        - AdministrationAccess: []
        - ClientAccess: []
      parameters:
        - $ref: '#/components/parameters/InstanceId'
        - $ref: '#/components/parameters/LineItemId'
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/Action'
      responses:
        '200':
          description: A list of actions that were created.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Action'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
    delete:
      tags:
        - Rules of Access
      servers:
        - url: >-
            https://{siteID}.flexnetoperations.{domainExtension}/dynamicmonetization/api
          description: Dynamic Monetization API URL
          variables:
            siteID:
              default: siteID
              description: Site ID for your Dynamic Monetization instance.
            domainExtension:
              default: com
              description: Domain extension for your Dynamic Monetization instance.
      summary: Delete all actions on a line item
      description: Deletes all actions on a line item.
      operationId: deleteActions
      security:
        - AdministrationAccess: []
        - ClientAccess: []
      parameters:
        - $ref: '#/components/parameters/InstanceId'
        - $ref: '#/components/parameters/LineItemId'
      responses:
        '204':
          description: Actions for the requested line item were successfully deleted.
        '401':
          $ref: '#/components/responses/401'
        '404':
          description: Actions not found or are empty for the requested line item.
        '500':
          $ref: '#/components/responses/500'
    get:
      tags:
        - Rules of Access
      servers:
        - url: >-
            https://{siteID}.flexnetoperations.{domainExtension}/dynamicmonetization/api
          description: Dynamic Monetization API URL
          variables:
            siteID:
              default: siteID
              description: Site ID for your Dynamic Monetization instance.
            domainExtension:
              default: com
              description: Domain extension for your Dynamic Monetization instance.
      summary: Get actions and allocations for a line item
      description: |
        Returns a list of actions to be taken when condition is met.
      operationId: getActions
      security:
        - AdministrationAccess: []
        - ClientAccess: []
      parameters:
        - $ref: '#/components/parameters/InstanceId'
        - $ref: '#/components/parameters/LineItemId'
      responses:
        '200':
          description: A list of actions was returned successfully.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Action'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
    put:
      tags:
        - Rules of Access
      servers:
        - url: >-
            https://{siteID}.flexnetoperations.{domainExtension}/dynamicmonetization/api
          description: Dynamic Monetization API URL
          variables:
            siteID:
              default: siteID
              description: Site ID for your Dynamic Monetization instance.
            domainExtension:
              default: com
              description: Domain extension for your Dynamic Monetization instance.
      summary: Modify actions for a line item
      description: >-
        Modifies the list of actions for a line item. The existing actions can
        be re-ordered, modified or omitted, and new actions can be added to the
        list. If an action is omitted, it will be completely removed and the
        current counts for a related allocation will be lost; therefore, care
        should be taken when making any changes.
      operationId: putActions
      security:
        - AdministrationAccess: []
        - ClientAccess: []
      parameters:
        - $ref: '#/components/parameters/InstanceId'
        - $ref: '#/components/parameters/LineItemId'
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/Action'
                properties:
                  id:
                    readOnly: false
      responses:
        '200':
          description: The replacement list of actions that has been saved.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Action'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
  /v1.0/instances:
    get:
      tags:
        - Instances
      servers:
        - url: >-
            https://{siteID}.flexnetoperations.{domainExtension}/dynamicmonetization/provisioning/api
          description: Dynamic Monetization API URL
          variables:
            siteID:
              default: siteID
              description: Site ID for your Dynamic Monetization instance.
            domainExtension:
              default: com
              description: Domain extension for your Dynamic Monetization instance.
      summary: Get a list of instances
      description: >
        Returns information about instances owned by a producer's customer
        accounts.  

        Each customer account may have one or more instances, and each instance
        serves 

        exactly one customer account.
      operationId: listInstances
      security:
        - AdministrationAccess: []
      parameters:
        - name: next
          in: query
          description: >-
            Enter the next page value returned by the response to the previous
            GET /instances request to get the next page of instances.
          required: false
          schema:
            type: integer
        - name: size
          in: query
          description: >-
            Enter the number of items to return. (This number of items is not
            guaranteed.)
          required: false
          schema:
            type: string
        - name: accountId
          in: query
          description: >-
            Find instances belonging to this account ID. This query parameter
            must be used in combination with the 'default' query parameter.
          required: false
          schema:
            type: string
        - name: default
          in: query
          description: >-
            Find the default instance for the given account ID. Must be set to
            'true'.
          required: false
          schema:
            type: boolean
      responses:
        '200':
          description: List of instances was successfully returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PageInfoResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
    post:
      tags:
        - Instances
      servers:
        - url: >-
            https://{siteID}.flexnetoperations.{domainExtension}/dynamicmonetization/provisioning/api
          description: Dynamic Monetization API URL
          variables:
            siteID:
              default: siteID
              description: Site ID for your Dynamic Monetization instance.
            domainExtension:
              default: com
              description: Domain extension for your Dynamic Monetization instance.
      summary: Create an instance
      description: >
        Creates a new instance. Each customer account may have one or more
        instances, 

        and each instance serves exactly one customer account.


        This method is intended for use if you do not use FlexNet Operations as
        your back office, 

        so that you can configure your upstream system (e.g. a CRM) to create
        instances for your accounts.
      operationId: addInstance
      security:
        - AdministrationAccess: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Instance'
        required: true
      responses:
        '200':
          description: Successfully created an instance
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Instance'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
  /v1.0/instances/{instanceId}:
    get:
      tags:
        - Instances
      servers:
        - url: >-
            https://{siteID}.flexnetoperations.{domainExtension}/dynamicmonetization/provisioning/api
          description: Dynamic Monetization API URL
          variables:
            siteID:
              default: siteID
              description: Site ID for your Dynamic Monetization instance.
            domainExtension:
              default: com
              description: Domain extension for your Dynamic Monetization instance.
      summary: Get instance by instance ID
      description: >
        Returns information about a specific instance. Pass the instance ID for
        which you require information as a path parameter.
      operationId: getInstanceById
      security:
        - AdministrationAccess: []
      parameters:
        - $ref: '#/components/parameters/InstanceId'
      responses:
        '200':
          description: The instance was retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Instance'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
  /v1.0/rate-tables:
    get:
      tags:
        - Rate Tables
      servers:
        - url: >-
            https://{siteID}.flexnetoperations.{domainExtension}/dynamicmonetization/provisioning/api
          description: Dynamic Monetization API URL
          variables:
            siteID:
              default: siteID
              description: Site ID for your Dynamic Monetization instance.
            domainExtension:
              default: com
              description: Domain extension for your Dynamic Monetization instance.
      summary: Get all rate tables
      description: >
        Gets all the rate tables created, whether the effective time of the rate
        table has been reached or not.
      operationId: getRateTables
      security:
        - AdministrationAccess: []
      responses:
        '200':
          description: Rate tables with all their details were successfully returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateTable'
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
    post:
      tags:
        - Rate Tables
      servers:
        - url: >-
            https://{siteID}.flexnetoperations.{domainExtension}/dynamicmonetization/provisioning/api
          description: Dynamic Monetization API URL
          variables:
            siteID:
              default: siteID
              description: Site ID for your Dynamic Monetization instance.
            domainExtension:
              default: com
              description: Domain extension for your Dynamic Monetization instance.
      summary: Create a rate table
      description: |
        Creates a new rate table.
      operationId: postRateTables
      security:
        - AdministrationAccess: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RateTable'
      responses:
        '201':
          description: Rate table was successfully saved.
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '409':
          description: Another rate table with the same version and series exists.
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: string
        '500':
          $ref: '#/components/responses/500'
    delete:
      tags:
        - Rate Tables
      servers:
        - url: >-
            https://{siteID}.flexnetoperations.{domainExtension}/dynamicmonetization/provisioning/api
          description: Dynamic Monetization API URL
          variables:
            siteID:
              default: siteID
              description: Site ID for your Dynamic Monetization instance.
            domainExtension:
              default: com
              description: Domain extension for your Dynamic Monetization instance.
      summary: Delete a rate table
      description: |
        Deletes a rate table that hasn't come into effect yet.

        Note: Rate tables that are already in effect cannot be deleted.
      operationId: deleteRateTables
      security:
        - AdministrationAccess: []
      parameters:
        - name: series
          in: query
          description: >-
            The series of the rate table. If not specified, only a rate table
            with no series would be deleted.
          required: false
          schema:
            type: string
        - name: version
          in: query
          description: The version of the rate table.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: Rate table was successfully deleted.
        '404':
          description: Rate table does not exist.
        '409':
          description: Rate table is already in effect.
  /v1.0/configuration:
    get:
      tags:
        - Configuration
      servers:
        - url: >-
            https://{siteID}.flexnetoperations.{domainExtension}/dynamicmonetization/provisioning/api
          description: Dynamic Monetization API URL
          variables:
            siteID:
              default: siteID
              description: Site ID for your Dynamic Monetization instance.
            domainExtension:
              default: com
              description: Domain extension for your Dynamic Monetization instance.
      summary: All configuration
      description: >
        Returns all configured values. If a configuration has been modified, the
        response includes the date of modification and the token key ID that was
        used to change configuration.
      operationId: getTenantConfigurations
      security:
        - AdministrationAccess: []
      responses:
        '200':
          description: Configuration was successfully returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConfigList'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
    patch:
      tags:
        - Configuration
      servers:
        - url: >-
            https://{siteID}.flexnetoperations.{domainExtension}/dynamicmonetization/provisioning/api
          description: Dynamic Monetization API URL
          variables:
            siteID:
              default: siteID
              description: Site ID for your Dynamic Monetization instance.
            domainExtension:
              default: com
              description: Domain extension for your Dynamic Monetization instance.
      summary: Update configuration
      description: |
        Update one or more configuration values.
      operationId: patchTenantConfigurations
      security:
        - AdministrationAccess: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConfigList'
      responses:
        '200':
          description: Configuration was saved successfully.
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
  /v1.0/instances/{instanceId}/conditions:
    get:
      tags:
        - Rules of Access
      servers:
        - url: >-
            https://{siteID}.flexnetoperations.{domainExtension}/dynamicmonetization/api
          description: Dynamic Monetization API URL
          variables:
            siteID:
              default: siteID
              description: Site ID for your Dynamic Monetization instance.
            domainExtension:
              default: com
              description: Domain extension for your Dynamic Monetization instance.
      security:
        - AdministrationAccess: []
        - ClientAccess: []
      parameters:
        - $ref: '#/components/parameters/InstanceId'
      summary: Get all defined conditions
      description: API to fetch conditions.
      operationId: getConditionsOfAccess
      responses:
        '200':
          description: OK. The request succeeded in its entirety.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConditionReadOnlyId'
              examples:
                sampleResponse:
                  $ref: '#/components/examples/sampleConditionResp'
    post:
      tags:
        - Rules of Access
      servers:
        - url: >-
            https://{siteID}.flexnetoperations.{domainExtension}/dynamicmonetization/api
          description: Dynamic Monetization API URL
          variables:
            siteID:
              default: siteID
              description: Site ID for your Dynamic Monetization instance.
            domainExtension:
              default: com
              description: Domain extension for your Dynamic Monetization instance.
      security:
        - AdministrationAccess: []
        - ClientAccess: []
      parameters:
        - $ref: '#/components/parameters/InstanceId'
      summary: Create conditions
      description: API to create conditions.
      operationId: postConditionsOfAccess
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConditionReadOnlyId'
            examples:
              sampleResponse:
                $ref: '#/components/examples/sampleConditionRequest'
      responses:
        '200':
          description: >-
            OK. The request succeeded in its entirety. The response body
            contains a list of the conditions that were created, existing
            conditions are not returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConditionReadOnlyId'
              examples:
                sampleResponse:
                  $ref: '#/components/examples/sampleConditionResp'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
    patch:
      tags:
        - Rules of Access
      servers:
        - url: >-
            https://{siteID}.flexnetoperations.{domainExtension}/dynamicmonetization/api
          description: Dynamic Monetization API URL
          variables:
            siteID:
              default: siteID
              description: Site ID for your Dynamic Monetization instance.
            domainExtension:
              default: com
              description: Domain extension for your Dynamic Monetization instance.
      security:
        - AdministrationAccess: []
        - ClientAccess: []
      parameters:
        - $ref: '#/components/parameters/InstanceId'
      summary: Update conditions
      description: Update existing and add new conditions to an instance.
      operationId: patchConditions
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConditionOptionalId'
            examples:
              sampleRequest:
                $ref: '#/components/examples/sampleConditionRequest'
      responses:
        '200':
          description: >-
            OK. The request succeeded in its entirety. The response body
            contains a list of the conditions that were created or updated, but
            unchanged conditions are not returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConditionReadOnlyId'
              examples:
                sampleResponse:
                  $ref: '#/components/examples/sampleConditionResp'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
    delete:
      tags:
        - Rules of Access
      servers:
        - url: >-
            https://{siteID}.flexnetoperations.{domainExtension}/dynamicmonetization/api
          description: Dynamic Monetization API URL
          variables:
            siteID:
              default: siteID
              description: Site ID for your Dynamic Monetization instance.
            domainExtension:
              default: com
              description: Domain extension for your Dynamic Monetization instance.
      security:
        - AdministrationAccess: []
        - ClientAccess: []
      parameters:
        - $ref: '#/components/parameters/InstanceId'
      summary: Delete conditions
      description: Delete all conditions configured on the instance.
      operationId: deleteConditionsOfAccess
      responses:
        '204':
          description: >-
            Conditions for requested Dynamic Monetization instance were
            successfully deleted.
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          description: >-
            Forbidden. Conditions cannot be deleted while being referenced by
            actions.
        '404':
          description: Conditions not found or are empty for the requested instance.
        '500':
          $ref: '#/components/responses/500'
  /v1.0/instances/{instanceId}/conditions/{conditionId}:
    delete:
      tags:
        - Rules of Access
      servers:
        - url: >-
            https://{siteID}.flexnetoperations.{domainExtension}/dynamicmonetization/api
          description: Dynamic Monetization API URL
          variables:
            siteID:
              default: siteID
              description: Site ID for your Dynamic Monetization instance.
            domainExtension:
              default: com
              description: Domain extension for your Dynamic Monetization instance.
      security:
        - AdministrationAccess: []
        - ClientAccess: []
      parameters:
        - $ref: '#/components/parameters/InstanceId'
        - $ref: '#/components/parameters/ConditionId'
      summary: Delete a condition by ID
      description: API to delete a specific condition configured on the instance.
      operationId: deleteConditionById
      responses:
        '204':
          description: Specified condition was successfully deleted.
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          description: >-
            Forbidden. Specified condition cannot be deleted while being
            referenced by actions.
        '404':
          description: Specified condition not found for the requested instance.
        '500':
          $ref: '#/components/responses/500'
  /v1.0/instances/{instanceId}/line-items/actions:
    get:
      tags:
        - Rules of Access
      servers:
        - url: >-
            https://{siteID}.flexnetoperations.{domainExtension}/dynamicmonetization/api
          description: Dynamic Monetization API URL
          variables:
            siteID:
              default: siteID
              description: Site ID for your Dynamic Monetization instance.
            domainExtension:
              default: com
              description: Domain extension for your Dynamic Monetization instance.
      summary: Get all actions for all Elastic Access line items of the instance
      description: >-
        API to fetch all actions for all Elastic Access line items of the
        instance.
      operationId: getLineItemActions
      security:
        - AdministrationAccess: []
        - ClientAccess: []
      parameters:
        - $ref: '#/components/parameters/InstanceId'
        - name: next
          in: query
          description: >
            The pagination cursor returned from the previous GET request. Use it
            to fetch the next set of line items, along with their associated
            actions. 

            If there are no more line items, the returned cursor value is 0.

            If not provided in the request, the cursor defaults to 0.
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: A list of actions was returned successfully.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PageInfoActionsResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '500':
          $ref: '#/components/responses/500'
  /v1.0/sessions:
    post:
      summary: Request a new session
      description: Creates a new session for elastic access.
      tags:
        - Sessions
      operationId: createSession
      security:
        - AdministrationAccess: []
        - ClientAccess: []
      parameters:
        - in: header
          name: x-instance-id
          description: >-
            UUID of the instance to create the session on. Required by requests
            that use a ClientAccess token.
          required: false
          schema:
            type: string
      requestBody:
        description: The information required in the request payload.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SessionRequest'
      responses:
        '200':
          description: OK. The request succeeded in its entirety.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InitSessionResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '500':
          description: >-
            Internal Server Error. The session state will be set to FAILED. To
            resolve this, the client should initiate a new session. If you need
            to contact support, please include the reference number provided in
            the response.
    get:
      summary: Fetch IDLE and ACTIVE sessions
      description: >-
        Returns up to 100 live sessions, sorted in descending order of creation
        time.
      tags:
        - Sessions
      operationId: getAllSessionsForInstance
      security:
        - AdministrationAccess: []
        - ClientAccess: []
      parameters:
        - in: query
          name: instanceId
          description: Filter sessions based on Instance UUID.
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK. The request succeeded.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LiveSessionResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
  /v1.0/sessions/{sessionId}:
    get:
      summary: Fetch session details
      description: Returns session details for the specified session ID.
      operationId: getSession
      tags:
        - Sessions
      security:
        - AdministrationAccess: []
        - ClientAccess: []
      parameters:
        - in: header
          name: x-instance-id
          description: >-
            UUID of the instance the session is linked to. Required by requests
            that use a ClientAccess token.
          schema:
            type: string
        - in: path
          name: sessionId
          description: UUID of the session to fetch.
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK. The request succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
    delete:
      summary: Close a session
      description: Closes a specified session for elastic access.
      operationId: closeSession
      security:
        - AdministrationAccess: []
        - ClientAccess: []
      tags:
        - Sessions
      parameters:
        - in: header
          name: x-instance-id
          description: >-
            UUID of the instance the session is linked to. Required by requests
            that use a ClientAccess token.
          schema:
            type: string
        - in: path
          name: sessionId
          description: UUID of the session to be closed.
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK. The request succeeded in its entirety.
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '409':
          $ref: '#/components/responses/409'
        '500':
          $ref: '#/components/responses/500'
        '503':
          description: API is temporarily unavailable. Try again later.
    put:
      summary: Elastic access request in the context of a session
      description: Makes an elastic access request in the context of a session.
      operationId: putSessionAccessRequest
      security:
        - AdministrationAccess: []
        - ClientAccess: []
      tags:
        - Sessions
      parameters:
        - in: header
          name: x-instance-id
          description: >-
            UUID of the instance the session is linked to. Required by requests
            that use a ClientAccess token.
          schema:
            type: string
        - in: path
          name: sessionId
          description: UUID of the session where the access request is being made.
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: The information required in the request payload.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SessionAccessRequest'
      responses:
        '200':
          description: OK. The request succeeded in its entirety.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionAccessResponse'
        '400':
          description: >-
            Bad Request. This error code is returned when the request contained
            an invalid instance ID or session ID, the instance ID is missing in
            the query parameter, or for an invalid request payload.
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
          description: >
            Forbidden. The operation might be forbidden due to an invalid JWT.
            If authorization is valid, this code is returned when one or more of
            the following apply:
              - the session is already in a FAILED or TERMINATED state. To resolve this, the client should initiate a new session. 
              - the access request found rate tables but these do not include one or more of the requested items.
              - the available count is not sufficient to grant the request.
        '404':
          $ref: '#/components/responses/404'
        '500':
          description: >-
            Internal Server Error. The session state will be set to FAILED. To
            resolve this, the client should initiate a new session. If you need
            to contact support, please include the reference number provided in
            the response.
        '503':
          description: API is temporarily unavailable. Try again later.
  /v1.0/sessions/{sessionId}/heartbeat:
    get:
      summary: Send heartbeat
      description: Sends a heartbeat for a session to keep it active.
      operationId: getHeartBeat
      security:
        - AdministrationAccess: []
        - ClientAccess: []
      tags:
        - Sessions
      parameters:
        - in: header
          name: x-instance-id
          description: >-
            UUID of the instance the session is linked to. Required by requests
            that use a ClientAccess token.
          schema:
            type: string
        - in: path
          name: sessionId
          description: UUID of the session to keep active.
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: OK. The request succeeded.
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
          description: >-
            Forbidden. The operation might be forbidden due to an invalid JWT.
            If authorization is valid, this code is returned when the session is
            already terminated or failed.
        '404':
          $ref: '#/components/responses/404'
        '409':
          $ref: '#/components/responses/409'
        '500':
          $ref: '#/components/responses/500'
  /v1.0/instances/{instanceId}/access-request:
    post:
      summary: Access request for elastic tokens
      description: >-
        API to request products, features or other items that will be charged
        for using elastic tokens.
      operationId: postAccessRequest
      security:
        - AdministrationAccess: []
        - ClientAccess: []
      tags:
        - Non-Session Access Request
      servers:
        - url: >-
            https://{siteID}.flexnetoperations.{domainExtension}/dynamicmonetization/elastic/api
          description: Dynamic Monetization API URL
          variables:
            siteID:
              default: siteID
              description: Site ID for your Dynamic Monetization instance.
            domainExtension:
              default: com
              description: Domain extension for your Dynamic Monetization instance.
      parameters:
        - $ref: '#/components/parameters/InstanceId'
      requestBody:
        description: The information required in the request payload.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccessRequest'
      responses:
        '200':
          description: OK The request succeeded in its entirety
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '500':
          $ref: '#/components/responses/500'
        '503':
          $ref: '#/components/responses/503'
components:
  schemas:
    LineItem:
      type: object
      properties:
        rate:
          description: Rate applied. The value can be fractional.
          type: number
          format: double
        activationId:
          description: Activation ID of line item charged to fulfill the request.
          type: string
        tokensCharged:
          description: Number of tokens charged. The value can be fractional.
          type: number
          format: double
        actionId:
          description: >-
            Unique identifier of the action and allocation used if the access
            request was fulfilled from an allocation within the line item.
          type: string
          format: uuid
    Requester:
      description: Requester details
      type: object
      allOf:
        - $ref: '#/components/schemas/BasicRequester'
          properties:
            dictionary:
              description: >-
                Dictionary of additional information about the requester. Will
                be used to evaluate actions defined on line items.
              type: object
          required:
            - type
            - value
    BasicRequester:
      description: Requester details
      type: object
      properties:
        type:
          description: Type of the requester.
          type: string
        value:
          description: Unique identifier for the requester.
          type: string
    RequestedItemRequest:
      description: The details of a requested item.
      type: object
      properties:
        item:
          description: The requested item.
          type: string
        version:
          description: >-
            The version of the item requested. This field may only be omitted or
            left blank if the intention is to access an item in a rate table
            with an empty or unspecified version.
          type: string
        count:
          description: >-
            Number of instances of the requested item required. The value can be
            fractional.
          type: number
          format: double
        metaData:
          $ref: '#/components/schemas/metaData'
      required:
        - item
        - count
    RequestedItem:
      type: object
      properties:
        count:
          description: >-
            Number of instances of the requested item granted. The value can be
            fractional.
          type: number
          format: double
        item:
          description: The name of a requested item.
          type: string
        version:
          description: The version of a requested item.
          type: string
        totalTokensCharged:
          description: >-
            Total number of tokens charged across all line items. The value can
            be fractional.
          type: number
          format: double
        lineItems:
          description: List of line items charged to fulfill this request.
          type: array
          items:
            $ref: '#/components/schemas/LineItem'
        status:
          type: object
          description: The response status to the request for the specific item.
          properties:
            code:
              description: >
                Possible values

                * 101 (Successfully checked out)

                * 102 (No Status)

                * 201 (Item not found in any effective rate table)

                * 301 (No valid active line items)

                * 306 (Insufficient count available)

                * 4001 (Failed due to internal server error) There was an
                internal error processing the request. If you need to contact
                support, please include the correlationId provided in the
                response.
              type: string
            description:
              description: A user-readable message explaining the status code.
              type: string
              example: Successfully checked out.
    metaData:
      description: >-
        (Optional) For sending custom data with the request, which will be sent
        to the data warehouse with the usage information to assist with
        analyzing access activity. The meta data content must be a valid JSON
        object.
      type: object
    AuthKeyRequest:
      description: Array of public keys.
      type: array
      minimum: 1
      maximum: 20
      items:
        $ref: '#/components/schemas/AuthKeyItem'
    AuthKeyItem:
      description: A named public key.
      type: object
      properties:
        publicKey:
          description: A public key in PEM format.
          type: string
          example: >-
            -----BEGIN PUBLIC KEY-----\nMIIBgjAcBgoqhkiG9w0BD...\n-----END
            PUBLIC KEY-----
        id:
          description: >-
            Your identifier for the key. This identifier must be added as a
            claim in a JWT token signed with the corresponding private key, in
            order to indicate which public key should be used to verify the JWT
            is valid.
          type: string
          example: xyz
    KeyPageInfoResponse:
      type: object
      description: A page of public keys.
      properties:
        keys:
          type: array
          description: The public keys.
          items:
            $ref: '#/components/schemas/PublicKey'
        next:
          type: integer
          description: >-
            Use this page value in your next GET /public-keys request to fetch
            the next batch of public keys.
    PublicKey:
      type: object
      description: A public key
      properties:
        id:
          type: string
          description: Identifies the public key.
        type:
          type: string
          description: Type of the public key (administration-key or client-key).
        publicKey:
          type: string
          description: A public key in PEM format.
        created:
          type: integer
          description: >-
            The date and time the key was created in milliseconds since
            1970-01-01 00:00.
          format: int64
        modified:
          type: integer
          description: >-
            The date and time the key was last modified in milliseconds since
            1970-01-01 00:00.
          format: int64
    ProvisionedLineItem:
      required:
        - activationId
        - state
        - attributes
        - start
        - end
        - quantity
      type: object
      properties:
        activationId:
          type: string
          description: >
            The activation ID of a line item that should be mapped to the
            instance.
        state:
          $ref: '#/components/schemas/LineItemState'
        quantity:
          minimum: 1
          type: integer
          description: |
            The quantity from the line item to map to the instance.
          format: int64
        start:
          type: integer
          description: >-
            Start date and time of the line item in milliseconds since
            1970-01-01 00:00.
          format: int64
        end:
          type: integer
          description: >-
            End date and time of the line item in milliseconds since 1970-01-01
            00:00.
          format: int64
        used:
          type: number
          description: >-
            The count from the line item quantity used by access requests. The
            value can be fractional.
          format: double
          readOnly: true
        attributes:
          $ref: '#/components/schemas/Attributes'
      description: |
        Defines the properties of a line item.
    LineItemState:
      type: string
      description: >
        The line item state. Valid states are:
          - DEPLOYED
          - INACTIVE
          - OBSOLETE

        INACTIVE and OBSOLETE can only be set when the line item already
        exists.<br>

        An OBSOLETE line item cannot be set to INACTIVE or DEPLOYED.
    Feature:
      type: object
      properties:
        name:
          type: string
          description: Feature name
        version:
          type: string
          description: Feature version
        count:
          minimum: 1
          type: integer
          description: The number of times the feature is made available in the product.
          format: int64
        recordVersion:
          type: integer
          format: int64
          writeOnly: true
        uuid:
          type: string
          format: uuid
          writeOnly: true
      description: A feature available in a product.
    Attributes:
      type: object
      description: >-
        The properties that determine how the service will respond to access
        requests.
      properties:
        elastic:
          type: boolean
          description: Indicates whether the line item is elastic.
          default: false
        rateTableSeries:
          type: string
          description: >-
            The rate table series used to determine the rate applied to Elastic
            access requests against this line item. An empty string indicates
            that the rate is determined by the latest version of a table with no
            series.
          default: ''
        overdraftLimit:
          type: integer
          description: >
            Allow requests to continue consuming tokens from this line item
            after the entitled quantity has been fully consumed, up to the
            overdraft limit. 

            The overdraftType field must be set to "Number" if an overdraft
            limit is provided.

            To consume tokens from this line item indefinitely, set the
            overdraftType to "Unlimited", and an overdraft limit is not
            required.

            If an overdraft limit is not set, requests can only consume from
            this line item until the entitled quantity is reached.
        overdraftType:
          type: string
          description: |
            The type of overdraft. Valid types are: 
            - Unlimited
            - Number
    Instance:
      required:
        - accountId
        - shortName
      type: object
      properties:
        id:
          type: string
          description: The ID of the instance.
          readOnly: true
        shortName:
          maxLength: 100
          minLength: 1
          type: string
          description: User-defined name of the instance.
        accountId:
          type: string
          description: ID of the customer account owning the instance.
          minLength: 1
        defaultInstance:
          type: boolean
          description: |
            Indicates whether this is the default instance for an account. If
            set to true, auto-provisioned line items will be mapped to this
            instance.
          readOnly: true
        created:
          type: integer
          description: >-
            The date and time the instance was created in milliseconds since
            1970-01-01 00:00.
          format: int64
          readOnly: true
        modified:
          type: integer
          description: >-
            The date and time the instance was last modified in milliseconds
            since 1970-01-01 00:00.
          format: int64
          readOnly: true
      description: An instance
    PageInfoResponse:
      type: object
      properties:
        content:
          type: array
          description: The list of instances.
          items:
            $ref: '#/components/schemas/Instance'
        next:
          type: integer
          description: >-
            Use this page value in your next GET /instances request to fetch the
            next page of instances.
      description: A page of instances.
    RateTableItem:
      description: An item that has a rate defined in a rate table.
      required:
        - name
        - rate
      type: object
      properties:
        name:
          type: string
          description: Name of the item.
          minLength: 1
          maxLength: 100
        version:
          type: string
          description: Version of the item.
        rate:
          type: number
          description: Rate of the item. The value can be fractional.
          format: double
          minimum: 0
    RateTable:
      description: Rate table defining the cost of using each item detailed.
      type: object
      properties:
        created:
          type: integer
          description: >-
            Creation time of the rate table in milliseconds since 1970-01-01
            00:00.
          format: int64
          readOnly: true
        effectiveFrom:
          type: integer
          description: >-
            Time when the rate table starts to take effect in milliseconds since
            1970-01-01 00:00.
          format: int64
        series:
          type: string
          description: A means of grouping similar rate tables of different versions.
        version:
          type: string
          description: The version of this rate table.
        items:
          type: array
          description: List of rate table items.
          items:
            $ref: '#/components/schemas/RateTableItem'
    ConfigItem:
      description: Details of the configuration.
      type: object
      properties:
        name:
          type: string
          description: The name of the configuration.
        value:
          type: string
          description: The value of the configuration.
        modified:
          type: number
          description: >-
            The date and time in milliseconds since 1970-01-01 00:00, when the
            configuration was last modified. This field is returned only if the
            configuration has been changed from its default value.
          readOnly: true
        updatedBy:
          type: string
          description: >-
            Public key identifier of the JWT token that was used to update this
            configuration. This key ID allows you to identify the user or users
            who are authorized to make this change. This field is returned only
            if the configuration has been changed from its default value.
          readOnly: true
    ConfigList:
      description: List of configurations.
      type: array
      items:
        $ref: '#/components/schemas/ConfigItem'
    Limits:
      description: List of limits.
      type: array
      items:
        $ref: '#/components/schemas/Limit'
    Limit:
      description: A Limit.
      type: object
      properties:
        uuid:
          type: string
          format: uuid
          description: >-
            The unique identifier for the limit, created by Dynamic
            Monetization, which cannot be modified. It is provided to allow
            subsequent modifications of individual limits.
        name:
          type: string
          description: >-
            The name for the limit which enables users to easily identified the
            limit in the limit scheme. The name must be unique (case
            insensitively) within the instance's limits, but it may later be
            changed.
        limit:
          type: number
          description: >-
            The maximum number of tokens consumable when this limit is applied
            across all active line items of the instance.
    ConditionReadOnlyId:
      description: List of conditions
      type: array
      items:
        allOf:
          - type: object
            properties:
              id:
                description: A generated identifier to uniquely identify the condition.
                type: string
                format: uuid
                readOnly: true
          - $ref: '#/components/schemas/Condition'
    ConditionOptionalId:
      description: List of conditions
      type: array
      items:
        allOf:
          - type: object
            properties:
              id:
                description: >-
                  The identifier of a condition to be modified. If an identifier
                  is not provided, a new condition will be created with a
                  generated identifier.
                type: string
                format: uuid
          - $ref: '#/components/schemas/Condition'
    Condition:
      type: object
      properties:
        name:
          type: string
          description: >-
            A human readable name to help a user identify the condition. Not
            required to be unique.
      oneOf:
        - $ref: '#/components/schemas/AttributeCondition'
        - $ref: '#/components/schemas/CompositeCondition'
        - $ref: '#/components/schemas/UnaryCondition'
    AttributeCondition:
      type: object
      properties:
        operator:
          description: The logical operator to apply.
          type: string
          enum:
            - IN
        property:
          description: The dictionary key.
          type: string
        values:
          description: The different values to match.
          type: array
          items:
            type: string
      required:
        - operator
        - property
        - values
    CompositeCondition:
      type: object
      properties:
        operator:
          description: The logical operator to apply.
          type: string
          enum:
            - AND
            - OR
        conditions:
          description: |
            Conditions to apply according to the logical operator.
            Note: The nesting depth is limited to 3 levels.
          type: array
          minItems: 2
          maxItems: 4
          items:
            oneOf:
              - $ref: '#/components/schemas/AttributeCondition'
              - $ref: '#/components/schemas/CompositeCondition'
              - $ref: '#/components/schemas/UnaryCondition'
      required:
        - operator
        - conditions
    UnaryCondition:
      type: object
      properties:
        operator:
          description: The logical operator to apply.
          type: string
          enum:
            - NOT
        condition:
          description: |
            Condition to apply according to the logical operator.
            Note: The nesting depth is limited to 3 levels.
          type: object
          oneOf:
            - $ref: '#/components/schemas/AttributeCondition'
            - $ref: '#/components/schemas/CompositeCondition'
            - $ref: '#/components/schemas/UnaryCondition'
      required:
        - operator
        - condition
    Action:
      description: An action to be taken when a condition is met.
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: A generated identifier to uniquely identify the action.
          readOnly: true
        name:
          type: string
          description: >-
            A human readable name to help a user identify the action. The same
            name may be re-used in other line items.
        conditionId:
          type: string
          format: uuid
          description: >
            The unique identifier of the condition that triggers this action.


            Required, unless defining a default action. Only one default action
            may be defined per line item.
        action:
          type: string
          description: The action to take when the condition is met.
          enum:
            - ALLOW
            - DENY
        allocation:
          type: number
          description: >
            The maximum number of tokens that may be consumed from the stated
            line item by requests satisfying the condition.


            Required for ALLOW, but may be omitted at most once per line item to
            create a default ALLOW action.

            Not used for DENY.
          format: number
          example: 1000
        used:
          type: number
          description: >
            The total count that has been consumed from the allocation by access
            requests.


            This field is only present for actions which have an allocation.
          format: double
          readOnly: true
      required:
        - action
    PageInfoActionsResponse:
      type: object
      properties:
        lineItems:
          type: array
          description: The list of instances.
          items:
            $ref: '#/components/schemas/ActivationActions'
        next:
          type: integer
          description: >-
            If there are more actions to get, this value will be non-zero and
            can be used in a subsequent GET request to retrieve the next page of
            actions.
      description: A page of line items with actions.
    ActivationActions:
      type: object
      properties:
        lineItemId:
          type: string
          description: The activation ID of the line item.
        actions:
          type: array
          description: The list of actions for the line item.
          items:
            $ref: '#/components/schemas/Action'
      description: |
        An ordered list of actions that are defined for the line-item.
    PageInfoEntitiesResponse:
      type: object
      properties:
        entities:
          type: array
          description: The list of entities.
          items:
            $ref: '#/components/schemas/Entity'
        next:
          type: integer
          description: >-
            If there are more entities to get, this value will be non-zero and
            can be used in a subsequent GET request to retrieve the next page of
            entities.
      description: A page of entities.
    Entity:
      description: Defines the properties of a SKU entity to be created.
      type: object
      required:
        - type
        - name
      properties:
        id:
          type: string
          format: uuid
          description: A generated identifier to uniquely identify the entity.
          readOnly: true
        type:
          type: string
          description: The type of the entity.
          enum:
            - PRODUCT
            - FEATURE
        name:
          type: string
          description: The name of the entity.
          minLength: 1
          maxLength: 100
        version:
          type: string
          description: The version of the entity.
          maxLength: 50
        entities:
          type: array
          description: The list of child entities associated with the main entity.
          items:
            $ref: '#/components/schemas/SKUSubEntity'
    SKUSubEntity:
      type: object
      required:
        - id
        - quantity
      properties:
        id:
          type: string
          format: uuid
          description: >-
            A unique identifier generated by Dynamic Monetization for the
            sub-entity.
        quantity:
          minimum: 1
          type: integer
          description: The quantity of the sub-entity available in the parent entity.
          format: int64
    EntityPostResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: >-
            A unique identifier generated by Dynamic Monetization for the
            entity.
    SessionRequest:
      description: Body of session request
      type: object
      properties:
        instanceId:
          description: UUID of the instance, used while creating a new session.
          type: string
          format: uuid
      required:
        - instanceId
    InitSessionResponse:
      description: The response to the session request.
      type: object
      properties:
        sessionId:
          description: UUID of the session created.
          type: string
          format: uuid
    SessionResponse:
      description: The response to the session request.
      type: object
      properties:
        sessionId:
          description: UUID of the session.
          type: string
          format: uuid
        instanceId:
          description: UUID of the instance that linked to this session.
          type: string
          format: uuid
        state:
          description: Current state of this session.
          type: string
          enum:
            - IDLE
            - ACTIVE
            - TERMINATED
            - FAILED
        items:
          uniqueItems: true
          type: array
          description: The items in this session.
          items:
            $ref: '#/components/schemas/SessionItem'
    SessionItem:
      description: Item used in the session.
      type: object
      properties:
        item:
          description: The name of an item.
          type: string
        version:
          description: >
            The version of an item.

            Must match the item version in the rate table exactly.

            If empty, it will only match an item in the rate table with an empty
            version field.

            Wild cards are not supported.
          type: string
        count:
          description: >-
            Number of instances of the requested item being used in the session.
            The value can be fractional.
          type: number
          format: double
    SessionAccessRequest:
      description: Body of access request
      type: object
      properties:
        requester:
          description: Requester details
          type: object
          $ref: '#/components/schemas/Requester'
        rollbackOnDeny:
          description: >-
            When true, if the request cannot be granted the session will revert
            to the combination of items it was charging for before the request
            was made. When false, if the request cannot be granted the session
            will refund all items it was charging for before the request was
            made, and the session state will be set to TERMINATED. The amount
            refunded will be calculated using the time of the denied request up
            until the end of the period that has been charged for.
          type: boolean
        requestedItems:
          description: >-
            A list of requested items. Provide an empty list to stop using all
            items.
          type: array
          items:
            $ref: '#/components/schemas/RequestedItemRequest'
      required:
        - requester
        - rollbackOnDeny
        - requestedItems
    SessionAccessResponse:
      description: The response to the access request.
      type: object
      properties:
        requestedItems:
          description: List of requested items.
          type: array
          items:
            $ref: '#/components/schemas/RequestedItem'
        requester:
          description: The details of the requester making the access request.
          type: object
          $ref: '#/components/schemas/Requester'
        correlationId:
          description: >-
            An ID for the request, generated by the service, which allows
            correlation of the request with usage information obtained from the
            data warehouse. The correlation ID cannot be set by the caller of
            the API.
          type: string
    LiveSessionResponse:
      description: The response to the live session request.
      type: object
      properties:
        sessionId:
          description: UUID of the session.
          type: string
          format: uuid
        instanceId:
          description: UUID of the instance that this session operates on.
          type: string
          format: uuid
        state:
          description: Current state of this session.
          type: string
          enum:
            - IDLE
            - ACTIVE
        chargedUntil:
          description: >-
            The timestamp for the last scheduled automatic charge, in
            milliseconds since the epoch.
          type: integer
        lastHeartBeat:
          description: >-
            The timestamp when the last heartbeat was received, in milliseconds
            since the epoch.
          type: integer
        lastAccessRequest:
          description: >-
            The timestamp when the last access request was received for the
            session, in milliseconds since the epoch.
          type: integer
    AccessRequest:
      description: Body of access request.
      type: object
      properties:
        requester:
          description: Requester details.
          type: object
          $ref: '#/components/schemas/Requester'
        requestedItems:
          description: A list of requested items.
          type: array
          items:
            $ref: '#/components/schemas/RequestedItemRequest'
      required:
        - requester
        - requestedItems
    AccessResponse:
      description: The response to the access request.
      type: object
      properties:
        requestedItems:
          description: List of requested items.
          type: array
          items:
            $ref: '#/components/schemas/RequestedItem'
        requester:
          description: The details of the requester making the access request.
          type: object
          $ref: '#/components/schemas/Requester'
        correlationId:
          $ref: '#/components/schemas/CorrelationId'
    UsedCountChangeResponse:
      description: Used count change response body.
      type: object
      properties:
        used:
          description: The resulting line item used count, after the change is applied.
          type: number
          format: double
        correlationId:
          $ref: '#/components/schemas/CorrelationId'
    CorrelationId:
      description: >-
        An ID for the request, generated by the service, which allows
        correlation of the request with usage information obtained from the data
        warehouse.
      type: string
    FloatingAccessRequest:
      description: The body of an access request.
      type: object
      properties:
        requester:
          description: Requester details.
          type: object
          allOf:
            - $ref: '#/components/schemas/BasicRequester'
            - required:
                - value
                - type
        items:
          description: List of items being requested.
          type: array
          items:
            $ref: '#/components/schemas/RequestItem'
      required:
        - requester
        - items
    FloatingAccessResponse:
      description: The response to the access request.
      type: object
      properties:
        correlationId:
          description: >-
            An ID for the request, generated by the service, which allows
            correlation of the request with usage information obtained from the
            data warehouse. The correlation ID cannot be set by the caller of
            the API. It must be included in support tickets.
          type: string
        requester:
          description: The details of the requester that made the access request.
          type: object
          $ref: '#/components/schemas/BasicRequester'
        items:
          description: List of responses, one for each item described in the request.
          type: array
          items:
            $ref: '#/components/schemas/ResponseItem'
    BasicItem:
      description: Basic item details.
      type: object
      properties:
        name:
          description: The name of the item being requested.
          type: string
        type:
          description: The type of the item being requested.
          type: string
        version:
          description: The version of the item being requested.
          type: string
        count:
          description: Quantity of the item requested.
          type: number
    RequestItem:
      allOf:
        - $ref: '#/components/schemas/BasicItem'
      description: Details of the item requested.
      type: object
      properties:
        duration:
          description: >-
            The length of time for which the item is borrowed expressed in ISO
            8601 format (e.g., P1D for one day).
          type: string
      required:
        - duration
        - name
        - type
        - count
    ResponseItem:
      allOf:
        - $ref: '#/components/schemas/BasicItem'
      description: Details of the item requested.
      type: object
      properties:
        expiration:
          description: >-
            The expiration time of the granted item, represented as the number
            of milliseconds since the Unix epoch (UTC).
          type: string
        status:
          type: object
          description: The response to the request for this specific item
          properties:
            code:
              description: |
                Possible values
                * 101 (Successfully checked out)
                * 302 (Line item has expired)
                * 303 (Line item has not started)
                * 304 (Activation ID unknown)
                * 305 (Invalid line item type)
              type: string
            description:
              description: A user-friendly message explaining the status code
              type: string
              example: Successfully checked out
        lineItems:
          description: List of activations from which the item is borrowed.
          type: array
          items:
            type: object
            properties:
              activationId:
                description: The Id of the line item from which the item is borrowed.
                type: string
              countUsed:
                description: The quantity of the item borrowed from this line item.
                type: number
    clientsResponse:
      description: >-
        The response containing the list of clients who are active on an
        instance.
      type: object
      properties:
        clients:
          description: List of active clients.
          type: array
          items:
            type: object
            properties:
              requester:
                $ref: '#/components/schemas/BasicRequester'
              items:
                description: List of items held by the client.
                type: array
                items:
                  $ref: '#/components/schemas/ResponseItem'
  parameters:
    InstanceId:
      name: instanceId
      in: path
      description: The UUID of the Dynamic Monetization instance.
      required: true
      schema:
        type: string
        format: uuid
    ConditionId:
      name: conditionId
      in: path
      description: |
        The unique identifier of the condition.
        This is a UUID that is generated by Dynamic Monetization.
      required: true
      schema:
        type: string
        format: uuid
    InstanceIdHeader:
      name: x-instance-id
      in: header
      description: >-
        UUID of Monetization instance. Required by requests that use a
        ClientAccess token.
      schema:
        type: string
        format: uuid
    KeyId:
      name: keyId
      in: path
      description: Public key ID.
      required: true
      schema:
        type: string
    LineItemId:
      name: lineItemId
      in: path
      description: |
        Line item ID. 
        Note: This is also known as the activation ID.
      required: true
      schema:
        type: string
  responses:
    '200':
      description: OK. The request succeeded in its entirety.
    '400':
      description: Bad Request. Check the request for any errors in the input.
    '401':
      description: Unauthorized. Check authentication details.
    '403':
      description: >-
        Forbidden. The user is forbidden from performing this operation. Check
        user permissions.
    '404':
      description: Resource not found. The requested resource is not available.
    '409':
      description: >-
        Resource conflict caused by another request that is using the same
        session. Try repeating the request; the session usually becomes free
        soon.
    '500':
      description: >-
        Internal Server Error. There was an internal error processing the
        request. If you need to contact support, please include the reference
        number provided in the response.
    '503':
      description: API is temporarily unavailable. Try again later.
  securitySchemes:
    AdministrationAccess:
      description: >
        A JWT token signed using a private key corresponding to a named producer
        admin public key.

        May be used by a producer user for elevated API access.


        Required claims:
          - iss: The URI of the issuing server.
          - nbf: The time this token is valid after, in seconds since the epoch.
          - exp: The time this token is valid until, in seconds since the epoch.
          - iat: The time this token was issued, in seconds since the epoch.
          - cnf: A JSON object that contains public key identity information.
            - kid: The ID of the public key that should be used to verify this JWT.
            - kty: The key type, must be "ADMIN".

        Example payload
          ```
          {
            "nbf": 1691663772,
            "exp": 1699652520,
            "iat": 1691663773,
            "iss": "producer.org",
            "cnf": {
                      "jwk" : {
                        "kid": "xyz-key-id",
                        "kty": "ADMIN"
                      }
                  }
          }
          ```
      type: http
      scheme: bearer
      bearerFormat: JWT
    ClientAccess:
      description: >
        A JWT token signed using a private key corresponding to a named client
        public key.

        May be used by a client, or customer user to access APIs.


        Required claims:
          - iss: The URI of the issuing server.
          - nbf: The time this token is valid after, in seconds since the epoch.
          - exp: The time this token is valid until, in seconds since the epoch.
          - iat: The time this token was issued, in seconds since the epoch.
          - aud: A list of instance IDs that this token will allow access to.
          - cnf: A JSON object that contains public key identity information.
            - kid: The ID of the public key that should be used to verify this JWT.
            - kty: The key type, must be "CLIENT".

        Example payload
          ```
          {
            "nbf": 1691663772,
            "exp": 1699652520,
            "iat": 1691663773,
            "iss": "producer.org",
            "aud":["47c173d4-a262-44ba-992c-63b0436fecc5"],
            "cnf": {
                      "jwk" : {
                        "kid": "xyz-key-id",
                        "kty": "CLIENT"
                      }
                  }
          }
          ```
      type: http
      scheme: bearer
      bearerFormat: JWT
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
  examples:
    sampleConditionResp:
      summary: Example JSON of conditions
      description: A sample list of conditions.
      value:
        - id: 123e4567-e89b-12d3-a456-426614174004
          name: compositeCondition
          operator: AND
          conditions:
            - operator: IN
              property: status
              values:
                - active
                - pending
            - operator: NOT
              condition:
                operator: IN
                property: category
                values:
                  - restricted
        - id: 123e4567-e89b-12d3-a456-426614174000
          name: simpleCondition
          operator: IN
          property: category
          values:
            - gold
            - silver
    sampleConditionRequest:
      summary: Example JSON of conditions request body
      description: A sample list of conditions.
      value:
        - name: compositeCondition
          operator: AND
          conditions:
            - operator: IN
              property: status
              values:
                - active
                - pending
            - operator: NOT
              condition:
                operator: IN
                property: category
                values:
                  - restricted
        - name: simpleCondition
          operator: IN
          property: category
          values:
            - gold
            - silver
