openapi: 3.0.3

info:
  title: Action (Matter) Bill Settings
  description: "For retrieving Action Bill Settings. For historical reasons Matters are referred to as *actions* in this version of the API. For information of how to construct requests utilising fieldsets, sorting, paging, filters, and '*includes*', please refer to the API Developer Portal. E&OE."
  version: "1.0"

externalDocs:
  description: API Developer Portal - Constructing API Requests
  url: https://docs.actionstep.com/api-requests/

paths:
  '/actionbillsettings':
    get:
      description: Returns a summary of bill settings for all matters.
      tags:
        - Action Bill Settings
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedActionBillSettings'

  '/actionbillsettings/{id}':
    get:
      description: Returns a summary of bill settings for an individual matter.
      tags:
        - Action Bill Settings
      parameters:
        - name: id
          in: path
          description: Unique identifier for a matter.
          required: true
          schema:
            type: integer
            format: int32
          example: 1930
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActionBillSettings'

    put:
      description: Updates the bill settings for a single matter.
      tags:
        - Action Bill Settings
      requestBody:
        $ref: '#/components/requestBodies/UpdateActionBillSettings'
      parameters:
        - name: id
          in: path
          description: Unique identifier for a matter.
          required: true
          schema:
            type: integer
            format: int32
          example: 1930
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActionBillSettings'

components:
  schemas:
    PagedActionBillSettings:
      type: object
      properties:
        actionbillsettings:
          type: array
          items:
            $ref: '#/components/schemas/ActionBillSettings'
        meta:
          $ref: '#/components/schemas/PageMetaData'

    PageMetaData:
      type: object
      properties:
        paging:
          $ref: '#/components/schemas/PagingData'

    PagingData:
      type: object
      properties:
        actionbillsettings:
          $ref: '#/components/schemas/ActionBillSettingsPageData'

    ActionBillSettingsPageData:
      type: object
      properties:
        recordCount:
          description: The total number of matter bill settings returned by the underlying query.
          type: integer
          example: 360
        pageCount:
          description: The total number of pages generated by the underlying query.
          type: integer
          example: 8
        page:
          description: The page number for this page of matter bill settings.
          type: integer
          example: 2
        pageSize:
          description: Page size.
          type: integer
          example: 50
        prevPage:
          description: A URL to the previous page of matter bill settings.
          type: string
          example: https://ap-southeast-2.actionstep.com/api/rest/actionbillsettings?page=1
        nextPage:
          description: A URL to the next page of matter bill settings.
          type: string
          example: https://ap-southeast-2.actionstep.com/api/rest/actionbillsettings?page=3

    ActionBillSettings:
      type: object
      properties:
        id:
          description: Unique identifier for the matter to which the bill settings are associated.
          example: 5850
          type: integer
        billType:
          description: Indicates the billing arrangement being applied to the matter.
          enum:
            - Hourly
            - Fixed fee
          example: Hourly
          type: string
        sendToEmailAddress:
          description: The default email address to which finalized bills are sent for this matter.
          example: john.smith@mybigcompany.com
          type: string
        quotedAmountIncludes:
          description: Indicates whether any quoted amount includes fees and/or costs (disbursements).
          enum:
            - Fees
            - Costs
            - Fees and costs
          example: Fees and costs
          type: string
        quotedAmount:
          description: A quoted amount for this matter.
          example: 5750.75
          type: number
          multipleOf: 0.01
          format: money
        isBillable:
          description: Flag to indicate if the matter is billable.
          enum:
            - T
            - F
          example: T
          type: string
          readOnly: true
        isUtbmsEnabled:
          description: Flag to indicate if UTBMS is enabled for this matter.
          enum:
            - T
            - F
          example: F
          type: string
        utbmsTaskCategoryCode:
          description: UTBMS task category code.
          example: Activity Codes
          type: string
        defaultTimeEntryBehavior:
          description: Default behavior for time entries.
          enum:
            - Bill
            - Hide
            - No Charge
          example: Bill
          type: string
        salesTaxAppliesTo:
          description: Indicates what sales tax is applied to.
          enum:
            - Fees
            - Expenses
            - All
          example: Fees
          type: string
        discountType:
          description: The discount type applicable for the matter.
          enum:
            - Amount
            - Percentage
            - None
          example: Amount
          type: string
        discountAmount:
          description: The amount of any discount.
          example: 550.50
          type: number
          multipleOf: 0.01
          format: money
        isSalesTaxEnabled:
          description: Flag to indicate if sales tax is enabled for the matter.
          enum:
            - T
            - F
          example: T
          type: string
        links:
          $ref: '#/components/schemas/Links'

    Links:
      type: object
      properties:
        defaultRate:
          description: Unique identifier for the default rate applicable to this matter.
          example: 3
          type: integer
        currency:
          description: ISO 3 character code for the default billing currency.
          example: USD
          type: string
          readOnly: true
        salesTaxRate:
          description: Unique identifier for the sales tax rate applicable to the bill settings.
          example: 3945
          type: integer

    UpdateLinks:
      type: object
      properties:
        defaultRate:
          description: Unique identifier for the default rate applicable to this matter.
          example: 3
          type: integer
        salesTaxRate:
          description: Unique identifier for the sales tax rate applicable to the bill settings.
          example: 3945
          type: integer

    UpdateBillSettings:
      type: object
      properties:
        billType:
          description: Indicates the billing arrangement being applied to the matter.
          enum:
            - Hourly
            - Fixed fee
          example: Hourly
          type: string
        sendToEmailAddress:
          description: The default email address to which finalized bills are sent for this matter.
          example: john.smith@mybigcompany.com
          type: string
        quotedAmountIncludes:
          description: Indicates whether any quoted amount includes fees and/or costs (disbursements).
          enum:
            - Fees
            - Costs
            - Fees and costs
          example: Fees and costs
          type: string
        quotedAmount:
          description: A quoted amount for this matter.
          example: 5750.75
          type: number
          multipleOf: 0.01
          format: money
        isUtbmsEnabled:
          description: Flag to indicate if UTBMS is enabled for this matter.
          enum:
            - T
            - F
          example: F
          type: string
        utbmsTaskCategoryCode:
          description: UTBMS task category code.
          example: Activity Codes
          type: string
        defaultTimeEntryBehavior:
          description: Default behavior for time entries.
          enum:
            - Bill
            - Hide
            - No Charge
          example: Bill
          type: string
        salesTaxAppliesTo:
          description: Indicates what sales tax is applied to.
          enum:
            - Fees
            - Expenses
            - All
          example: Fees
          type: string
        discountType:
          description: The discount type applicable for the matter.
          enum:
            - Amount
            - Percentage
            - None
          example: Amount
          type: string
        discountAmount:
          description: The amount of any discount.
          example: 550.50
          type: number
          multipleOf: 0.01
          format: money
        isSalesTaxEnabled:
          description: Flag to indicate if sales tax is enabled for the matter.
          enum:
            - T
            - F
          example: T
          type: string
        links:
          $ref: '#/components/schemas/UpdateLinks'
          
  requestBodies:
    UpdateActionBillSettings:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdateBillSettings'
