# Sub-Accounts History

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

#### Headers

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

#### Request Body

| Name       | Type   | Description                                                                 |
| ---------- | ------ | --------------------------------------------------------------------------- |
| trackingid | string | customer trancking id store during creation or from get subaccount endpoint |

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/subaccount-history' \
--header 'Authorization: Bearer SECRET_KEY' \
```

{% endcode %}
{% endtab %}

{% tab title="NodeJS" %}

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

let config = {
  method: 'post',
  url: 'https://api.oneappgo.com/v1/business/subaccount-history',
  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/subaccount-history',
  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_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": "Transction history found.",
  "data": [
    {
      "prevbal": "0.00",
      "newbal": "250002.00",
      "descriptions": "Fund credit to Olajide Olatunji subaccount",
      "type": "credit",
      "reference": "BW1S405671B8165007",
      "paidtru": "1app",
      "status": "1",
      "trackingid": "bi158338",
      "date_created": "16, January 2024 11:39 am",
      "amount": "250002.00",
      "paystatus": "Completed"
    },
    {
      "prevbal": "250002.00",
      "newbal": "350002.00",
      "descriptions": "Fund credit to Olajide Olatunji subaccount",
      "type": "credit",
      "reference": "BW797S10104509B346",
      "paidtru": "1app",
      "status": "1",
      "trackingid": "bi158338",
      "date_created": "16, January 2024 10:57 am",
      "amount": "10000.00",
      "paystatus": "Completed"
    }
  ]
}
```

{% endtab %}
{% endtabs %}
