In response to the Payment Services Directive 2 (PSD2), SMBC Group offers a collection of APIs that will allow third party providers (TPPs) to integrate the bank's services into their applications. This page will guide TPP developers through the necessary steps required to interact with SMBC Group's API services in the sandbox environment and retrieve simulated responses. The reader should:
- review SMBC Group's implementations of PSD2 APIs (Berlin Group) and the OAuth v2 delegated access model;
- review the section on using the sandbox including the sandbox API flows, testing your application and testing digital signatures;
- register an account on the developer portal. We will ask for some basic information, including your company's TPP authorisation number;
- register your sandbox application in the developer portal to obtain the credentials to interact with our sandbox API environment; and
- test your application against our sandbox API environment, making reference to our API documents section to obtain access to the mocked data.
PSD2 APIs
In support of the PSD2, SMBC Group has implemented APIs to enable its end-users, also referred to as payment service users (PSUs), to interact with the bank's payment services via a TPP.
To support pan-European payments interoperability, SMBC Group has adopted the Berlin Group Specification v1.3 standards, with refinements, to ensure a consistent level of service relative to its online banking solutions, e.g., a field that is optional in the Berlin Group specification may be mandatory when using the SMBC Group implementation.
The APIs fall into two broad categories:
- Account Information Service (AIS): These are operated by an Account Information Service Provider (AISP) that retrieves account information from financial institutions on behalf of the end-user. The AISP APIs enable the end-customer to retrieve account details, balances and transactions.
- Payment Initiation Service (PIS): These are operated by a Payment Information Service Provider (PISP) that provides payment initiation and authorisation services for the end-user. The PISP APIs enable the end-customer to initiate and authorise payments in addition to querying the status of payments.
OAuth v2 Delegated Access Model
As detailed in our token service page, SMBC Group implements two specific OAuth 2 flows:
- OAuth2 client credentials grant to enable a TPP to initiate, query and revoke PSU consents resources; and
- OAuth2 authorisation code grant to enable end-users to securely authorise TPPs to access banking services on their behalf without exposing their online banking credentials to TPPs.
Using the Sandbox
Overview of Sandbox
The Sandbox offers a safe environment for end-to-end testing of TPP client applications backed by mock services and static datasets to simulate a pre-defined set of scenarios, covering both happy and unhappy paths.
Functionally, the sandbox APIs are almost identical to the production APIs with differences only in configuration to ensure a consistent experience between environments and confidence that your client application will be ready for production.
There are four differences between the sandbox and production environments:
- Stateless mock services with static datasets: The sandbox does not manage state. All responses are fixed and derived from static datasets.
- Sandbox authorisation service: This is strictly for use in the sandbox and stands in for the SMBC Group portal that will be used in production as the OAuth2 authorisation server. The sandbox requires no authentication credentials and will return a PSU authorisation code if all the request parameters are valid. Furthermore, it deviates from the OAuth2 specification in how the authorisation code response step is handled; instead of redirecting the PSU back to the TPP redirect URI using HTTP 302, we will return the "Location" HTTP response header using HTTP 200. This is an intentional deviation from the OAuth2 specification since the authorisation code is returned to the TPP and not the PSU/user-agent in the sandbox.
- Simulated PSU authorisation: Unlike production, the pre-configured static dataset for consents assumes that the PSU has already authorised the TPP for the given consent. Only the pre-configured consents are “pre-authorised”.
- Restricted mutually authenticated (MA) TLS connection: The sandbox supports MA TLS using a custom TLS certificate issued by SMBC Group for testing purposes only. To access production APIs, you will need a valid eIDAS qualified certificates for website authentication (QWAC).
- green_bank_pi_ai_qwac.pem.cer
- green_bank_pi_ai_qwac.key
- Passphrase: password
These differences have the following impacts:
- Resources are never created nor deleted: For example, the POST /consents operation does not create a new consents resource and none of the request data is persisted or used in subsequent operations. Instead, it returns a static response from a pre-configured set of consents that are provisioned in the sandbox for testing purposes. The operation still validates all your request parameters in addition to enforcing OAuth2 semantics, e.g., you must supply a valid and unexpired TPP access token. And likewise, the sandbox Dynamic Client Registration Service does not create a new application with dedicated client credentials when you invoke POST /register using the sandbox APIs; to use the Berlin Group sandbox APIs, you should use the client credentials for the sandbox application and not the credentials returned from the sandbox Dynamic Client Registration Service.
- Sequence of Berlin Group operations: The sandbox force operations to occur in sequence. For example, you can retrieve the accounts list before you create a new consent because we have provisioned a set of “pre-authorised” consent IDs in the sandbox as part of the static dataset. Technically, you can start your testing flow at step 1 below “TPP redirects PSU to SMBC Group sandbox authorisation service” to obtain a PSU authorisation code. Note OAuth2 token semantics are strictly enforced so you must first obtain a PSU authorisation code to exchange for a PSU access token.
- OAuth2 TPP redirection: You are not required to implement the TPP redirect URI in step 2.3 when the sandbox authorisation service returns the PSU authorisation code back to your TPP sandbox test application. All you need to do is extract the query parameters from the redirection URI in step 2.3, such as the PSU authorisation code, that you will need for step 2.4 when exchanging the PSU authorisation code for a PSU access token.
- Simplified development workflow: In the end-to-end flows above, we have depicted the PSU/user-agent separate from the TPP sandbox test application. However, the PSU/user-agent is not strictly required for testing purposes. This role could be fulfilled by your TPP sandbox test application to simplify your development workflow. The module that stands in for the PSU/user-agent can later be removed for pre-production testing.
The simplified workflow is made possible by implementing the OAuth2 authorisation server endpoint using an API instead of a web portal that requires human intervention.
Sandbox API Flows
The following sequence diagrams step the developer through the steps required for a TPP to initiate its first API call to access account information on behalf of a PSU.
- TPP creates consents resource
- PSU authorises consents resource
- TPP performs AIS operation
# |
Step > Sub-Step |
Description |
API Request and Response |
1 |
TPP creates consent The TPP creates a new consent for the PSU to authorise |
||
1.1 |
Your TPP obtains a TPP access token that must be presented to create a new consent in the next step. This uses the OAuth2 client credentials grant for machine-to-machine authentication. |
OAuth2 POST /token |
|
1.2 |
The TPP creates a new consent resource that represents the access rights to account and payment services. SMBC will return the Consent ID and the URI to the OAuth2 authorisation server. |
Berlin Group POST /consents |
|
2 |
PSU authorises consent with OAuth The PSU must explicitly authorise the TPP to act on his behalf |
||
2.1 |
The TPP is responsible for redirecting the PSU to the authorisation server and must include the required OAuth2 parameters (e.g. Client ID and state). Furthermore, the TPP must append the code_challenge that is required for the Proof Key for Code Exchange (PKCE). SMBC requires this to be a SHA256 hash of the plain text code_verifier that the TPP will supply later. Sandbox authorize endpoint: https://api-sandbox.smbcdigital.com/sandboxauth/v1/authorize Important note: The Berlin Group specification uses the “scope” query parameter to identify the Consent. The Consent ID in the “scope” parameter must match that returned in Step 1.2 above. |
OAuth2 HTTP 302 /sandboxauth/v1/authorize |
|
2.2 |
If all the OAuth2 request parameters are valid, the Sandbox Auth Service will generate a PSU authorisation code. This will be included in the redirection of the PSU back to the TPP. Sandbox note: Unlike the Production flows, the Sandbox Auth Service will not require secure customer authentication before issuing the PSU authorisation code. This is an intentional simplification for the Sandbox. |
Internal within SMBC |
|
2.3 |
At the conclusion of Step 2, the SMBC Sandbox Auth Service redirects the PSU back to the TPP with the OAuth2 response parameters (e.g. authorisation code, state). Furthermore, SMBC must append the code_challenge in accordance with PKCE. |
OAuth2 HTTP 200 <TPP Redirect URI> |
|
2.4 |
This is the standard OAuth2 flow that exchanges the (PSU) authorisation code for a (PSU) access token. Furthermore, the TPP must append the code_verifier, in accordance with PKCE, which represents the unhashed, plain text value of the code_challenge previously supplied in Step 2.1. In particular, the token endpoint will verify the following: SHA256(code_verifier) == code_challenge |
OAuth2 POST /token
|
|
3 |
AIS/PIS Operation The TPP performs the AIS/PIS operation using the PSU access token |
||
3.1 |
> AIS example: |
Your application requests the list of accounts on behalf of the PSU using the PSU access token. Other AIS operations are listed below in the Technical API Documentation below. Important Note: The mandatory Consent ID supplied in the HTTP request header must match the Consent ID associated with the PSU access token which the PSU had previously authorised in relation to the Consent. |
Berlin Group GET /accounts |
3.2 |
> PIS example: |
Your application submits a payment on behalf of the PSU using the PSU access token. Note that two authorisations are required per payment. Furthermore, the PSUs for both payment authorisations must be unique. Other PIS operations are listed below in the Technical API Documentation. Important Note: The mandatory Consent ID supplied in the HTTP request header must match the Consent ID associated with the PSU access token which the PSU had previously authorised in relation to the Consent. |
Berlin Group POST /payments/{payment-product} |
Technical API Documentation for Sandbox
The Sandbox implements the following operations:
# |
SMBC Service |
Provenance |
Basepath & Endpoints |
Authorisation |
Additional Notes |
|
1 |
OAuth2 Token Service |
Full basepath: api-sandbox.smbcdigital.com/oauth/v1/token |
||||
1.1 |
> Token |
POST / token |
HTTP basic authentication using TPP client credentials |
The token endpoint is used in three OAuth2 token scenarios:
|
||
2 |
Consent Service |
Full basepath: api-sandbox.smbcdigital.com/berlingroup/v1/consents |
||||
2.1 |
> Create new Consent |
POST /consents |
TPP access token |
This must be a PSU-attended call and must include the PSU IP Address and Device ID in the HTTP request headers. |
||
2.2 |
> Get Consent Status |
GET /consents/{ID}/status |
TPP access token |
|||
2.3 |
> Get Consent Details |
GET /consents/{ID} |
PSU access token |
This includes all the accounts and associated access on those accounts for the given Consent. TPP access must be explicitly authorised, hence the use of PSU access token. |
||
2.4 |
> Delete Consent Details |
DELETE /consents/{ID} |
PSU access token |
|||
3 |
Account Service |
Full basepath: api-sandbox.smbcdigital.com/berlingroup/v1/accounts |
||||
3.1 |
> Get account list |
GET /accounts |
PSU access token |
This always returns the interim available balance and ignores the “withBalance” query parameter. |
||
3.2 |
> Get specified account details |
GET /accounts/{ID} |
PSU access token |
This always returns the interim available balance and ignores the “withBalance” query parameter. |
||
3.3 |
> Get account balances |
GET /accounts/{ID}/balances |
PSU access token |
This returns four types of balances:
|
||
3.4 |
> Get account transactions |
GET /accounts/{ID}/transactions |
PSU access token |
This supports filtering as defined in the Berlin Group, e.g., using from and to dates. Furthermore, the transactions response supports both JSON and XML response payloads which includes balances for the given account. Opening booked and opening available balances are always included for the given dateFrom. If dateTo is today, the interim booked and interim available balances are included, otherwise the closing booked and closing available balances are included. Consequently, you should expect only four of the following six balance types for each transaction record depending on your request parameters.
|
||
4 |
Payment Service |
Full basepath: api-sandbox.smbcdigital.com/berlingroup/v1/payments |
||||
4.1 |
> Create payment |
POST /payments/{payment-product} |
PSU access token |
The method to initiate a payment is submitted in an ISO 20022 pain.001.001.03 format. The supported payment products are:
|
||
4.2 |
> Get payment details |
GET /payments/{payment-product}/{ID} |
PSU access token |
Returns payment details in ISO20022 pain.001.001.03 format. | ||
4.3 |
> Get payment status |
GET /payments/{payment-product}/{ID}/status |
PSU access token |
Returns payment status in ISO20022 pain.002.001.03 format. |
||
4.4 |
> Create payment authorisation |
POST /payments/{payment-product}/{ID}/authorisations |
PSU access token |
Creates authorisation sub-resource for the specified payment. Note that two authorisations are required per payment. Furthermore, the PSUs for both payment authorisations must be unique. |
||
4.5 |
> Get payment authorisation |
GET /payments/{payment-product}/{ID}/authorisations/{AuthID} |
PSU access token |
Returns status of the authorisation sub-resource for the specified payment. |
||
4.6 |
> Delete payment |
DELETE /payments/{payment-product}/{ID} |
PSU access token |
Cancels existing payment |
||
5 |
Signing Basket Service |
Full basepath: api-sandbox.smbcdigital.com/berlingroup/v1/signing-baskets |
||||
5.1 |
> Create signing basket |
POST /signing-baskets |
PSU access token |
Creates a signing basket resource with one or not more than 100 payments for authorisation |
||
5.2 |
> Get signing basket |
GET /signing-baskets/{ID} |
PSU access token |
Returns the list of payments in the signing basket resource |
||
6 |
Funds Confirmation Service |
Full basepath: api-sandbox.smbcdigital.com/berlingroup/v1/funds-confirmations |
||||
6.1 |
> Request funds confirmation |
POST /funds-confirmations |
PSU access token |
Returns 'true' or 'false' on availability of PSU funds |
Testing your Application
As we’ve noted, the Sandbox APIs are built from the same codebase as the Production APIs and are not simplified nor modified in any way to implement the Sandbox. This helps you to test your application thoroughly using the code, processes and rules that we will use in production. We describe in the table below a selection of happy and unhappy paths that you can test using the Sandbox.
# |
Step > Sub-Step |
Happy Path |
Unhappy Paths |
1 |
TPP Creates Consent The TPP creates a new Consent for the PSU to authorise |
||
1.1 |
> Get TPP access token |
|
|
1.2 |
> Create consent |
|
|
2 |
PSU Authorises Consent with OAuth The PSU must explicitly authorise the TPP to act on his behalf |
||
2.1 |
> TPP redirects PSU to SMBC Sandbox Authorisation Service |
|
|
2.2 |
> Get PSU authorisation code |
This is an internal SMBC step that will validate the parameters in Step 2.1. Any errors will be flagged at that point. |
There are no alternate or unhappy flows if the request parameters in Step 2.1 are all valid. |
2.3 |
> SMBC redirects PSU back to TPP |
|
There are no alternate or unhappy flows if the request parameters in Step 2.1 are all valid. But you must validate that the state and code_challenge match the request you made in Step 2.1. |
2.4 |
> Exchange PSU authorisation code for PSU access token |
|
|
3 |
AIS operation The TPP performs the AIS operation using the PSU access token |
||
3.1 |
> Get account list |
|
|
4 |
PIS operation The TPP performs the PIS operation using the PSU access token |
||
4.1 |
> Create payment |
|
|
Testing your Digital Signatures with Sandbox Utilities
Developing and testing applications that implement digital signatures can be challenging as one needs to be very precise about how the signing string is constructed. To that end, SMBC Group have exposed a set of digital signature utilities for the sandbox to enable you to fully test your digital signature implementation before proceeding with the relevant PIS operations that require digital signatures. The Berlin Group specification adopts the IETF Draft for Signing HTTP Messages by Cavage/Sporny and introduces the following HTTP request headers.
- TPP-Signature-Certificate: This is the certificate used for signing the request, in base64 encoding. To access production APIs, you will need a valid eIDAS qualified certificates for electronic seals (QSeal) to digitally sign your requests; furthermore, note that the TPP Authorisation Number in both the QSeal and QWAC certificates must match.
- Digest: This header is included only if the "Signature" element is contained in the header of the request and contains a hash of the request payload. SMBC Group supports only SHA-256 for digests.
- Signature: The digital signature header in the format defined by the Cavage/Sporny specification and comprises the following parameters, all of which are mandated by SMBC Group:
- keyId: This is an opaque string that the server can use to look up the component they need to validate the signature.
- signature: This is a base64 encoded digital signature constructed using the "algorithm" and "headers" signature parameters to form a canonicalized "signing string".
- headers: This is used to specify the list of HTTP headers included when generating the signature for the message. Note that the order of the headers is significant as the signing string is constructed by concatenating the headers in the order defined by the "headers" parameter. While the full set of mandatory fields in "Signature/headers" will vary by operation for production APIs, the common mandatory fields are: (request-target), date, digest.
- algorithm: This is used to specify the digital signature algorithm to use when generating the signature. SMBC Group supports only RSA-SHA256 for digital signature algorithm.
For your convenience, we have prepared the following sandbox certificate and private key for use with the sandbox APIs including the sandbox utilities described below. That said, you are free to use your own certificate/private key pairs.
- green_bank_pi_ai_qseal.pem.cer
- green_bank_pi_ai_qseal.key
- Passphrase: password
SMBC Group recommends the following approach to develop and test your digital signature implementation:
# |
Step and Use Case |
Provenance |
Endpoint |
Parameters |
1 |
Generate signing string and digital signature
|
SMBC Group |
HTTP headers
Request payload
|
|
2 |
Validate Berlin Group request headers for digital signatures
|
SMBC Group |
HTTP headers
Request payload
|
|
3 |
Submit payment and signing basket requests with digital signatures
|
Berlin Group |
All PISP operations requiring digital signatures including POST /payments/{payment-product} |
See the respective API documentation pages. |
Access to Production APIs
When your organisation is ready to connect to our production APIs, you should:
- register a dedicated TPP registration application in the developer portal with which you will manage the lifecycle of your production TPP application using the production Dynamic Client Registration Service;
- configure the TPP registration application with the following:
- credentials obtained from the developer portal for the TPP registration application;
- valid eIDAS qualified certificate for website authentication (QWAC) issued by a Qualified Trust Service Providers (QTSPs) to establish a mutually authenticated TLS connection between your TPP registration application and the production Dynamic Client Registration Service; and
- valid eIDAS qualified certificate for electronic seal (QSEAL) issued by a QTSP with which your TPP registration application must digitally sign your registration requests to the production Dynamic Client Registration Service.
- register your organisation's production TPP application with your TPP registration application;
- configure the production TPP application with the following:
- credentials obtained from the Dynamic Client Registration Service for the production TPP application;
- valid eIDAS QWAC issued by a QTSP to establish mutually authenticated TLS connection required for all production APIs; and
- valid eDIAS QSEAL certificate issued by a QTSP (for PISP only).
- access the production APIs using the production TPP application.
Sandbox Mock Data
Sandbox Mock Data - Common
# |
Step > Sub-Step |
PSU 1 using TPP 1 |
PSU 2 using TPP 1 |
1 |
TPP creates consent The TPP creates a new consent for the PSU to authorise |
||
1.1 |
> Get TPP access token |
Not applicable – the TPP access token you receive is an authentic access token issued by the API Gateway. |
As per PSU 1. |
1.2 |
> Create consent |
If the request is valid – see Testing Your Application above – the sandbox will always return a fixed consent response for PSU 1. Let’s call this consent 1.
|
As per PSU 2 but will return a fixed consent response for PSU 2 that will be different from that for PSU 1. Let’s call this Consent 2.
|
2 |
PSU Authorises Consent with OAuth The PSU must explicitly authorise the TPP to act on his behalf |
||
2.1 |
> TPP redirects PSU to SMBC Sandbox Authorisation Service |
You must use the Consent ID for Consent 1, notably "d3a7cbff-76da-42b3-a90e-58ef0bff6f25" (without double quotes). Note that these identifiers are fixed and pre-configured in the Sandbox mock data. Note that the code_challenge, and by extension the code_verifier, are determined by you. The Sandbox will use any values you supply and enforce the PKCE checks in Step 2.4. |
As per PSU 1 but using Consent 2, notably "q3j4pmrr-76jp-51o7-z35k-24qu0ljj3z41" (without double quotes). |
2.2 |
> Get PSU authorisation code |
Not applicable – this is an internal SMBC step. |
As per PSU 1. |
2.3 |
> SMBC redirects PSU back to TPP |
Not applicable – no mock data in the redirection back to your TPP application. |
As per PSU 1. |
2.4 |
> Exchange PSU authorisation code for PSU access token |
Not applicable – no mock data used in this step. Do note that you responsible for ensuring the correct code_verifier is supplied in this step. In particular, code_challenge in Step 2.1 must match SHA256(code_verifier). |
As per PSU 1. |
Sandbox Mock Data - Account Service
# |
Step > Sub-Step |
PSU 1 using TPP 1 |
PSU 2 using TPP2 |
3 |
AIS Operation The TPP performs the operation using the PSU access token |
||
3.1 |
> Get Account List |
Consent 1 is authorised to access three accounts that we shall refer to as Account 1, Account 2 and Account 3. Each account has a unique identifier that you can use to retrieve the balances and transactions for that given account. The accounts list also returns the interim available balance. |
Consent 2 is authorised for Account 1, Account 4 and Account 5. Note that there is an overlap between the two consents, namely Account 1. |
3.2 |
> Get Account Balance |
This returns all the balances of a given account as follows: Account 1 (EUR)
Account 2 (KWD)
Account 3 (USD)
|
This returns all the balances of a given account as follows: Account 1 (EUR) – as per PSU 1. Account 4 (JPY)
Account 5 (GBP)
|
3.3 |
> Get Account Transactions |
This returns the transactions of a given account as follows: Account 1 (EUR)
Account 2 (KWD)
Account 3 (USD) – no transactions |
This returns all the balances of a given account as follows: Account 1 (EUR) – As per PSU 1 Account 4 (JPY)
Account 5 (GBP)
|
Sandbox Mock Data - Payment Service
The following payments are pre-loaded in the sandbox for all non-POST operations.
Payment# | Unique Identifier | Product Type | Currency | Debit Amount | Status | Create Payment Authorisation | Get Payment Authorisation | Delete Payment |
|
PIS Operation The TPP performs the operation using the PSU access token |
|||||||
Payment1 | GPTPP190409125959000001 | pain.001-sepa-credit-transfers | EUR | 100.55 | PATC - partially accepted, technically correct Awaiting SCA - locked |
Failure - HTTP 409 Status Invalid | Started | Success - HTTP 204 No Content |
Payment2 | GPTPP190409125959000002 | pain.001-internal-transfers | USD | 200.15 | RJCT - rejected | Failure - 409 Status Invalid | Finalised | Failure - HTTP 405 Cancellation Invalid |
Payment3 | GPTPP190409125959000003 | pain.001-swift-transfers | JPY | 30035 | PATC - partially accepted, technically correct | Success - SCA redirection | Finalised | Success - HTTP 204 No Content |
Payment5 | GPTPP190409125959000005 | pain.001-chaps-payments | GBP | 500000.55 | n.a. | Failure - HTTP 409 Status Invalid | Finalised | Failure - HTTP 405 Cancellation Invalid |
Payment6 | GPTPP190409125959000006 | pain.001-faster-payments | GBP | 600.65 | RJCT - rejected | Failure - HTTP 409 Status Invalid | Finalised | Failure - HTTP 405 Cancellation Invalid |
For example, the following operations are applicable to Payment1:
- Get payment details: GET /payments/pain.001-sepa-credit-transfers/GPTPP190409125959000001
- Create payment authorisation: POST /payments/pain.001-sepa-credit-transfers/GPTPP190409125959000001/authorisations
- Delete payment: DELETE /payments/pain.001-sepa-credit-transfers/GPTPP190409125959000001
Additionally, POST /payments always returns a fixed payment identifier for a given payment product, that is pre-loaded in the sandbox. This never changes regardless of the request payload. For example, POST /payments/pain.001-sepa-credit-transfers always returns GPTPP190409125959000008.
Sandbox Mock Data - Signing Basket Service
The following signing baskets are pre-loaded in the sandbox for all non-POST operations.
Basket# |
Unique Identifier |
Payments in Basket |
Basket Status |
|
PIS Operation The TPP performs the operation using the PSU access token |
||
Basket1 |
a9f28b85-9ac1-4aab-965c-e871cf2683e6 |
Payment1 Payment7 |
Finalised |
Basket2 |
fab2d89e-5130-461b-9526-a738d96e728c |
Payment5 Payment6 |
Failed |
Basket3 |
7b461c2c-14ee-489f-b524-288359a94faf |
Payment4 Payment5 Payment6 Payment7 |
Finalised |
POST /signing-baskets always returns a fixed basket identifier, that is pre-loaded in the sandbox. This never changes regardless of the request payload. For example, POST /signing-baskets always returns 0de5878f-06dd-4f1c-9563-8e05e962bed3.
Sandbox Mock Data - Funds Confirmation Service
The funds confirmation service always returns "true" regardless of the request payload.