Get customer's account balances report or outstandings list of the linked delayed debit card

Use case

This service allows to get the account balance report or the outstandings list of the customer delayed debit card.

This service follows the return of the list of current accounts and debit cards for a customer : a resource identifier corresponding to an account or card must be provided to obtain the list of balances / outstandings.

 3 balance types will be returned in the case of an account beeing passed as a parameter :

  • Value date balance ("VALU" in the STET standard)  => value-date balance, displayed balance in relation to a value date
  • Accounting balance ("CLBD" in the STET standard) => accounting balance at the end of a period (end of week, end of month, end of quarter, end of year)
  • Instant balance ("OTHR" in the STET standard) => instant balance (evolves in real time with each account posting)

3 outstanding types will be returned in the case of a card beeing passed as a parameter :

  • Outstandings => card slips amounts reported to the following month
  • Undrawn finished outstandings => current month's card slips amounts that were not already posted
  • Drawn finished outstandings => previous month's card slips amounts

In the case of a lot of data returned a pagination will be done with links giving access to first page, previous one, next one and last one in order to make easier the result consultation.

Access to this method is limited to a maximum of 4 batch accesses per calendar day, for one given TPP.

In summary, this service makes it possible to list the balances of a current account of the customer or to list the outstandings of a deferred debit card backed up by this current account.

Prerequisite

In order to process this request it 's needed to fill the eligibility and to get the OAUTH2 access token (see the use case "Get your access token").

Retrieval of a account balances report :

  • The IBAN account should have been transmitted in the balances list of PUT /consents method and shouldn't be revoked since (<=> no cancel and replace using PUT /consents method without the IBAN in the transactions list) ;

  • The "accountResourceId" field as an account parameter of this method, is obtained with the result of the GET /accounts method in the "resourceId" field for the account linked to this IBAN, that means :

    "accountId": {"iban" } ;

  • URI for this method access is given by the field "_links": {"balances": {"href": ...}} result of the GET /accounts request for the "resourceId" field of the account.

In order to get the outstandings of a delayed debit card linked to an account :

  • The IBAN account should have been transmitted in the balances list of PUT /consents method and shouldn't be revoked since (<=> no cancel and replace using PUT /consents method without the IBAN in the transactions list) ;

  • The "accountResourceId" field as a delayed debit card parameter of this method, is obtained with the result of the GET /accounts method in the "resourceId" field for the delayed debit card, that means :

    "accountId": {"other": {"schemeName": "CPAN"}}) with "linkedAccount" wich corresponds to "resourceId" field of the account

    with "resourceId" filed of the account obtained with GET /accounts request and with "accountId": {"iban" } ;

  • URI for this method access is given by the field "_links": {"balances": {"href": ...}} result of the GET /accounts request for the "resourceId" field of delayed debit card.

Request

Request "get/accounts/{accountResourceId}/balances"

épinglesee also STET V1.4.0.47 / Part II / Section 4.2.4 / page 10

Mandatory or facultative body parameters needed for this service

Mandatory parameter accountResourceId : account we want to consult the balances or delayed debit card we want to consult the outstandings, this data matches with the field "resourceId" obtained in the result page of GET /accounts.

facultative parameter : PSU-IP-ADDRESS => parameter is mandatory if the customer is connected

Returned result

This call allows to get :

  • balances list for the account passed as a parameter ;
  • or the outstandings list of the delayed debit card passed as a parameter.

3 types of balances will be returned in the case of an account passed as a parameter:   

  • Value date balance ("VALU" in the STET standard)
=> value-date balance, displayed balance in relation to a value date
  • Accounting balance ("CLBD" in the STET standard)
=> accounting balance at the end of a period (end of week, end of month, end of quarter, end of semester, end of year)
  • Instant balance ("OTHR" in the STET standard)
=>  instant balance (evolves in real time with each account posting) 

3 types of outstandings will be returned in the case of a card passed as a parameter

  • Outstandings
 => card slips amounts reported to the following month
  • Undrawn finished outstandings     
 => current month's card slips amounts that were not already posted
  • Drawn finished outstandings 
 => previous month's card slips amounts

A self link will also be displayed in order to go back to the page obtained right after the request execution.

Access to this method is limited to a maximum of 4 batch accesses per calendar day for an association of one customer and one account or delayed debit card given (pagination not included). On the contrary, when the online customer asks his accounts directly, the accesses number is not limited.

Example

Request

GET /stet/psd2/v1/accounts/038-CPT30019654051/balances

A more complete example of a query is provided in the use case "Sandbox assembly".

épingleSee also STET V1.4.0.47 / Part III / Section 5.3 / page 8

Result

Status code : 200

Body

{
  "balances": [
    {
      "balanceType": "VALU",
      "name": "Solde en Valeur",
      "balanceAmount": {
        "amount": "4321.95",
        "currency": "EUR"
      },
      "referenceDate": "2019-05-16"
    },
    {
      "balanceType": "CLBD",
      "name": "Solde Comptable",
      "balanceAmount": {
        "amount": "4179.95",
        "currency": "EUR"
      },
      "referenceDate": "2019-05-15"
    },
    {
      "balanceType": "OTHR",
      "name": "Solde TP",
      "balanceAmount": {
        "amount": "4348.95",
        "currency": "EUR"
      }
    }
  ],
  "_links": {
    "self": {
      "href": "https://www.rs-sandbox.api.89c3.com/stet/psd2/v1/accounts/038-CPT30019654051/balances"
    },
    "transactions": {
      "href": "https://www.rs-sandbox.api.89c3.com/stet/psd2/v1/accounts/038-CPT30019654051/transactions"
    },
    "parent-list": {
      "href": "https://www.rs-sandbox.api.89c3.com/stet/psd2/v1/accounts"
    }
  }
}

(data set Marc's persona - D0999990I0)

Error code

Here is the list of error codes descriptions for each service. There is a red annotation for errors being described in the CFONB codification.

Error Error description

AC01

(CFONB)

IncorrectAccountNumber : account number is invalid or missing

AC04 (CFONB) ClosedAccountNumber : account has been closed

AC06

(CFONB)

BlockedAccount : account is blocked, prohibiting posting of transactions against it

BE05

(CFONB)

UnrecognisedInitiatingParty : the AISP is not recognised
BADS BadScope : request with an access token which is not authorized to access to the resource (incorrect CBPII scope, instead of expected AISP scope)
INTE InternalError : there was an internal processing error
INTS InternalServerError : there was an internal communication error with the information system
NGAC NotGrantedAccount : access to the account has not been granted
NIMP NotImplemented : invalid method used (GET method expected)
TMRQ TooManyRequest : the maximum number of requests has been exceeded
IPSU InvalidPSU : unregistered subscriber number or terminated Cyber subscription

 

Acceptation tests

The purpose of these tests is to allow you to practice some tests in order to take charge of the API to access it from your application.

Test description Dataset

Retrieve all the balances linked to a customer's account

=> Verification of the hypermedia links (self, balances and transactions)



Persona :

Marc - 038-CPT30019654051

Prerequisite :

scope OAuth2 = aisp

Result :

response HTTP 200 => OK

Retrieve the three balances of the PSU's account

Retrieve all the balances linked to a customer's account with balances equals to 0

=> Verification of the hypermedia links (self, balances and transactions)



Persona :

Adam - 038-CPT30319665741

Prerequisite :

scope OAuth2 = aisp

Result :

réponse HTTP 200 => OK

Retrieve the three balances of the PSU's account

The balances are equals to 0

Retrieve the balances linked to an unknown account

Persona :

Inconnu - 038-CPT30014684067

Prerequisite :

scope OAuth2 = aisp

Result :

response HTTP 404 => unknown account

error message : AC01

HTTP resuqest with access token not allowed for the ressource (bad scope)

Persona :

Marc - 038-CPT30019654051

Prerequisite :

scope OAuth2 <> aisp

Result :

response HTTP 403 => Access to the resource is not allowed

error message : BADS

HTTP POST request execution

Persona :

Marc - 038-CPT30019654051

Prerequisite :

scope OAuth2 = aisp

Result :

response HTTP 405 => method not allowed