openapi: 3.0.1
info:
  title: Elevate Pricing API
  description: >
    ### Usage and Rental Pricing Management

    Provides read & write access to usage and rental rate cards and inclusive
    usage plans


    #### Definitions

    * Usage Rate Card - a representation of the pricing structure for usage that
    can be sold to Customers, for example 5 pence per minute for UK National
    calls 

    * Rental Rate Card - a representation of the pricing structure for rental
    product that can be sold to Customers, for example £10 per month for line
    rental

    * Inclusive Usage Plan - a representation of an inclusive bundle that can be
    sold to a Customer, for example you can allocate 500 free minutes to UK
    National or Local calls
  version: '2.22'
servers:
  - url: https://rest.elevatebilling.com/v2
tags:
  - name: usage-rate-cards
    description: >-
      Usage rate cards represent the pricing structure for usage products that
      can be sold to Customers
  - name: usage-rates
    description: Usage rates represent the pricing rates for a usage product
  - name: rental-rate-cards
    description: >-
      Rental rates card represent the pricing structure for rental products that
      can be sold to Customers
  - name: rental-rates
    description: Rental rates represent the pricing rates for a rental product
  - name: inclusive-usage-plans
    description: >-
      Inclusive usage plans represent an inclusive bundle that can be sold to
      Customers
  - name: inclusive-usage-balances
    description: >-
      Inclusive usage balances represent the current balance of an inclusive
      usage plan for a Customer, Site or Inventory
  - name: rental-discount-plans
    description: >-
      Rental discount plans provide percentage-based discounts on rental
      products for Customers
  - name: rental-discount-plan-rules
    description: >-
      Rental discount plan rules define the discount percentage for specific
      rental product categories
paths:
  /usage-rate-cards:
    get:
      tags:
        - usage-rate-cards
      summary: Get a list of available usage rate cards
      operationId: getUsageRateCards
      x-si-permissions:
        - VIEW_USAGE_RATE_CARD
      security:
        - bearerAuth: []
      x-si-filterable: true
      parameters:
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/pageSize'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/fields'
        - name: contractOwnerId
          in: query
          description: Filter by contract owner
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: name
          in: query
          description: Filter by name
          schema:
            $ref: '#/components/schemas/StringFilterParam'
        - name: availableFrom
          in: query
          description: Filter by available from date
          schema:
            $ref: '#/components/schemas/DateFilterParam'
          required: false
        - name: availableTo
          in: query
          description: Filter by available to date
          schema:
            $ref: '#/components/schemas/DateFilterParam'
          required: false
        - name: rateCardType
          in: query
          description: Filter by rate card type
          schema:
            $ref: '#/components/schemas/StringFilterParam'
          required: false
        - name: usageProductId
          in: query
          description: Filter by usage product
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: supplierId
          in: query
          description: Filter by supplier
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: summary
          in: header
          description: >-
            If true, returns a lightweight summary of each usage rate card
            instead of the full object. Use this to reduce payload size and
            improve performance when only basic information is needed.
          required: false
          schema:
            $ref: '#/components/schemas/BooleanFilterParam'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UsageRateCard'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
    head:
      tags:
        - usage-rate-cards
      summary: Check if a usage rate card exists
      operationId: checkUsageRateCards
      x-si-permissions:
        - VIEW_USAGE_RATE_CARD
      security:
        - bearerAuth: []
      parameters:
        - name: id
          in: query
          description: Filter by id
          schema:
            $ref: '#/components/schemas/IdFilterParam'
        - name: contractOwnerId
          in: query
          description: Filter by contract Owner
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: name
          in: query
          description: Filter by name
          schema:
            $ref: '#/components/schemas/StringFilterParam'
        - name: availableFrom
          in: query
          description: Filter by available from date
          schema:
            $ref: '#/components/schemas/DateFilterParam'
          required: false
        - name: availableTo
          in: query
          description: Filter by available to date
          schema:
            $ref: '#/components/schemas/DateFilterParam'
          required: false
        - name: rateCardType
          in: query
          description: Filter by rate card type
          schema:
            $ref: '#/components/schemas/StringFilterParam'
          required: false
        - name: usageProductId
          in: query
          description: Filter by usage product
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: supplierId
          in: query
          description: Filter by supplier
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
      responses:
        '200':
          description: OK
          content: {}
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Not Found
          content: {}
    post:
      tags:
        - usage-rate-cards
      summary: Create a new usage rate card
      operationId: createUsageRateCard
      x-si-permissions:
        - CREATE_USAGE_RATE_CARD
      x-si-apply-impact-of-change: true
      security:
        - bearerAuth: []
      requestBody:
        description: New usage rate card
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UsageRateCard'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageRateCard'
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageRateCard'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
  /usage-rate-cards/{usage_rate_card_id}:
    get:
      tags:
        - usage-rate-cards
      summary: Get a specific usage rate card
      operationId: getUsageRateCard
      x-si-permissions:
        - VIEW_USAGE_RATE_CARD
      security:
        - bearerAuth: []
      parameters:
        - name: usage_rate_card_id
          in: path
          description: Usage rate card identifier
          required: true
          schema:
            $ref: '#/components/schemas/IdParam'
        - name: fields
          in: query
          description: >-
            Comma-delimited list of the field(s) to return if only a subset is
            required (other fields will be returned as null for now)
          schema:
            $ref: '#/components/schemas/FieldsParam'
          required: false
        - name: summary
          in: header
          description: >-
            If true, returns a lightweight summary of usage rate card instead of
            the full object. Use this to reduce payload size and improve
            performance when only basic information is needed.
          required: false
          schema:
            $ref: '#/components/schemas/BooleanFilterParam'
      responses:
        '200':
          description: Usage rate card found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageRateCard'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Not Found
          content: {}
    delete:
      tags:
        - usage-rate-cards
      summary: Delete a specific usage rate card
      operationId: deleteUsageRateCard
      x-si-permissions:
        - DELETE_USAGE_RATE_CARD
      security:
        - bearerAuth: []
      parameters:
        - name: usage_rate_card_id
          in: path
          description: Usage rate card identifier
          required: true
          schema:
            $ref: '#/components/schemas/IdParam'
      responses:
        '200':
          description: OK
          content: {}
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Not Found
          content: {}
    patch:
      tags:
        - usage-rate-cards
      summary: Update a usage rate card
      operationId: updateUsageRateCard
      x-si-json-patch: true
      x-si-allow-patch:
        - /name
        - /contractOwnerIds
        - /contractOwnerIds/.*
        - /rateCardType
        - /available(From|To)
        - /usageProductId
        - /supplierId
        - /decimalPlaces
        - /priceRoundingStyle
        - /defaultMinCharge
        - /roundAccessChargeFirstMinute
        - /boltOn
        - /boltOnTaxBandId
        - /applyCrossTimeBandCharging
        - /defaultQuantityRoundingIncrement
        - /defaultVariableChargeUnitSize
        - /timeBandPlans
        - /accessCharges
        - /usageRates
        - /usageRates/.*
      x-si-permissions:
        - UPDATE_USAGE_RATE_CARD
      x-si-apply-impact-of-change: true
      security:
        - bearerAuth: []
      parameters:
        - name: usage_rate_card_id
          in: path
          description: Usage rate card identifier
          required: true
          schema:
            $ref: '#/components/schemas/IdParam'
        - name: summary
          in: header
          description: >-
            If true, returns a lightweight summary of usage rate card instead of
            the full object. Use this to reduce payload size and improve
            performance when only basic information is needed.
          required: false
          schema:
            $ref: '#/components/schemas/BooleanFilterParam'
      requestBody:
        description: >-
          A set of JSONPatch operations to be performed. Note that usage rates
          can only be added here. To update or delete a rate, use
          /usage-rates/id PATCH or DELETE method
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PatchRequest'
            examples:
              Rename:
                summary: Rename usage rate card
                value:
                  - op: replace
                    path: /name
                    value: My Rate Card
                description: Rename usage rate card
              AddRate:
                summary: Add a new rate to an existing usage rate card
                value:
                  - op: add
                    path: /usageRates/-
                    value:
                      id: null
                      chargeGroupId: 386
                      usageRateType: VARIABLE
                      peakInitialCharge: 0
                      peakInitialPeriod: 0
                      peakValue: 0
                      peakMinimum: 0
                      offPeakInitialCharge: 0
                      offPeakInitialPeriod: 0
                      offPeakValue: 0
                      offPeakMinimum: 0
                      weekendInitialCharge: 0
                      weekendInitialPeriod: 0
                      weekendValue: 0
                      weekendMinimum: 0
                      quantityRoundingIncrement: 1
                      variableChargeUnitSize: 60
                      startDate: '2023-10-01'
                description: Add a new rate to an existing usage rate card
              AddContractOwnerIdsUsingAddOp:
                summary: Add contract owner id using 'add'
                value:
                  - op: add
                    path: /contractOwnerIds/-
                    value: 2
                description: >-
                  To add a contract owner's ID, use the 'add' operation and
                  specify a new contract owner ID as the value. For example, if
                  a usage rate card is associated with contract owner ID 1, and
                  the contract owner with ID 2 should be added, the value should
                  be 2
              AddContractOwnerIdsReplaceOp:
                summary: Add contract owner ids using 'replace'
                value:
                  - op: replace
                    path: /contractOwnerIds
                    value:
                      - 1
                      - 2
                description: >-
                  To add a contract owner's ID, use the 'replace' operation and
                  specify the new set of contract owner IDs associated with the
                  usage rate card as the value (including old values). For
                  example, if a usage rate card is associated with contract
                  owner IDs 1, and the contract owner with ID 2 should be added,
                  the value should be [1, 2]
              RemoveContractOwnerIds:
                summary: Remove contract owner ids
                value:
                  - op: replace
                    path: /contractOwnerIds
                    value:
                      - 1
                description: >-
                  To remove a contract owner's ID, use the 'replace' operation
                  and specify the new set of contract owner IDs associated with
                  the usage rate card as the value. For example, if a usage rate
                  card was associated with contract owner IDs 1 and 2, and the
                  contract owner with ID 2 should be removed, the value should
                  be [1]
              ReplaceSupplier:
                summary: Replace supplier
                value:
                  - op: add
                    path: /supplierId
                    value: 1
                description: >-
                  To replace a supplier, use the 'add' operation and specify the
                  supplier ID associated with the usage rate card as the value.
                  For example, if a usage rate card is associated with supplier
                  IDs 2, and a new supplier ID 1 should be associated with this
                  rate card, the value should be 1
              ReplaceTimeBandPlan:
                summary: Replace time band plan
                value:
                  - op: replace
                    path: /timeBandPlans
                    value:
                      - timeBandPlanId: 1
                        name: newTimeBandPlanName
                        startDate: '2020-01-01'
                        endDate: '2030-01-01'
                description: >-
                  To replace a time band plan, use the 'replace' operation and
                  specify the information about new time band plan associated
                  with the usage rate card as the value.
              ChangeBoltOnOption:
                summary: Change boltOn option
                value:
                  - op: replace
                    path: /boltOn
                    value: true
                description: >-
                  To change a boltOn option, use the 'replace' operation and
                  specify true or false value.
              ReplaceAccessCharges:
                summary: Replace access charges
                value:
                  - op: replace
                    path: /accessCharges
                    value:
                      - id: 1
                        charge: 0.1
                        startDate: '2025-01-01'
                        endDate: null
                      - id: 2
                        charge: 0
                        startDate: '2023-01-01'
                        endDate: '2024-01-01'
                description: >-
                  To replace accessCharges, use the 'replace' operation and
                  specify an information about charges associated with the usage
                  rate card as the value.
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageRateCard'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Not Found
          content: {}
  /usage-rates:
    get:
      tags:
        - usage-rates
      summary: Get a list of usage rates
      operationId: getUsageRates
      x-si-permissions:
        - VIEW_USAGE_RATE_CARD
      security:
        - bearerAuth: []
      x-si-filterable: true
      parameters:
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/pageSize'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/fields'
        - name: usageRateCardId
          in: query
          description: Filter by usage rate card
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: true
        - name: chargeGroupId
          in: query
          description: Filter by charge group
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: usageRateType
          in: query
          description: Filter by usage rate type
          schema:
            $ref: '#/components/schemas/StringFilterParam'
          required: false
        - name: availableFrom
          in: query
          description: Filter by available from date
          schema:
            $ref: '#/components/schemas/DateFilterParam'
          required: false
        - name: availableTo
          in: query
          description: Filter by available to date
          schema:
            $ref: '#/components/schemas/DateFilterParam'
          required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UsageRate'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
  /usage-rates/{usage_rate_id}:
    patch:
      tags:
        - usage-rates
      summary: Update a usage rate within a usage rate card
      operationId: updateUsageRate
      x-si-json-patch: true
      x-si-allow-patch:
        - /chargeGroupId
        - /usageRateType
        - /peakInitialPeriod
        - /peakValue
        - /peakMinimum
        - /peakInitialCharge
        - /offPeakInitialPeriod
        - /offPeakValue
        - /offPeakMinimum
        - /offPeakInitialCharge
        - /weekendInitialPeriod
        - /weekendValue
        - /weekendMinimum
        - /weekendInitialCharge
        - /quantityRoundingIncrement
        - /variableChargeUnitSize
        - /surchargeInitialPeriod
        - /surchargeValue
        - /surchargeMinimum
        - /surchargeInitialCharge
        - /(start|end)Date
      x-si-permissions:
        - UPDATE_USAGE_RATE_CARD
      x-si-apply-impact-of-change: true
      security:
        - bearerAuth: []
      parameters:
        - name: usage_rate_id
          in: path
          description: Usage rate identifier
          required: true
          schema:
            $ref: '#/components/schemas/IdParam'
      requestBody:
        description: >-
          A set of JSONPatch operations to be performed. Note that usage rates
          can only be updated here. To add a new rate, use /usage-rate-cards/
          PATCH method
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PatchRequest'
            examples:
              ChangeOffPeakValue:
                value:
                  - op: replace
                    path: /offPeakValue
                    value: '5'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageRate'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Not Found
          content: {}
    delete:
      tags:
        - usage-rates
      summary: Delete usage rate
      operationId: deleteUsageRate
      x-si-permissions:
        - DELETE_USAGE_RATE_CARD
      x-si-apply-impact-of-change: true
      security:
        - bearerAuth: []
      parameters:
        - name: usage_rate_id
          in: path
          description: Usage rate identifier
          required: true
          schema:
            $ref: '#/components/schemas/IdParam'
      responses:
        '200':
          description: OK
          content: {}
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Not Found
          content: {}
  /rental-rate-cards:
    get:
      tags:
        - rental-rate-cards
      summary: Get a list of available rental rate cards
      operationId: getRentalRateCards
      x-si-permissions:
        - VIEW_RENTAL_RATE_CARD
      security:
        - bearerAuth: []
      x-si-filterable: true
      parameters:
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/pageSize'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/fields'
        - name: contractOwnerId
          in: query
          description: Filter by contract owner
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: name
          in: query
          description: Filter by name
          schema:
            $ref: '#/components/schemas/StringFilterParam'
          required: false
        - name: availableFrom
          in: query
          description: Filter by available from date
          schema:
            $ref: '#/components/schemas/DateFilterParam'
          required: false
        - name: availableTo
          in: query
          description: Filter by available to date
          schema:
            $ref: '#/components/schemas/DateFilterParam'
          required: false
        - name: rentalRateCardType
          in: query
          description: Filter by rate card type
          schema:
            $ref: '#/components/schemas/StringFilterParam'
          required: false
        - name: rentalProductCategoryId
          in: query
          description: Filter by rental product category
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: summary
          in: header
          description: >-
            If true, returns a lightweight summary of each rental rate card
            instead of the full object. Use this to reduce payload size and
            improve performance when only basic information is needed.
          required: false
          schema:
            $ref: '#/components/schemas/BooleanFilterParam'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RentalRateCard'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
    head:
      tags:
        - rental-rate-cards
      summary: Check if a rental rate card exists
      operationId: checkRentalRateCards
      x-si-permissions:
        - VIEW_RENTAL_RATE_CARD
      security:
        - bearerAuth: []
      parameters:
        - name: id
          in: query
          description: Filter by id
          schema:
            $ref: '#/components/schemas/IdFilterParam'
        - name: contractOwnerId
          in: query
          description: Filter by contract Owner
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: name
          in: query
          description: Filter by name
          schema:
            $ref: '#/components/schemas/StringFilterParam'
        - name: availableFrom
          in: query
          description: Filter by available from date
          schema:
            $ref: '#/components/schemas/DateFilterParam'
          required: false
        - name: availableTo
          in: query
          description: Filter by available to date
          schema:
            $ref: '#/components/schemas/DateFilterParam'
          required: false
        - name: rentalRateCardType
          in: query
          description: Filter by rate card type
          schema:
            $ref: '#/components/schemas/StringFilterParam'
          required: false
        - name: rentalProductCategoryId
          in: query
          description: Filter by rental product category
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
      responses:
        '200':
          description: OK
          content: {}
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Not Found
          content: {}
    post:
      tags:
        - rental-rate-cards
      summary: Create a new rental rate card
      operationId: createRentalRateCard
      x-si-permissions:
        - CREATE_RENTAL_RATE_CARD
      x-si-apply-impact-of-change: true
      security:
        - bearerAuth: []
      requestBody:
        description: New rental rate card
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RentalRateCard'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RentalRateCard'
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RentalRateCard'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
  /rental-rate-cards/{rental_rate_card_id}:
    get:
      tags:
        - rental-rate-cards
      summary: Get a specific rental rate card
      operationId: getRentalRateCard
      x-si-permissions:
        - VIEW_RENTAL_RATE_CARD
      security:
        - bearerAuth: []
      parameters:
        - name: rental_rate_card_id
          in: path
          description: Rental rate card identifier
          required: true
          schema:
            $ref: '#/components/schemas/IdParam'
        - name: fields
          in: query
          description: >-
            Comma-delimited list of the field(s) to return if only a subset is
            required (other fields will be returned as null for now)
          schema:
            $ref: '#/components/schemas/FieldsParam'
          required: false
        - name: summary
          in: header
          description: >-
            If true, returns a lightweight summary of rental rate card instead
            of the full object. Use this to reduce payload size and improve
            performance when only basic information is needed.
          required: false
          schema:
            $ref: '#/components/schemas/BooleanFilterParam'
      responses:
        '200':
          description: Rental rate card found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RentalRateCard'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Not Found
          content: {}
    patch:
      tags:
        - rental-rate-cards
      summary: Update a rental rate card
      operationId: updateRentalRateCard
      x-si-json-patch: true
      x-si-allow-patch:
        - /name
        - /contractOwnerIds
        - /contractOwnerIds/.*
        - /rentalRateCardType
        - /available(From|To)
        - /basedOnTemplateId
        - /rentalProductCategoryId
        - /acceptOverridesFromParents
        - /rentalRates
        - /rentalRates/.*
      x-si-permissions:
        - UPDATE_RENTAL_RATE_CARD
      x-si-apply-impact-of-change: true
      security:
        - bearerAuth: []
      parameters:
        - name: rental_rate_card_id
          in: path
          description: Rental rate card identifier
          required: true
          schema:
            $ref: '#/components/schemas/IdParam'
        - name: summary
          in: header
          description: >-
            If true, returns a lightweight summary of rental rate card instead
            of the full object. Use this to reduce payload size and improve
            performance when only basic information is needed.
          required: false
          schema:
            $ref: '#/components/schemas/BooleanFilterParam'
      requestBody:
        description: >-
          A set of JSONPatch operations to be performed. Note that rental rates
          can only be added here. To update or delete a rate, use
          /rental-rates/id PATCH or DELETE method
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PatchRequest'
            examples:
              AddRate:
                summary: Add rental rate card
                value:
                  - op: add
                    path: /rentalRates/-
                    value:
                      rentalProductId: 1963
                      rentalRateType: ADVANCE
                      periodsInAdvance: STANDARD
                      rentalRatePriceType: RENTAL
                      price: 111
                      rentalRateFrequency: QUARTERLY
                      startDate: '2023-04-02'
                      endDate: '2023-04-02'
              AddContractOwnerIdsUsingAddOp:
                summary: Add contract owner ids using 'add'
                value:
                  - op: add
                    path: /contractOwnerIds/-
                    value: 2
                description: >-
                  To add a contract owner's ID, use the 'add' operation and
                  specify a new contract owner ID as the value. For example, if
                  a rental rate card is associated with contract owner ID 1, and
                  the contract owner with ID 2 should be added, the value should
                  be 2
              AddContractOwnerIdsUsingReplaceOp:
                summary: Add contract owner ids using 'replace'
                value:
                  - op: replace
                    path: /contractOwnerIds
                    value:
                      - 1
                      - 2
                description: >-
                  To add a contract owner's ID, use the 'replace' operation and
                  specify the new set of contract owner IDs associated with the
                  rental rate card as the value (including old values). For
                  example, if a rental rate card is associated with contract
                  owner IDs 1, and the contract owner with ID 2 should be added,
                  the value should be [1, 2]
              RemoveContractOwnerIds:
                summary: Remove contract owner ids
                value:
                  - op: replace
                    path: /contractOwnerIds
                    value:
                      - 1
                description: >-
                  To remove a contract owner's ID, use the 'replace' operation
                  and specify the new set of contract owner IDs associated with
                  the rental rate card as the value. For example, if a rental
                  rate card was associated with contract owner IDs 1 and 2, and
                  the contract owner with ID 2 should be removed, the value
                  should be [1]
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RentalRateCard'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Not Found
          content: {}
  /rental-rates/{rental_rate_id}:
    patch:
      tags:
        - rental-rates
      summary: Update a rental rate within a rental rate card
      operationId: updateRentalRate
      x-si-json-patch: true
      x-si-allow-patch:
        - /rentalProductId
        - /price
        - /rentalRateType
        - /rentalRatePriceType
        - /periodsInAdvance
        - /rentalRateFrequency
        - /(start|end)Date
        - /showOnInvoice
      x-si-permissions:
        - UPDATE_RENTAL_RATE_CARD
      x-si-apply-impact-of-change: true
      security:
        - bearerAuth: []
      parameters:
        - name: rental_rate_id
          in: path
          description: Rental rate identifier
          required: true
          schema:
            $ref: '#/components/schemas/IdParam'
      requestBody:
        description: >-
          A set of JSONPatch operations to be performed. Note that rental rates
          can only be updated here. To add a new rate, use /rental-rate-cards/
          PATCH method
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PatchRequest'
            examples:
              ChangePrice:
                value:
                  - op: replace
                    path: /price
                    value: 1.03
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RentalRate'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Not Found
          content: {}
    delete:
      tags:
        - rental-rates
      summary: Delete rental rate
      operationId: deleteRentalRate
      x-si-permissions:
        - DELETE_RENTAL_RATE_CARD
      x-si-apply-impact-of-change: true
      security:
        - bearerAuth: []
      parameters:
        - name: rental_rate_id
          in: path
          description: Rental rate identifier
          required: true
          schema:
            $ref: '#/components/schemas/IdParam'
      responses:
        '200':
          description: OK
          content: {}
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Not Found
          content: {}
  /inclusive-usage-balances:
    get:
      tags:
        - inclusive-usage-balances
      summary: >-
        Provides the remaining inclusive usage values — such as duration, data,
        or one-off events
      operationId: getInclusiveUsageBalances
      x-si-permissions:
        - VIEW_INCLUSIVE_USAGE_PLAN
      security:
        - bearerAuth: []
      x-si-filterable: true
      parameters:
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/pageSize'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/fields'
        - name: customerId
          in: query
          description: Filter by customer id
          required: false
          schema:
            $ref: '#/components/schemas/IdFilterParam'
        - name: siteId
          in: query
          description: Filter by site id
          required: false
          schema:
            $ref: '#/components/schemas/IdFilterParam'
        - name: usageProductInventoryId
          in: query
          description: Filter by usage product inventory id
          required: false
          schema:
            $ref: '#/components/schemas/IdFilterParam'
        - name: billRunId
          in: query
          description: Filter by bill run id
          required: false
          schema:
            $ref: '#/components/schemas/IdFilterParam'
        - name: assignmentId
          in: query
          description: Filter by inclusive usage plan assignment id
          required: false
          schema:
            $ref: '#/components/schemas/IdFilterParam'
        - name: inclusiveUsagePlanId
          in: query
          description: Filter by inclusive usage plan id
          required: false
          schema:
            $ref: '#/components/schemas/IdFilterParam'
        - name: componentId
          in: query
          description: Filter by inclusive usage component id
          required: false
          schema:
            $ref: '#/components/schemas/IdFilterParam'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/InclusiveUsageBalance'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
  /inclusive-usage-plans:
    get:
      tags:
        - inclusive-usage-plans
      summary: Get a list of available inclusive usage plans
      operationId: getInclusiveUsagePlans
      x-si-permissions:
        - VIEW_INCLUSIVE_USAGE_PLAN
      security:
        - bearerAuth: []
      x-si-filterable: true
      parameters:
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/pageSize'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/fields'
        - name: contractOwnerId
          in: query
          description: Filter by contract Owner
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: name
          in: query
          description: Filter by name
          schema:
            $ref: '#/components/schemas/StringFilterParam'
        - name: availableFrom
          in: query
          description: Filter by available from date
          schema:
            $ref: '#/components/schemas/DateFilterParam'
          required: false
        - name: availableTo
          in: query
          description: Filter by available to date
          schema:
            $ref: '#/components/schemas/DateFilterParam'
          required: false
        - name: usageProductId
          in: query
          description: Filter by usage product
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: taxBandId
          in: query
          description: Filter by tax band
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: summary
          in: header
          description: >-
            If true, returns a lightweight summary of each inclusive usage plan
            instead of the full object. Use this to reduce payload size and
            improve performance when only basic information is needed.
          required: false
          schema:
            $ref: '#/components/schemas/BooleanFilterParam'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/InclusiveUsagePlan'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
    head:
      tags:
        - inclusive-usage-plans
      summary: Check if an inclusive usage plan exists
      operationId: checkInclusiveUsagePlans
      x-si-permissions:
        - VIEW_INCLUSIVE_USAGE_PLAN
      security:
        - bearerAuth: []
      parameters:
        - name: id
          in: query
          description: Filter by id
          schema:
            $ref: '#/components/schemas/IdFilterParam'
        - name: contractOwnerId
          in: query
          description: Filter by contract Owner
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: name
          in: query
          description: Filter by name
          schema:
            $ref: '#/components/schemas/StringFilterParam'
        - name: availableFrom
          in: query
          description: Filter by available from date
          schema:
            $ref: '#/components/schemas/DateFilterParam'
          required: false
        - name: availableTo
          in: query
          description: Filter by available to date
          schema:
            $ref: '#/components/schemas/DateFilterParam'
          required: false
        - name: usageProductId
          in: query
          description: Filter by usage product
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: taxBandId
          in: query
          description: Filter by tax band
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
      responses:
        '200':
          description: OK
          content: {}
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Not Found
          content: {}
    post:
      tags:
        - inclusive-usage-plans
      summary: Create a new inclusive usage plan
      operationId: createInclusiveUsagePlan
      x-si-permissions:
        - CREATE_INCLUSIVE_USAGE_PLAN
      x-si-apply-impact-of-change: true
      security:
        - bearerAuth: []
      requestBody:
        description: New Inclusive Usage Plan
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InclusiveUsagePlan'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InclusiveUsagePlan'
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InclusiveUsagePlan'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
  /inclusive-usage-plans/{inclusive_usage_plan_id}:
    get:
      tags:
        - inclusive-usage-plans
      summary: Get a specific inclusive usage plan
      operationId: getInclusiveUsagePlan
      x-si-permissions:
        - VIEW_INCLUSIVE_USAGE_PLAN
      security:
        - bearerAuth: []
      parameters:
        - name: inclusive_usage_plan_id
          in: path
          description: Inclusive usage plan identifier
          required: true
          schema:
            $ref: '#/components/schemas/IdParam'
      responses:
        '200':
          description: Inclusive usage plan found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InclusiveUsagePlan'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Not Found
          content: {}
    patch:
      tags:
        - inclusive-usage-plans
      summary: Patch update inclusive usage plan
      operationId: updateInclusiveUsagePlan
      x-si-json-patch: true
      x-si-allow-patch:
        - /name
        - /usageProductId
        - /available(From|To)
        - /boltOn
        - /taxBandId
        - /nominalCode
        - /rolloverPeriods
        - /triggerChargeId
        - /supplierAccountId
        - /frequency
        - /minQualifyingQuantity
        - /maxPerEventQuantity
        - /inclusiveUsageComponents/-
        - >-
          /inclusiveUsageComponents/[0-9]*(/(description|componentType|chargingType|quantity|valueInPence)|)
        - /inclusiveUsageComponents/[0-9]*/timebands/-
        - /inclusiveUsageComponents/[0-9]*/timebands/[0-9]*(/timeband|)
        - /inclusiveUsageComponents/[0-9]*/chargeGroups/-
        - /inclusiveUsageComponents/[0-9]*/chargeGroups/[0-9]*(/chargeGroupId|)
        - /inclusiveUsageComponents/[0-9]*/chargeGroupCategories/-
        - >-
          /inclusiveUsageComponents/[0-9]*/chargeGroupCategories/[0-9]*(/chargeGroupCategoryId|)
        - /inclusiveUsageComponents/[0-9]*/dialStrings/-
        - >-
          /inclusiveUsageComponents/[0-9]*/dialStrings/[0-9]*(/(dialString|isWholeNumber)|)
        - /boltOnCharges/-
        - >-
          /boltOnCharges/[0-9]*(/(price|rentalRateType|periodsInAdvance|rentalRateFrequency|showOnInvoice|startDate|endDate)|)
      x-si-permissions:
        - UPDATE_INCLUSIVE_USAGE_PLAN
      x-si-apply-impact-of-change: true
      security:
        - bearerAuth: []
      parameters:
        - name: inclusive_usage_plan_id
          in: path
          description: Inclusive usage plan identifier
          required: true
          schema:
            $ref: '#/components/schemas/IdParam'
        - name: summary
          in: header
          description: >-
            If true, returns a lightweight summary of inclusive usage plan
            instead of the full object. Use this to reduce payload size and
            improve performance when only basic information is needed.
          required: false
          schema:
            $ref: '#/components/schemas/BooleanFilterParam'
      requestBody:
        description: A set of JSONPatch operations to be performed
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PatchRequest'
            examples:
              Rename:
                value:
                  - op: replace
                    path: /name
                    value: My Plan
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InclusiveUsagePlan'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Not Found
          content: {}
  /rental-discount-plans:
    get:
      tags:
        - rental-discount-plans
      summary: Get a list of available rental discount plans
      operationId: getRentalDiscountPlans
      x-si-permissions:
        - VIEW_DISCOUNT
      security:
        - bearerAuth: []
      x-si-filterable: true
      parameters:
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/pageSize'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/fields'
        - name: contractOwnerId
          in: query
          description: Filter by contract owner
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: name
          in: query
          description: Filter by name
          schema:
            $ref: '#/components/schemas/StringFilterParam'
          required: false
        - name: availableFrom
          in: query
          description: Filter by available from date
          schema:
            $ref: '#/components/schemas/DateFilterParam'
          required: false
        - name: availableTo
          in: query
          description: Filter by available to date
          schema:
            $ref: '#/components/schemas/DateFilterParam'
          required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RentalDiscountPlan'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
    head:
      tags:
        - rental-discount-plans
      summary: Check if a rental discount plan exists
      operationId: checkRentalDiscountPlans
      x-si-permissions:
        - VIEW_DISCOUNT
      security:
        - bearerAuth: []
      parameters:
        - name: id
          in: query
          description: Filter by id
          schema:
            $ref: '#/components/schemas/IdFilterParam'
        - name: contractOwnerId
          in: query
          description: Filter by contract owner
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: name
          in: query
          description: Filter by name
          schema:
            $ref: '#/components/schemas/StringFilterParam'
        - name: availableFrom
          in: query
          description: Filter by available from date
          schema:
            $ref: '#/components/schemas/DateFilterParam'
          required: false
        - name: availableTo
          in: query
          description: Filter by available to date
          schema:
            $ref: '#/components/schemas/DateFilterParam'
          required: false
      responses:
        '200':
          description: OK
          content: {}
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Not Found
          content: {}
    post:
      tags:
        - rental-discount-plans
      summary: Create a new rental discount plan
      operationId: createRentalDiscountPlan
      x-si-permissions:
        - CREATE_DISCOUNT
      x-si-apply-impact-of-change: true
      security:
        - bearerAuth: []
      requestBody:
        description: New rental discount plan
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RentalDiscountPlan'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RentalDiscountPlan'
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RentalDiscountPlan'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
  /rental-discount-plans/{rental_discount_plan_id}:
    get:
      tags:
        - rental-discount-plans
      summary: Get a specific rental discount plan
      operationId: getRentalDiscountPlan
      x-si-permissions:
        - VIEW_DISCOUNT
      security:
        - bearerAuth: []
      parameters:
        - name: rental_discount_plan_id
          in: path
          description: Rental discount plan identifier
          required: true
          schema:
            $ref: '#/components/schemas/IdParam'
        - name: fields
          in: query
          description: >-
            Comma-delimited list of the field(s) to return if only a subset is
            required (other fields will be returned as null for now)
          schema:
            $ref: '#/components/schemas/FieldsParam'
          required: false
      responses:
        '200':
          description: Rental discount plan found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RentalDiscountPlan'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Not Found
          content: {}
    patch:
      tags:
        - rental-discount-plans
      summary: Update a rental discount plan
      operationId: updateRentalDiscountPlan
      x-si-json-patch: true
      x-si-allow-patch:
        - /name
        - /durationInMonths
        - /available(From|To)
      x-si-permissions:
        - UPDATE_DISCOUNT
      x-si-apply-impact-of-change: true
      security:
        - bearerAuth: []
      parameters:
        - name: rental_discount_plan_id
          in: path
          description: Rental discount plan identifier
          required: true
          schema:
            $ref: '#/components/schemas/IdParam'
      requestBody:
        description: A set of JSONPatch operations to be performed
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PatchRequest'
            examples:
              Rename:
                summary: Rename rental discount plan
                value:
                  - op: replace
                    path: /name
                    value: My Discount Plan
                description: Rename rental discount plan
              UpdateDuration:
                summary: Update duration in months
                value:
                  - op: replace
                    path: /durationInMonths
                    value: 24
                description: Update the duration in months
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RentalDiscountPlan'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Not Found
          content: {}
  /rental-discount-plan-rules:
    get:
      tags:
        - rental-discount-plan-rules
      summary: Get a list of rental discount plan rules
      operationId: getRentalDiscountPlanRules
      x-si-permissions:
        - VIEW_DISCOUNT
      security:
        - bearerAuth: []
      x-si-filterable: true
      parameters:
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/pageSize'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/fields'
        - name: rentalDiscountPlanId
          in: query
          description: Filter by rental discount plan
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: productCategoryId
          in: query
          description: Filter by product category
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
        - name: rentalProductId
          in: query
          description: Filter by rental product
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RentalDiscountPlanRule'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '404':
          description: Not Found
          content: {}
    post:
      tags:
        - rental-discount-plan-rules
      summary: Create a new rental discount plan rule
      operationId: createRentalDiscountPlanRule
      x-si-permissions:
        - CREATE_DISCOUNT
      x-si-apply-impact-of-change: true
      security:
        - bearerAuth: []
      requestBody:
        description: New rental discount plan rule
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RentalDiscountPlanRule'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RentalDiscountPlanRule'
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RentalDiscountPlanRule'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '404':
          description: Not Found
          content: {}
  /rental-discount-plan-rules/{rental_discount_plan_rule_id}:
    get:
      tags:
        - rental-discount-plan-rules
      summary: Get a specific rental discount plan rule
      operationId: getRentalDiscountPlanRule
      x-si-permissions:
        - VIEW_DISCOUNT
      security:
        - bearerAuth: []
      parameters:
        - name: rental_discount_plan_rule_id
          in: path
          description: Rental discount plan rule identifier
          required: true
          schema:
            $ref: '#/components/schemas/IdParam'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RentalDiscountPlanRule'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '404':
          description: Not Found
          content: {}
    patch:
      tags:
        - rental-discount-plan-rules
      summary: Update a rental discount plan rule
      operationId: updateRentalDiscountPlanRule
      x-si-json-patch: true
      x-si-allow-patch:
        - /productCategoryId
        - /rentalProductId
        - /discountPercentage
      x-si-permissions:
        - UPDATE_DISCOUNT
      x-si-apply-impact-of-change: true
      security:
        - bearerAuth: []
      parameters:
        - name: rental_discount_plan_rule_id
          in: path
          description: Rental discount plan rule identifier
          required: true
          schema:
            $ref: '#/components/schemas/IdParam'
      requestBody:
        description: A set of JSONPatch operations to be performed
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PatchRequest'
            examples:
              ChangeDiscountPercentage:
                value:
                  - op: replace
                    path: /discountPercentage
                    value: 25
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RentalDiscountPlanRule'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Not Found
          content: {}
    delete:
      tags:
        - rental-discount-plan-rules
      summary: Delete a rental discount plan rule
      operationId: deleteRentalDiscountPlanRule
      x-si-permissions:
        - DELETE_DISCOUNT
      x-si-apply-impact-of-change: true
      security:
        - bearerAuth: []
      parameters:
        - name: rental_discount_plan_rule_id
          in: path
          description: Rental discount plan rule identifier
          required: true
          schema:
            $ref: '#/components/schemas/IdParam'
      responses:
        '200':
          description: OK
          content: {}
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Not Found
          content: {}
components:
  schemas:
    UsageRateCard:
      required:
        - contractOwnerIds
        - name
        - rateCardType
        - availableFrom
        - usageProductId
        - decimalPlaces
        - priceRoundingStyle
        - defaultMinCharge
      type: object
      x-si-class-validation: |
        @After(first = "availableTo", second = "availableFrom")
        @RequiredWhen.List({
          @RequiredWhen(fieldName = "boltOn", fieldValue = "true", dependFieldName = "boltOnTaxBandId"),
          @RequiredWhen(fieldName = "boltOn", fieldValue = "true", dependFieldName = "nominalCode")
        })
      properties:
        id:
          description: Usage rate card identifier
          type: integer
          readOnly: true
          format: int64
          example: 1
        contractOwnerIds:
          description: >-
            The billing entity or entities that will have access to this item.
            This is a multi-select field. If there is only one existing
            contractOwnerId, you can replace it with another regardless of
            currency. However, if there are multiple contractOwnerIds, any new
            or replacement contractOwnerIds must use the same currency as the
            existing contractOwnerId(s). Different currencies cannot be mixed
          type: array
          items:
            type: integer
            format: int32
            x-si-validation: '@ValidId'
            example: 1
        name:
          type: string
          description: Usage rate card name
          minLength: 1
          maxLength: 50
          pattern: '[\w\p{L}\s%£@&#='':;`’,|!_—–\(\)\\/\-\+\.\?\*\$]*'
        rateCardType:
          $ref: '#/components/schemas/UsageRateCardType'
        availableFrom:
          description: Available from date
          type: string
          format: date
        availableTo:
          description: Available to date
          type: string
          format: date
        usageProductId:
          description: Usage product identifier
          type: integer
          format: int64
          x-si-validation: '@ValidId'
          example: 1
        supplierId:
          description: Supplier identifier
          type: integer
          format: int64
          x-si-validation: '@ValidId'
          example: 1
        decimalPlaces:
          description: >-
            Number of decimal places. In the context of pence this defines the
            precision to which usage prices will be calculated. For example, a
            value of 4 would result in prices being calculated to 4 decimal
            places (1.0045 pence)
          type: integer
          format: int32
          example: 4
        priceRoundingStyle:
          $ref: '#/components/schemas/PriceRoundingStyle'
        defaultMinCharge:
          description: >-
            Default minimum charge. The minimum charge that will be applied. For
            example, a call calculated to be 4.3 pence would be charged at 5
            pence if this value was set to 5 pence. This default value can be
            overridden at Charge Group level
          type: number
        roundAccessChargeFirstMinute:
          description: >-
            Round access charge for first minute. When pricing using access
            charges round the first minute of the call
          type: boolean
          default: false
        boltOn:
          description: >-
            Bolt on enabled. A bolt on is a usage rate card that incurs a
            recurring charge (typically a monthly charge provides access to
            discounted call rates)
          type: boolean
          default: false
        boltOnTaxBandId:
          description: >-
            Tax band identifier for bolt on charges (required when bolt on
            enabled)
          type: integer
          format: int64
          x-si-validation: '@ValidId'
          example: 1
        nominalCode:
          description: Nominal code
          type: string
          minLength: 1
          maxLength: 100
          pattern: ^[\w\p{L}\s%£@&#=':;,`’|!_—–()/\-+.?*$\[\]€^{}<>~]*$
          example: SALES-01QTR2
        applyCrossTimeBandCharging:
          description: >-
            Apply cross time band charging. Where a call crosses multiple time
            bands this option allows the different portions of the call to be
            charged at either peak or off-peak rates as required. If this option
            is not selected then the entire call will be charged using the rate
            applicable at the start of the call
          type: boolean
          default: false
        defaultQuantityRoundingIncrement:
          description: >-
            Default quantity rounding increment. The chargeable quantity
            (seconds or megabytes) will be rounded up to the nearest multiple of
            this value. For example, a 61 second call would be rounded up to 120
            seconds if this value is set to an increment of 60. This default
            value can be overridden at Charge Group level
          type: integer
          format: int32
          example: 1
        defaultVariableChargeUnitSize:
          description: >-
            Default variable charge unit size. The unit size in which charges
            will be calculated. For example, if this value is 60 seconds then
            the charge is pence per minute; if this value is 1024 MB then the
            charge is pence per gigabyte. This default value can be overridden
            at Charge Group level
          type: integer
          format: int32
          example: 1
        usageRates:
          type: array
          items:
            $ref: '#/components/schemas/UsageRate'
        timeBandPlans:
          type: array
          items:
            $ref: '#/components/schemas/UsageRateTimeBandPlan'
        accessCharges:
          type: array
          items:
            $ref: '#/components/schemas/UsageRateAccessCharge'
        boltOnCharges:
          type: array
          items:
            $ref: '#/components/schemas/UsageRateCardBoltOnCharge'
    RentalRateCard:
      required:
        - name
        - rentalProductCategoryId
        - rentalRateCardType
        - availableFrom
      type: object
      x-si-class-validation: |
        @After(first = "availableTo", second = "availableFrom")
        @RequiredWhen.List({
          @RequiredWhen(fieldName = "rentalRateCardType", fieldValue = "SELL", dependFieldName = "contractOwnerIds"),
          @RequiredWhen(fieldName = "rentalRateCardType", fieldValue = "TEMPLATE", dependFieldName = "contractOwnerIds"),
          @RequiredWhen(fieldName = "rentalRateCardType", fieldValue = "BUY", dependFieldName = "supplierAccountId")
        })
        @NotAllowedWhen.List({
          @NotAllowedWhen(fieldName = "rentalRateCardType", fieldValue = "SELL", dependFieldName = "supplierAccountId"),
          @NotAllowedWhen(fieldName = "rentalRateCardType", fieldValue = "TEMPLATE", dependFieldName = "supplierAccountId")
        })
      properties:
        id:
          description: Rental rate card identifier
          type: integer
          readOnly: true
          format: int64
          example: 1
        contractOwnerIds:
          description: >-
            The billing entity or entities that are required for SELL/TEMPLATE
            rental rate card and have access to this item. This is a
            multi-select field. If there is only one existing contractOwnerId,
            you can replace it with another regardless of currency. However, if
            there are multiple contractOwnerIds, any new or replacement
            contractOwnerIds must use the same currency as the existing
            contractOwnerId(s). Different currencies cannot be mixed
          type: array
          items:
            type: integer
            format: int32
            x-si-validation: '@ValidId'
            example: 1
        name:
          type: string
          description: Rental rate card name
          minLength: 1
          maxLength: 255
          pattern: '[\w\p{L}\s%£@&#='':;`’,|!_—–\(\)\\/\-\+\.\?\*\$]*'
        rentalProductCategoryId:
          description: Rental product category identifier
          type: integer
          format: int64
          x-si-validation: '@ValidId'
          example: 1
        rentalRateCardType:
          $ref: '#/components/schemas/RentalRateCardType'
        basedOnTemplateId:
          description: >-
            Based on rental rate card identifier. Sell rental rate cards can be
            linked to a template. Typically the template would contain the more
            obscure products that are less subject to price variations meaning
            the sell rate card can contain fewer products and be easier to
            maintain
          type: integer
          format: int64
          x-si-validation: '@ValidId'
          example: 1
        availableFrom:
          description: Available from
          type: string
          format: date
        availableTo:
          description: Available to
          type: string
          format: date
        acceptOverridesFromParents:
          description: >-
            Accept overrides from parents. Pricing can be assigned at customer,
            site or product inventory levels and could be a rate card assignment
            or override assignment. If selected, this property allows overrides
            assigned at a higher point in the hierarchy to override prices set
            within this rate card
          type: boolean
          default: true
        rentalRates:
          type: array
          items:
            $ref: '#/components/schemas/RentalRate'
        supplierAccountId:
          description: The supplier account associated with BUY rate card only
          type: integer
          format: int64
          x-si-validation: '@ValidId'
          example: 1
    UsageRate:
      required:
        - chargeGroupId
        - usageRateType
        - peakInitialPeriod
        - peakValue
        - peakMinimum
        - offPeakInitialPeriod
        - offPeakValue
        - offPeakMinimum
        - weekendInitialPeriod
        - weekendValue
        - weekendMinimum
        - quantityRoundingIncrement
        - startDate
      type: object
      x-si-class-validation: |
        @After(first = "endDate", second = "startDate")
      properties:
        id:
          description: Usage rate identifier
          type: integer
          readOnly: true
          format: int64
          example: 1
        chargeGroupId:
          description: Charge group identifier
          type: integer
          format: int64
          x-si-validation: '@ValidId'
          example: 1
        usageRateType:
          $ref: '#/components/schemas/UsageRateType'
        peakInitialCharge:
          description: >-
            Peak initial charge. The charge that would be applied to the Initial
            Period. For example, if Initial Period is set to 30 seconds the
            first 30 seconds of the call would be charged at 50 pence (or the
            minor currency unit) if this value was set to 50 pence. Similarly,
            if Initial Period is set to 512 MB the first 512 MB of data would be
            charged at 100 pence if this value was set to 100 pence
          type: number
        peakInitialPeriod:
          description: >-
            Peak initial period. This specifies the duration of an initial
            period if one is required. For example, if this value is 30 seconds
            then the first 30 seconds of the call would be charged at a fixed
            rate (the Initial Charge). Similarly, if this value is 1024 MB then
            the first 1024 MB of data would be charged at a fixed rate (the
            Initial Charge). Any remaining period will be charged at the
            assigned variable charge
          type: integer
          format: int32
        peakValue:
          description: >-
            Peak value. The pence (or the minor currency unit) per unit if
            Charge Type is Variable and a percentage if the Charge Type is Mark
            Up. For example 3 pence per minute or 35%
          type: number
        peakMinimum:
          description: >-
            Peak minimum charge. The minimum charge that will be applied. For
            example, a call calculated to be 4.3 pence (or the minor currency
            unit) would be charged at 5 pence if this value was set to 5 pence
          type: number
        offPeakInitialCharge:
          description: >-
            Offpeak initial charge. The charge that would be applied to the
            Initial Period. For example, if Initial Period is set to 30 seconds
            the first 30 seconds of the call would be charged at 50 pence (or
            the minor currency unit) if this value was set to 50 pence.
            Similarly, if Initial Period is set to 512 MB the first 512 MB of
            data would be charged at 100 pence if this value was set to 100
            pence
          type: number
        offPeakInitialPeriod:
          description: >-
            Offpeak initial period. This specifies the duration of an initial
            period if one is required. For example, if this value is 30 seconds
            then the first 30 seconds of the call would be charged at a fixed
            rate (the Initial Charge). Similarly, if this value is 1024 MB then
            the first 1024 MB of data would be charged at a fixed rate (the
            Initial Charge). Any remaining period will be charged at the
            assigned variable charge
          type: integer
          format: int32
        offPeakValue:
          description: >-
            Offpeak value. The pence (or the minor currency unit) per unit if
            Charge Type is Variable and a percentage if the Charge Type is Mark
            Up. For example 3 pence per minute or 35%
          type: number
        offPeakMinimum:
          description: >-
            Offpeak minimum charge. The minimum charge that will be applied. For
            example, a call calculated to be 4.3 pence (or the minor currency
            unit) would be charged at 5 pence if this value was set to 5 pence
          type: number
        weekendInitialCharge:
          description: >-
            Weekend initial charge. The charge that would be applied to the
            Initial Period. For example, if Initial Period is set to 30 seconds
            the first 30 seconds of the call would be charged at 50 pence (or
            the minor currency unit) if this value was set to 50 pence.
            Similarly, if Initial Period is set to 512 MB the first 512 MB of
            data would be charged at 100 pence if this value was set to 100
            pence
          type: number
        weekendInitialPeriod:
          description: >-
            Weekend initial period. This specifies the duration of an initial
            period if one is required. For example, if this value is 30 seconds
            then the first 30 seconds of the call would be charged at a fixed
            rate (the Initial Charge). Similarly, if this value is 1024 MB then
            the first 1024 MB of data would be charged at a fixed rate (the
            Initial Charge). Any remaining period will be charged at the
            assigned variable charge
          type: integer
          format: int32
        weekendValue:
          description: >-
            Weekend value. The pence (or the minor currency unit) per unit if
            Charge Type is Variable and a percentage if the Charge Type is Mark
            Up. For example 3 pence per minute or 35%
          type: number
        weekendMinimum:
          description: >-
            Weekend minimum charge. The minimum charge that will be applied. For
            example, a call calculated to be 4.3 pence (or the minor currency
            unit) would be charged at 5 pence if this value was set to 5 pence
          type: number
        quantityRoundingIncrement:
          description: >-
            Quantity rounding increment. The chargeable quantity (seconds or
            megabytes) will be rounded up to the nearest multiple of this value.
            For example, a 61 second call would be rounded up to 120 seconds if
            this value is set to an increment of 60. This default value can be
            overridden at Charge Group level
          type: number
          example: 1
        variableChargeUnitSize:
          description: >-
            Variable charge unit size. The unit size in which charges will be
            calculated.For example, if this value is 60 seconds then the charge
            is pence (or the minor currency unit) per minute; if this value is
            1024 MB then the charge is pence per gigabyte. The default value can
            be overridden at Charge Group level
          type: integer
          format: int32
          example: 1
        surchargeInitialCharge:
          description: >-
            Surcharge initial charge. The charge that would be applied to the
            Initial Period. For example, if Initial Period is set to 30 seconds
            the first 30 seconds of the call would be charged at 50 pence (or
            the minor currency unit) if this value was set to 50 pence.
            Similarly, if Initial Period is set to 512 MB the first 512 MB of
            data would be charged at 100 pence if this value was set to 100
            pence
          type: number
        surchargeInitialPeriod:
          description: >-
            Surcharge initial period. This specifies the duration of an initial
            period if one is required. For example, if this value is 30 seconds
            then the first 30 seconds of the call would be charged at a fixed
            rate (the surchargeInitialCharge). Similarly, if this value is 1024
            MB then the first 1024 MB of data would be charged at a fixed rate
            (the surchargeInitialCharge). Any remaining period will be charged
            at the assigned variable charge (the surchargeValue)
          type: integer
          format: int32
        surchargeValue:
          description: >-
            Surcharge value per min. A value of zero will ignore surcharging. If
            the UPI has applySurcharges and this rate matches then an extra
            surcharge will be applied as, surchargeValue x the quantity (in
            mins). The value is pence (or the minor currency unit) per unit if
            Charge Type is Variable and a percentage if the Charge Type is Mark
            Up
          type: number
        surchargeMinimum:
          description: >-
            Surcharge minimum charge. The minimum charge that will be applied.
            For example, a call calculated to be 4.3 pence (or the minor
            currency unit) would be charged at 5 pence if this value was set to
            5 pence
          type: number
        startDate:
          description: Start date
          type: string
          format: date
        endDate:
          description: End date
          type: string
          format: date
    RentalRate:
      required:
        - rentalProductId
        - price
        - rentalRatePriceType
        - startDate
        - rentalRateFrequency
      type: object
      x-si-class-validation: |
        @After(first = "endDate", second = "startDate")
        @RequiredWhen.List({
          @RequiredWhen(fieldName = "rentalRatePriceType", fieldValue = "RENTAL", dependFieldName = "rentalRateType"),
          @RequiredWhen(fieldName = "rentalRateType", fieldValue = "ADVANCE", dependFieldName = "periodsInAdvance")
        })
      properties:
        id:
          description: Rental rate identifier
          type: integer
          readOnly: true
          format: int64
          example: 1
        rentalProductId:
          description: Rental product identifier
          type: integer
          format: int64
          x-si-validation: '@ValidId'
          example: 1
        price:
          description: Price
          type: number
        rentalRateType:
          $ref: '#/components/schemas/RentalRateType'
        rentalRatePriceType:
          $ref: '#/components/schemas/RentalRatePriceType'
        periodsInAdvance:
          $ref: '#/components/schemas/PeriodsInAdvance'
        rentalRateFrequency:
          $ref: '#/components/schemas/RentalRateFrequency'
        startDate:
          description: Start date
          type: string
          format: date
        endDate:
          description: End date
          type: string
          format: date
        showOnInvoice:
          description: Show on invoice?
          type: boolean
          default: true
    UsageRateAccessCharge:
      required:
        - charge
        - startDate
      type: object
      properties:
        id:
          description: Usage rate access charge identifier
          type: integer
          readOnly: true
          format: int64
          example: 1
        charge:
          description: Charge (in minor currency)
          type: number
        startDate:
          description: Start date
          type: string
          format: date
        endDate:
          description: End date
          type: string
          format: date
    UsageRateTimeBandPlan:
      required:
        - timeBandPlanId
        - name
        - startDate
      type: object
      x-si-class-validation: |
        @After(first = "endDate", second = "startDate")
      properties:
        id:
          description: Usage rate timeband plan identifier
          type: integer
          readOnly: true
          format: int64
          example: 1
        timeBandPlanId:
          description: Timeband plan identifier
          type: integer
          format: int64
          x-si-validation: '@ValidId'
          example: 1
        name:
          type: string
          description: Name of timeband plan
          minLength: 1
          maxLength: 100
          pattern: '[\w\p{L}\s%£@&#='':;`’,|!_—–\(\)\\/\-\+\.\?\*\$]*'
        startDate:
          description: Start date
          type: string
          format: date
        endDate:
          description: End date
          type: string
          format: date
    UsageRateCardBoltOnCharge:
      description: Bolt on pricing
      type: object
      required:
        - price
        - rentalRateType
        - rentalRateFrequency
        - showOnInvoice
        - startDate
      x-si-class-validation: >
        @After(first = "endDate", second = "startDate")

        @RequiredWhen(fieldName = "rentalRateType", fieldValue = "ADVANCE",
        dependFieldName = "periodsInAdvance")
      properties:
        id:
          description: Bolt on pricing identifier
          type: integer
          readOnly: true
          format: int64
          example: 1
        price:
          type: number
        rentalRateType:
          $ref: '#/components/schemas/RentalRateType'
        periodsInAdvance:
          $ref: '#/components/schemas/PeriodsInAdvance'
        rentalRateFrequency:
          $ref: '#/components/schemas/RentalRateFrequency'
        showOnInvoice:
          description: Whether to show the bolt-on on the invoice
          type: boolean
          default: true
        startDate:
          description: Start date
          type: string
          format: date
        endDate:
          description: End date
          type: string
          format: date
    InclusiveUsageBalance:
      description: Inclusive usage balance
      type: object
      properties:
        billRunId:
          description: bill run identifier
          type: integer
          format: int64
          x-si-validation: '@ValidId'
        periodStartDate:
          description: bill run start date
          type: string
          format: date
          example: '2025-09-01'
        periodEndDate:
          description: bill run start date
          type: string
          format: date
          example: '2025-09-30'
        usageProductInventoryId:
          description: usage product inventory identifier
          type: integer
          format: int64
          x-si-validation: '@ValidId'
        inclusiveUsageBalanceAssignments:
          description: assignments for this balance
          type: array
          items:
            $ref: '#/components/schemas/InclusiveUsageBalanceAssignment'
    InclusiveUsageBalanceAssignment:
      description: Inclusive usage balance assignment
      type: object
      properties:
        assignmentId:
          description: inclusive usage assignment identifier
          type: integer
          format: int64
          x-si-validation: '@ValidId'
        assignmentLevel:
          $ref: '#/components/schemas/AssignmentLevel'
        assignmentStartDate:
          description: Inclusive usage assignment start date
          type: string
          format: date
          example: '2025-01-01'
        assignmentEndDate:
          description: Inclusive usage assignment end date
          type: string
          format: date
          example: null
        inclusiveUsagePlanId:
          description: inclusive usage plan identifier
          type: integer
          format: int64
          x-si-validation: '@ValidId'
        components:
          description: components for this balance assignment
          type: array
          items:
            $ref: '#/components/schemas/InclusiveUsageBalanceComponent'
    InclusiveUsageBalanceComponent:
      description: components for balance assignment
      type: object
      properties:
        componentId:
          description: inclusive usage component identifier
          type: integer
          format: int64
          x-si-validation: '@ValidId'
        byValue:
          description: Whether the allowance is defined by value rather than quantity
          type: boolean
        chargingType:
          $ref: '#/components/schemas/ChargingUnitType'
        allowance:
          description: Original allowance for this component
          type: integer
          example: 1000
        remaining:
          description: Remaining balance in this component
          type: integer
          example: 500
        startDate:
          description: Start of the allowance period
          type: string
          format: date-time
          example: '2025-08-01 00:00:00'
        endDate:
          description: End of the allowance period
          type: string
          format: date-time
          example: '2025-08-31 11:59:59'
    InclusiveUsagePlan:
      required:
        - contractOwnerId
        - name
        - usageProductId
        - availableFrom
      type: object
      x-si-class-validation: >
        @After(first = "availableTo", second = "availableFrom")

        @RequiredWhen.List({
          @RequiredWhen(fieldName = "boltOn", fieldValue = "true", dependFieldName = "taxBandId"),
          @RequiredWhen(fieldName = "boltOn", fieldValue = "true", dependFieldName = "nominalCode")
        })

        @NotAllowedWhen.List({
          @NotAllowedWhen(fieldName = "boltOn", fieldValue = "true", dependFieldName = "rolloverPeriods"),
          @NotAllowedWhen(fieldName = "boltOn", fieldValue = "true", dependFieldName = "triggerChargeId"),
          @NotAllowedWhen(fieldName = "boltOn", fieldValue = "true", dependFieldName = "supplierAccountId"),
          @NotAllowedWhen(fieldName = "boltOn", fieldValue = "true", dependFieldName = "frequency"),
          @NotAllowedWhen(fieldName = "boltOn", fieldValue = "true", dependFieldName = "minQualifyingQuantity"),
          @NotAllowedWhen(fieldName = "boltOn", fieldValue = "true", dependFieldName = "maxPerEventQuantity"),
        })

        @RequiredWhenNotNull.List({
          @RequiredWhenNotNull(fieldName = "triggerChargeId", dependFieldName = "supplierAccountId"),
          @RequiredWhenNotNull(fieldName = "triggerChargeId", dependFieldName = "frequency")
        })

        @NotAllowedWhenNotNull(fieldName = "triggerChargeId", dependFieldName =
        "rolloverPeriods")

        @NotAllowedWhenNull.List({
          @NotAllowedWhenNull(fieldName = "triggerChargeId", dependFieldName = "supplierAccountId"),
          @NotAllowedWhenNull(fieldName = "triggerChargeId", dependFieldName = "frequency") })
      properties:
        id:
          description: Inclusive usage plan identifier
          type: integer
          readOnly: true
          format: int64
          example: 1
        contractOwnerId:
          description: Contract owner identifier
          type: integer
          format: int32
          x-si-validation: '@ValidId'
          example: 1
        name:
          type: string
          description: Inclusive usage plan name
          minLength: 1
          maxLength: 100
          pattern: '[\w\p{L}\s%£@&#='':;`’,|!_—–\(\)\\/\-\+\.\?\*\$]*'
        usageProductId:
          description: Usage product identifier
          type: integer
          format: int64
          x-si-validation: '@ValidId'
          example: 1
        availableFrom:
          description: Available from date
          type: string
          format: date
        availableTo:
          description: Available to date
          type: string
          format: date
        boltOn:
          description: Bolt on flag
          type: boolean
          default: false
        taxBandId:
          description: Tax band identifier
          type: integer
          format: int64
          x-si-validation: '@ValidId'
        nominalCode:
          description: Nominal code
          type: string
          minLength: 1
          maxLength: 100
          pattern: ^[\w\p{L}\s%£@&#=':;,`’|!_—–()/\-+.?*$\[\]€^{}<>~]*$
          example: SALES-01QTR2
        inclusiveUsageComponents:
          type: array
          items:
            $ref: '#/components/schemas/InclusiveUsage'
        boltOnCharges:
          type: array
          items:
            $ref: '#/components/schemas/InclusiveUsageBoltOnCharge'
        rolloverPeriods:
          description: Roll over period
          type: integer
          format: int64
        triggerChargeId:
          description: >-
            The first qualifying inclusive usage event will trigger a charge
            using the selected rental product (an RPI will be created). If the
            allowance is used up, the next qualifying event will trigger another
            charge
          type: integer
          format: int64
          x-si-validation: '@ValidId'
          example: 1
        supplierAccountId:
          description: >-
            The supplier account associated with the triggered rental product
            based on the rental product's supplier (required when trigger charge
            is set)
          type: integer
          format: int64
          x-si-validation: '@ValidId'
          example: 1
        frequency:
          $ref: '#/components/schemas/InclusiveUsageFrequency'
        minQualifyingQuantity:
          description: >-
            If required, specify the minimum quantity required for an event to
            qualify for deduction from the inclusive usage allowance. E.g. rate
            events as normal if the qty is less than this value but deduct from
            the allowance if equal to or greater than this value. Only
            applicable for inclusive usage components that are quantity based
            (duration/megabyte/one-off)
          type: number
        maxPerEventQuantity:
          description: >-
            Events over this quantity will be split such that the first part of
            the event is deducted from the inclusive usage allowance while the
            latter part is rated as normal. Leave this value as "0" to ignore
            this functionality and qualify the whole event for inclusive usage
            rating
          type: number
    InclusiveUsage:
      required:
        - description
        - componentType
        - quantity
        - timebands
      type: object
      x-si-class-validation: >
        @RequiredWhen.List({
          @RequiredWhen(fieldName = "componentType", fieldValue = "VALUE", dependFieldName = "valueInPence"),
          @RequiredWhen(fieldName = "componentType", fieldValue = "QUANTITY", dependFieldName = "chargingType"),
          @RequiredWhen(fieldName = "componentType", fieldValue = "QUANTITY", dependFieldName = "quantity")
        })

        @NotAllowedWhen(fieldName = "componentType", fieldValue = "VALUE",
        dependFieldName = "chargingType")
      properties:
        id:
          description: Inclusive usage identifier
          type: integer
          readOnly: true
          format: int64
          example: 1
        description:
          type: string
          description: The description of the component
          minLength: 1
          maxLength: 100
          pattern: '[\w\p{L}\s%£@&#='':;`’,|!_—–\(\)\\/\-\+\.\?\*\$]*'
        componentType:
          $ref: '#/components/schemas/InclusiveUsageComponentType'
        chargingType:
          $ref: '#/components/schemas/InclusiveUsageChargingType'
        quantity:
          description: >-
            The charging quantity to use. Used if the component type is set to
            QUANTITY, and is relative to the charging type (i.e. in Seconds if
            DURATION, in Megabytes if MB)
          type: integer
          format: int64
          default: 0
        valueInPence:
          description: The value in pence. Used if the component type is set to VALUE
          type: integer
          format: int64
        timebands:
          type: array
          items:
            $ref: '#/components/schemas/InclusiveUsageTimeBand'
        chargeGroups:
          type: array
          items:
            $ref: '#/components/schemas/InclusiveUsageChargeGroup'
        chargeGroupCategories:
          type: array
          items:
            $ref: '#/components/schemas/InclusiveUsageChargeGroupCategory'
        dialStrings:
          type: array
          items:
            $ref: '#/components/schemas/InclusiveUsageDialString'
    InclusiveUsageTimeBand:
      description: >-
        The timeband period for the component. Note that each component can have
        multiple time bands
      type: object
      required:
        - timeband
      properties:
        id:
          description: Inclusive usage to time band identifier
          type: integer
          readOnly: true
          format: int64
          example: 1
        timeband:
          $ref: '#/components/schemas/Timeband'
    InclusiveUsageChargeGroup:
      description: An object describing a charge group for the component
      type: object
      required:
        - chargeGroupId
      properties:
        id:
          description: Inclusive usage to charge group identifier
          type: integer
          readOnly: true
          format: int64
          example: 1
        chargeGroupId:
          description: the charge group ID
          type: integer
          format: int64
          x-si-validation: '@ValidId'
    InclusiveUsageChargeGroupCategory:
      description: An object describing a charge group category for the component
      type: object
      required:
        - chargeGroupCategoryId
      properties:
        id:
          description: Inclusive usage to charge group category identifier
          type: integer
          readOnly: true
          format: int64
          example: 1
        chargeGroupCategoryId:
          description: the charge group category ID
          type: integer
          format: int64
          x-si-validation: '@ValidId'
    InclusiveUsageDialString:
      description: An object describing a dial string for the component
      type: object
      required:
        - dialString
        - isWholeNumber
      properties:
        id:
          description: Inclusive usage to dial string identifier
          type: integer
          readOnly: true
          format: int64
          example: 1
        dialString:
          description: The dial string to be used
          type: string
          minLength: 3
          maxLength: 15
          pattern: '[0-9]+'
        isWholeNumber:
          description: >-
            Whether the dial string should match completely against a call, or
            whether the string can be used for digit-tree analysis
          type: boolean
          default: true
    InclusiveUsageBoltOnCharge:
      description: Bolt on pricing
      type: object
      required:
        - price
        - rentalRateType
        - rentalRateFrequency
        - showOnInvoice
        - startDate
      x-si-class-validation: >
        @After(first = "endDate", second = "startDate")

        @RequiredWhen(fieldName = "rentalRateType", fieldValue = "ADVANCE",
        dependFieldName = "periodsInAdvance")
      properties:
        id:
          description: Bolt on pricing identifier
          type: integer
          readOnly: true
          format: int64
          example: 1
        price:
          type: number
        rentalRateType:
          $ref: '#/components/schemas/RentalRateType'
        periodsInAdvance:
          $ref: '#/components/schemas/PeriodsInAdvance'
        rentalRateFrequency:
          $ref: '#/components/schemas/RentalRateFrequency'
        showOnInvoice:
          description: Whether to show the bolt-on on the invoice
          type: boolean
          default: true
        startDate:
          description: Start date
          type: string
          format: date
        endDate:
          description: End date
          type: string
          format: date
    InclusiveUsageComponentType:
      description: The type for a component
      type: string
      enum:
        - VALUE
        - QUANTITY
    InclusiveUsageChargingType:
      description: >-
        The charging type of the component. Required if componentType is set to
        QUANTITY
      type: string
      enum:
        - DURATION
        - MB
        - ONE_OFF
    InclusiveUsageFrequency:
      description: >-
        Frequency or period for the inclusive usage plan. This can be daily,
        weekly or monthly (required when trigger charge is set)
      type: string
      enum:
        - MONTHLY
        - DAILY
        - WEEKLY
    Timeband:
      description: >-
        A definition of timebands to be used. Primarily used in Inclusive Usage
        plans
      type: string
      enum:
        - PEAK
        - OFFPEAK
        - WEEKEND
    RentalRateCardType:
      description: >-
        Rental rate card type. Buy = used to price rental products purchased
        from the supplier, Sell = used to price rental products sold to
        customers, Template = is a rate card to which other rate cards can be
        linked
      type: string
      enum:
        - SELL
        - TEMPLATE
        - BUY
    UsageRateCardType:
      description: >-
        Usage rate card type. Buy = used to price usage purchased from the
        supplier, Sell = used to price usage sold to customers, Template = is a
        rate card to which other rate cards can be linked
      type: string
      enum:
        - TEMPLATE
        - SELL
        - BUY
      default: SELL
    PriceRoundingStyle:
      description: >-
        Price rounding style. When pricing usage, each call will be rounded to
        the specified number of decimal places using the method selected here
      type: string
      enum:
        - UP
        - DOWN
        - MATHEMATICAL
      default: MATHEMATICAL
    UsageRateType:
      description: Usage rate type
      type: string
      enum:
        - MARKUP
        - VARIABLE
    RentalRateType:
      description: Rental rate type. Required when rentalRatePriceType is RENTAL
      type: string
      enum:
        - ADVANCE
        - ARREARS
    RentalRatePriceType:
      description: Rental price type - recurring rental or one off?
      type: string
      enum:
        - RENTAL
        - ONEOFF
    PeriodsInAdvance:
      description: >-
        Number of periods in advance (i.e. Months) for rentals. Required when
        rentalRateType is ADVANCE
      type: string
      enum:
        - STANDARD
        - ADVANCEDPLUSONEMONTH
    RentalRateFrequency:
      description: Frequency of rental. Required when rentalRatePriceType is RENTAL
      type: string
      enum:
        - DAILY
        - WEEKLY
        - MONTHLY
        - YEARLY
        - QUARTERLY
        - SIXMONTHS
        - TWENTYFOURMONTHS
    RentalDiscountPlan:
      required:
        - contractOwnerId
        - name
        - durationInMonths
        - availableFrom
      type: object
      x-si-class-validation: |
        @After(first = "availableTo", second = "availableFrom")
      properties:
        id:
          description: Rental discount plan identifier
          type: integer
          readOnly: true
          format: int64
          example: 1
        contractOwnerId:
          description: The billing entity that will have access to this item
          type: integer
          format: int32
          x-si-validation: '@ValidId'
          example: 1
        name:
          type: string
          description: Rental discount plan name. Must be unique for a given contract owner
          minLength: 1
          maxLength: 50
          pattern: '[\w\p{L}\s%£@&#='':;`'',|!_—–\(\)\\/\-\+\.\?\*\$]*'
          example: 12 month 50% off
        durationInMonths:
          description: Duration of the discount plan in months
          type: integer
          format: int32
          minimum: 1
          maximum: 120
          example: 12
        availableFrom:
          description: Available from date
          type: string
          format: date
        availableTo:
          description: Available to date
          type: string
          format: date
    RentalDiscountPlanRule:
      required:
        - rentalDiscountPlanId
        - productCategoryId
        - discountPercentage
      type: object
      x-si-no-change-allowed-in-finalised-bill-run: >
        fields = { "rentalDiscountPlanId", "productCategoryId",
        "rentalProductId" }
      x-si-only-billrun-owner-can-change-in-closed-bill-run: >
        fields = { "rentalDiscountPlanId", "productCategoryId",
        "rentalProductId" }
      properties:
        id:
          description: Rental discount plan rule identifier
          type: integer
          readOnly: true
          format: int64
          example: 1
        rentalDiscountPlanId:
          description: Rental discount plan identifier
          type: integer
          format: int64
          x-si-validation: '@ValidId'
          example: 1
        productCategoryId:
          description: >-
            Product category identifier. The rule applies to all rental products
            in this category (unless rentalProductId is specified)
          type: integer
          format: int64
          x-si-validation: '@ValidId'
          example: 1
        rentalProductId:
          description: >-
            Rental product identifier. Optional - if specified, the rule applies
            only to this specific rental product within the category
          type: integer
          format: int64
          x-si-validation: '@ValidId'
          example: 1
        discountPercentage:
          description: Discount percentage to apply (0-100)
          type: number
          format: double
          minimum: 0
          maximum: 100
          example: 15
    AssignmentLevel:
      description: assignment level
      type: string
      enum:
        - CUSTOMER
        - SITE
        - INVENTORY
    PageParam:
      description: Page of results to show
      minimum: 1
      type: integer
      format: int32
      example: 1
    ResultsPerPageParam:
      description: Results to return per page
      maximum: 1000
      minimum: 1
      type: integer
      format: int32
      example: 100
    SortParam:
      description: >-
        Comma-delimited list of the fields to sort by - defaults to ascending
        order, suffix :desc to change
      example: id,name | name:desc
      type: string
    FieldsParam:
      description: >-
        Comma-delimited list of the field(s) to return if only a subset is
        required
      example: id,name
      type: string
    IdFilterParam:
      description: Filter by this numeric id value
      example: '0'
      type: string
    StringFilterParam:
      description: >-
        Filter by this string value where value can optionally be prefixed
        (in:|like:)
      example: xyz | in:x,y | like:xyz
      type: string
    DateFilterParam:
      description: >-
        Filter by this date value where value can optionally be prefixed
        (gt:|lt:|gtn:|gen:)
      example: yyyy-MM-dd | lt:yyyy-MM-dd | gt:yyyy-MM-dd | gtn:yyyy-MM-dd
      type: string
    BooleanFilterParam:
      description: Filter by this boolean value (true or false)
      example: true | false
      type: string
    IdParam:
      description: Identifier
      minimum: 1
      type: integer
      format: int64
      example: 1
    PatchDocument:
      description: A JSONPatch document as defined by RFC 6902
      required:
        - op
        - path
      type: object
      properties:
        op:
          type: string
          description: The JSON Patch operation to be performed
          x-si-exclude: true
          enum:
            - add
            - remove
            - replace
            - move
            - copy
            - test
        path:
          type: string
          description: A JSON-Pointer
        value:
          type: object
          properties: {}
          description: The value to be used within the operations
        from:
          type: string
          description: A string containing a JSON Pointer value
    PatchRequest:
      type: array
      description: >-
        JSON Patch is a format for describing changes to a JSON document as
        specified in RFC 6902. Refer to [jsonpatch.com](http://jsonpatch.com/)
        for more information
      items:
        $ref: '#/components/schemas/PatchDocument'
    ChargingUnitType:
      type: string
      description: Charging unit i.e. duration or data (MB) or one off
      enum:
        - DURATION
        - MB
        - ONE_OFF
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
  parameters:
    page:
      name: page
      in: query
      description: Page of results to show
      schema:
        $ref: '#/components/schemas/PageParam'
      required: true
    pageSize:
      name: pageSize
      description: Results to return per page
      in: query
      schema:
        $ref: '#/components/schemas/ResultsPerPageParam'
      required: true
    sort:
      name: sort
      in: query
      description: >-
        Comma-delimited list of the fields to sort by - defaults to ascending
        order, suffix :desc to change
      schema:
        $ref: '#/components/schemas/SortParam'
      required: false
    fields:
      name: fields
      in: query
      description: >-
        Comma-delimited list of the field(s) to return if only a subset is
        required
      schema:
        $ref: '#/components/schemas/FieldsParam'
      required: false
