Accounts

The accounts flow can be used to acquire a list of the consumer’s bank accounts.

Request

POST /xs2a/v1/consents/{consent-id}/accounts/get HTTP/1.1
Content-Type: application/json; charset=utf-8
Authorization: Token <Token>
Host: <Host>
{
    "consent_token": String,
    "psu": ?{
        "user_agent": String,
        "ip_address": String,
    }
}

consent_token String, required

The consent_token can be obtained as described here.

psu Object, optional

The psu object is optional, however, if the consumer is present, it is recommended to provide it. Some banks soften their daily consent usage restrictions if the PSU data is available.

psu.user_agent String, required

The user_agent property holds the user agent string of the consumer's client application, e.g. the web browser.

psu.ip_address String, required

The ip_address property holds the IP address of the consumer. Both IPv4 and IPv6 are accepted formats.

Response

{
    "data": {
        "result": ?{
            "accounts": Array<Account>,
        },
        "consent_token": String
    }
}

data.result.accounts Account[], always present

The accounts array holds the requested accounts.

data.consent_token String, always present

The response contains a new consent_token that has to be used in the following request.

NOTE: The returned information can differ depending on the selected bank, as some banks provide more information than others.

Example

Request

POST /xs2a/v1/consents/gp4cb0g6d9r3qf4d68fkrlb7ejo8mqqk/accounts/get

{
    "consent_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbiI6IjEyMzQ1Njc4OTAifQ.na71ipK8ASvggoM6C5vMjBKgJlZLxV-m6ElgHBrNtlU",
    "psu": {
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.162 Safari/537.36",
        "ip_address": "192.168.2.1",
    }
}

Response

200 OK

{
    "data": {
        "result": {
            "accounts": [
                {
                    "id": "0",
                    "alias": "Girokonto(MaxMustermann)",
                    "iban": "DE06000000000023456789",
                    "bic": "SFRTDE20XXX",
                    "account_number": "23456789",
                    "holder_name": "MaxMustermann",
                    "bank_code": "",
                    "transfer_type": "FULL",
                    "account_type": "DEFAULT",
                    "balance": {
                        "amount": 12345,
                        "currency": "EUR"
                    }
                },
                {
                    "id": "1",
                    "alias": "Girokonto (Musterman, Petra)",
                    "iban": "DE86000000002345678902",
                    "bic": "SFRTDE20XXX",
                    "account_number": "2345678902",
                    "holder_name": "Musterman, Petra",
                    "bank_code": "",
                    "transfer_type": "FULL",
                    "account_type": "DEFAULT"
                }
            ],
        },
        "consent_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbiI6Ijg4OTk3Nzg4In0.QQscn9a6-nQXuVK4Rwbft_LFMF3-r2xzWROEZMS2lW0"
    }
}

results matching ""

    No results matching ""