> ## Documentation Index
> Fetch the complete documentation index at: https://help.gorelo.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Updates a contract and its service lines.

> 

            Every field is optional and a field left out keeps its value. `Reference`,
            `EndDate`, `InvoiceTemplateId`, `InvoiceEmailTemplateId` and
            `BrandingThemeId` clear with `null`; `ContactIds: []` removes every
            auto-approve contact. `StatusId` 3 archives the contract and 1 restores it.
            `ClientId` can't change. Once an invoice has been generated from the contract,
            `StartDate` and `RepeatPeriodId` are refused with 409.
            


  `ServiceLines` replaces the set, matched by `Id`: an entry with an `Id` updates
            that line, one without adds a line, and a line left out is removed, which is refused with 409
            while it has time logged that hasn't been invoiced. Each line's `LineItems` replaces its
            set the same way. Only a No Labor Terms line can change its labor terms. On a Block Hours line
            `Balance` and the thresholds can change; the template and price can't.
            

Returns the contract in the `GET /v1/contracts/{contractId}` shape.



## OpenAPI

````yaml /api-reference/openapi.json patch /v1/contracts/{contractId}
openapi: 3.0.4
info:
  title: Public API
  description: Gorelo Public API documentation.
  version: 1.0.0
servers:
  - url: https://api.usw.gorelo.io
    description: US
  - url: https://api.aue.gorelo.io
    description: Australia
security:
  - ApiKeyAuth: []
tags:
  - name: Attachments
    description: "Uploading a file, for anything that can carry one. One endpoint rather than one per record\r\ntype, because the upload itself is identical - only the record it is checked against differs."
  - name: Alerts
    description: Alerts management operations
  - name: Assets
    description: Assets management operations
  - name: Billing
    description: Billing management operations
  - name: Tickets
    description: Tickets management operations
  - name: Clients
    description: Clients management operations
  - name: Contacts
    description: Contacts management operations
  - name: Deletions
    description: Deletions management operations
  - name: Documents
    description: Documents management operations
  - name: Forms
    description: Forms management operations
  - name: Organization
    description: Organization management operations
  - name: Projects
    description: Projects management operations
paths:
  /v1/contracts/{contractId}:
    patch:
      tags:
        - Billing
      summary: Updates a contract and its service lines.
      description: "\n\r\n            Every field is optional and a field left out keeps its value. `Reference`,\r\n            `EndDate`, `InvoiceTemplateId`, `InvoiceEmailTemplateId` and\r\n            `BrandingThemeId` clear with `null`; `ContactIds: []` removes every\r\n            auto-approve contact. `StatusId` 3 archives the contract and 1 restores it.\r\n            `ClientId` can't change. Once an invoice has been generated from the contract,\r\n            `StartDate` and `RepeatPeriodId` are refused with 409.\r\n            \r\n\n\r\n  `ServiceLines` replaces the set, matched by `Id`: an entry with an `Id` updates\r\n            that line, one without adds a line, and a line left out is removed, which is refused with 409\r\n            while it has time logged that hasn't been invoiced. Each line's `LineItems` replaces its\r\n            set the same way. Only a No Labor Terms line can change its labor terms. On a Block Hours line\r\n            `Balance` and the thresholds can change; the template and price can't.\r\n            \r\n\nReturns the contract in the `GET /v1/contracts/{contractId}` shape."
      operationId: patch_v1_contracts_contractId
      parameters:
        - name: contractId
          in: path
          description: Identifier of the contract.
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: Fields to change.
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/UpdateContractCommand'
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateContractCommand'
          text/json:
            schema:
              $ref: '#/components/schemas/UpdateContractCommand'
          application/*+json:
            schema:
              $ref: '#/components/schemas/UpdateContractCommand'
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ContractDetailModelBaseResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDetailModelBaseResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/ContractDetailModelBaseResponse'
        '400':
          description: Bad Request
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
        '401':
          description: Unauthorized
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
        '404':
          description: Not Found
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
        '409':
          description: Conflict
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
        '500':
          description: Internal Server Error
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
components:
  schemas:
    UpdateContractCommand:
      type: object
      properties:
        Name:
          type: string
          description: Name of the contract. Not clearable.
          nullable: true
        ClientId:
          type: integer
          description: 'Not accepted: a contract''s client can''t change, as in the app.'
          format: int64
          nullable: true
        StatusId:
          type: integer
          description: >-
            1 Active or 3 Archived: the app's Restore and Archive. 2 Expired
            follows from EndDate and can't be set.
          format: int32
          nullable: true
          example: 3
        Reference:
          type: string
          description: >-
            Free-text reference printed on the contract's invoices. Send null to
            clear it.
          nullable: true
        StartDate:
          type: string
          description: "Date coverage starts, a calendar date. Refused with 409 once an invoice has been generated\r\nfrom the contract. Line items keep their own dates. Not clearable."
          format: date-time
          nullable: true
        EndDate:
          type: string
          description: >-
            Date coverage ends, a calendar date. Send null to make the contract
            open-ended.
          format: date-time
          nullable: true
        RepeatPeriodId:
          type: integer
          description: >-
            1 Monthly, 2 Quarterly, 3 Yearly, 4 Half Yearly. Refused with 409
            once an invoice has been generated.
          format: int32
          nullable: true
        DaysBeforeInvoiceCreation:
          type: integer
          description: Days before the billing period ends that the invoice is created.
          format: int32
          nullable: true
        DaysUntilDue:
          type: integer
          description: Days the client has to pay.
          format: int32
          nullable: true
        AutoApproveAndSend:
          type: boolean
          description: >-
            Approve and send each invoice raised from the contract
            automatically.
          nullable: true
        ContactIds:
          type: array
          items:
            type: integer
            format: int64
          description: The auto-approve contacts, replacing the set. `[]` removes them all.
          nullable: true
        IsForAllLocations:
          type: boolean
          description: >-
            Whether the contract covers all the client's locations. False needs
            LocationIds, sent or already stored.
          nullable: true
        LocationIds:
          type: array
          items:
            type: integer
            format: int64
          description: >-
            The locations covered, replacing the set. Read only when the
            contract is location-scoped.
          nullable: true
        ProrateTypeId:
          type: integer
          description: >-
            0 Do not prorate, 1 Prorate and add to next invoice, 2 Prorate and
            generate standalone invoice.
          format: int32
          nullable: true
        AutoInvoiceTicketProducts:
          type: boolean
          description: >-
            Sweep approved ticket products into the next recurring invoice. Only
            on an all-locations contract.
          nullable: true
        InvoiceTemplateId:
          type: integer
          description: >-
            Invoice template for the contract's invoices. Send null to clear it;
            the default then applies.
          format: int64
          nullable: true
        InvoiceEmailTemplateId:
          type: integer
          description: >-
            Email template for the contract's invoices. Send null to clear it;
            the default then applies.
          format: int64
          nullable: true
        BrandingThemeId:
          type: string
          description: >-
            Accounting-system branding theme for the contract's invoices. Send
            null to clear it.
          format: uuid
          nullable: true
        ServiceLines:
          type: array
          items:
            $ref: '#/components/schemas/ContractServiceLineInput'
          description: "The service lines, replacing the set: an entry with an Id updates that line, one without adds\r\na line, and a line left out is removed. Leave the field out to keep the lines as they are."
          nullable: true
      additionalProperties: false
      description: "Partial update of a contract. Every field is optional and a field left out keeps its value; a\r\nclearable field clears with `null`. `ServiceLines`, and each line's `LineItems`,\r\nreplace their set, matched by `Id`."
    ContractDetailModelBaseResponse:
      type: object
      properties:
        StatusCode:
          $ref: '#/components/schemas/HttpStatusCode'
        IsSuccess:
          type: boolean
        Data:
          $ref: '#/components/schemas/ContractDetailModel'
        DataContext:
          type: object
          additionalProperties: false
          nullable: true
          example: null
        Notifications:
          type: array
          items:
            $ref: '#/components/schemas/Error'
      additionalProperties: false
    ObjectBaseResponse:
      type: object
      properties:
        StatusCode:
          $ref: '#/components/schemas/HttpStatusCode'
        IsSuccess:
          type: boolean
        Data:
          nullable: true
        DataContext:
          $ref: '#/components/schemas/ErrorDataContext'
        Notifications:
          type: array
          items:
            $ref: '#/components/schemas/Error'
      additionalProperties: false
    ContractServiceLineInput:
      type: object
      properties:
        Id:
          type: integer
          description: "PATCH only: the service line to keep and update. Leave it out to add a line. Not accepted on\r\nPOST."
          format: int64
          nullable: true
          example: 88214
        Name:
          type: string
          description: Name of the service line. Required on a new line.
          nullable: true
          example: Managed Services
        LaborTermsId:
          type: integer
          description: "How the line bills time: 1 Unlimited Hours, 2 Hourly, 3 Block Hours, 4 No Labor Terms,\r\n5 Limited Hours. Required on a new line. On an existing line only a No Labor Terms line can\r\nchange, once."
          format: int32
          nullable: true
          example: 1
        WorkTypeIds:
          type: array
          items:
            type: integer
            format: int64
          description: "The work types the line covers. Left out on a new line, every work type is covered, as in the\r\napp. Not accepted on a No Labor Terms line."
          nullable: true
        WorkRoleIds:
          type: array
          items:
            type: integer
            format: int64
          description: The billing roles the line covers. Same rules as `WorkTypeIds`.
          nullable: true
        AutoApproveTime:
          type: boolean
          description: >-
            Approve time logged against the line automatically. Every labor term
            except No Labor Terms. Default false.
          nullable: true
        AutoInvoiceTime:
          type: boolean
          description: "Sweep approved time waiting on the line into the contract's recurring invoice. Every labor term\r\nexcept No Labor Terms. Default false."
          nullable: true
        IncludedTimeGoesToId:
          type: integer
          description: "Where covered time lands when it is approved: 1 Complete (default) or 2 Waiting to invoice.\r\nUnlimited, Block and Limited Hours only."
          format: int32
          nullable: true
          example: 1
        UnlimitedHoursDetails:
          $ref: '#/components/schemas/UnlimitedHoursDetailsInput'
        PerHourDetails:
          $ref: '#/components/schemas/PerHourDetailsInput'
        LimitedHoursDetails:
          $ref: '#/components/schemas/LimitedHoursDetailsInput'
        BlockHoursDetails:
          $ref: '#/components/schemas/BlockHoursDetailsInput'
        LineItems:
          type: array
          items:
            $ref: '#/components/schemas/ContractLineItemInput'
          description: "The products and bundles billed on the line. On PATCH the list replaces the set, matched by\r\n`Id`; leave it out to keep the line items as they are."
          nullable: true
      additionalProperties: false
      description: "One service line on `POST /v1/contracts` or `PATCH /v1/contracts/{contractId}`. Send\r\nexactly one details object, the one matching `LaborTermsId`; No Labor Terms takes none."
    HttpStatusCode:
      enum:
        - 100
        - 101
        - 102
        - 103
        - 200
        - 201
        - 202
        - 203
        - 204
        - 205
        - 206
        - 207
        - 208
        - 226
        - 300
        - 301
        - 302
        - 303
        - 304
        - 305
        - 306
        - 307
        - 308
        - 400
        - 401
        - 402
        - 403
        - 404
        - 405
        - 406
        - 407
        - 408
        - 409
        - 410
        - 411
        - 412
        - 413
        - 414
        - 415
        - 416
        - 417
        - 421
        - 422
        - 423
        - 424
        - 426
        - 428
        - 429
        - 431
        - 451
        - 500
        - 501
        - 502
        - 503
        - 504
        - 505
        - 506
        - 507
        - 508
        - 510
        - 511
      type: integer
      format: int32
    ContractDetailModel:
      type: object
      properties:
        Id:
          type: integer
          description: Identifier of the contract.
          format: int64
          example: 4021
        Name:
          type: string
          description: Name of the contract.
          example: All Labor Terms Example
        Status:
          $ref: '#/components/schemas/CodeModel'
        Client:
          $ref: '#/components/schemas/CodeModel'
        LocationIds:
          type: array
          items:
            type: integer
            format: int64
          description: "The client locations the contract is scoped to, as location ids. Empty\r\nwhen the contract covers every one of the client's locations (see\r\n`IsForAllLocations`) as well as when a location-scoped contract's rows have all\r\nbeen removed; never null."
        IsForAllLocations:
          type: boolean
          description: "Whether the contract covers every one of the client's locations rather than the specific\r\nones named in `LocationIds`. When true, `LocationIds` is empty by\r\ndefinition."
        CreatedOn:
          type: string
          description: When the contract was created, in UTC.
          format: date-time
          nullable: true
        UpdatedOn:
          type: string
          description: >-
            When the contract was last changed, in UTC. Null when it has never
            been changed.
          format: date-time
          nullable: true
        Reference:
          type: string
          description: >-
            The contract's invoice reference, free text. Null when it is not
            set.
          nullable: true
          example: MSA-2025-014
        StartDate:
          type: string
          description: Date the contract's coverage starts, a calendar date.
          format: date
        EndDate:
          type: string
          description: >-
            Date the contract's coverage ends, a calendar date, or null when it
            is open-ended.
          format: date
          nullable: true
        RepeatPeriod:
          $ref: '#/components/schemas/CodeModel'
        DaysBeforeInvoiceCreation:
          type: integer
          description: >-
            How many days before the billing period ends the invoice is
            generated.
          format: int32
          nullable: true
        DaysUntilDue:
          type: integer
          description: >-
            How many days the client has to pay once invoiced. Renamed from
            `InvoiceDue` (ENG-7288).
          format: int32
          example: 30
        ProrateType:
          $ref: '#/components/schemas/CodeModel'
        AutoInvoiceTicketProducts:
          type: boolean
          description: "Whether approved ticket products for this client are swept into the contract's next\r\nrecurring invoice. Only ever true on a contract that covers all the client's locations."
        InvoiceTemplateId:
          type: integer
          description: >-
            Invoice template invoices raised from this contract use. Null means
            the service provider's default.
          format: int64
          nullable: true
        InvoiceEmailTemplateId:
          type: integer
          description: >-
            Email template invoices raised from this contract are sent with.
            Null means the service provider's default.
          format: int64
          nullable: true
        BrandingThemeId:
          type: string
          description: >-
            Accounting-system branding theme invoices raised from this contract
            use. Null means the default.
          format: uuid
          nullable: true
        AutoApproveAndSend:
          type: boolean
          description: >-
            Whether an invoice raised from this contract is approved and sent
            automatically.
          nullable: true
        Contacts:
          type: array
          items:
            $ref: '#/components/schemas/CodeModel'
          description: >-
            The contacts who can auto-approve invoices on this contract. Empty
            when none are set.
        RecurringAmount:
          type: number
          description: Total recurring amount the contract bills each period, before tax.
          format: double
          example: 6870
        RecurringCost:
          type: number
          description: >-
            Total recurring cost of the contract's recurring products each
            period.
          format: double
          example: 2981.36
        ServiceLines:
          type: array
          items:
            $ref: '#/components/schemas/ContractServiceLineDetailModel'
          description: >-
            The contract's service lines. Empty when the contract has none;
            never null.
      additionalProperties: false
      description: "Everything about one contract: the client and locations it covers, its billing schedule, and\r\neach service line with the actual products/labor billed on it."
    Error:
      type: object
      properties:
        Code:
          pattern: ^[0-9]{6}$
          type: string
          description: 6-digit MMTTNN error code. See the Public API error-code registry.
          example: '070101'
        Message:
          type: string
        PropertyName:
          type: string
          nullable: true
        ActionHint:
          type: string
          nullable: true
        DocUrl:
          type: string
          nullable: true
      additionalProperties: false
    ErrorDataContext:
      type: object
      properties:
        TraceId:
          type: string
          description: Request correlation id. Quote this when reporting a problem.
          nullable: true
      additionalProperties: false
      description: "The `DataContext` of an error response: carries the correlation id for the failed\r\nrequest."
    UnlimitedHoursDetailsInput:
      type: object
      additionalProperties: false
    PerHourDetailsInput:
      type: object
      properties:
        RateTypeId:
          type: integer
          description: >-
            1 Use default labor rates, 2 Use fixed labor rate, 3 Custom labor
            rates. Default 1.
          format: int32
          nullable: true
          example: 2
        HourlyRate:
          type: number
          description: >-
            The flat rate per hour. Required with RateTypeId 2, refused with any
            other.
          format: double
          nullable: true
          example: 150
        CustomRates:
          $ref: '#/components/schemas/ContractCustomRatesInput'
      additionalProperties: false
    LimitedHoursDetailsInput:
      type: object
      properties:
        ShowRemainingHoursInClientPortal:
          type: boolean
          description: >-
            Show the client the hours left in the allocation in the client
            portal. Default false.
          nullable: true
        AllocatedHours:
          type: number
          description: Hours included each billing period. Required on a new line.
          format: double
          nullable: true
          example: 10
        RateTypeId:
          type: integer
          description: Same as on `PerHourDetails`.
          format: int32
          nullable: true
        HourlyRate:
          type: number
          description: Same as on `PerHourDetails`.
          format: double
          nullable: true
        CustomRates:
          $ref: '#/components/schemas/ContractCustomRatesInput'
      additionalProperties: false
    BlockHoursDetailsInput:
      type: object
      properties:
        ShowRemainingHoursInClientPortal:
          type: boolean
          description: >-
            Show the client the hours left in the block in the client portal.
            Default false.
          nullable: true
        TemplateId:
          type: integer
          description: "A Block Hours Template id, or 0 for Custom. With a template, Balance and Price come from it and\r\nare refused on the request, as the app disables both once a template is picked. Required on a\r\nnew line."
          format: int64
          nullable: true
          example: 0
        Balance:
          type: number
          description: >-
            Hours in the block. Custom (TemplateId 0) only, and then required on
            a new line.
          format: double
          nullable: true
          example: 20
        Price:
          type: number
          description: "The price of the block, billed once on the Draft invoice the new line raises. Custom\r\n(TemplateId 0) only, and then required on a new line."
          format: double
          nullable: true
          example: 2000
        WarningThreshold:
          type: integer
          description: >-
            Percentage of the block left that raises a low-balance warning, a
            whole number 0-90.
          format: int32
          nullable: true
          example: 20
        OverrunThreshold:
          type: integer
          description: >-
            Percentage of the block the client may run past zero, a whole number
            0-50.
          format: int32
          nullable: true
          example: 10
      additionalProperties: false
    ContractLineItemInput:
      type: object
      properties:
        Id:
          type: integer
          description: >-
            PATCH only: the existing line item to keep and update. Leave it out
            to add one.
          format: int64
          nullable: true
          example: 991204
        ItemId:
          type: string
          description: >-
            The catalog item to bill. Required on a new entry, not accepted on
            an existing one.
          format: uuid
          nullable: true
        Quantity:
          type: number
          description: >-
            Quantity billed each period. Required on a new entry. Greater than
            0.
          format: double
          nullable: true
          example: 12
        Description:
          type: string
          description: >-
            Description on the invoice. Defaults to the item's. Send null to
            clear it.
          nullable: true
        UnitPrice:
          type: number
          description: Unit price charged. Defaults to the item's price. Not negative.
          format: double
          nullable: true
          example: 24.2
        UnitCost:
          type: number
          description: Unit cost. Defaults to the item's cost. Not negative.
          format: double
          nullable: true
          example: 18.4
        DiscountPercent:
          type: number
          description: Discount percentage, 0-100. Default 0.
          format: double
          nullable: true
        TaxId:
          type: integer
          description: >-
            Tax applied. Null, or left out on a new line item, gives the tax the
            app would pick for the item; left out on an existing one, its tax is
            kept. To bill no tax, send the tax-exempt rate's id.
          format: int64
          nullable: true
          example: 2419
        BillableStatusId:
          type: integer
          description: >-
            1 Billable (default), 2 No charge, 3 Non-billable. A line that isn't
            Billable bills 0.
          format: int32
          nullable: true
        StartDate:
          type: string
          description: "Date the line starts billing, a calendar date. Defaults to today in the service provider's zone,\r\nor the contract's start date if that is later."
          format: date-time
          nullable: true
        EndDate:
          type: string
          description: >-
            Date the line stops billing, a calendar date. Send null to make it
            open-ended.
          format: date-time
          nullable: true
      additionalProperties: false
      description: "One product or bundle billed on a service line. A new entry needs ItemId and Quantity; the rest\r\nfalls back to the item's own values, as an invoice line does. Amount and TaxAmount are always\r\ncalculated."
    CodeModel:
      type: object
      properties:
        Id:
          type: integer
          description: >-
            Numeric identifier of the coded value (e.g. status, priority, type,
            or source id).
          format: int64
          example: 1
        Name:
          type: string
          description: Display name of the coded value.
      additionalProperties: false
      description: >-
        A coded value, such as a status, priority, type or source, as an id and
        a display name.
    ContractServiceLineDetailModel:
      type: object
      properties:
        Id:
          type: integer
          description: >-
            Identifier of the service line. The same value a time entry's
            ServiceLineId carries.
          format: int64
          example: 88214
        Name:
          type: string
          description: Name of the service line.
        CreatedOn:
          type: string
          description: When the service line was created, in UTC.
          format: date-time
          nullable: true
        UpdatedOn:
          type: string
          description: >-
            When the service line was last changed, in UTC. Null when it has
            never been changed.
          format: date-time
          nullable: true
        LaborTerms:
          $ref: '#/components/schemas/CodeModel'
        WorkTypes:
          type: array
          items:
            $ref: '#/components/schemas/CodeModel'
          description: "The work types this line applies to. Only recorded for an Unlimited Hours line; empty for\r\nevery other `LaborTerms` today, since the other labor terms carry no work-type\r\nselection of their own in storage."
        WorkRoles:
          type: array
          items:
            $ref: '#/components/schemas/CodeModel'
          description: Same coverage as `WorkTypes`, for billing roles.
        AutoApproveTime:
          type: boolean
          description: >-
            Whether time logged against this line is approved automatically.
            False on a No Labor Terms line.
        AutoInvoiceTime:
          type: boolean
          description: "The app's \"Auto Invoice Time\": approved time waiting on this line is swept into the\r\ncontract's recurring invoice. False on a No Labor Terms line."
        IncludedTimeGoesTo:
          $ref: '#/components/schemas/CodeModel'
        UnlimitedHoursDetails:
          $ref: '#/components/schemas/UnlimitedHoursDetailsModel'
        PerHourDetails:
          $ref: '#/components/schemas/PerHourDetailsModel'
        LimitedHoursDetails:
          $ref: '#/components/schemas/LimitedHoursDetailsModel'
        BlockHoursDetails:
          $ref: '#/components/schemas/BlockHoursDetailsModel'
        RecurringAmount:
          type: number
          description: Recurring amount this service line bills each period, before tax.
          format: double
        RecurringCost:
          type: number
          description: >-
            Recurring cost of this service line's recurring products each
            period.
          format: double
        LineItems:
          type: array
          items:
            $ref: '#/components/schemas/ContractLineItemModel'
          description: "The actual products/labor billed on this line. Empty array when nothing is billed on it\r\nyet; never null."
      additionalProperties: false
      description: >-
        One service line inside a contract, with the products/labor billed on
        it.
    ContractCustomRatesInput:
      type: object
      properties:
        WorkRoles:
          type: array
          items:
            $ref: '#/components/schemas/ContractCustomWorkRoleRateInput'
          nullable: true
        WorkTypes:
          type: array
          items:
            $ref: '#/components/schemas/ContractCustomWorkTypeRateInput'
          nullable: true
      additionalProperties: false
      description: "Overrides for the Custom labor rates grid. The line starts from every billing role and work type\r\nat the service provider's own rates; only the rows sent here change. On PATCH, entries merge by\r\nid into the line's existing rows."
    UnlimitedHoursDetailsModel:
      type: object
      additionalProperties: false
      description: "Nothing is specific to an Unlimited Hours line today. `AutoApprove` moved to the service\r\nline as `AutoApproveTime` (ENG-7288)."
    PerHourDetailsModel:
      type: object
      properties:
        RateType:
          $ref: '#/components/schemas/CodeModel'
        HourlyRate:
          type: number
          description: >-
            The flat rate charged per hour. Set only when `RateType` is Fixed;
            null otherwise.
          format: double
          nullable: true
        CustomRates:
          $ref: '#/components/schemas/ContractCustomRatesModel'
      additionalProperties: false
    LimitedHoursDetailsModel:
      type: object
      properties:
        ShowRemainingHoursInClientPortal:
          type: boolean
          description: >-
            Whether the client portal shows the client the hours left in the
            allocation.
        AllocatedHours:
          type: number
          description: Hours included each billing period.
          format: double
          nullable: true
        RateType:
          $ref: '#/components/schemas/CodeModel'
        HourlyRate:
          type: number
          description: >-
            The flat rate charged per hour. Set only when `RateType` is Fixed;
            null otherwise.
          format: double
          nullable: true
        CustomRates:
          $ref: '#/components/schemas/ContractCustomRatesModel'
      additionalProperties: false
    BlockHoursDetailsModel:
      type: object
      properties:
        ShowRemainingHoursInClientPortal:
          type: boolean
          description: >-
            Whether the client portal shows the client the hours left in the
            block.
        TemplateId:
          type: integer
          description: >-
            The Block Hours Template the block was created from. 0 means Custom:
            no template applies.
          format: int64
        Balance:
          type: number
          description: The block's total balance, in hours.
          format: double
          nullable: true
        WarningThreshold:
          type: number
          description: "Percentage of the block left at which a low-balance warning is raised, a whole number from\r\n0 to 90. Earlier documented as hours, which it never was."
          format: double
          nullable: true
        OverrunThreshold:
          type: number
          description: "Percentage of the block the client may run past zero before the block counts as overrun, a\r\nwhole number from 0 to 50. Earlier documented as hours, which it never was."
          format: double
          nullable: true
      additionalProperties: false
    ContractLineItemModel:
      type: object
      properties:
        Id:
          type: integer
          description: Identifier of this line.
          format: int64
        ItemId:
          type: string
          description: "The catalog item this line bills, resolving against `GET /v1/items`. Null for a line\r\nthat does not reference a catalog item."
          format: uuid
          nullable: true
        ItemType:
          $ref: '#/components/schemas/CodeModel'
        Name:
          type: string
          description: Name of the line as billed.
        Description:
          type: string
          description: Description of the line as billed, if any.
          nullable: true
        Quantity:
          type: number
          description: Quantity billed.
          format: double
          nullable: true
        UnitCost:
          type: number
          description: >-
            Unit cost of the line. Renamed from `Cost` (ENG-7288), the name
            items and invoice lines use.
          format: double
          nullable: true
        UnitPrice:
          type: number
          description: Unit price charged.
          format: double
        DiscountPercent:
          type: number
          description: Discount percentage applied to this line, 0-100.
          format: double
          nullable: true
        StartDate:
          type: string
          description: >-
            Date this line's coverage starts, if it is date-scoped. A calendar
            date.
          format: date
          nullable: true
        EndDate:
          type: string
          description: >-
            Date this line's coverage ends, if it is date-scoped. A calendar
            date.
          format: date
          nullable: true
        Tax:
          $ref: '#/components/schemas/CodeModel'
        Amount:
          type: number
          description: Line total after discount, before tax.
          format: double
        TaxAmount:
          type: number
          description: Tax on this line.
          format: double
          nullable: true
        BillableStatus:
          $ref: '#/components/schemas/CodeModel'
      additionalProperties: false
      description: One product, bundle or labor charge billed on a contract's service line.
    ContractCustomWorkRoleRateInput:
      type: object
      properties:
        WorkRoleId:
          type: integer
          description: The billing role this row prices. Required.
          format: int64
          nullable: true
          example: 12
        HourlyRate:
          type: number
          description: Rate per hour. Left out, the current rate is kept.
          format: double
          nullable: true
          example: 95
        CoaCode:
          type: string
          description: Accounting code. Left out, the current code is kept.
          nullable: true
          example: '270'
      additionalProperties: false
    ContractCustomWorkTypeRateInput:
      type: object
      properties:
        WorkTypeId:
          type: integer
          description: The work type this row prices. Required.
          format: int64
          nullable: true
          example: 176
        HourlyMultiplier:
          type: number
          description: >-
            Multiplier on the role's rate. Left out, the current multiplier is
            kept.
          format: double
          nullable: true
          example: 1.5
        CoaCode:
          type: string
          description: Accounting code. Left out, the current code is kept.
          nullable: true
          example: '200'
      additionalProperties: false
    ContractCustomRatesModel:
      type: object
      properties:
        WorkRoles:
          type: array
          items:
            $ref: '#/components/schemas/ContractCustomWorkRoleRateModel'
          description: The rate per billing role.
        WorkTypes:
          type: array
          items:
            $ref: '#/components/schemas/ContractCustomWorkTypeRateModel'
          description: The multiplier per work type.
      additionalProperties: false
      description: >-
        The Custom labor rates grid of a Per Hour or Limited Hours line: one row
        per billing role and per work type.
    ContractCustomWorkRoleRateModel:
      type: object
      properties:
        WorkRoleId:
          type: integer
          description: The billing role.
          format: int64
        HourlyRate:
          type: number
          description: Rate charged per hour for this role on this line.
          format: double
        CoaCode:
          type: string
          description: Accounting code the role's time is posted to. Null when not set.
          nullable: true
      additionalProperties: false
    ContractCustomWorkTypeRateModel:
      type: object
      properties:
        WorkTypeId:
          type: integer
          description: The work type.
          format: int64
        HourlyMultiplier:
          type: number
          description: >-
            Multiplier applied to the role's rate for this work type on this
            line.
          format: double
        CoaCode:
          type: string
          description: >-
            Accounting code the work type's time is posted to. Null when not
            set.
          nullable: true
      additionalProperties: false
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      description: >-
        Your Gorelo API key. See [Generate API key](/generate-api-key). If your
        data is hosted in Australia, click the base URL at the top of this page
        and select `https://api.aue.gorelo.io`.
      name: X-API-Key
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.