Changelog

Get Card Balance

Method is used to retrieve balance on specific bank account of the user

👍

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/balance/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.
cardID
REQUIRED
Stringid of the card which balance is requested for
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": "5e6a5c184cb15c5bbdca720da21a9dc1586d89789d44a77bb468efb095f1190c",
	"userSecret": "Tj56n40ZqoPepDpySGroisPRNpj/OO/ZI1QT90w/JKxVJtGgKiN05sEQRR/EMVTSlgH2ULt0SdrZcVQqPRheLZEgti6UHoy4aE/DvJ5QXiByLNE3Sx3Fohk4FPXJ5dew37saEUD7O3XdRZU2ZYDLJ5NZl+po92DJ4FQoxDj/MX2ttCnA7W5r358f0tbII/jE0j1kPdr7EEBadV8NAnIRzKp60/ASJeLtEvPCFRc1lpkYIT+Gm5GuXFUUWj9BWT1lvpAd3BYa1MCtOv3Bv6OvSNqAp7M24ZQBrkz6ItkHYRtus9UMqtaEqiPyiJiUAgwqpQmepuy/hKbdgNw7uEt7botiUrhEE+HzcISkh0Tlf/WpCU9x8vyWJLhtQTjJ7NQ1VTTob1weogni1koE5TwiaXlJTjghEQdCLg2xu/SMeWlgyiHMLjrLHhIUnKb7z8Et6U0gtpYds6Qb1TaUtU1Zwj8s+kl/q3z2qmAQc0qO0jD0uNJ0HX8jSl+lpjlMo0cGsb24sX6Hnhbqko5pNn2gnZtxXYVWXLg10IxKJYeGYWUh1iLIan6cVA7d1sfNLiMbKkvT9nP3+201tFJn6MTUTwvA453Q4z+Zba0UQkFkstfn9203N5rjSMrcx3LNv5uZT1CEHotRKZ9Xzagm7s+eKkRY9GCPxXkUZMqVMywNt8U=",
	"cardID": "yUZ3k5H6YRasdq1gf94fMrrMsOsnTDrB2uHm0JqEtq7Et2KbUO6ajpNN54E7KzGCcdBFcC4xYO8EbJGjIV7CWIlw=="
}

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
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
balanceObject< Balance >Object containing the account's balance information.
userInputsArray<UserInputs>Specifies the type of further information required from the user before the job can be completed.

Is only returned if operation status is `user_input_required

Account Schema

ParameterTypeDescription
availableBalanceNumberAvailable balance of requested card
outstandingBalanceNumberOutstanding balance of requested card
amountDueStringThe amount due for the current statement
cardNumberStringThe card's number as provided by the financial institution.
dueDateStringThe current due date for the selected card
currencyObject<Currency>An object containing the account's currency information.

Currency Schema

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

Response Example

{
    "operationID": "307e2a1f-3dc0-49cf-acae-4c1fa8ff8c38",
    "success": true,
    "status": "done",
    "balance": {
        "amountDue": 1856,
        "availableBalance": 10033.86,
        "cardNumber": "XXXXXXXXXXXX7740",
        "currency": {
            "code": "AED",
            "name": "UNITED ARAB EMIRATES DIRHAM"
        },
        "dueDate": "2021-06-04T00:00:00.000Z",
        "outstandingBalance": 4966
    }
}

Successful Request/Response

Successful Request

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

Successful Response

{
   "balance": {
        "amountDue": 1856,
        "availableBalance": 10033.86,
        "cardNumber": "XXXXXXXXXXXX7740",
        "currency": {
            "code": "AED",
            "name": "UNITED ARAB EMIRATES DIRHAM"
        },
        "dueDate": "2021-06-04T00:00:00.000Z",
        "outstandingBalance": 4966
    },
  "operationID": "e6847737-c24a-4a31-9bdd-700ee9cec4b8",
  "status": "done",
  "success": true
}

Request / Response - When User Input Required

Request - When User Input Is Required

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

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 - Invalid JSON Body

Failed Request - Invalid JSON Body

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

Failed Response - Invalid JSON Body

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

Failed Request / Response - Invalid Secret Specified

Failed Request - Invalid Secret Specified

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

Failed Response - Invalid Secret Specified

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

📘

Note

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