Accounts
Receive fully automated transaction data on your bank account.
Tutorial
Important: This API is in closed beta and both the product and the sandbox are available to closed beta participants only.
This tutorial describes how to connect an application to the Business Account Insight API in the sandbox environment.
The sandbox and production environments for Business Account Insights API are functionally identical, the technical and authorization documentation applies to both environments. However, the sandbox is static, which means that you can perform all operations that are known in production without making any transactions on an account. The transactions posted in the sandbox are cleaned everyday. Returned errors are production-like. However, only functional error scenarios are handled in the sandbox.
The following account types are available for testing:
Account type | IBAN | Description |
---|---|---|
Commercial Account | NL62ABNA9999841479 | Returns a total of 310 transactions spread over most bookdays in the last 24 days. Use this to test Next Page key |
Small Commercial Account | NL12ABNA9999876523 | Returns a total of 88 transactions spread over most bookdays in the last 24 days. |
Sandbox URL: https://api-sandbox.abnamro.com
Important: To use this API in a production environment, you must have the following:
- An ABN AMRO Commercial Account
- One of the following ABN AMRO products: Internet Banking Business, Access Online, or Access Direct.
Notes:
- For information on operations, see Technical
- You do not need to be on-boarded to access the sandbox. On-boarding is required for production use only. For more information, see Get Access to Production
Step 1 - Get access to the sandbox
Use the following credentials in the Client credentials procedure:
Attribute | Value |
---|---|
client_id | test_client |
API-Key | The API Key for your application on the Developer Portal |
redirect_uri | https://localhost/auth |
Certificate Files |
---|
Download : Public certificate file is only shared with closed beta clients |
Download : Private key file is only shared with closed beta clients |
Note: Depending on your system, you may require an exception for self-signed certificates.
Step 2 - Request an access token for account access
Request an access token using the following sample:
Sample: request transactions
curl -X POST "https://auth-sandbox.connect.abnamro.com/as/token.oauth2" \
-v \
--cert CertificateCommercial.crt \
--key PrivateKeyCommercial.key \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'grant_type=client_credentials&client_id=test_client&scope=account:details:read account:balance:read account:transaction:read account:funds:read'
Request Attributes
Attribute | Description |
---|---|
grant_type | Indicates which type of authorization is used, it must contain 'client_credentials' |
scope | Indicates for which scope authorization is being requested. For more information, see Technical. |
client_id | In the sandbox environment, use test_client as client_id. In production you will receive a client_id from ABN AMRO. |
For more information, see client credentials.
Sample response
{
"token_type": "Bearer",
"access_token": "X1PTWZre0fnW72l263yrhAWB2FDwx3tg",
"expires_in": 7199
}
For more information, see client credentials.
Step 3 - Check access using consent information
This is an optional step. You can check which scopes you have received authorization on. Check the scopes by calling the consent info API.
Sample request
curl -X GET "https://api-sandbox.abnamro.com/v1/consentinfo" \
-H 'Accept: application/json' \
-H 'API-Key: X1QTWZre0fnW72l263yrhAWB2FDwx3tg' \
-H 'Authorization: Bearer GPgYglX4sO1WhzfChx4tmjr4y7Qg'
Request attributes
Attribute | Description |
---|---|
authorization | The access token (from step 2) that you want to check the consent information on. |
For more information, see OAuth.
Sample response
{
"scopes": "account:details:read account:balance:read account:transaction:read account:funds:read",
"iban": null,
"transactionId": null,
"valid": 1525691979
}'
Note: You can store the IBAN and scopes for your own administration and for access to the Business Account Insight API.
Step 4 - Call the Business Account Insight API
Get details
Use this operation to fetch account details, such as account holder name.
Sample request
curl -X GET "https://api-sandbox.abnamro.com/v1/accounts/NL12ABNA9999876523/details" \
-H 'Authorization: Bearer GPgYglX4sO1WhzfChx4tmjr4y7Qg' \
-H 'API-Key: X1QTWZre0fnW72l263yrhAWB2FDwx3tg'
Request attributes
Attribute | Description |
---|---|
authorization | The access token, from step 2, that you want to check the consent information on. |
API-Key | The API Key for your sandbox application. This is obtained from the developer portal. |
accountNumber | The IBAN of the account that you want to retrieve details on. |
Sample Response
{
"accountNumber": "NL12ABNA9999876523",
"currency": "USD",
"accountHolderName": "E.P.G. Doe"
}
GET balances
Use this operation to fetch the balance for a given accountnumber
.
Sample request
curl -X GET "https://api-sandbox.abnamro.com/v1/accounts/NL12ABNA9999876523/balances" \
-H 'Authorization: Bearer GPgYglX4sO1WhzfChx4tmjr4y7Qg' \
-H 'API-Key: X1QTWZre0fnW72l263yrhAWB2FDwx3tg'
Sample response
{
"accountNumber": "NL12ABNA9999876523",
"balanceType": "BOOKBALANCE",
"amount": -3.02,
"currency": "USD"
}
GET transactions
This operation fetches the available transaction details for an account.
Sample request
curl -X GET "https://api-sandbox.abnamro.com/v1/accounts/NL12ABNA9999876523/transactions?bookDateFrom=2019-10-01&bookDateTo=2019-10-28" \
-H 'Authorization: Bearer GPgYglX4sO1WhzfChx4tmjr4y7Qg' \
-H 'API-Key: X1QTWZre0fnW72l263yrhAWB2FDwx3tg'
Request attributes
Attribute | Description |
---|---|
bookDateFrom | Retrieve transactions after this date. Use the following format: yyyy-mm-dd. If a field or date is omitted, the last 50 transactions are retrieved. |
bookDateTo | Retrieve transactions preceding this date (Format: yyyy-mm-dd). |
nextPageKey | Reference key of the last retrieved transaction. This can be used as a query parameter in the next call to fetch the next set of transactions. This key is only provided if more than 50 transactions are present. |
Sample response
{
"transactions": [
{
"mutationCode": "333",
"descriptionLines": [
"Payment from Greece",
"for grapes"
],
"transactionTimestamp": "2019-10-23-16:01:07.160",
"bookDate": "2019-10-23",
"balanceAfterMutation": 4985,
"counterPartyAccountNumber": "GR000230201201",
"counterPartyName": "Greasy Grapes Inc",
"amount": -15,
"currency": "EUR",
"status": "EXECUTED",
"transactionId": "TRXID001"
},
{
"mutationCode": "432",
"descriptionLines": [
"Initial cash deposit",
"made at Shanghai branch",
"employee: Nick. L."
],
"transactionTimestamp": "2019-10-23-09:41:12.540",
"bookDate": "2019-10-22",
"balanceAfterMutation": 5000,
"counterPartyAccountNumber": "",
"counterPartyName": "",
"amount": 5000,
"currency": "EUR",
"status": "EXECUTED",
"transactionId": "9190O1514368695SXAQ"
}
],
"accountNumber": "NL12ABNA9999876523",
"nextPageKey": "2019-10-24T11:50:27.810000"
}
GET transactions using nextPageKey
The nextPageKey
of the previous response can be used as input.
Sample request
curl -X GET "https://api-sandbox.abnamro.com/v1/NL12ABNA9999876523/transactions?nextPageKey=2019-10-24T11:50:27.810000" \
-H 'Authorization: Bearer GPgYglX4sO1WhzfChx4tmjr4y7Qg' \
-H 'API-Key: X1QTWZre0fnW72l263yrhAWB2FDwx3tg'
GET funds
This operation verifies if the amount specified in the request is available on the account.
Sample request
curl -X GET "https://api-sandbox.abnamro.com/v1/accounts/NL12ABNA9999876523/funds?amount=123.45¤cy=EUR" \
-H 'Authorization: Bearer GPgYglX4sO1WhzfChx4tmjr4y7Qg' \
-H 'API-Key: X1QTWZre0fnW72l263yrhAWB2FDwx3tg'
Sample response
{
"accountNumber": "NL12ABNA9999876523",
"amount": 123.45,
"currency": "USD",
"available": false
}