Tutorial
How the Consumer Investments Instrument API works
- Request an access token.
- Retrieve Instrument and InstrumentList.
Requirements
To use this API in a production environment, you must have the following:
- A TLS certificate of the type Organization Validation (OV) or Extended Validation (EV) from Digicert, Quo Vadis, Sectigo or Entrust without wildcard options.
- The organization name issued on the certificate must correspond to the name of the API contract holder.
Sandbox access
The sandbox and production environments are functionally identical. The sandbox is static, which means that you can perform all operations to retrieve Instruments details in a safe environment.
To use the Consumer Investments Instrument API in a sandbox environment, complete the following steps:
-
Register and create an account:
- Click Sign up.
- Enter your details, and click Create new account.
- Developer Support will send you an activation link by email.
- Click the activation link.
-
Create and register application:
- Log in to your account.
- In the left-side navigation bar, click Apps.
- Click Add app.
- In the App name field, enter a name for your application.
- In the APIs field, select Consumer Investments Instrument, and click Add app.
-
Complete the steps within How to use this API process.
To provide feedback on this API, see Contact.
- Sandbox URL: https://api-sandbox.abnamro.com
- Sandbox token URL: https://auth-mtls-sandbox.abnamro.com
Production access
Follow requirements given below to use this API in a production environment.
To get access to production:
- Log in to Consumer Investments Instrument (https://developer.abnamro.com/).
- In the left-side navigation, click Apps.
- Click Request Production Access.
- Select the API category that you want to request production access for. >Note: It is not possible to request production access for multiple API categories in one request.
- Fill in the form, and click Submit.
- You receive a confirmation email and ticket-ID.
- ABN AMRO Developer Support validates the form.
- When the form is validated and the setup is complete, ABN AMRO Developer Support contacts you and supplies you with a client_id.
- A new app is added in Apps. This new app contains your API key.
Production access details
- Production URL: https://api.abnamro.com
- Production Token URL: https://auth-mtls.abnamro.com/as/token.oauth2
Use the following credentials for production:
| Attribute | Value for Production |
|---|---|
| client_id | As supplied to you by ABN AMRO |
| API-Key | The API Key for your production application on the Developer Portal |
Certificates
| Certificate files: |
|---|
| Certificate file : Your OV or EV SSL certificate |
| Private key : Your private key |
How to use this API
This instruction describes how to connect an application to the Consumer Investments Instrument API in the sandbox environment.
Note: Before you start this process, you must complete the steps described in Sandbox access.
Postman collection
Use the following Postman collections to try out the functionality of this API:
- This collection highlights all available operations of the API: run this API in Postman
For additional information on how to configure Postman and import a collection, see Postman.
Step 1 - Request an access token
In this step, the OAuth 2.0 client credentials flow is used to obtain access to the Consumer Investments Instrument API.
Request attributes
You must specify the scope for the operation that is to be authorized. The possible scopes are described in the table below.
| Operation | Request for scope |
|---|---|
| Get Instrument | consumer-investments-instruments:instrumentcode:read |
| Get Instrument Search | consumer-investments-instruments:instrumentlist:read |
The table below defines the usage of attributes in a request.
| Attribute | Value |
|---|---|
| client_id | test_client |
| API-Key | The API Key for your application on the Developer Portal |
Certificates
| Certificate files |
|---|
| Download public certificate: Download |
| Download private key: Download |
Sample request
Request an access token using the following sample:
```shell
curl -X POST "https://auth-mtls-sandbox.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=consumer-investments-instruments:instrumentcode:read'
```
Sample response
```json
{
"token_type": "Bearer",
"access_token": "X1PTWZre0fnW72l263yrhAWB2FDwx3tg",
"expires_in": 7199
}
```
Step 2 - Call the Consumer Investments Instrument API
In this step, you will call the Consumer Investments Instrument API using all available operations.
- Use the following request to retrieve instrument details, such as name, type etc. from an valid instrument code.
Sample request
```shell
curl -X GET "https://api-sandbox.abnamro.com/consumer-investments/instruments/v2/059985" \
-H 'Authorization: Bearer X1PTWZre0fnW72l263yrhAWB2FDwx3tg' \
-H 'API-Key: YourApiKeyHere'
```
Sample response
```json
{
"code": "059985",
"nameNL": "AA ESG PROFIELFONDS ZEER OFFENSIEF ",
"shortNameNL": "AA ESG PROFIELFDS 6 ",
"internationalName": "AA ESG PROFILE FUND VERY AGGRESSIVE ",
"type": "ABN_AMRO_INTERNAL_FUND",
"marketIdentifierCode": " ",
"exchangeCode": "ABR ",
"exchangeCountryCode": "NL",
"exchangeName": "ABN/AMRO BELEG ",
"preferredExchangeCode": "ABR ",
"forbiddenChannels": [],
"unitOfAdministration": "PART",
"orderStream": "ABN_AMRO_INTERNAL_MARKET",
"priceUpdatedDate": "2023-08-17",
"smallestTradableUnit": 0.0,
"minimumOrderAmount": 0.0,
"tickSize": 0.0,
"allowedDecimalFraction": 4,
"currencyCode": "EUR",
"settlementCurrencyCode": "EUR",
"status": "ACTIVE",
"lastDayTradingVolume": 0,
"percentualEODPriceDifference": -1.33821,
"fees": [
{
"type": "Front-End-Fee ",
"quotationType": "PERCENTAGE",
"amount": 5.25,
"typeOfAmount": "MAX"
},
{
"type": "Max one-off charges entry costs ex-ante",
"quotationType": "PERCENTAGE",
"amount": 5.0,
},
{
"type": "Max one-off charges entry costs ex-ante",
"quotationType": "PERCENTAGE",
"amount": 5.0,
"typeOfAmount": "MAX"
},
{
"type": "One-off charges exit costs ex-ante ",
"quotationType": "PERCENTAGE",
"amount": 1.0,
"typeOfAmount": "MAX"
},
{
"type": "One-off charges max entry costs ex-ante",
"quotationType": "PERCENTAGE",
"amount": 0.0,
"typeOfAmount": "MAX"
},
{
"type": "One-off charges max exit costs ex-ante",
"quotationType": "PERCENTAGE",
"amount": 0.0,
"typeOfAmount": "MAX"
},
{
"type": "OCF ",
"quotationType": "PERCENTAGE",
"amount": 0.95,
},
{
"type": "OCF EX-ANTE ",
"quotationType": "PERCENTAGE",
"amount": 0.95,
},
{
"type": "OCF EX-POST ",
"quotationType": "PERCENTAGE",
"amount": 0.95,
},
{
"type": "Repurchase Ch ",
"quotationType": "PERCENTAGE",
"amount": 1.0,
"typeOfAmount": "MAX"
},
{
"type": "TR FEE EX-ANTE ",
"quotationType": "PERCENTAGE",
"amount": 0.2,
},
{
"type": "TR FEE EX-POST ",
"quotationType": "PERCENTAGE",
"amount": 0.2,
}
],
"ISINCode": "LU0121971286",
"EODMarketPrice": 237.4,
"EODPriceType": "MONEY"
}
```
- To retrieve the valid instrument list based on SHARE instrument type and "application/json" Accept header operation.
Sample request
```shell
curl -X GET "https://api-sandbox.abnamro.com/consumer-investments/instruments/v2/?instrumentType=SHARE"
-H 'Authorization: Bearer X1PTWZre0fnW72l263yrhAWB2FDwx3tg' \
-H 'API-Key: YourApiKeyHere'
```
Sample response
```json
{
"instruments": [
{
"code": "017304",
"nameNL": "BNP GOUD TURBO LONG 972 ",
"shortNameNL": "BNP GOLD TL 972 ",
"internationalName": "BNP GOUD TURBO LONG 972 ",
"type": "SHARE",
"marketIdentifierCode": "XMLI",
"exchangeCode": "EAP ",
"exchangeCountryCode": "NL",
"exchangeName": "EURONEXT ACC PARIS ",
"preferredExchangeCode": "EAP ",
"forbiddenChannels": [],
"unitOfAdministration": "PIECE",
"orderStream": "DOMESTIC_CLASSICAL",
"priceUpdatedDate": "2023-07-07",
"smallestTradableUnit": 0.0,
"minimumOrderAmount": 0.0,
"tickSize": 7.0,
"allowedDecimalFraction": 0,
"currencyCode": "EUR",
"settlementCurrencyCode": "EUR",
"status": "ACTIVE",
"lastDayTradingVolume": 0,
"ISINCode": "NL0000173045",
"EODMarketPrice": 91.085,
"EODPriceType": "MONEY"
}
]
}
- It retrieves the list of all active instruments. No search criteria is supported for "text/csv,application/json" Accept header operation.
#### Sample request
```shell
curl -X GET "https://api-sandbox.abnamro.com/consumer-investments/instruments/v2"
-H "accept: text/csv,application/json" \
-H 'Authorization: Bearer X1PTWZre0fnW72l263yrhAWB2FDwx3tg' \
-H 'API-Key: YourApiKeyHere'
Sample response
CREATED:13092023_124713
"FONDSCODE";"ISIN-FONDSCODE";"FONDSNAAM";"FONDSTYPE";"AFREKENMUNTSOORT";"BEURSCODE";"MARKET-IDENT-CODE";"HULPFONDS";"DATUM-WAARD-KOERS";"WAARD-KOERS";"CORR-FACTOR-ESA";"EXPIRATIE-DATUM";"HANDELSEENH";"UITOEFEN-PRIJS";"UITOEFEN-CURR";"CALL-PUT";"SYMBOL";"EENH-ADMINISTRATIE";"ORDERSTROOMKODE"
"000351";"NL0000003515";"NED 05/37 CPN 15/1/29 RENTE";"OB";"EUR";"ENA ";"XAMS";"N";"20230630";"00085,7617";"0";" ";" ";" ";" ";" ";" ";"EUR ";"01"
"000352";"NL0000003523";"NED 05/37 CPN 15/1/30 RENTE";"OB";"EUR";"ENA ";"XAMS";"N";"20230630";"00083,5841";"0";" ";" ";" ";" ";" ";" ";"EUR ";"01"
RECORDCOUNT:0000000002
Need help?