> ## 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.

# Everything about one contract, including each service line's actual products/labor.

> Adds the resolved `Client`, the invoice schedule (`DaysBeforeInvoiceCreation`,
`InvoiceDue`, `AutoApproveAndSend`), `Contacts`, and on each service line one
filled labor-terms-detail object (`UnlimitedHoursDetails`/`PerHourDetails`/
`LimitedHoursDetails`/`BlockHoursDetails`, matching `LaborTerms`) plus
`LineItems` — the actual products/labor billed on that line, empty when there's
nothing billed yet. A non-existent id, or one belonging to another service provider, is a
404.



## OpenAPI

````yaml /api-reference/openapi.json get /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}:
    get:
      tags:
        - Billing
      summary: >-
        Everything about one contract, including each service line's actual
        products/labor.
      description: "Adds the resolved `Client`, the invoice schedule (`DaysBeforeInvoiceCreation`,\r\n`InvoiceDue`, `AutoApproveAndSend`), `Contacts`, and on each service line one\r\nfilled labor-terms-detail object (`UnlimitedHoursDetails`/`PerHourDetails`/\r\n`LimitedHoursDetails`/`BlockHoursDetails`, matching `LaborTerms`) plus\r\n`LineItems` — the actual products/labor billed on that line, empty when there's\r\nnothing billed yet. A non-existent id, or one belonging to another service provider, is a\r\n404."
      operationId: get_v1_contracts_contractId
      parameters:
        - name: contractId
          in: path
          description: Identifier of the contract.
          required: true
          schema:
            type: integer
            format: int64
      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'
        '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'
        '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:
    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
    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
        InvoiceDue:
          type: integer
          description: How many days the client has to pay once invoiced.
          format: int64
        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."
    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.
        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.
    UnlimitedHoursDetailsModel:
      type: object
      properties:
        AutoApprove:
          type: boolean
          description: Whether time logged against this line is approved automatically.
          nullable: true
      additionalProperties: false
    PerHourDetailsModel:
      type: object
      properties:
        RateType:
          $ref: '#/components/schemas/CodeModel'
      additionalProperties: false
    LimitedHoursDetailsModel:
      type: object
      properties:
        RateType:
          $ref: '#/components/schemas/CodeModel'
      additionalProperties: false
    BlockHoursDetailsModel:
      type: object
      properties:
        Balance:
          type: number
          description: The block's total balance, in hours.
          format: double
          nullable: true
        WarningThreshold:
          type: number
          description: Hours remaining before a low-balance warning is raised on the block.
          format: double
          nullable: true
        OverrunThreshold:
          type: number
          description: How far past zero the block may run before it is considered overrun.
          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
        Cost:
          type: number
          description: Unit cost of the line.
          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.
  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.