> For the complete documentation index, see [llms.txt](https://developer.flash-payments.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.flash-payments.com/accounts/virtual-account-numbers/query-sub-clients.md).

# Query sub-clients

### Available queries

#### Query for a single sub-client

The `aliases` field lists the sub-client's [PayIDs](/accounts/virtual-account-numbers/sub-client-payids.md). It is resolved separately for every sub-client in a response, so request it only where you need it.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
const bodyJSON = {
  variables: {
    id: "606d28675a2d931bc925fec2",
      input: {
        currencies: ["EUR","USD","HKD","CNY"],
      },
  },
  query: `
query ($id: ID!, $input: FundingAccountQueryInput!) {
  subClient(id: $id) {
    id fullName legalName tradingAsName clientType status 
    primaryContact {
      firstName middleName lastName email dob mobile
    }
    address {
      building street suburb state country postcode
    }
    postalAddress {
      building street suburb state country postcode
    } 
    principals {
      id roles firstName middleName lastName dob
    }
    businessNumber bsb accountNo externalId
    aliases {
      alias aliasType status createdAt
    }
    fundingAccounts(input: $input) {
      iban accountNo bic currency externalReference
    }
  }
}`,
};
```

{% endtab %}

{% tab title="GraphQL Query" %}

```graphql
query($id: ID!, $input: FundingAccountQueryInput!) {
  subClient(id: $id) {
    id
    fullName
    legalName
    tradingAsName
    clientType
    status
    primaryContact {
      firstName
      middleName
      lastName
      email
      dob
      mobile
    }
    address {
      building
      street
      suburb
      state
      country
      postcode
    }
    postalAddress {
      building
      street
      suburb
      state
      country
      postcode
    }
    principals {
      id
      roles
      firstName
      middleName
      lastName
      dob
    }
    businessNumber
    bsb
    accountNo
    externalId
    aliases {
      alias
      aliasType
      status
      createdAt
    }
    fundingAccounts(input: $input) {
      iban
      accountNo
      bic
      currency
      externalReference
    }
  }
}
```

{% endtab %}

{% tab title="Variables" %}

```javascript
{ 
  "id": "606d28675a2d931bc925fec2",
  "input": {
    "currencies": ["EUR", "USD", "HKD", "CNY"] 
  }
}
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
  "data": {
    "subClient": {
      "id": "606d28675a2d931bc925fec2",
      "fullName": "ACME Corp",
      "legalName": "ACME Corp",
      "tradingAsName": null,
      "clientType": "COMPANY",
      "status": "ACTIVE",
      "primaryContact": {
        "firstName": "John",
        "middleName": null,
        "lastName": "Smith",
        "email": "john.smith@example.com",
        "dob": "1980-12-12",
        "mobile": "+61 422 832 849"
      },
      "address": {
        "building": "25",
        "street": "Moore St",
        "suburb": "Waterloo",
        "state": "NSW",
        "country": "AU",
        "postcode": "2017"
      },
      "postalAddress": {
        "building": "25",
        "street": "Moore St",
        "suburb": "Waterloo",
        "state": "NSW",
        "country": "AU",
        "postcode": "2017"
      },
      "principals": [
        {
          "id": "68d4c3a1f2b9e07c4d1a5b11",
          "roles": ["DIRECTOR", "ULTIMATE_BENEFICIAL_OWNER"],
          "firstName": "John",
          "middleName": null,
          "lastName": "Smith",
          "dob": "1980-12-12"
        },
        {
          "id": "68d4c3a1f2b9e07c4d1a5b12",
          "roles": ["BENEFICIAL_OWNER"],
          "firstName": "Jane",
          "middleName": null,
          "lastName": "Smith",
          "dob": null
        }
      ],
      "businessNumber": "91383840265",
      "bsb": "802919",
      "accountNo": "1066419",
      "externalId": "991188227733",
      "aliases": [
        {
          "alias": "acme-corp@example.com",
          "aliasType": "EMAIL",
          "status": "ACTIVE",
          "createdAt": "2026-10-08T01:12:33.481Z"
        }
      ]
    }
  }
}
```

{% endtab %}
{% endtabs %}

#### Query for multiple sub-clients

{% tabs %}
{% tab title="JavaScript" %}

```javascript
const bodyJSON = {
  variables: {
    input: {
    },
  },
  query: `
query ($input: SubClientQueryInput!) {
  subClients(input: $input) {   
    id fullName legalName clientType status businessNumber
    bsb accountNo externalId
  }
}`,
};  
```

{% endtab %}

{% tab title="GraphQL Query" %}

```graphql
query($input: SubClientQueryInput!){
  subClients(input: $input) {
    id
    fullName
    legalName
    clientType
    status
    businessNumber
    bsb
    accountNo
    externalId
    # any other set of properties
  }
}
```

{% endtab %}

{% tab title="Variables" %}

```javascript
 {
 "input": {
  }
}
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
  "data": {
    "subClients": [
      {
        "id": "5fb314cb9224595df522db61",
        "fullName": "Richard Smith",
        "legalName": null,
        "clientType": "INDIVIDUAL",
        "status": "ACTIVE",
        "businessNumber": null,
        "bsb": "802919",
        "accountNo": "1963041",
        "externalId": null
      },
      {
        "id": "60612f00a4d7dd5c96e37676",
        "fullName": "ABC Capital",
        "legalName": "ABC Co",
        "clientType": "COMPANY",
        "status": "ACTIVE",
        "businessNumber": "839399923932",
        "bsb": "802919",
        "accountNo": "1914920",
        "externalId": null
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

#### Query for multiple sub-clients with filters

{% tabs %}
{% tab title="JavaSscript" %}

```javascript
const bodyJSON = {
  variables: {
    input: {
      clientType: "INDIVIDUAL",
      status: "ACTIVE",
      firstName: "John",
      lastName: "Smith",
      address: { 
        country: "AU", 
      },
    },
  },
  query: `
query ($input: SubClientQueryInput!) {
  subClients(input: $input) {   
    id fullName clientType status 
    primaryContact {
      firstName lastName
    }
    address {
      country
    }
  }
}`,
};  
```

{% endtab %}

{% tab title="GraphQL Query" %}

```graphql
query($input: SubClientQueryInput!){
  subClients(input: $input) {
    id
    fullName
    clientType
    status   
    primaryContact {
      firstName
      lastName
    }
    address {
      country
    }
    # any other set of properties
  }
}
```

{% endtab %}

{% tab title="Variables" %}

<pre class="language-graphql"><code class="lang-graphql">{   
# more filters available, see SubClientQueryInput in API schema
<strong>  "input": {
</strong>    "clientType": "INDIVIDUAL",
    "status": "ACTIVE",
    "firstName": "John",
    "lastName": "Smith",
    "address": { 
      "country": "AU" 
    }
  }
}
</code></pre>

{% endtab %}

{% tab title="Response" %}

```javascript
{
  "data": {
    "subClients": [
      {
        "id": "5fb314cb9224595df522db61",
        "fullName": "John Smith",
        "clientType": "INDIVIDUAL",
        "status": "ACTIVE",
        "primaryContact": {
          "firstName": "John",
          "lastName": "Smith"
        },
        "address": {
          "country": "AU"
        }
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.flash-payments.com/accounts/virtual-account-numbers/query-sub-clients.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
