---
title: "Available companies"
description: "Retrieve a list of companies available to an authenticated user using the availableCompanies GraphQL field, with optional filtering and sorting arguments."
lang: en
languages:
  en: https://docs.vismasoftware.no/businessnxtapi/apireference/schema/companies/index.md
lastmod: 2026-07-10
---

> Documentation index: https://docs.vismasoftware.no/businessnxtapi/apireference/schema/llms.txt


# Available companies

Last modified July 10, 2026

> Retrieve a list of companies available to an authenticated user using the availableCompanies GraphQL field, with optional filtering and sorting arguments.


The list of companies available to the authenticated user is available with a special field available under the `Query` type. This field is called `availableCompanies`. It is similar to the connection types seen so far, except that the `pageInfo` field is missing.

![availableCompanies field](https://docs.vismasoftware.no/businessnxtapi/apireference/schema/availablecompanies.png)

Here is a query example:

```graphql { title = "Query" }
{
  availableCompanies
  {
    totalCount
    items
    {
      name
      vismaNetCompanyId
      vismaNetCustomerId
    }
  }
}
```

```graphql { title = "Result" }
{
  "data": {
    "availableCompanies": {
      "totalCount": 2,
      "items": [
        {
          "name": "Marius Test AS",
          "vismaNetCompanyId": 5280...
          "vismaNetCustomerId": 9123...
        },
        {
          "name": "JAM&WAFFLES",
          "vismaNetCompanyId": 5199...
          "vismaNetCustomerId": 9456...
        }
      ]
    }
  }
}
```

The `availableCompanies` field has several optional arguments:

- an argument called `customerNo` that indicates the Visma.net number of the customer for which available companies should be retrieved
- an argument called `first` that indicates the number of elements to be fetched from the top of the companies list
- an argument called `last` that indicates the number of elements to be fetched from the back of the companies list; if both `first` and `last` are present, `first` is used and `last` is ignored
- an argument called `orderBy` that defines the sorting order of the result
- a deprecated argument called `sortOrder` that defines the sorting order of the result

To fetch companies specific to a particular customer, pass its Visma.net identifier in the `customerNo` parameter, as shown in the following example:

```graphql { title = "Query" }
{
  availableCompanies(customerNo : 12345678)
  {
    totalCount
    items
    {
      name
      vismaNetCompanyId
    }
  }
}
```

```graphql { title = "Result" }
{
  "data": {
    "availableCompanies": {
      "totalCount": 2,
      "items": [
        {
          "name": "Marius Test AS",
          "vismaNetCompanyId": 5280...
        },
        {
          "name": "JAM&WAFFLES",
          "vismaNetCompanyId": 5199...
        }
      ]
    }
  }
}
```

If the `customerNo` parameter is missing, the companies available to all the available customers in the list are returned.

To retrieve the list of available customers see [Available customers](https://docs.vismasoftware.no/businessnxtapi/apireference/schema/customers/index.md).

## Service context

When you authenticate with client credentials (using a client ID and a client secret), fetching the list of available companies requires specifying a customer no (as described earlier).

You can find out the customer number in two ways:

- Authenticate with a Visma.net user and use the `availableCustomers` field to fetch the list (see [Available customers](https://docs.vismasoftware.no/businessnxtapi/apireference/schema/customers/index.md)).
- Retrieve this information from Visma.Net Admin.

To do the latter:

- Logon to <https://adm.visma.net/>
- Open the *Configuration* tab
- Copy the value for *Visma.net Customer ID*

![Visma.Net Admin Configuration](https://docs.vismasoftware.no/businessnxtapi/apireference/schema/vismaadm1.png)

When then customer ID is not provided, an error is returned, as follows:

```json
{
  "errors": [
    {
      "message": "GraphQL.ExecutionError: Could not fetch the list of available companies. Customer number is mandatory."
    }
  ],
  "data": {
    "availableCompanies": null
  },
  "extensions": {
    "vbnxt-trace-id": "..."
  }
}
```


---

[View this page](https://docs.vismasoftware.no/businessnxtapi/apireference/schema/companies/)
