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

# List a contract's line items

> Lists what one contract charges for, oldest first, a deleted contract included: under the contract's current amendment, or under the amendment named by `amendmentId`. A line item keeps its id across amendments, so comparing two amendments' lists by id shows what changed. A contract of another entity, or an amendment that is not one of the contract's, has none. Page with `limit` and the cursors from the previous page; `hasMore` says whether more rows lie in the direction being read. Keep the same contract and `amendmentId` for the whole run. Needs a key holding `contracts:read`.



## OpenAPI

````yaml https://app.synthetic.ai/api/v1/openapi.json get /contract-line-items
openapi: 3.1.0
info:
  title: Synthetic API
  description: Read access to your Synthetic data.
  version: 0.1.0
servers:
  - url: https://app.synthetic.ai/api/v1
security: []
paths:
  /contract-line-items:
    get:
      tags:
        - Contracts
      summary: List a contract's line items
      description: >-
        Lists what one contract charges for, oldest first, a deleted contract
        included: under the contract's current amendment, or under the amendment
        named by `amendmentId`. A line item keeps its id across amendments, so
        comparing two amendments' lists by id shows what changed. A contract of
        another entity, or an amendment that is not one of the contract's, has
        none. Page with `limit` and the cursors from the previous page;
        `hasMore` says whether more rows lie in the direction being read. Keep
        the same contract and `amendmentId` for the whole run. Needs a key
        holding `contracts:read`.
      operationId: contractLineItems-list
      parameters:
        - in: query
          name: contractId
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
            description: The contract whose line items to list.
          required: true
          description: The contract whose line items to list.
        - in: query
          name: amendmentId
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
            description: >-
              One of this contract's amendments, to list the line items as that
              amendment states them, for example the id of the contract's
              futureAmendment, or its draftAmendmentId. Leave it out for the
              contract's current amendment.
        - in: query
          name: startingAfter
          schema:
            type: string
            minLength: 1
            maxLength: 1024
            pattern: ^[A-Za-z0-9._-]+$
            description: The nextCursor of the previous page, to read the page after it.
        - in: query
          name: endingBefore
          schema:
            type: string
            minLength: 1
            maxLength: 1024
            pattern: ^[A-Za-z0-9._-]+$
            description: The prevCursor of the previous page, to read the page before it.
        - in: query
          name: limit
          schema:
            default: 50
            description: Rows per page, 1 to 100.
            type: integer
            minimum: 1
            maximum: 100
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ContractLineItem'
                  hasMore:
                    type: boolean
                  nextCursor:
                    type: string
                  prevCursor:
                    type: string
                required:
                  - data
                  - hasMore
                additionalProperties: false
        '400':
          description: Input validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.BAD_REQUEST'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.UNAUTHORIZED'
        '500':
          description: An unexpected error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR'
      security:
        - BearerAuth: []
components:
  schemas:
    ContractLineItem:
      type: object
      properties:
        id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          description: >-
            The line item's id. It is the same in every amendment of the
            contract, and invoice lines name it as contractLineItemId.
        contractId:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        type:
          type: string
          enum:
            - SUBSCRIPTION
            - ONE_TIME
          description: >-
            SUBSCRIPTION: charged every cadence period. ONE_TIME: a fee charged
            once.
        amount:
          type: object
          properties:
            value:
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            currencyCode:
              type: string
              enum:
                - USD
                - CAD
                - EUR
                - USDC
          required:
            - value
            - currencyCode
          additionalProperties: false
          description: >-
            What the line item charges each cadence period for a SUBSCRIPTION,
            or once for a ONE_TIME. When a later amendment keeps a ONE_TIME fee,
            amount is still the whole fee, and that amendment charges only the
            part not billed yet. Its value is a whole number of the currency's
            smallest unit.
        description:
          type: string
          description: >-
            What the line item is for. It is set when the line item is added to
            the contract and stays the same in every amendment.
        revenueGeneralLedgerAccountId:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          description: >-
            The id of the general ledger account the line item's revenue is
            recognized in.
        cadence:
          anyOf:
            - type: string
              enum:
                - MONTHLY
                - QUARTERLY
                - SEMI_ANNUAL
                - ANNUAL
            - type: 'null'
          description: How often a SUBSCRIPTION is charged; null for a ONE_TIME.
        recognitionMode:
          type: string
          enum:
            - OVER_BILLING_PERIOD
            - OVER_CONTRACT_PERIOD
          description: >-
            How the revenue of each charge is spread over time.
            OVER_BILLING_PERIOD: over the days the charge bills for.
            OVER_CONTRACT_PERIOD: over the dates of the amendment it is billed
            under.
        createdAt:
          description: When the line item was first added to the contract.
          type: string
        updatedAt:
          type: string
      required:
        - id
        - contractId
        - type
        - amount
        - description
        - revenueGeneralLedgerAccountId
        - cadence
        - recognitionMode
        - createdAt
        - updatedAt
      additionalProperties: false
      description: >-
        Something a contract charges the customer for: a subscription charged
        every cadence period, or a one-time fee.
    error.BAD_REQUEST:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Input validation failed
        code:
          type: string
          description: The error code
          example: BAD_REQUEST
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
      title: Input validation failed error (400)
      description: The error information
      example:
        code: BAD_REQUEST
        message: Input validation failed
        issues: []
    error.UNAUTHORIZED:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Unauthorized
        code:
          type: string
          description: The error code
          example: UNAUTHORIZED
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
      title: Unauthorized error (401)
      description: The error information
      example:
        code: UNAUTHORIZED
        message: Unauthorized
        issues: []
    error.INTERNAL_SERVER_ERROR:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: An unexpected error occurred.
        code:
          type: string
          description: The error code
          example: INTERNAL_SERVER_ERROR
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
      title: An unexpected error occurred. error (500)
      description: The error information
      example:
        code: INTERNAL_SERVER_ERROR
        message: An unexpected error occurred.
        issues: []
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 'An API key created in Settings, sent as `Authorization: Bearer <key>`.'

````

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