# Attach Bank to a Sub-Account

<mark style="color:green;">`POST`</mark> `https://api.oneappgo.com/v1/business/addbank-subaccount`

#### Headers

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

#### Request Body

| Name       | Type   | Description                                                                                                                    |
| ---------- | ------ | ------------------------------------------------------------------------------------------------------------------------------ |
| trackingid | string | Customer tracking id from the create account endpoint response                                                                 |
| bankname   | string | Your preffered bank from the list of available partner banks.  List of available banks are:  providus, 9psb, polaris, fidelity |
|            |        |                                                                                                                                |

Take a look at how you might do this:

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

```json
curl --location 'https://api.oneappgo.com/v1/business/addbank-subaccount' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer SECRE_KEY' \
--data-raw '{
    "trackingid":"00104K0000000",
    "bankname":"providus"
}'
```

{% endcode %}
{% endtab %}

{% tab title="NodeJS" %}

```json
const axios = require('axios');
let data = JSON.stringify({
  "trackingid":"00104K0000000",
  "bankname":"providus"
});

let config = {
  method: 'post',
  url: 'https://api.oneappgo.com/v1/business/addbank-subaccount',
  headers: { 
    'Content-Type': 'application/json', 
    'Authorization': 'Bearer SECRET_KEY', 
  },
  data : data
};

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/addbank-subaccount',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "trackingid":"00104K0000000",
    "bankname":"providus"
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Bearer SECRET_KEY'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```

{% endtab %}
{% endtabs %}

### Sample Response

{% tabs %}
{% tab title="200: OK " %}
{% code overflow="wrap" %}

```json5
{
    "status":true,
    "message":"Providus Account Successfully Generated",
    "trackingid":"00104K0000000"
}
```

{% endcode %}
{% endtab %}
{% endtabs %}
