# Create a Connected Account

### **Creation of a connected businesses/account**

Connected accounts can be created via dashboard and available via API for larger integrations. If you accessing connected accounts via your business dashboard, simply go to connect and select the connected account tab.

#### **Terminologies for connected businesses**

* **`bankName`** and **`accountNumber`**: This refers to the bank account of the connected account while the later refers to the bank code

{% hint style="info" %}
Access [**`get banks`**](/api-reference/banks.md) endpoint here&#x20;
{% endhint %}

* **`businessName`** and **`userMobile`**: This refers to the name of the business and the phone number associated with the business/merchant.&#x20;
* **`splitType`**: this refers to the commission the parent business would like to receive from the connected account. Split types include **`flat`** and **`percentage with cap`**
* **`flat`**: this refers to a flat fee you want to receive from the connected account from each transaction made
  1. to accept a payment of 50 naira for each transaction, **`split_type`** will be **`"flat"`** and **`split_value`** will be **`50`**
  2. to accept a payment of 100 naira for each transaction, **`split_type`** will be **`"flat"`** and **`split_value`** will be **`100`**
* **`percentage with cap`**: this refers to the percentage of the transaction you would like to get as a commission with a cap **`txCap`**(or no cap)
  1. to accept payment of 3% for each transaction with a cap of 2000 naira, **`split_type`** will be **`"percentage with cap"`** and **`split_value`** will be **`0.03`**&#x77;hile **`txCap`** will be **`2000`**
  2. to accept payment of 3% for each transaction with no cap, **`split_type`** will be **`"percentage with cap"`** and **`split_value`** will be **`0.03`**&#x77;hile **`txCap`** will be 0

### Create Connected accounts

Connected accounts can either be created via your business/merchant dashboard or directly via create account endpoint.&#x20;

## Create a Connected Accounts

<mark style="color:green;">`POST`</mark> `https://api2.ourpass.co/v1/api/subaccounts/partial`

This endpoint help businesses to create connected accounts

#### Headers

| Name                                     | Type   | Description                                                   |
| ---------------------------------------- | ------ | ------------------------------------------------------------- |
| apiKey<mark style="color:red;">\*</mark> | String | Pass your api key in the request header to authorise the call |

{% tabs %}
{% tab title="200: OK This is the response you get if creation is successful" %}

```javascript
{
    "success": true,
    "message": "Business Subaccount created",
    "data": {
        "businessName": "Dan Busee ltd",
        "accountNumber": "0073559141",
        "bankCode": "000001",
        "currency": "NGN",
        "authorizationKeys": "auth_live_lHe89VQLI9Jym4Yd5WGiTSZVqHpel9Qy",
        "splitType": "percentage-with-cap",
        "splitValue": 0,
        "percentValue": 10,
        "createdAt": "Mon Mar 28 2022 10:45:01 GMT+0100 (West Africa Standard Time)"
    }
}
```

{% endtab %}

{% tab title="400: Bad Request This is the response you get if creation is unsuccessful" %}

```javascript
{
    "success": false,
    "message": "This bank account details already exist in one of your subaccounts",
    "data": null
}
```

{% endtab %}
{% endtabs %}

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

```
curl --location --request POST 'https://api2.ourpass.co/v1/api/subaccounts/partial' \
--data-raw '{
    "bankCode": "000001",
    "txCap": 1000,
    "subAccountEmail": "kilofer2357.nd@gmail.com",
    "userMobile": "2348098783565",
    "businessName": "Dan Busee ltd",
    "accountNumber": "0073559141",
    "accountName": "OLALEKAN ADEWALE",
    "currency": "NGN",
    "bankName": "ACCESS BANK"    
}'
```

{% endtab %}

{% tab title="Node.js" %}

```
var axios = require('axios');
var data = '{\n    "bankCode": "000001",\n    "txCap": 1000,\n    "subAccountEmail": "kilofer2357.nd@gmail.com",\n    "userMobile": "2348098783565",\n    "businessName": "Dan Busee ltd",\n    "accountNumber": "0073559141",\n    "accountName": "OLALEKAN ADEWALE",\n    "currency": "NGN",\n    "bankName": "ACCESS BANK"    \n}';

var config = {
  method: 'post',
  url: 'https://api2.ourpass.co/v1/api/subaccounts/partial',
  headers: { },
  data : data
};

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

```

{% endtab %}

{% tab title="PHP" %}

```
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api2.ourpass.co/v1/api/subaccounts/partial');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setBody('{\n    "bankCode": "000001",\n    "txCap": 1000,\n    "subAccountEmail": "kilofer2357.nd@gmail.com",\n    "userMobile": "2348098783565",\n    "businessName": "Dan Busee ltd",\n    "accountNumber": "0073559141",\n    "accountName": "OLALEKAN ADEWALE",\n    "currency": "NGN",\n    "bankName": "ACCESS BANK"    \n}');
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
```

{% endtab %}

{% tab title="Ruby" %}

```
require "uri"
require "net/http"

url = URI("https://api2.ourpass.co/v1/api/subaccounts/partial")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request.body = "{\n    \"bankCode\": \"000001\",\n    \"txCap\": 1000,\n    \"subAccountEmail\": \"kilofer2357.nd@gmail.com\",\n    \"userMobile\": \"2348098783565\",\n    \"businessName\": \"Dan Busee ltd\",\n    \"accountNumber\": \"0073559141\",\n    \"accountName\": \"OLALEKAN ADEWALE\",\n    \"currency\": \"NGN\",\n    \"bankName\": \"ACCESS BANK\"    \n}"

response = https.request(request)
puts response.read_body

```

{% endtab %}

{% tab title="Python" %}

```
import requests

url = "https://api2.ourpass.co/v1/api/subaccounts/partial"

payload = "{\n    \"bankCode\": \"000001\",\n    \"txCap\": 1000,\n    \"subAccountEmail\": \"kilofer2357.nd@gmail.com\",\n    \"userMobile\": \"2348098783565\",\n    \"businessName\": \"Dan Busee ltd\",\n    \"accountNumber\": \"0073559141\",\n    \"accountName\": \"OLALEKAN ADEWALE\",\n    \"currency\": \"NGN\",\n    \"bankName\": \"ACCESS BANK\"    \n}"
headers = {}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ourpass.co/connect/create-a-connected-account.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
