This document explains the flow of events related to Domestic Standing Orders - Payment Initiation API v3.1.1.
Step 1 - Sign up as a TPP
A Third-Party Provider(TPP), is an authorized third-party that allows merchants to accept a wide variety of payments through a single channel/third-party application, and manage the entire payment flow from start to finish. For more information on the role, see TPP roles.
The TPP needs to register its Payment Initiation Service Provider (PISP) application in WSO2 API store in order to access the data.
Click here to see how it is done...
Navigate to the API Store at https://:9443/store
Select Sign-up that is on the top left corner of the homepage.
Provide the requested details on the Sign Up page.
Click here for more information..
a. Generic details:
Field | Description |
---|
Username/Email | The username/email that the TPP uses to sign in to the API Store. |
Password | The password that the TPP uses to sign in to the API Store. |
Retype Password | This is to prevent the TPP from accidentally setting an incorrect password. |
Last Name | This is the last name of the TPP. |
First Name | This is the first name of the TPP. |
b. Company details:
Field | Description |
---|
Legal Entity Name | The official name of the TPP. |
Country of Registration | The country in which the TPP is registered. |
Legal Identifier Number (LEI) | This identifies the TPP. |
Company Register | The organization that registered the TPP. |
Company Registration Number | Identifier issued at the TPP registration. |
Address Line 1 | Address of the TPP. |
Address Line 2 | Address of the TPP. |
City | City in which the TPP is located. |
Postal Code | Postal code of the geographical location of the TPP. |
Country | The country in which the TPP is located. |
c. Competent authority registration details:
Field | Description |
---|
Competent Authority | The regulatory body that authorises and supervises the open banking services delivered by the TPP. |
Competent Authority Country | Country of the competent authority that authorised the TPP to provide open banking services. |
Competent Authority Registration Number | The registration number issued by the Competent Authority to the TPP. |
URL of the Competent Authority Register Page | URL of the page that has the list of organizations authorised by the competent authority. |
Open Banking Roles | Captures the open banking roles the TPP is willing to take up: Account Information Service Provider: An Account Information Service Provider (AISP) provides an aggregated view of all the accounts and past transactions that a customer has with different banks. To provide this view to the customer, the AISP should have authorisation from the customer to view the corresponding transaction and balance information of all the payment accounts. The AISPs can also provide the facility to analyze the customer's spending patterns, expenses, and financial needs. Unlike a PISP, an AISP cannot transfer funds from a payment account. Payment Initiation Service Provider: A Payment Initiation Service Provider (PISP) initiates credit transfers on behalf of a bank's customer.
After selecting PISP, indicate whether the TPP is authorised by a competent authority to provide the services of the selected roles. If the TPP is not yet registered to provide the services of the selected roles, indicate whether the TPP has applied for registration or not. |
Read terms and conditions. Click the checkbox to agree to the terms and conditions.
Click Sign Up. A request to approve the TPP sign up is now sent to the Approver users.
Step 2 - Approve the TPP
Now that you have signed up as a TPP, an admin who overlooks all TPP sign-up forms must approve it.
Click here to see how it is done...
Sign in to the WSO2 Open Banking API Manager Admin portal as an Approver at https://<WSO2_OB_APIM_HOST>:9443/admin
Locate the approval request and click Assign To Me.
- Click Start to start the approval process.
- Select Approve then Complete.
Now the TPP can sign in to the API store.
Step 3 - Sign in to the API store as the TPP
Users can sign in to the API store and proceed with the steps mentioned below.
Click here to see how it is done...
Sign in to the API Store as the TPP at https://<WSO2_OB_APIM_HOST>:9443/store
Click Sign In and navigate to the Sign In page.
Enter the username and the password you entered when signing up as a TPP.
Click Sign In.
The homepage of the API store is now displayed along with the APIs.
Step 4 - Create an application
The TPP with a P application needs to create an application using WSO2 API store. The application created via WSO2 API store allows to observe statistics of APIs, subscribe to APIs, and access the subscribed APIs.
Click here to see how it is done...
Go to the Applications tab in the API Store.
Click Add Application.
Enter application details.
Field | Description |
---|
Name | Application name. |
Per Token Quota | Determines the maximum number of API requests accepted within a given duration. |
Description | This describes the purpose of the application. |
Click Add.
Step 5 - Subscribe to API
The TPP user needs to subscribe to the PaymentInitiationAPI - v3.1
API in order to access API resources. Once subscribed, the users can access all the supported services of the API resources.
Click here to see how it is done...
Go to the APIs tab in the API Store.
Select the API.
Select the application you created in the Create an application section.
Set the throttling policy to Unlimited
.
Click Subscribe.
Now that you have subscribed to the API, generate access tokens and invoke the API.
Step 6 - Create and upload certificates
The TPP user needs to create certificates to validate whether the TPP is registered in a governing entity. It is verified in the TPP Onboarding process. For example, in Dynamic Client Registration, the TPP is dynamically registered with ASPSPs when the client sends a registration request with its metadata. Therefore, the ASPSP is required to upload the root and issuer certificates obtained from Open Banking Implementation Entity. For more information, see Dynamic Client Registration v3.2.
Once you create a self-signed certificate, upload it to the client trust stores of WSO2 OB APIM and WSO2 OB KM.
keytool -import -alias <alias> -keystore cacerts -file <PEMFileName>.pem
Step 7 - Generate keys
The TPP user requires a Client ID(Consumer Key) and a Client Secret(Consumer Secret) to access the subscribed APIs.
Click here to see how it is done...
Sign in to the API store as a TPP user and click either of the following on the Applications tab.
Production Keys: Generates access tokens in the production environment.
Sandbox Keys: Generates access tokens in the sandbox environment.
Provide the requested information as defined below:
Field | Description |
---|
Grant Types | These determine the credentials that are used to generate the access token. Refresh Token: This is to renew an expired access token. Client Credential: This relates to the client credentials grant type and is applicable when consuming the API as an application. Code: This relates to the authorisation code grant type and is applicable when consuming the API as a user.
|
Client ID | OrganizationIdentifier as provided in the EIDAS certificate. The organizationIdentifier attribute contains information using the following structure in the presented order: PSD as the 3-character legal person identity type reference; 2-character ISO 3166 country code representing the NCA country; hyphen-minus (-) 2-8 character NCA identifier (A-Z upper case only, no separator) hyphen-minus (-) PSP (Payment Service Provider) identifier (authorisation number as specified by NCA)
|
Callback URL | This is the URL used by the Account Information Service Provider (AISP) / Payment Initiation Service Provider (PISP) to receive the authorisation code sent from the Account Servicing Payment Service Provider (ASPSP), e.g: bank. The authorisation code can be used later to generate an OAuth2 access token. |
Application Certificate | This is the content between the BEGIN CERTIFICATE and END CERTIFICATE strings of the application certificate (.PEM) that you created above. |
Click Request Access if you are generating production keys. If workflows are configured in the solution, it sends a request to Approver user to approve the token generation. Otherwise, it generates consumer key and consumer secret.
Click Generate Keys if you are generating sandbox keys. It generates consumer key and consumer secret.
Step 8 - Approve Production Key generation
This step includes instructions to an Approver user to review and approve a request to generate production keys for an appli
Click here to see how it is done...
Step 9 - Generate application access token
When invoking APIs in the payment flow, application access tokens must be generated using the client credential grant type. The generated application access token is used to invoke the PaymentInitiationAPI - v3.1 API.
Click here to see how it is done...
Once the client is successfully registered, sign in to the API Store and go to the Applications tab.
Select your client application from the Application List. Click View of the application that you created.
Choose the Production Keys or Sandbox Keys tab based on your environment.
The Consumer Key shown above is the client ID of your application.
Generate the client assertion by signing the following JSON payload using the supported algorithms.
Run the following cURL command in a command prompt to generate the access token. Update the placeholders with the relevant values.
curl POST \
https://<WSO2_OB_APIM_HOST>:8243/token \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--cert <PUBLIC_KEY_FILE_PATH> --key <PRIVATE_KEY_FILE_PATH> \
-d 'client_id=<CLIENT_ID>&grant_type=client_credentials&scope=payments%20openid%20&client_assertion=<CLIENT_ASSERTION_JWT>&client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer&redirect_uri=<APPLICATION_CALLBACK_URL>'
The access token is now generated.
Step 10 - Initiate domestic standing order consent
In this step, the TPP creates a request to get the consent of the PSU to access the payment account and create a new payment-order. This informs the bank(ASPSP) that one of its PSUs intends to make a payment-order.
Click here to see how it is done
POST /domestic-standing-order-consents
This API endpoint allows the PISP to ask an ASPSP to create a new domestic-standing-order-consent resource. The ASPSP creates the resource and responds with a unique ConsentId
to refer to the resource.
Use the following format in the consent body.
{
"Data": {
"Permission": "Create",
"Initiation": {
"Frequency": "EvryDay",
"Reference": "Pocket money for Damien",
"FirstPaymentDateTime": "1976-06-06T06:06:06+00:00",
"FirstPaymentAmount": {
"Amount": "6.66",
"Currency": "GBP"
},
"RecurringPaymentAmount": {
"Amount": "7.00",
"Currency": "GBP"
},
"FinalPaymentDateTime": "1981-03-20T06:06:06+00:00",
"FinalPaymentAmount": {
"Amount": "7.00",
"Currency": "GBP"
},
"DebtorAccount": {
"SchemeName": "UK.OBIE.SortCodeAccountNumber",
"Identification": "11280001234567",
"Name": "Andrea Smith"
},
"CreditorAccount": {
"SchemeName": "UK.OBIE.SortCodeAccountNumber",
"Identification": "08080021325698",
"Name": "Bob Clements"
}
}
},
"Risk": {
"PaymentContextCode": "PartyToParty"
}
}
- Add all mandatory headers:
A sample request follows the format given below.
curl POST \
https://<WSO2_OB_APIM_HOST>:8243/open-banking/v3.1/pisp/domestic-standing-order-consents \
-H 'Authorization: Bearer <APPLICATION_ACCESS_TOKEN>' \
-H 'x-idempotency-key: FRESCO.21302.GFX.20' \
-H 'x-jws-signature: TGlmZSdzIGEgam91cm5leSBub3QgYSBkZXN0aW5hdGlvbiA=..T2ggZ29vZCBldmVuaW5nIG1yIHR5bGVyIGdvaW5nIGRvd24gPw==' \
-H 'x-fapi-financial-id: OB/2017/001' \
-H 'x-fapi-customer-last-logged-time: Sun, 10 Sep 2017 19:43:31 GMT' \
-H 'x-fapi-customer-ip-address: 104.25.212.99' \
-H 'x-fapi-interaction-id: 93bac548-d2de-4546-b106-880a5018460d' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
--cert <PUBLIC_KEY_FILE_PATH> --key <PRIVATE_KEY_FILE_PATH> \
-d '{
"Data": {
"Permission": "Create",
"Initiation": {
"Frequency": "EvryDay",
"Reference": "Pocket money for Damien",
"FirstPaymentDateTime": "1976-06-06T06:06:06+00:00",
"FirstPaymentAmount": {
"Amount": "6.66",
"Currency": "GBP"
},
"RecurringPaymentAmount": {
"Amount": "7.00",
"Currency": "GBP"
},
"FinalPaymentDateTime": "1981-03-20T06:06:06+00:00",
"FinalPaymentAmount": {
"Amount": "7.00",
"Currency": "GBP"
},
"DebtorAccount": {
"SchemeName": "UK.OBIE.SortCodeAccountNumber",
"Identification": "11280001234567",
"Name": "Andrea Smith"
},
"CreditorAccount": {
"SchemeName": "UK.OBIE.SortCodeAccountNumber",
"Identification": "08080021325698",
"Name": "Bob Clements"
}
}
},
"Risk": {
"PaymentContextCode": "PartyToParty"
}
}'
The response will bear the ConsentId
.
{
"Data": {
"ConsentId": "SOC-100",
"CreationDateTime": "1976-01-01T06:06:06+00:00",
"Status": "AwaitingAuthorisation",
"StatusUpdateDateTime": "1976-06-06T06:06:06+00:00",
"Permission": "Create",
"Initiation": {
"Frequency": "EvryDay",
"Reference": "Pocket money for Damien",
"FirstPaymentDateTime": "1976-06-06T06:06:06+00:00",
"FirstPaymentAmount": {
"Amount": "6.66",
"Currency": "GBP"
},
"RecurringPaymentAmount": {
"Amount": "7.00",
"Currency": "GBP"
},
"FinalPaymentDateTime": "1981-03-20T06:06:06+00:00",
"FinalPaymentAmount": {
"Amount": "7.00",
"Currency": "GBP"
},
"DebtorAccount": {
"SchemeName": "UK.OBIE.SortCodeAccountNumber",
"Identification": "11280001234567",
"Name": "Andrea Smith"
},
"CreditorAccount": {
"SchemeName": "UK.OBIE.SortCodeAccountNumber",
"Identification": "08080021325698",
"Name": "Bob Clements"
}
}
},
"Risk": {
"PaymentContextCode": "PartyToParty"
},
"Links": {
"Self": "https://obank.com/open-banking/v3.1/pisp/domestic-standing-order-consents/SOC-100"
},
"Meta": {}
}
GET /domestic-standing-order-consents/{ConsentId}
A PISP is able to retrieve a payment consent resource that they have created to check its status. The PISP must have an access token issued by the ASPSP using a client credentials grant.
- Add the mandatory headers.
- ConsentId - The unique id of the consent which you want to retrieve.
- x-fapi-financial-id - The unique id of the ASPSP to which the request is issued. This id will be issued by the OBIE.
- Authorization - An Authorisation Token as per https://tools.ietf.org/html/rfc6750. Enter the application access token, you generated from the above step.
Step 11 - Authorizing payment consents
The PISP redirects the bank customer to authenticate and approve/deny application-provided consents.
Click here to see how it is done
Generate the request object by signing the following JSON payload using the supported algorithms.
{
"kid": "<CERTIFICATE_FINGERPRINT>",
"alg": "<SUPPORTED_ALGORITHM>",
"typ": "JWT"
}
{
"max_age": 86400,
"aud": "<This is the audience that the ID token is intended for. e.g., https://<WSO2_OB_APIM_HOST>:8243/token>",
"scope": "payments openid",
"iss": "<APPLICATION_ID>",
"claims": {
"id_token": {
"acr": {
"values": [
"urn:openbanking:psd2:sca",
"urn:openbanking:psd2:ca"
],
"essential": true
},
"openbanking_intent_id": {
"value": "<CONSENTID>",
"essential": true
}
},
"userinfo": {
"openbanking_intent_id": {
"value": "<CONSENTID>",
"essential": true
}
}
},
"response_type": "<code:Retrieves authorize code/code id_token: Retrieves authorize token and ID token>",
"redirect_uri": "<CLIENT_APPLICATION_REDIRECT_URI>",
"state": "YWlzcDozMTQ2",
"exp": <EPOCH_TIME_OF_TOKEN_EXPIRATION>,
"nonce": "<PREVENTS_REPLAY_ATTACKS>",
"client_id": "<APPLICATION_ID>"
}
Run the following in a browser to prompt the invocation of the authorize API. Make sure you update the placeholders with the relevant values:
https://<WSO2_OB_APIM_HOST>:8243/authorize/?response_type=<RESPONSE_TYPE>&client_id=<APPLICATION_ID>&scope=payments%20openid&redirect_uri=<APPLICATION_REDIRECT_URI>&state=YWlzcDozMTQ2&request=<REQUEST_OBJECT>&prompt=login&nonce=<REQUEST_OBJECT_NONCE>
- You are directed to a login page. Log in with the credentials of a user that has a subscriber role.
- If a secondary factor is required, e.g. SMSOTP, provide the relevant values. Upon successful authentication, the user is redirected to the consent management page.
- Upon providing consent, an authorization code is generated.
Step 12 - Generate user access token
In this section, you will be generating an access token using the authorization code generated in the section above.
Click here to see how it is done
Run the following cURL command in a command prompt to generate the access token as a TPP user:
curl POST \
https://<WSO2_OB_APIM_HOST>:8243/token \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--cert <PUBLIC_KEY_FILE_PATH> --key <PRIVATE_KEY_FILE_PATH> \
-d 'client_id=<APPLICATION_ID>&grant_type=authorization_code&code=<CODE_GENERATED>&redirect_uri=<APPLICATION_REDIRECT_URI>&client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer&client_assertion=<CLIENT_ASSERTION>'
The response contains an access token and a refresh token.
Step 13 - Invoke payment submission API
Once the domestic-standing-order-consent has been authorised by the PSU, the PISP can proceed to submitting the domestic-standing-order for processing. This request is an instruction to the ASPSP to begin the process of the domestic domestic-standing-order.
Click here to see how it is done
POST /domestic-standing-orders
The PISP must ensure that the Initiation
and Risk
sections of the domestic-standing-order match the corresponding Initiation
and Risk
sections of the domestic-standing-order-consent resource.
Any operations on the domestic-standing-order resource will not result in a status change for the domestic-standing-order resource.
The response contains DomesticStandingOrderId
along with the payment submission details.
The following API functionality is also available in the Domestic Standing Orders v3.1.1.
Retrieval of a domestic-standing-order resource
GET /domestic-standing-orders/{DomesticStandingOrderId}
The PISP can retrieve the domestic-standing-order to check its status.