# Get All Sub-Accounts

<mark style="color:green;">`GET`</mark> `https://api.oneappgo.com/v1/business/subaccounts`

#### Headers

| Name                                            | Type   | Description |
| ----------------------------------------------- | ------ | ----------- |
| authorization<mark style="color:red;">\*</mark> | String | SECRET\_KEY |

{% tabs %}
{% tab title="cURL" %}
{% code overflow="wrap" %}

```json
curl --location 'https://api.oneappgo.com/v1/business/subaccounts' \
--header 'Authorization: Bearer SECRET_KEY' \
```

{% endcode %}
{% endtab %}

{% tab title="NodeJS" %}

```json
const axios = require('axios');

let config = {
  method: 'get',
  url: 'https://api.oneappgo.com/v1/business/subaccounts',
  headers: { 
    'Authorization': 'Bearer SECRET_KEY',
  }
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}

{% tab title="PHP - cURL" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.oneappgo.com/v1/business/subaccounts',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer SECRET_KEY'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```

{% endtab %}
{% endtabs %}

### Sample Response

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "status": true,
  "message": "Success",
  "data": [
    
    {
      "name": "Olamide kabiru",
      "email": "ojid@gmail.com",
      "phoneno": "09010029133",
      "balance": "800000.00",
      "customer_code": "",
      "tracking": "00109010029133",
      "smsalert": false,
      "date_created": "04, February 2025",
      "account_number": "",
      "bankname": "",
      "acctname": "",
      "accountstatus": "Active"
    },
    
    {
      "name": "Olajide Olatunji",
      "email": "jide@test.com",
      "phoneno": "07068900000",
      "balance": "1000000.00",
      "customer_code": "00107068900000",
      "tracking": "00107068900000",
      "smsalert": true,
      "date_created": "30, May 2024",
      "account_number": "",
      "bankname": "",
      "acctname": "",
      "accountstatus": "Active"
    },
    {
      "name": "CHRISTOPHER JOY FALANA",
      "email": "",
      "phoneno": "08108048335",
      "balance": "51000.00",
      "customer_code": "BMV-CR-ET-04-0119",
      "tracking": "CRET040119",
      "smsalert": true,
      "date_created": "11, September 2023",
      "account_number": "",
      "bankname": "",
      "acctname": "",
      "accountstatus": "Active"
    }
  ]
}
```

{% endtab %}
{% endtabs %}
