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

# getContracts

> Get all contracts in the environment (across every customer), with offset pagination. Contracts that have a billing contract are enriched with a preview of their upcoming invoice.



**query** `getContracts(input: GetContractsInput!): ContractsPageDTO!`

## Arguments

**`input`**: `GetContractsInput!` (required)

## Returns

`ContractsPageDTO!`

**`contracts`**: `[ContractDTO!]!`

The contracts in this page

---

**`totalCount`**: `Int!`

Total number of contracts across all pages

## Examples

```graphql Query
query GetContracts($input: GetContractsInput!) {
  getContracts(input: $input) {
    contracts {
      activationEndDate
      activationStartDate
      billingId
      billingState
      contractId
      createdAt
    }
    totalCount
  }
}
```

```json Variables
{
  "input": {}
}
```

```json Response
{
  "data": {
    "getContracts": {
      "contracts": [
        {
          "activationEndDate": "value",
          "activationStartDate": "value",
          "billingId": "string",
          "billingState": "ACTIVE",
          "contractId": "string",
          "createdAt": "value"
        }
      ],
      "totalCount": 1
    }
  }
}
```


## Related topics

- [getContract](https://docs.stigg.io/graphql-reference/queries/getContract.md)
- [Go](https://docs.stigg.io/api-and-sdks/changelog/backend-rest/go.md)
- [GetContractInput](https://docs.stigg.io/graphql-reference/types/GetContractInput.md)
- [GetContractsInput](https://docs.stigg.io/graphql-reference/types/GetContractsInput.md)
- [Get contract billing summary](https://docs.stigg.io/api-reference/contracts/get-contract-billing-summary.md)


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