Light APIv1.0.0

API / Reference / Contracts

List contracts

GET https://api.light.inc/v1/contracts

Returns a paginated list of contracts

Authorization

Send one of these on every request. See Authentication for how to get credentials.

  • API key

    Basic authentication header of the form Basic <api_key>, where <api_key> is your api key.

  • Bearer token

Query parameters

  • sort string

    Sort string in the format field:direction. To provide multiple sort fields, separate them with commas.

    Available directions: asc, desc.

    Available fields: activatedAt, companyEntityId, companyEntityName, createdAt, customerId, customerName, description, endDate, estimatedAmount, renewalDate, startDate, state, terminatedAt.

  • filter string

    Filter string in the format field:operator:value. To provide multiple filters, separate them with commas.

    Available operators: eq, ne, in, not_in, gt, gte, lt, lte.

    • For in and not_in operators, provide multiple values separated by the pipe character (|).
  • limit integer · int32

    Maximum number of items to return. Default is 50, maximum is 200.

  • offset integer · int64deprecated

    Number of items to skip before starting to collect the result set. Deprecated, use 'cursor' instead.

  • cursor string

    The cursor position to start returning results from. To opt-in into cursor-based pagination, provide 0 for the initial request. For subsequent requests, use nextCursor and prevCursor from the previous response to navigate. Cursor values are opaque and should not be constructed manually.

Response

  • records array of object

    List of records for the current page

    • id string · uuid

      Unique identifier for the object

    • companyId string · uuid

      ID of the company

    • startDate string · date

      Contract start date

    • endDate string · date

      Contract end date

    • activatedAt string · date-time

      Timestamp when the contract was activated/published

    • terminatedAt string · date-time

      Timestamp when the contract was terminated

    • terminationReason string

      Reason for contract termination

    • terminationReasonType string

      Categorized reason for contract termination

      • FINISHED - Contract ran to its natural end
      • OTHER - Terminated for another reason, described in terminationReason
      • RENEWED - Contract ended because it was renewed into a new contract

      ⚠️ This enum is not exhaustive; new values may be added in the future.

      One of FINISHED OTHER RENEWED

    • renewalDate string · date

      Date when the contract should be renewed

    • companyEntityId string · uuid

      ID of the entity

    • invoiceTemplateId string · uuid

      ID of the invoice template to use for generating invoices

    • currency string

    • estimatedAmount integer · int64

      Estimated total amount for the contract in cents

    • paymentType string

      Payment type for invoices generated from this contract

      • AIRWALLEX - Payment via Airwallex. A payment link will be displayed on the invoice
      • BANK_TRANSFER - Payment via bank transfer. Bank information will be displayed on the invoice
      • DIRECT_DEBIT - Payment via direct debit. A notice that the amount will be collected automatically will be displayed on the invoice
      • STRIPE - Payment via Stripe. A payment link will be sent to the customer

      ⚠️ This enum is not exhaustive; new values may be added in the future.

      One of AIRWALLEX BANK_TRANSFER DIRECT_DEBIT STRIPE

    • payeeBankAccountId string · uuid

      ID of the bank account where payments should be sent

    • billingStart string · date

      Date when billing should start for this contract

    • netTerms integer · int32

      Number of days from invoice date to when payment is due

    • invoiceLeadDays integer · int32

      Number of days before billing period start to date the invoice

    • description string

      Description of the contract

    • customerId string · uuid

      ID of the customer

    • state string

      Current state of the contract

      • CREATED - Contract has been created
      • DRAFT - Contract is in draft state and can be edited
      • ACTIVE - Contract is active and generating invoices
      • PENDING_TERMINATION - Contract has a scheduled termination
      • TERMINATED - Contract has been terminated

      ⚠️ This enum is not exhaustive; new values may be added in the future.

      One of CREATED DRAFT ACTIVE PENDING_TERMINATION TERMINATED

    • areLinesWithTax boolean

      Whether invoice line amounts include tax or tax is added on top

    • lines array of object

      List of contract line items. Only returned when fetching a single contract by ID

      • id string · uuid

        Unique identifier for the object

      • companyId string · uuid

        ID of the company

      • contractId string · uuid

        ID of the contract this line belongs to

      • productId string · uuid

        ID of the product

      • billingStart string · date

        Date when billing starts for this line

      • billingEnd string · date

        Date when billing ends for this line

      • billingRecurrence string

        Billing frequency for this line

        • ONE_TIME - The product is billed once
        • MONTHLY - The product is billed every month
        • QUARTERLY - The product is billed every three months
        • HALF_YEARLY - The product is billed every six months
        • YEARLY - The product is billed every year

        ⚠️ This enum is not exhaustive; new values may be added in the future.

        One of ONE_TIME MONTHLY QUARTERLY HALF_YEARLY YEARLY

      • accountId string · uuid

        ID of the account for bookkeeping

      • taxCodeId string · uuid

        ID of the tax code

      • avataxCode string

        Avalara tax code

      • discount object

        Discount to apply to this line (can be percentage or amount-based)

        • startDate string · date

        • endDate string · date

        • type string

          ⚠️ This enum is not exhaustive; new values may be added in the future.

          One of PERCENTAGE AMOUNT

      • quantity number

        Quantity of the product

      • priceOverwrite integer · int64

        Custom price override in cents

      • productNameOverwrite string

        Custom product name override

      • amortizationTemplateId string · uuid

        ID of the amortization template

      • amortizationStartDate string · date

        Start date for amortization

      • amortizationEndDate string · date

        End date for amortization

      • aiValueSuggestions array of object

        AI-generated suggestions for this line

        • field string

        • fieldValues array of string

        • reasoning string

      • customProperties array of object

        List of custom properties associated with the line

        • groupId string · uuid

          ID of the custom property group

        • groupInternalName string

          Internal name of the custom property group

        • values array of object

          List of values. Note that this will be a single value unless the group input type supports multiple values

          • id string · uuid

            Unique identifier for the object

          • groupId string · uuid

            ID of the custom property group

          • groupInternalName string

            Internal name of the custom property group

          • companyId string · uuid

            ID of the company

          • internalName string

            Internal name of the custom property value

          • label string

            Label of the custom property value

          • context string

            Context/description of the custom property value

          • createdAt string · date-time

            Timestamp when the custom property value was created

          • updatedAt string · date-time

            Timestamp when the custom property value was last updated

      • createdAt string · date-time

        Timestamp when the line was created

      • updatedAt string · date-time

        Timestamp when the line was last updated

    • taxEngineName string

      Name of the tax engine to be used

      • AVATAX - Avalara AvaTax will be used for tax calculations
      • LIGHT - Light built-in tax engine will be used for tax calculations
      • SPHERE - Sphere tax engine will be used for tax calculations

      ⚠️ This enum is not exhaustive; new values may be added in the future.

      One of AVATAX LIGHT SPHERE

    • externalId string

      External identifier from an external system

    • externalSource string

      Source system if contract was synced from an external system

      • HUBSPOT - Contract synced from HubSpot
      • SALESFORCE - Contract synced from Salesforce

      ⚠️ This enum is not exhaustive; new values may be added in the future.

      One of HUBSPOT SALESFORCE

    • customProperties array of object

      List of custom properties associated with the contract

      • groupId string · uuid

        ID of the custom property group

      • groupInternalName string

        Internal name of the custom property group

      • values array of object

        List of values. Note that this will be a single value unless the group input type supports multiple values

        • id string · uuid

          Unique identifier for the object

        • groupId string · uuid

          ID of the custom property group

        • groupInternalName string

          Internal name of the custom property group

        • companyId string · uuid

          ID of the company

        • internalName string

          Internal name of the custom property value

        • label string

          Label of the custom property value

        • context string

          Context/description of the custom property value

        • createdAt string · date-time

          Timestamp when the custom property value was created

        • updatedAt string · date-time

          Timestamp when the custom property value was last updated

    • createdAt string · date-time

      Timestamp when the contract was created

    • updatedAt string · date-time

      Timestamp when the contract was last updated

  • hasMore boolean

    Boolean flag indicating if there are more records available

  • total integer · int64deprecated

    Total number of records (only for offset pagination). This field is not guaranteed to be returned and only available for offset pagination, please do not rely on it and migrate to cursor pagination.

  • nextCursor string

    Cursor for fetching the next page (only for cursor pagination)

  • prevCursor string

    Cursor for fetching the previous page (only for cursor pagination)