Get Complete Accounts

Method is used to retrieve list of all the bank accounts registered on the user and the balance of those accounts. (A unified version of the getAccounts and getBalance endpoints)
The list will contain all types of bank accounts, including:

  • Savings
  • Credit
  • Current....

👍

Pre-Conditions

You have obtained user's permanent access token from Exchange Token endpoint

To read more about authentication process and access token please refer to Authentication Documentation

Request

https://api.dapi.com/v2/data/completeAccounts/get

Headers

ParameterTypeDescription
Authorization
REQUIRED
StringSet type to bearer token and the value to the accessToken obtained using the Exchange Token
request.

Body Parameter

ParameterTypeDescription
appSecret
REQUIRED
StringPrivate token generated at application creation.
userSecret
REQUIRED
StringEncrypted version of the userKey.
userInputs
OPTIONAL
Array<userInputs>Array of UserInputs object, required only if initial request responded with user inputs specification.

You can read more about user inputs specification on Specify User Input

Request Example

{
	"appSecret": "00bae841ad979345fca2e2585c000da7eac420504d189cf63315e7a6234d45c68dbd6fff749167292cd1475622805dce7a2b979db3c16e25a2897158ee63845b1043930ff603e19deb1d2d54ad9afc3d52df241d3c4e7286244a2f98a10212e38b2e9f8b0e3a7592702fa4358fb9103b93a26dd6bb92c2be0327ac054f14becc",
	"userSecret": "DSv56dS/PB7QGJI/IGX4qKDhGVhIvQQhWo4zxTDT0gn079JlHnUSSq8NAtavX4fpHj7PGQ74BzVXBO9pFHXdSeLCMnayKLTLD0+zmMu7wfGzy+ZhkYTBe040CXWQ+AYaPhGTzfVWu3Lz6oM2QnqM9X56BbvpC80tN8Zg72VJHWC6YjazdQQ2NK0pl9+ePbmqn7PNjFKLhipgpTl7Hw3kvnLrSIC9AcXzVYQeSWYAv3LAEbECB1aNLXC0glMG2W7L2iLTMwy54wHbXXfSQlK9S6X7wmnZ0tn28H0MwMqWdLLtxvcFyYlMr3E0hqYnK4a5sU0IvF1yJAMHMBCbjw2Trnx2VMuX5IWjdxScfh+8IxWGvKl6RypksJTyNg100H+Q+j0vfKW/bOijFolZgHJtAxUowPlewK9JwoWahkbX2KTGoqQbSCh6KSzaCxdbg7ykNI5n+m6vdoWzGfZGFYjfgMX6aMInAM3b32ZAp9DlfFxRkg3oeoLBuTGTz73E51bZj9mGgD0FxkIXFPIWGx0WyxoYpMEesJeT8phNy0G82Bd7qzWCPGP4gK70jGpqfCWsvj1XZKMMMjReCdUrhtXKB4spQIFi+63WcGV7vDyWQdUTINOhmR8QfZOJoVm+VZgFiqCLI3Aa8AnoYw3UIPiheVjE5lxMulPNIP0QGMR31VY="
}

Response

📘

Note

Your responses may differ from those listed below on a case-by-case basis.

ParameterTypeDescription
operationIDStringUnique ID generated to identify a specific operation.
successBooleanReturns true if request is successful and false for all else.
statusEnumThe status of the job.

done - Operation Completed

failed - Operation Failed

user_input_required - Pending User Input

initialized - Operation In Progress

*For further explanation see Operation Statuses
accountsArray<Account>An array containing the accounts data of the user.

Is only returned if request was successful
typeEnumType of error encountered

Is only returned if the request was not successful
msgStringDetailed description of the error

Is only returned if the request was not successful

Account Schema

📘

Note

Routing Number object is only returned for USA banks. For all other banks it will not be provided

ParameterTypeDescription
ibanStringThe account's IBAN number as provided by the financial institution.
numberStringThe account's number as provided by the financial institution.
routingNumbersObject<routingNumbers>An object containing accounts routing numbers information.

Is only returned for US Bank Accounts
nameStringThe account's name.
isFavouriteBooleanIf the account is the user's favourite account.
balanceNumberAccount's current balance.
idStringThe account's unique identifier.
currencyObject<Currency>An object containing the account's currency information.
typeEnumThe account type.
- current
- savings
- loan
- credit
- deposit
- other

Currency Schema

ParameterTypeDescription
codeStringThe ISO 4217 code of the currency.
nameStringThe full name of the currency.

Routing Numbers Schema

ParameterTypeDescription
typeEnumType of routing number provided.

- wire

- ach
valueStringRouting number of the account

Response Example

{
    "accounts": [
        {
            "balance": 49477,
            "currency": {
                "code": "AED",
                "name": "UNITED ARAB EMIRATES DIRHAM"
            },
            "iban": "DAPIBANKAEENBD1627569235664324100356",
            "id": "jXjbVdOOHnpQtcNzHy4fpc37TZOZOzPI2LB4p+ooTlOWjnphbT7koZgz+Hi52ZlRemr2638XaYQY490Xa63veQ==",
            "isFavourite": false,
            "name": "current",
            "number": "1627569235664324100356",
            "type": "current"
        }
    ],
    "operationID": "DAPIBANK_AE_ENBD:d0380ffc-61a0-4ff4-aa9c-e56cf104b10e",
    "status": "done",
    "success": true
}

Successful Request/Response

Successful Request

{
	"appSecret": "00bae841ad979345fca2e2585c000da7eac420504d189cf63315e7a6234d45c68dbd6fff749167292cd1475622805dce7a2b979db3c16e25a2897158ee63845b1043930ff603e19deb1d2d54ad9afc3d52df241d3c4e7286244a2f98a10212e38b2e9f8b0e3a7592702fa4358fb9103b93a26dd6bb92c2be0327ac054f14becc",
	"userSecret": "DSv56dS/PB7QGJI/IGX4qKDhGVhIvQQhWo4zxTDT0gn079JlHnUSSq8NAtavX4fpHj7PGQ74BzVXBO9pFHXdSeLCMnayKLTLD0+zmMu7wfGzy+ZhkYTBe040CXWQ+AYaPhGTzfVWu3Lz6oM2QnqM9X56BbvpC80tN8Zg72VJHWC6YjazdQQ2NK0pl9+ePbmqn7PNjFKLhipgpTl7Hw3kvnLrSIC9AcXzVYQeSWYAv3LAEbECB1aNLXC0glMG2W7L2iLTMwy54wHbXXfSQlK9S6X7wmnZ0tn28H0MwMqWdLLtxvcFyYlMr3E0hqYnK4a5sU0IvF1yJAMHMBCbjw2Trnx2VMuX5IWjdxScfh+8IxWGvKl6RypksJTyNg100H+Q+j0vfKW/bOijFolZgHJtAxUowPlewK9JwoWahkbX2KTGoqQbSCh6KSzaCxdbg7ykNI5n+m6vdoWzGfZGFYjfgMX6aMInAM3b32ZAp9DlfFxRkg3oeoLBuTGTz73E51bZj9mGgD0FxkIXFPIWGx0WyxoYpMEesJeT8phNy0G82Bd7qzWCPGP4gK70jGpqfCWsvj1XZKMMMjReCdUrhtXKB4spQIFi+63WcGV7vDyWQdUTINOhmR8QfZOJoVm+VZgFiqCLI3Aa8AnoYw3UIPiheVjE5lxMulPNIP0QGMR31VY="
}

Successful Response

{
    "accounts": [
        {
            "balance": 49477,
            "currency": {
                "code": "AED",
                "name": "UNITED ARAB EMIRATES DIRHAM"
            },
            "iban": "DAPIBANKAEENBD1627569235664324100356",
            "id": "jXjbVdOOHnpQtcNzHy4fpc37TZOZOzPI2LB4p+ooTlOWjnphbT7koZgz+Hi52ZlRemr2638XaYQY490Xa63veQ==",
            "isFavourite": false,
            "name": "current",
            "number": "1627569235664324100356",
            "type": "current"
        },
       {
            "balance": 1267,
            "currency": {
                "code": "AED",
                "name": "UNITED ARAB EMIRATES DIRHAM"
            },
            "iban": "DAPIBANKAEENBD1627569235664324100111",
            "id": "jXjbVdOOHnpQtcNzHy4fpc37TZOZOzPI2LB4p+ooTlOWjnphbT7koZgz+Hi52ZlRemr2638XaYQY490Xa63veQ==",
            "isFavourite": false,
            "name": "SAVER",
            "number": "1627569235664324100111",
            "type": "savings"
        }
    ],
    "operationID": "DAPIBANK_AE_ENBD:d0380ffc-61a0-4ff4-aa9c-e56cf104b10e",
    "status": "done",
    "success": true
}

Successful Request / Response - When User Input Required

Successful Request - When User Input Is Required

{
	"appSecret": "00bae841ad979345fca2e2585c000da7eac420504d189cf63315e7a6234d45c68dbd6fff749167292cd1475622805dce7a2b979db3c16e25a2897158ee63845b1043930ff603e19deb1d2d54ad9afc3d52df241d3c4e7286244a2f98a10212e38b2e9f8b0e3a7592702fa4358fb9103b93a26dd6bb92c2be0327ac054f14becc",
	"userSecret": "DSv56dS/PB7QGJI/IGX4qKDhGVhIvQQhWo4zxTDT0gn079JlHnUSSq8NAtavX4fpHj7PGQ74BzVXBO9pFHXdSeLCMnayKLTLD0+zmMu7wfGzy+ZhkYTBe040CXWQ+AYaPhGTzfVWu3Lz6oM2QnqM9X56BbvpC80tN8Zg72VJHWC6YjazdQQ2NK0pl9+ePbmqn7PNjFKLhipgpTl7Hw3kvnLrSIC9AcXzVYQeSWYAv3LAEbECB1aNLXC0glMG2W7L2iLTMwy54wHbXXfSQlK9S6X7wmnZ0tn28H0MwMqWdLLtxvcFyYlMr3E0hqYnK4a5sU0IvF1yJAMHMBCbjw2Trnx2VMuX5IWjdxScfh+8IxWGvKl6RypksJTyNg100H+Q+j0vfKW/bOijFolZgHJtAxUowPlewK9JwoWahkbX2KTGoqQbSCh6KSzaCxdbg7ykNI5n+m6vdoWzGfZGFYjfgMX6aMInAM3b32ZAp9DlfFxRkg3oeoLBuTGTz73E51bZj9mGgD0FxkIXFPIWGx0WyxoYpMEesJeT8phNy0G82Bd7qzWCPGP4gK70jGpqfCWsvj1XZKMMMjReCdUrhtXKB4spQIFi+63WcGV7vDyWQdUTINOhmR8QfZOJoVm+VZgFiqCLI3Aa8AnoYw3UIPiheVjE5lxMulPNIP0QGMR31VY="
}

Successful Response - When User Input Is Required

{
    "operationID": "47204fa6-dca6-44a5-8111-6c6489a232a2",
    "success": true,
    "status": "user_input_required",
   "userInputs": [
    {
      "answer": "",
      "id": "otp",
      "index": 0,
      "query": "Please enter a Smart Pass Token from your ENBD mobile application"
    }
    ]
}

Failed Request / Response - When Invalid JSON Is Provided

Failed Request - When Invalid JSON Is Provided

{
	"appSecret": invalid json
	"userSecret": "DSv56dS/PB7QGJI/IGX4qKDhGVhIvQQhWo4zxTDT0gn079JlHnUSSq8NAtavX4fpHj7PGQ74BzVXBO9pFHXdSeLCMnayKLTLD0+zmMu7wfGzy+ZhkYTBe040CXWQ+AYaPhGTzfVWu3Lz6oM2QnqM9X56BbvpC80tN8Zg72VJHWC6YjazdQQ2NK0pl9+ePbmqn7PNjFKLhipgpTl7Hw3kvnLrSIC9AcXzVYQeSWYAv3LAEbECB1aNLXC0glMG2W7L2iLTMwy54wHbXXfSQlK9S6X7wmnZ0tn28H0MwMqWdLLtxvcFyYlMr3E0hqYnK4a5sU0IvF1yJAMHMBCbjw2Trnx2VMuX5IWjdxScfh+8IxWGvKl6RypksJTyNg100H+Q+j0vfKW/bOijFolZgHJtAxUowPlewK9JwoWahkbX2KTGoqQbSCh6KSzaCxdbg7ykNI5n+m6vdoWzGfZGFYjfgMX6aMInAM3b32ZAp9DlfFxRkg3oeoLBuTGTz73E51bZj9mGgD0FxkIXFPIWGx0WyxoYpMEesJeT8phNy0G82Bd7qzWCPGP4gK70jGpqfCWsvj1XZKMMMjReCdUrhtXKB4spQIFi+63WcGV7vDyWQdUTINOhmR8QfZOJoVm+VZgFiqCLI3Aa8AnoYw3UIPiheVjE5lxMulPNIP0QGMR31VY="
}

Failed Response - When Invalid JSON Is Provided

{
  "msg": "Invalid JSON request",
  "type": "BAD_REQUEST",
  "success": false,
  "status": "failed"
}

Failed Request / Response - When Invalid Token Is Provided

Failed Request - When Invalid Token Is Provided

{
	"appSecret": "invalid_key",
	"userSecret": "DSv56dS/PB7QGJI/IGX4qKDhGVhIvQQhWo4zxTDT0gn079JlHnUSSq8NAtavX4fpHj7PGQ74BzVXBO9pFHXdSeLCMnayKLTLD0+zmMu7wfGzy+ZhkYTBe040CXWQ+AYaPhGTzfVWu3Lz6oM2QnqM9X56BbvpC80tN8Zg72VJHWC6YjazdQQ2NK0pl9+ePbmqn7PNjFKLhipgpTl7Hw3kvnLrSIC9AcXzVYQeSWYAv3LAEbECB1aNLXC0glMG2W7L2iLTMwy54wHbXXfSQlK9S6X7wmnZ0tn28H0MwMqWdLLtxvcFyYlMr3E0hqYnK4a5sU0IvF1yJAMHMBCbjw2Trnx2VMuX5IWjdxScfh+8IxWGvKl6RypksJTyNg100H+Q+j0vfKW/bOijFolZgHJtAxUowPlewK9JwoWahkbX2KTGoqQbSCh6KSzaCxdbg7ykNI5n+m6vdoWzGfZGFYjfgMX6aMInAM3b32ZAp9DlfFxRkg3oeoLBuTGTz73E51bZj9mGgD0FxkIXFPIWGx0WyxoYpMEesJeT8phNy0G82Bd7qzWCPGP4gK70jGpqfCWsvj1XZKMMMjReCdUrhtXKB4spQIFi+63WcGV7vDyWQdUTINOhmR8QfZOJoVm+VZgFiqCLI3Aa8AnoYw3UIPiheVjE5lxMulPNIP0QGMR31VY="
}

Failed Response - When Invalid Token Is Provided

{
  "msg": "Invalid access token",
  "type": "UNAUTHORIZED",
  "success": false,
  "status": "failed"
}

📘

Note

For more information and detailed breakdown of possible errors, please see Errors.