Get Accounts

Learn how to get the details of any account created on Bloc

On this page, you'll learn how to use our different "Get Accounts" endpoints to request details regarding all of the accounts you have created.

Get accounts belonging to a particular customer

To get all accounts belonging to a customer, you only need to call the endpoint URL today alongside the customer_id.

https://api.blochq.io/v1/accounts/customers/accounts/{customerID}

Your response will be a list of all virtual accounts that have been created and assigned to that customer.

Please note:

  • Replace the {customerID} placeholder with the id of the customer whose accounts you want to get.
  • To avoid errors, make sure that the URL is correct and that no special characters such as apostrophes, quotes or colons are passed with the customer's ID.

Get single account

There are two ways to get the details of a specific virtual account — by account_id or account_number. Regardless of which method you choose, the response will be the same:

To get account details by account_id, call the endpoint URL below:

curl --request GET \
     --url https://api.blochq.io/v1/accounts/{{accountID}} \
     --header 'accept: application/json' \
     --header 'authorization: Bearer sk_live_64520e0201478f5cd412865f64520e0201478f5cd4128660'

To get account details by account_number, call the endpoint URL below insteadL

curl --request GET \
     --url https://api.blochq.io/v1/accounts/number/{{accountNumber}} \
     --header 'accept: application/json' \
     --header 'authorization: Bearer sk_live_64520e0201478f5cd412865f64520e0201478f5cd4128660'

Below is a sample of the response you get:

{
  "success": true,
  "data": {
    "id": "6410616d7f1b4b36103f872b",
    "name": "bug atti - plane",
    "bvn": "22403240419",
    "kyc_tier": "0",
    "created_at": "2023-03-14T11:58:37.007Z",
    "updated_at": "2023-03-14T11:58:37.007Z",
    "deleted_at": "0001-01-01T00:00:00Z",
    "status": "Open",
    "environment": "test",
    "organization_id": "640b045929eb9cf45bc720c9",
    "balance": 0,
    "currency": "NGN",
    "frequency": 0,
    "frequency_count": 0,
    "meta_data": {},
    "customer_id": "6410612c7f1b4b36103f872a",
    "customer": {
      "id": "6410612c7f1b4b36103f872a",
      "full_name": "atti bug",
      "phone_number": "08033225577",
      "organization_id": "640b045929eb9cf45bc720c9",
      "environment": "test",
      "email": "[email protected]",
      "country": "",
      "group": "main",
      "status": "active",
      "created_at": "2023-03-14T11:57:32.567Z",
      "updated_at": "0001-01-01T00:00:00Z",
      "SyncData": {
        "ID": null,
        "Provider": ""
      },
      "first_name": "bug",
      "last_name": "atti",
      "kyc_tier": "0",
      "bvn": "22403240419",
      "date_of_birth": "0001-01-01T00:00:00Z",
      "customer_type": "Personal",
      "source": "Banking",
      "address": {}
    },
    "account_number": "2013113347",
    "bank_name": "Banc Corp",
    "type": "Virtual",
    "collection_account": false,
    "hide_account": false,
    "SkipNumber": false,
    "external_account": {},
    "alias": "plane"
  },
  "message": "account found"
}

Get all accounts

This allows you to request all the Fixed Accounts created by your organization. Please note, we do not include Collection Accounts created in this response. This is strictly for Fixed Accounts.

To do this, call the endpoint URL below.

curl --request GET \
     --url https://api.blochq.io/v1/accounts \
     --header 'accept: application/json' \
     --header 'authorization: Bearer sk_live_64520e0201478f5cd412865f64520e0201478f5cd4128660'