# Get Providus Account Statement

***

#### Test Base URL

<https://api-staging.providusbank.com>

#### Production Base URL

<https://api.providusbank.com>

#### HTTP Request <a href="#http-request" id="http-request"></a>

GET /account/NIP

***

## NIP Account.

<mark style="color:blue;">`GET`</mark> `https://api-staging.providusbank.com/v1 /account/NIP`

Get NIP Account.

#### Request Body

| Name                                              | Type   | Description                    |
| ------------------------------------------------- | ------ | ------------------------------ |
| account\_number<mark style="color:red;">\*</mark> | string | account number for the account |
| bank\_code                                        | string | code of the bank               |
| Username                                          | string | Username of account owner      |
| Password                                          | string | Password of account owner      |

{% tabs %}
{% tab title="200 Account successfully retrieved" %}

```javascript
{
    "bankCode":"57",
    "accountName":"NNAJI, JOSHUA & VIVIAN",
    "transactionReference":"",
    "bvn":"",
    "responseMessage":" Approved or completed successfully",
    "accountNumber":"3041004406",
    "responseCode":"00"
}
```

{% endtab %}

{% tab title="401: Unauthorized Permission denied" %}

{% endtab %}

{% tab title="400: Bad Request The server cannot process the request due to a client error, such as malformed syntax or invalid parameters in the request." %}

{% endtab %}

{% tab title="500: Internal Server Error Server encountered an unexpected error" %}

{% endtab %}
{% endtabs %}

***

### Sample Implementation

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

```javascript
curl -x GET "https://api-staging.providusbank.com/account/NIP?account_number=3041004406&bank_code=57"
  -H "Authorization: {{Authentication token}}"
  -H "Username: Username"
  -H "Password: Password"
```

{% endcode %}

> The above command returns JSON structured like this:

```json
{
    "bankCode":"57",
    "accountName":"NNAJI, JOSHUA & VIVIAN",
    "transactionReference":"",
    "bvn":"",
    "responseMessage":" Approved or completed successfully",
    "accountNumber":"3041004406",
    "responseCode":"00"
}
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
from requests.structures import CaseInsensitiveDict
url = "https://api-staging.providusbank.com/account/NIP?account_number=3041004406&bank_code=57"
headers = CaseInsensitiveDict()
headers["Authorization"] = "{{Authentication token}}"
headers["Username"] = "Username"
headers["Password"] = "Password"
resp = requests.get(url, headers=headers)
print(resp.status_code)
```

> The above command returns JSON structured like this:

```json
{
    "bankCode":"57",
    "accountName":"NNAJI, JOSHUA & VIVIAN",
    "transactionReference":"",
    "bvn":"",
    "responseMessage":" Approved or completed successfully",
    "accountNumber":"3041004406",
    "responseCode":"00"
}
```

{% endtab %}

{% tab title="Java" %}

```java
URL url = new URL("https://api-staging.providusbank.com/account/NIP?account_number=3041004406&bank_code=57");
HttpURLConnection http = (HttpURLConnection)url.openConnection();
http.setRequestProperty("Authorization", "{{Authentication token}}");
http.setRequestProperty("Username", "Username");
http.setRequestProperty("Password", "Password");
System.out.println(http.getResponseCode() + " " + http.getResponseMessage());
http.disconnect();
```

> The above command returns JSON structured like this:

```json
{
    "bankCode":"57",
    "accountName":"NNAJI, JOSHUA & VIVIAN",
    "transactionReference":"",
    "bvn":"",
    "responseMessage":" Approved or completed successfully",
    "accountNumber":"3041004406",
    "responseCode":"00"
}
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function() {
  if(this.readyState === 4) {
    console.log(this.responseText);
  }
});
xhr.open("GET", "https://api-staging.providusbank.com/account/NIP?account_number=3041004406&bank_code=57");
xhr.setRequestHeader("Authorization", "{{Authentication token}}");
xhr.setRequestHeader("Username", "Username");
xhr.setRequestHeader("Password", "Password");
xhr.send();
```

> The above command returns JSON structured like this:

```json
{
    "bankCode":"57",
    "accountName":"NNAJI, JOSHUA & VIVIAN",
    "transactionReference":"",
    "bvn":"",
    "responseMessage":" Approved or completed successfully",
    "accountNumber":"3041004406",
    "responseCode":"00"
}
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api-staging.providusbank.com/account/NIP?account_number=3041004406&bank_code=57');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => '{{Authentication token}}',
  'Username' => 'Username',
  'Password' => 'Password'
));
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();
}
```

> The above command returns JSON structured like this:

```json
{
    "bankCode":"57",
    "accountName":"NNAJI, JOSHUA & VIVIAN",
    "transactionReference":"",
    "bvn":"",
    "responseMessage":" Approved or completed successfully",
    "accountNumber":"3041004406",
    "responseCode":"00"
}
```

{% endtab %}

{% tab title="C#" %}

```csharp
var client = new RestClient("https://api-staging.providusbank.com/account/NIP?account_number=3041004406&bank_code=57");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "{{Authentication token}}");
request.AddHeader("Username", "Username");
request.AddHeader("Password", "Password");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
```

> The above command returns JSON structured like this:

```json
{
    "bankCode":"57",
    "accountName":"NNAJI, JOSHUA & VIVIAN",
    "transactionReference":"",
    "bvn":"",
    "responseMessage":" Approved or completed successfully",
    "accountNumber":"3041004406",
    "responseCode":"00"
}
```

{% endtab %}
{% endtabs %}
