---
updatedAt: 2026-08-18T18:39:20.000Z
agentTools:
  projectIndex: https://stockpit.readme.io/llms.txt
---

# Queries

Company queries return the company of the current user as well as partner companies.

# Available queries

### `Company` - Returns the company of the current user

```graphql
query {
  Company {
    id
    label
    currency {
      id
      label
    }
    address {
      city
    }
  }
}
```

### `PartnerCompany` - Returns a single partner company based on the `id` provided

```graphql
query {
  PartnerCompany (id: 100012) {
    id
    label
    partner_id
    status
  }
}
```

### `PartnerCompanies` - Returns a list of partner companies based on the filters defined

```graphql
query {
  PartnerCompanies {
    data {
      id
      label
      partner_id
      status
    }
  }
}
```

<br/>

***

# Available fields

| id <span style={{ fontWeight: "normal" }}>- [Int](/reference/data-types#int) </span> |
| :----------------------------------------------------------------------------------- |
| Unique identifier of the company                                                     |

| label <span style={{ fontWeight: "normal" }}>- [String](/reference/data-types#string)</span> |
| :------------------------------------------------------------------------------------------- |
| Name of the company                                                                          |

| currency <span style={{ fontWeight: "normal" }}>- [Currency](/reference/currency-queries)</span> |
| :----------------------------------------------------------------------------------------------- |
| Currency of the company                                                                          |

| user\_profiles <span style={{ fontWeight: "normal" }}>- Array of [UserProfile](/reference/user-profile-queries)</span> |
| :--------------------------------------------------------------------------------------------------------------------- |
| User profiles associated with the company                                                                              |

| address <span style={{ fontWeight: "normal" }}>- [Address](/reference/address-queries)</span> |
| :-------------------------------------------------------------------------------------------- |
| Address of the company                                                                        |

| logo <span style={{ fontWeight: "normal" }}>- [File](/reference/file-queries)</span> |
| :----------------------------------------------------------------------------------- |
| Logo of the company                                                                  |

| billing <span style={{ fontWeight: "normal" }}>- [String](/reference/data-types#string)</span> |
| :--------------------------------------------------------------------------------------------- |
| Billing information of the company                                                             |

| partner\_id <span style={{ fontWeight: "normal" }}>- [String](/reference/data-types#string)</span> |
| :------------------------------------------------------------------------------------------------- |
| Unique identifier of the partner                                                                   |

| phone <span style={{ fontWeight: "normal" }}>- [String](/reference/data-types#string)</span> |
| :------------------------------------------------------------------------------------------- |
| Phone number of the company                                                                  |

| vat\_number <span style={{ fontWeight: "normal" }}>- [String](/reference/data-types#string)</span> |
| :------------------------------------------------------------------------------------------------- |
| VAT number of the company                                                                          |

| status <span style={{ fontWeight: "normal" }}>- [String](/reference/data-types#string)</span> |
| :-------------------------------------------------------------------------------------------- |
| Current status of the company                                                                 |

| created\_at <span style={{ fontWeight: "normal" }}>- [DateTime](/reference/data-types#datetime)</span> |
| :----------------------------------------------------------------------------------------------------- |
| Creation date of the company                                                                           |

| global\_message <span style={{ fontWeight: "normal" }}>- [String](/reference/data-types#string)</span> |
| :----------------------------------------------------------------------------------------------------- |
| Global message displayed for the company                                                               |

| trial\_days <span style={{ fontWeight: "normal" }}>- [Int](/reference/data-types#int) </span> |
| :-------------------------------------------------------------------------------------------- |
| Number of trial days of the company                                                           |

| trial\_days\_left <span style={{ fontWeight: "normal" }}>- [Int](/reference/data-types#int) </span> |
| :-------------------------------------------------------------------------------------------------- |
| Number of trial days left for the company                                                           |

| active <span style={{ fontWeight: "normal" }}>- [Boolean](/reference/data-types#boolean)</span> |
| :---------------------------------------------------------------------------------------------- |
| If true, the company is active                                                                  |

| frozen <span style={{ fontWeight: "normal" }}>- [Boolean](/reference/data-types#boolean)</span> |
| :---------------------------------------------------------------------------------------------- |
| If true, the company is frozen                                                                  |

| discount\_ends\_at <span style={{ fontWeight: "normal" }}>- [String](/reference/data-types#string)</span> |
| :-------------------------------------------------------------------------------------------------------- |
| End date of the company discount                                                                          |

| payment\_method <span style={{ fontWeight: "normal" }}>- [JSON](/reference/data-types#json)</span> |
| :------------------------------------------------------------------------------------------------- |
| Payment method of the company                                                                      |

| partner\_clients <span style={{ fontWeight: "normal" }}>- Array of [Company](/reference/company-queries)</span> |
| :-------------------------------------------------------------------------------------------------------------- |
| Partner clients of the company                                                                                  |

| settings <span style={{ fontWeight: "normal" }}>- Array of [Setting](/reference/company-queries#setting-data-type)</span> |
| :------------------------------------------------------------------------------------------------------------------------ |
| Settings of the company                                                                                                   |

| valuation <span style={{ fontWeight: "normal" }}>- [Float](/reference/data-types#float)</span> |
| :--------------------------------------------------------------------------------------------- |
| Computed total valuation of the company stock                                                  |

| last\_12\_months\_valuation <span style={{ fontWeight: "normal" }}>- [JSON](/reference/data-types#json)</span> |
| :------------------------------------------------------------------------------------------------------------- |
| Valuation of the company over the last 12 months                                                               |

| onboarding <span style={{ fontWeight: "normal" }}>- [Int](/reference/data-types#int) </span> |
| :------------------------------------------------------------------------------------------- |
| Onboarding step of the company                                                               |

| invoices <span style={{ fontWeight: "normal" }}>- [JSON](/reference/data-types#json)</span> |
| :------------------------------------------------------------------------------------------ |
| Invoices of the company                                                                     |

| available\_plans <span style={{ fontWeight: "normal" }}>- [JSON](/reference/data-types#json)</span> |
| :-------------------------------------------------------------------------------------------------- |
| Available subscription plans for the company                                                        |

| plan <span style={{ fontWeight: "normal" }}>- [JSON](/reference/data-types#json)</span> |
| :-------------------------------------------------------------------------------------- |
| Current plan of the company                                                             |

| subscriptions <span style={{ fontWeight: "normal" }}>- [JSON](/reference/data-types#json)</span> |
| :----------------------------------------------------------------------------------------------- |
| List of the company subscriptions                                                                |

| subscription <span style={{ fontWeight: "normal" }}>- [JSON](/reference/data-types#json)</span> |
| :---------------------------------------------------------------------------------------------- |
| Last subscription of the company                                                                |

| customer <span style={{ fontWeight: "normal" }}>- [JSON](/reference/data-types#json)</span> |
| :------------------------------------------------------------------------------------------ |
| Billing customer information of the company                                                 |

| default\_location <span style={{ fontWeight: "normal" }}>- [Location](/reference/location-queries)</span> |
| :-------------------------------------------------------------------------------------------------------- |
| Default location of the company                                                                           |

| company\_owner\_id <span style={{ fontWeight: "normal" }}>- [Int](/reference/data-types#int) </span> |
| :--------------------------------------------------------------------------------------------------- |
| ID of the owner of the company                                                                       |

| company\_owner <span style={{ fontWeight: "normal" }}>- [UserProfile](/reference/user-profile-queries)</span> |
| :------------------------------------------------------------------------------------------------------------ |
| Owner of the company                                                                                          |

<br/>

***

# Filters

You can create filters based on following fields

| id                                                                 |
| :----------------------------------------------------------------- |
| Example: \{ "column" : "ID", "operator" : "EQ", "value" : 100012 } |

| label                                                                        |
| :--------------------------------------------------------------------------- |
| Example: \{ "column" : "LABEL", "operator" : "LIKE", "value" : "%Company%" } |

| status                                                                   |
| :----------------------------------------------------------------------- |
| Example: \{ "column" : "STATUS", "operator" : "EQ", "value" : "active" } |

***

# Sorting

You can sort data based on following fields : id, label

```graphql
query PartnerCompanies(
  $orderBy: [QueryPartnerCompaniesOrderByOrderByClause!],
  $first: Int = 50, 
  $page: Int
) {
  PartnerCompanies(
    orderBy: $orderBy
    first: $first
    page: $page
  ) {
    paginatorInfo {
      total
    }
    data {
      id
      label
      status
    }
  }
}
```

```json Variables (JSON)
{
  "orderBy": [
    {
      "column": "LABEL",
      "order": "ASC"
    }
  ],
  "first": 50,
  "page": 1
}
```

## Example of a query

```graphql
query PartnerCompanies(
  $where: QueryPartnerCompaniesWhereWhereConditions, 
  $first: Int = 50, 
  $page: Int
) {
  PartnerCompanies(
    where: $where
    first: $first
    page: $page
  ) {
    paginatorInfo {
      total
      count
      currentPage
      perPage
    }
    data {
      id
      label
      status
    }
  }
}
```

```json
{
  "first": 50,
  "page": 1,
  "where": {
    "AND": [
      {
        "AND": [
          {
            "column": "STATUS",
            "operator": "EQ",
            "value": "active"
          }
        ]
      }
    ]
  }
}
```

## Example of data returned

```json
{
  "data": {
    "PartnerCompanies": {
      "paginatorInfo": {
        "total": 1,
        "count": 1,
        "currentPage": 1,
        "perPage": 50
      },
      "data": [
        {
          "id": 100012,
          "label": "Partner Company",
          "status": "active"
        }
      ]
    }
  }
}
```

# Data types

## Setting data type

| label <span style={{ fontWeight: "normal" }}>- [String](/reference/data-types#string) </span> |
| :-------------------------------------------------------------------------------------------- |
| Label of the setting                                                                          |

| value <span style={{ fontWeight: "normal" }}>- [JSON](/reference/data-types#json) </span> |
| :---------------------------------------------------------------------------------------- |
| Value of the setting                                                                      |