This document guides you with the assumption that you have set up WSO2 Open Banking Key Manager, and WSO2 Open Banking API Manager in separate servers.
Before you begin
- Create a user with Internal/creator and Internal/publisher roles using
https://<OBKM_HOSTNAME>:9446/carbon
. To create users and roles, see configuring users and roles, which elaborates the steps to create the user as the API publisher. - Set endpoints in the velocity_template.xml file.
- Configure sequence files.
Configuring an API
In the WSO2 Open Banking Berlin v1.1, it is mandatory to configure APIs for:
- Accounts API v1.1
- Payments API v1.1
Given below is the general procedure to configure and publish an API.
- Create a user in order to configure API. For more information on creating a user, refer Configuring users and roles.
- If one version of the API is already deployed, you may create a new version of it instead of deploying a new API. For more information, see create a new version for an existing API.
Sign in to the API Publisher ( Click ADD NEW API > I have an existing API. Select the Swagger definition from Click Upload In Flow and select the corresponding In sequence file from the Click Next: Manage to navigate to the next level. Expand API Properties and add the following values as Additional properties: Property Name Property Value Click the + button to save the above values. Click Save & Publish. Specification In flowhttps://
) with the a user whose roles include localhost
:9443/publisherInternal/publisher
. Follow the steps given below:<WSO2_OB_APIM_HOME>/repository/resources/finance/apis
and configure the properties according to the open-banking specification. Find more information from the table given below.
Click Start Creating.<WSO2_OB_APIM_HOME>/repository/resources/finance/apis/berlin-group.org/
directory.ob-spec berlin Summarized information for configuring APIs
API Implement tab Manage tab Endpoint type Endpoint Enable Message mediation API property name API property value Berlin specification AccountInfo API v1.1.0 Dynamic N/A Mark as
checked
Select the respective In Sequence
in the
<WSO2_OB_APIM_HOME>
directory/repository/resources/finance/apis/
berlin-group.org/Accountsob-spec
berlin
Payments API v1.1.0 Dynamic N/A Mark as checked
Select the respective In Sequence
in the
directorywso2-obam-version/repository/resources/finance/apis/
berlin-group.org/Paymentsob-spec
berlin
Configuring the velocity_template.xml file
velocity_template
file checks the deployed specification. The velocity_template.xml
file in the <WSO2_OBAM_HOME>/repository/resources/api_templates/velocity_template.xml
file, is by default configured to support berlin
specification with the following handler.
<handler class="com.wso2.finance.open.banking.berlin.consent.enforcement.ConsentEnforcementHandler"> <property name="accountValidationUrl" value="https://<OBKM_HOST>:9446/consent/berlin110/accounts-validation"/> <property name="keyStore" value="./repository/resources/security/wso2carbon.jks"/> <property name="password" value="wso2carbon"/> <property name="alias" value="wso2carbon"/> </handler>
Configuring sequence files
Sequence files for Accounts and Payments must be updated separately in the <WSO2_OBAM_HOME>/repository/resources/finance/apis
/ berlin-group.org
/
<Name
of the API>
. Update the value of the <OBKM_HOSTNAME>
with the hostname of the WSO2 Open Banking Key Manager server.
By default, WSO2 Open Banking API Manager includes a mock bank backend, which is configured by default in the In sequences
. Ideally, the two occurrences of https://<OBAM_HOSTNAME>:9443/open-banking/services/accounts/accountservice
should be replaced by the core banking system's API endpoints corresponding to the production, and sandbox environments respectively. For more information, see Integrating Core Banking System for Berlin.
<sequence xmlns="http://ws.apache.org/ns/synapse" name="accounts-dynamic-endpoint-insequence-2.0.0"> <property name="endpointURI" expression="get-property('To')"/> <header name="TPP-Unique-ID" expression="get-property('api.ut.consumerKey')" scope="transport"/> <filter regex=".*\/consents.*" source="$ctx:endpointURI"> <then> <property name="resourcepath" scope="default" type="STRING" value=""/> <property expression="get-property('resourcepath')" name="REST_URL_POSTFIX" scope="axis2" type="STRING"/> <header name="To" expression="fn:concat('https://<OBKM_HOST>:9446/consent/berlin110' , get-property('api.ut.resource'))"/> <rewrite> <rewriterule> <action type="replace" regex="\/consents" value="\/accounts" fragment="path"/> </rewriterule> </rewrite> </then> <else> <filter source="$ctx:AM_KEY_TYPE" regex="PRODUCTION"> <then> <header name="To" value="https://<OBAM_HOST>:9443/open-banking-berlin/services/accounts"/> </then> <else> <header name="To" value="https://<OBAM_HOST>:9443/open-banking-berlin/services/accounts"/> </else> </filter> </else> </filter> <property expression="get-property('To')" name="ENDPOINT_ADDRESS"/> </sequence>
<sequence xmlns="http://ws.apache.org/ns/synapse" name="payments-dynamic-endpoint-insequence-2.0.0"> <property name="endpointURI" expression="get-property('To')"/> <filter source="$ctx:endpointURI" regex=".*payments.*"> <then> <header name="TPP-Unique-ID" scope="transport" expression="get-property('api.ut.consumerKey')"/> <filter source="get-property('api.ut.HTTP_METHOD')" regex="POST"> <then> <header name="To" value="https://<OBKM_HOST>:9446/consent/berlin110/payments"/> <filter source="$ctx:endpointURI" regex="^((?!\/bulk-payments).)*$"> <then> <payloadFactory media-type="json"> <format>[$1]</format> <args> <arg evaluator="json" expression="$"/> </args> </payloadFactory> </then> </filter> </then> <else> <filter source="get-property('api.ut.HTTP_METHOD')" regex="GET"> <then> <property name="resourcePath" scope="default" type="STRING" value=""/> <property expression="get-property('resourcePath')" name="REST_URL_POSTFIX" scope="axis2" type="STRING"/> <header name="To" expression="fn:concat('https://<OBKM_HOST>:9446/consent/berlin110', get-property('api.ut.resource'))"/> <rewrite> <rewriterule> <action type="replace" regex="\/payments\/sepa-credit-transfers" value="\/payments" fragment="path"/> <action type="replace" regex="\/payments\/instant-sepa-credit-transfers" value="\/payments" fragment="path"/> <action type="replace" regex="\/payments\/target-2-payments" value="\/payments" fragment="path"/> <action type="replace" regex="\/payments\/cross-border-credit-transfers" value="\/payments" fragment="path"/> <action type="replace" regex="\/bulk-payments\/sepa-credit-transfers" value="\/payments" fragment="path"/> <action type="replace" regex="\/bulk-payments\/instant-sepa-credit-transfers" value="\/payments" fragment="path"/> <action type="replace" regex="\/bulk-payments\/target-2-payments" value="\/payments" fragment="path"/> <action type="replace" regex="\/bulk-payments\/cross-border-credit-transfers" value="\/payments" fragment="path"/> <action type="replace" regex="\/periodic-payments\/sepa-credit-transfers" value="\/payments" fragment="path"/> <action type="replace" regex="\/periodic-payments\/instant-sepa-credit-transfers" value="\/payments" fragment="path"/> <action type="replace" regex="\/periodic-payments\/target-2-payments" value="\/payments" fragment="path"/> <action type="replace" regex="\/periodic-payments\/cross-border-credit-transfers" value="\/payments" fragment="path"/> </rewriterule> </rewrite> </then> </filter> </else> </filter> </then> <else> <filter source="$ctx:AM_KEY_TYPE" regex="PRODUCTION"> <then> <header name="To" value="https://<OBAM_HOST>:9443/open-banking/services/payments/paymentservice"/> </then> <else> <header name="To" value="https://<OBAM_HOST>:9443/open-banking/services/payments/paymentservice"/> </else> </filter> </else> </filter> <property name="ENDPOINT_ADDRESS" expression="get-property('To')"/> </sequence>
Select the CREATE NEW VERSION tab. Follow the versioning format and define the new version. Click Done. Users need to define the correct version for the API and choose the swagger and In sequence files appropriately. The directory path to the files in the solution pack helps you to choose the correct file. For example, choose the swagger and in sequence files from Click Save & Publish. To get the existing subscriptions to the new version, follow the steps below:Create a new version for an existing API
In the API Publisher of WSO2 Open Banking, users are not allowed to duplicate the scope of an API. Therefore, users are allowed to create a new version for the API in order to share the same scope. See below to find how it is done:https://<WSO2_OB_APIM_HOST>:9443/publisher
), click the API thumbnail to view the API overview.<WSO2_OB_APIM_HOME>/repository/resources/finance/apis/openbanking.org.uk/Payments/3.1.1
if you want to create the 3.1.1 version of Payment Initiation API..yaml
format and click Open File.In sequence
file for the corresponding API and its version, and click Upload.ob-spec
property is set to reflect the correct specification.
Tick the relevant boxes if you want to: