# Get Providus Account

***

#### Test Base URL

[https://api-staging.providusbank.com](<https://api-staging.providusbank.com&#xA;&#xA;>)

#### Production Base URL

<https://api.providusbank.com>

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

POST /GetProvidusAccount

***

## Providus Account.

<mark style="color:green;">`POST`</mark> `https://api-staging.providusbank.com/v1/GetProvidusAccount`

Get Providus Account.

#### Request Body

| Name            | Type   | Description                    |
| --------------- | ------ | ------------------------------ |
| Username        | string | Username of account owner      |
| Password        | string | Password of account owner      |
| account\_number | String | account number for the account |

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

```json
{
    "accountStatus":"ACTIVE",
    "emailAddress":"CHARLES2@GMAIL.COM",
    "phoneNumber":"08054477605",
    "accountName":"CHARLY ODUMODU BLACK",
    "bvn":"22100477606",
    "accountNumber":"5900043856",
    "cbaCustomerID":"45139",
    "responseMessage":"SUCCESSFUL",
    "availableBalance":"468520.951",
    "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 --location 'https://api-staging.providusbank.com/GetProvidusAccount' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
    "accountNumber": "1700263070",
    "userName" : "test",
    "password" : "test" 
}'
```

{% endcode %}

> The above command returns JSON structured like this:

```json
{
    "accountStatus":"ACTIVE",
    "emailAddress":"CHARLES2@GMAIL.COM",
    "phoneNumber":"08054477605",
    "accountName":"CHARLY ODUMODU BLACK",
    "bvn":"22100477606",
    "accountNumber":"5900043856",
    "cbaCustomerID":"45139",
    "responseMessage":"SUCCESSFUL",
    "availableBalance":"468520.951",
    "responseCode":"00"
}
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = "https://api-staging.providusbank.com/GetProvidusAccount"

payload = json.dumps({
  "accountNumber": "1700263070",
  "userName": "test",
  "password": "test"
})
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

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

print(response.text)

```

> The above command returns JSON structured like this:

```json
{
    "accountStatus":"ACTIVE",
    "emailAddress":"CHARLES2@GMAIL.COM",
    "phoneNumber":"08054477605",
    "accountName":"CHARLY ODUMODU BLACK",
    "bvn":"22100477606",
    "accountNumber":"5900043856",
    "cbaCustomerID":"45139",
    "responseMessage":"SUCCESSFUL",
    "availableBalance":"468520.951",
    "responseCode":"00"
}
```

{% endtab %}

{% tab title="Java" %}

```java
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n    \"accountNumber\": \"1700263070\",\n    \"userName\" : \"test\",\n    \"password\" : \"test\" \n}");
Request request = new Request.Builder()
  .url("https://api-staging.providusbank.com/GetProvidusAccount")
  .method("POST", body)
  .addHeader("Accept", "application/json")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();
```

> The above command returns JSON structured like this:

```json
{
    "accountStatus":"ACTIVE",
    "emailAddress":"CHARLES2@GMAIL.COM",
    "phoneNumber":"08054477605",
    "accountName":"CHARLY ODUMODU BLACK",
    "bvn":"22100477606",
    "accountNumber":"5900043856",
    "cbaCustomerID":"45139",
    "responseMessage":"SUCCESSFUL",
    "availableBalance":"468520.951",
    "responseCode":"00"
}
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
var data = JSON.stringify({
  "accountNumber": "1700263070",
  "userName": "test",
  "password": "test"
});

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

xhr.addEventListener("readystatechange", function() {
  if(this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api-staging.providusbank.com/GetProvidusAccount");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("Content-Type", "application/json");

xhr.send(data);
```

> The above command returns JSON structured like this:

```json
{
    "accountStatus":"ACTIVE",
    "emailAddress":"CHARLES2@GMAIL.COM",
    "phoneNumber":"08054477605",
    "accountName":"CHARLY ODUMODU BLACK",
    "bvn":"22100477606",
    "accountNumber":"5900043856",
    "cbaCustomerID":"45139",
    "responseMessage":"SUCCESSFUL",
    "availableBalance":"468520.951",
    "responseCode":"00"
}
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api-staging.providusbank.com/GetProvidusAccount');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Accept' => 'application/json',
  'Content-Type' => 'application/json'
));
$request->setBody('{\n    "accountNumber": "1700263070",\n    "userName" : "test",\n    "password" : "test" \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();
}
```

> The above command returns JSON structured like this:

```json
{
    "accountStatus":"ACTIVE",
    "emailAddress":"CHARLES2@GMAIL.COM",
    "phoneNumber":"08054477605",
    "accountName":"CHARLY ODUMODU BLACK",
    "bvn":"22100477606",
    "accountNumber":"5900043856",
    "cbaCustomerID":"45139",
    "responseMessage":"SUCCESSFUL",
    "availableBalance":"468520.951",
    "responseCode":"00"
}
```

{% endtab %}

{% tab title="C#" %}

```csharp
var options = new RestClientOptions("https://api-staging.providusbank.com")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/GetProvidusAccount", Method.Post);
request.AddHeader("Accept", "application/json");
request.AddHeader("Content-Type", "application/json");
var body = @"{" + "\n" +
@"    ""accountNumber"": ""1700263070""," + "\n" +
@"    ""userName"" : ""test""," + "\n" +
@"    ""password"" : ""test"" " + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);

```

> The above command returns JSON structured like this:

```json
{
    "accountStatus":"ACTIVE",
    "emailAddress":"CHARLES2@GMAIL.COM",
    "phoneNumber":"08054477605",
    "accountName":"CHARLY ODUMODU BLACK",
    "bvn":"22100477606",
    "accountNumber":"5900043856",
    "cbaCustomerID":"45139",
    "responseMessage":"SUCCESSFUL",
    "availableBalance":"468520.951",
    "responseCode":"00"
}
```

{% 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://developer.providusbank.com/digital-collection-services/get-providus-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.
