openapi: 3.0.1
info:
  title: Elevate Rental API
  description: >
    ### Rental Service


    Provides access to rental rating values for customer and RPIs. Currently
    supports;


    - Get the Early Termination Charge (ETC) that would apply for a given
    customer or RPI should the customer/RPI end the contract early

    - Get the rated sell records for a rental product inventory, site or
    customer in a given adhoc/bill run

    - Get the rated buy records for a rental product inventory, site or customer
    in a given bill run

    - Get the suspense records for a rental product inventory, site or customer
  version: '1.5'
servers:
  - url: https://rest.elevatebilling.com/v1
tags:
  - name: etc
    description: Early Termination Charge
  - name: rental-rated-sell-records
    description: Rental Rated Sell Records
  - name: rental-rated-buy-records
    description: Rental Rated Buy Records
  - name: rental-suspense-records
    description: Rental Suspense Records
  - name: rental-combined-records
    description: Rental Combined Records of suspense, supplier, buy and sell
paths:
  /rental-etcs:
    get:
      tags:
        - etc
      summary: Get the Early Termination Charges (ETC)
      description: >-
        Get the Early Termination Charges (ETC) that would apply for given
        customer or RPI on proposed end date
      operationId: getEarlyTerminationCharge
      x-si-permissions:
        - VIEW_CUSTOMER
      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: Return based on customer id - mandatory
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: true
        - name: calculationDate
          in: query
          description: Proposed date for ETC calculation - mandatory
          schema:
            example: yyyy-MM-dd
            type: string
          required: true
        - name: rentalProductInventoryId
          in: query
          description: Filter based on RPI id
          schema:
            $ref: '#/components/schemas/IdFilterParam'
          required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EarlyTerminationCharge'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
  /rental-rated-sell-records:
    get:
      tags:
        - rental-rated-sell-records
      summary: Get the rated sell records
      description: >-
        Get the rated sell records for a rental product inventory, site or
        customer in a given adhoc/bill run
      operationId: getRentalRatedSell
      parameters:
        - name: page
          in: query
          description: Page of results to show
          required: true
          schema:
            $ref: '#/components/schemas/PageParam'
        - name: pageSize
          in: query
          description: Results to return per page
          required: true
          schema:
            $ref: '#/components/schemas/ResultsPerPageParam'
        - name: sort
          in: query
          description: >-
            Comma-delimited list of the fields to sort by - defaults to
            ascending order, suffix :desc to change
          required: false
          schema:
            $ref: '#/components/schemas/SortParam'
        - name: fields
          in: query
          description: >-
            Comma-delimited list of the field(s) to return if only a subset is
            required
          required: false
          schema:
            $ref: '#/components/schemas/FieldsParam'
        - name: rentalProductInventoryId
          in: query
          description: >-
            Return based on rental product inventory identifier - required
            unless the "siteId+adhocBillRunId/billRunId" or
            "customerId+adhocBillRunId/billRunId" filter combinations have been
            specified
          required: false
          style: form
          explode: true
          schema:
            $ref: '#/components/schemas/IdFilterParam'
        - name: billRunId
          in: query
          description: Filter based on bill run identifier
          required: false
          style: form
          explode: true
          schema:
            $ref: '#/components/schemas/IdFilterParam'
        - name: adhocBillRunId
          in: query
          description: Filter based on adhoc bill run identifier
          required: false
          style: form
          explode: true
          schema:
            $ref: '#/components/schemas/IdFilterParam'
        - name: customerId
          in: query
          description: >-
            Filter based on customer identifier - required with
            "adhocBillRunId/billRunId" unless the "rentalProductInventoryId" or
            "siteId+adhocBillRunId/billRunId" filter combinations have been
            specified
          required: false
          style: form
          explode: true
          schema:
            $ref: '#/components/schemas/IdFilterParam'
        - name: siteId
          in: query
          description: >-
            Filter based on site identifier - required with
            "adhocBillRunId/billRunId" unless the "rentalProductInventoryId" or
            "customerId+adhocBillRunId/billRunId" filter combinations have been
            specified
          required: false
          style: form
          explode: true
          schema:
            $ref: '#/components/schemas/IdFilterParam'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RentalRatedSell'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
      security:
        - bearerAuth: []
      x-si-permissions:
        - VIEW_CUSTOMER
      x-si-filterable: true
  /rental-rated-buy-records:
    get:
      tags:
        - rental-rated-buy-records
      summary: Get the rated buy records
      description: >-
        Get the rated buy records for a rental product inventory, site or
        customer in a given bill run
      operationId: getRentalRatedBuy
      parameters:
        - name: page
          in: query
          description: Page of results to show
          required: true
          schema:
            $ref: '#/components/schemas/PageParam'
        - name: pageSize
          in: query
          description: Results to return per page
          required: true
          schema:
            $ref: '#/components/schemas/ResultsPerPageParam'
        - name: sort
          in: query
          description: >-
            Comma-delimited list of the fields to sort by - defaults to
            ascending order, suffix :desc to change
          required: false
          schema:
            $ref: '#/components/schemas/SortParam'
        - name: fields
          in: query
          description: >-
            Comma-delimited list of the field(s) to return if only a subset is
            required
          required: false
          schema:
            $ref: '#/components/schemas/FieldsParam'
        - name: rentalProductInventoryId
          in: query
          description: >-
            Return based on rental product inventory identifier - required
            unless the "siteId+billRunId" or "customerId+billRunId" filter
            combinations have been specified
          required: false
          style: form
          explode: true
          schema:
            $ref: '#/components/schemas/IdFilterParam'
        - name: billRunId
          in: query
          description: Filter based on bill run identifier
          required: false
          style: form
          explode: true
          schema:
            $ref: '#/components/schemas/IdFilterParam'
        - name: customerId
          in: query
          description: >-
            Filter based on customer identifier - required with "billRunId"
            unless the "rentalProductInventoryId" or "siteId+billRunId" filter
            combinations have been specified
          required: false
          style: form
          explode: true
          schema:
            $ref: '#/components/schemas/IdFilterParam'
        - name: siteId
          in: query
          description: >-
            Filter based on site identifier - required with "billRunId" unless
            the "rentalProductInventoryId" or "customerId+billRunId" filter
            combinations have been specified
          required: false
          style: form
          explode: true
          schema:
            $ref: '#/components/schemas/IdFilterParam'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RentalRatedBuy'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
      security:
        - bearerAuth: []
      x-si-permissions:
        - VIEW_CUSTOMER
      x-si-filterable: true
  /rental-suspense-records:
    get:
      tags:
        - rental-suspense-records
      summary: Get the suspense records
      description: >-
        Get the suspense records for a rental product inventory, site or
        customer
      operationId: getRentalSuspense
      parameters:
        - name: page
          in: query
          description: Page of results to show
          required: true
          schema:
            $ref: '#/components/schemas/PageParam'
        - name: pageSize
          in: query
          description: Results to return per page
          required: true
          schema:
            $ref: '#/components/schemas/ResultsPerPageParam'
        - name: sort
          in: query
          description: >-
            Comma-delimited list of the fields to sort by - defaults to
            ascending order, suffix :desc to change
          required: false
          schema:
            $ref: '#/components/schemas/SortParam'
        - name: fields
          in: query
          description: >-
            Comma-delimited list of the field(s) to return if only a subset is
            required
          required: false
          schema:
            $ref: '#/components/schemas/FieldsParam'
        - name: rentalProductInventoryId
          in: query
          description: Return based on rental product inventory identifier
          required: false
          style: form
          explode: true
          schema:
            $ref: '#/components/schemas/IdFilterParam'
        - name: customerId
          in: query
          description: Filter based on customer identifier
          required: false
          style: form
          explode: true
          schema:
            $ref: '#/components/schemas/IdFilterParam'
        - name: siteId
          in: query
          description: Filter based on site identifier
          required: false
          style: form
          explode: true
          schema:
            $ref: '#/components/schemas/IdFilterParam'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RentalRatedSuspense'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
      security:
        - bearerAuth: []
      x-si-permissions:
        - VIEW_CUSTOMER
      x-si-filterable: true
  /rental-combined-records:
    get:
      tags:
        - rental-combined-records
      summary: Get the combined suspense, supplier, sell and buy records
      description: >-
        Get the combined suspense, supplier, sell and buy records records for a
        rental product inventory
      operationId: getRentalCombined
      parameters:
        - name: page
          in: query
          description: Page of results to show
          required: true
          schema:
            $ref: '#/components/schemas/PageParam'
        - name: pageSize
          in: query
          description: Results to return per page
          required: true
          schema:
            $ref: '#/components/schemas/ResultsPerPageParam'
        - name: sort
          in: query
          description: >-
            Comma-delimited list of the fields to sort by - defaults to
            ascending order, suffix :desc to change
          required: false
          schema:
            $ref: '#/components/schemas/SortParam'
        - name: fields
          in: query
          description: >-
            Comma-delimited list of the field(s) to return if only a subset is
            required
          required: false
          schema:
            $ref: '#/components/schemas/FieldsParam'
        - name: rentalProductInventoryId
          in: query
          description: Return based on rental product inventory identifier
          required: true
          style: form
          explode: true
          schema:
            $ref: '#/components/schemas/IdFilterParam'
        - name: excludeBuyPrices
          in: query
          description: Filter out buy prices (true/false)
          schema:
            $ref: '#/components/schemas/StringFilterParam'
          required: false
        - name: excludeSellPrices
          in: query
          description: Filter out sell prices (true/false)
          schema:
            $ref: '#/components/schemas/StringFilterParam'
          required: false
        - name: excludeSupplierPrices
          in: query
          description: Filter out supplier prices (true/false)
          schema:
            $ref: '#/components/schemas/StringFilterParam'
          required: false
        - name: excludeSuspense
          in: query
          description: Filter out suspense records
          schema:
            $ref: '#/components/schemas/StringFilterParam'
          required: false
        - name: hasSellPrice
          in: query
          description: Filter out those records without a sell price
          schema:
            $ref: '#/components/schemas/StringFilterParam'
          required: false
        - name: searchFilter
          in: query
          description: Filter by search text against all fields
          schema:
            $ref: '#/components/schemas/StringFilterParam'
          required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RentalRatedCombined'
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
      security:
        - bearerAuth: []
      x-si-permissions:
        - VIEW_CUSTOMER
      x-si-filterable: true
components:
  schemas:
    EarlyTerminationCharge:
      required:
        - customerId
        - amountInMajorCurrency
        - currencyCode
        - calculationDate
      type: object
      properties:
        customerId:
          description: Customer Id
          type: integer
          format: int64
          x-si-validation: '@ValidId'
          example: 1
        rentalProductInventoryId:
          description: RPI Id
          type: integer
          format: int64
          x-si-validation: '@ValidId'
          example: 1
        amountInMajorCurrency:
          description: ETC amount in major currency (e.g pounds/dollars/euros)
          type: number
          example: 10.5
          minimum: -9999999
          maximum: 9999999
        currencyCode:
          $ref: '#/components/schemas/CurrencyCode'
        calculationDate:
          description: Date when the ETC was calculated for
          type: string
          format: date
    RentalRatedSell:
      required:
        - rentalProductInventoryId
      type: object
      properties:
        id:
          type: integer
          description: Rental rated sell identifier
          format: int64
          readOnly: true
          example: 1
          x-si-validation: '@ValidId'
        rentalProductInventoryId:
          type: integer
          description: Rental product inventory identifier
          format: int64
          example: 1
          x-si-validation: '@ValidId'
        customerId:
          description: Customer identifier
          type: integer
          format: int64
          x-si-validation: '@ValidId'
        siteId:
          description: Site identifier
          type: integer
          format: int64
          x-si-validation: '@ValidId'
        billRunId:
          type: integer
          description: Bill run identifier
          format: int64
          example: 1
          x-si-validation: '@ValidId'
        billRunName:
          maxLength: 255
          minLength: 0
          type: string
          description: Bill run friendly name
        billRunStatus:
          maxLength: 255
          minLength: 0
          type: string
          description: Bill run status
        adhocBillRunId:
          type: integer
          description: Adhoc bill run identifier
          format: int64
          example: 1
          x-si-validation: '@ValidId'
        creationDate:
          type: string
          description: Created date
          format: date
        chargeStartDate:
          type: string
          description: Charge start date
          format: date
        chargeEndDate:
          type: string
          description: Charge end date
          format: date
        preDiscountPrice:
          type: number
          description: Rated pre discount price
          example: 10.5
        sellPrice:
          type: number
          description: Rated sell price
          example: 10.5
        priceType:
          maxLength: 255
          minLength: 0
          type: string
          description: Price type
          example: Rental
        qty:
          type: number
          description: Quantity
          example: 1
    RentalRatedBuy:
      required:
        - rentalProductInventoryId
      type: object
      properties:
        id:
          type: integer
          description: Rental rated buy identifier
          format: int64
          readOnly: true
          example: 1
          x-si-validation: '@ValidId'
        rentalProductInventoryId:
          type: integer
          description: Rental product inventory identifier
          format: int64
          example: 1
          x-si-validation: '@ValidId'
        customerId:
          description: Customer identifier
          type: integer
          format: int64
          x-si-validation: '@ValidId'
        siteId:
          description: Site identifier
          type: integer
          format: int64
          x-si-validation: '@ValidId'
        billRunId:
          type: integer
          description: Bill run identifier
          format: int64
          example: 1
          x-si-validation: '@ValidId'
        billRunName:
          maxLength: 255
          minLength: 0
          type: string
          description: Bill run friendly name
        billRunStatus:
          maxLength: 255
          minLength: 0
          type: string
          description: Bill run status
        creationDate:
          type: string
          description: Created date
          format: date
        chargeStartDate:
          type: string
          description: Charge start date
          format: date
        chargeEndDate:
          type: string
          description: Charge end date
          format: date
        buyPrice:
          type: number
          description: Rated buy price
          example: 10.5
        priceType:
          maxLength: 255
          minLength: 0
          type: string
          description: Price type
          example: Rental
        qty:
          type: number
          description: Quantity
          example: 1
    RentalRatedSuspense:
      required:
        - rentalProductInventoryId
      type: object
      properties:
        id:
          type: integer
          description: Rental rated buy identifier
          format: int64
          readOnly: true
          example: 1
          x-si-validation: '@ValidId'
        rentalProductInventoryId:
          type: integer
          description: Rental product inventory identifier
          format: int64
          example: 1
          x-si-validation: '@ValidId'
        customerId:
          description: Customer identifier
          type: integer
          format: int64
          x-si-validation: '@ValidId'
        siteId:
          description: Site identifier
          type: integer
          format: int64
          x-si-validation: '@ValidId'
        creationDate:
          type: string
          description: Created date
          format: date
        suspenseReason:
          maxLength: 255
          minLength: 0
          type: string
          description: Suspense reason
          example: Cannot find a rate in the rate card
    RentalRatedCombined:
      required:
        - rentalProductInventoryId
      type: object
      properties:
        rentalProductInventoryId:
          type: integer
          description: Rental product inventory identifier
          format: int64
          example: 1
          x-si-validation: '@ValidId'
        invoicePresentationProductName:
          type: string
          description: Product name as presented on invoice
          minLength: 1
          maxLength: 255
          pattern: '[\w\p{L}\s%£@&#='':;`’,|!_—–\(\)\\/\-\+\.\?\*\$]*'
        billRunId:
          type: integer
          description: Bill run identifier
          format: int64
          example: 1
          x-si-validation: '@ValidId'
        adhocBillRunId:
          type: integer
          description: Adhoc bill run identifier
          format: int64
          example: 1
          x-si-validation: '@ValidId'
        billRunName:
          maxLength: 255
          minLength: 0
          type: string
          description: Bill run friendly name
        adhocBillRunName:
          maxLength: 255
          minLength: 0
          type: string
          description: Adhoc bill run friendly name
        billRunStatus:
          maxLength: 255
          minLength: 0
          type: string
          description: Bill run status
        adhocBillRunStatus:
          maxLength: 255
          minLength: 0
          type: string
          description: Adhoc bill run status
        chargeStartDate:
          type: string
          description: Charge start date
          format: date
        chargeEndDate:
          type: string
          description: Charge end date
          format: date
        buyPrice:
          type: number
          description: Rated buy price
          example: 10.5
        sellPrice:
          type: number
          description: Rated sell price
          example: 10.5
        preDiscountSellPrice:
          type: number
          description: Rated sell price before discounting
          example: 10.5
        supplierPrice:
          type: number
          description: Supplier price
          example: 10.5
        sellPriceType:
          maxLength: 255
          minLength: 0
          type: string
          description: Sell price type
          example: Rental
        buyPriceType:
          maxLength: 255
          minLength: 0
          type: string
          description: Buy price type
          example: Rental
        qty:
          type: number
          description: Rental product inventory quantity
          example: 1
        howWasTheBuyRateDerived:
          type: string
          maxLength: 1024
          description: description of how the buy price was arrived at
        howWasTheSellRateDerived:
          type: string
          maxLength: 1024
          description: description of how the sell price was arrived at
        suspenseReason:
          maxLength: 255
          minLength: 0
          type: string
          description: Suspense reason
          example: Cannot find a rate in the rate card
    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
    CurrencyCode:
      description: ISO 4217 3-character currency code
      type: string
      minLength: 3
      maxLength: 3
      pattern: '[A-Z]{3}'
      example: GBP
    StringFilterParam:
      description: >-
        Filter by this string value where value can optionally be prefixed
        (in:|like:)
      example: xyz | in:x,y | like:xyz
      type: string
  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
