Integration Setup
  • 26 Jun 2020
  • 6 Minutes To Read
  • Print
  • Share
  • Dark
    Light

Integration Setup

  • Print
  • Share
  • Dark
    Light

General prerequisites

Mambu
Have the Chart of Accounts configured as per the bank’s requirements.

Azure Active Directory
Configure the Azure App for your company by providing the necessary API permissions to the application. Azure directory is also the place where tenantID, clientID and clientSecret are kept. They will be used later on, in the authentication process, at step #9 of the Installation instructions section.

MS Dynamics
1. Create the Chart of Accounts in MS Dynamics and map the GL code, GL account name, GL account type and other necessary settings to obtain a one-to-one relationship with Mambu.
GL code

2. Create a set of custom dimensions that will hold the dimension values. Dimension values will be attached to Journal Lines for reporting purposes.

List of Dimensions implemented in the current version of the connector:

  • Account dimension : holds the account id (code field) of the loan or savings account and account name (name field)
  • Branch dimension : holds the branch id (code field) and branch name (name field)
  • Client dimension : holds the client id (code field) and client name (name field)
  • Product dimension : holds the product id (code field) and product name (name field)

3. A scheduled job that will post the Journal Lines in the General Ledger accounts needs to be configured in MS Dynamics.

Also, have Postman or another API client installed as it will be used in the authorization process.

Installation instructions

1. Login to your MPO environment. Press the Create button and upload the Json file you received for this integration by selecting the From file option. Once the upload is complete, you will see the MS Dynamics V1.0 folder in your workspace.
Upload json

2. Login to your Mambu environment. Create a user for the integration and grant necessary permissions. Take note of the username and password.
3. Create webhook - End of day processing:
  3.1. In the MPO environment step on the Start node of the Webhook receiver (CRON trigger) process and Copy webhook via JSON.
Cron receiver

  3.2. In the Mambu environment create a new webhook with the following settings:
    • Target End of day processing
    • On Event Accounts Updated
    • Web Hook URL - paste the webhook URL copied at step #3.1
    • Request Type POST
    • Authorization No Authorization
    • Content Type application/json
    • Body of request:

{
 "Mambu message":"Process triggered on FORMAT_DATE{CURRENT_DATE_TIME,datePattern=dd-MM-yyyy}"
}

Webhook

4. Create webhook- Client created:
  4.1. In the MPO environment step on the Start node of the Webhook receiver - create dimensionValues for client, deposit account, loan account process and Copy webhook via JSON.
Add receiver

  4.2. In the Mambu environment create a new webhook with the following settings:
    • Option select Opt-out
    • Target Clients
    • On Event Client Created
    • Web Hook URL - paste the webhook URL copied at step #4.1
    • Request Type POST
    • Authorization No Authorization
    • Content Type application/json
    • Body of request:

{ 
 "dimensionCode":"dimension name for storing the Clients from MS Dynamics",
 "dimensionValueCode":"{RECIPIENT_ID}",
 "dimensionValueName":"{RECIPIENT_NAME}"
}

Note: Create a new webhook for Groups under the same conditions as for the Client entity.

5. Create webhook - Loan Account Created: repeat the same actions as in step #4 to create a new webhook.
    • Option select Opt-out
    • Target Clients
    • On Event Loan Account Created
    • Web Hook URL- use the same webhook URL copied at step #4.1
    • Request Type POST
    • Authorization No Authorization
    • Content Type application/json
    • Body of request:

{
 "dimensionCode":"dimension name for storing the Accounts from MS Dynamics",
 "dimensionValueCode":"{ACCOUNT_ID}",
 "dimensionValueName":"{ACCOUNT_NAME}"
}

Note: Create a new webhook for Groups under the same conditions as for the Client entity.

6. Create webhook - Loan Account Refinanced: repeat the same actions as in step #4 to create a new webhook.
    • Option select Opt-out
    • Target Clients
    • On Event Loan Account Refinanced
    • Web Hook URL - use the same webhook URL copied at step #4.1
    • Request Type POST
    • Authorization No Authorization
    • Content Type application/json
    • Body of request:

{
 "dimensionCode":"dimension name for storing the Accounts from MS Dynamics",
 "dimensionValueCode":"{ACCOUNT_ID}",
 "dimensionValueName":"{ACCOUNT_NAME}"
}

Note: Create a new webhook for Groups under the same conditions as for the Client entity.

7. Create webhook - Loan Account Rescheduled: repeat the same actions as in step #4 to create a new webhook.
    • Option select Opt-out
    • Target Clients
    • On Event Loan Account Rescheduled
    • Web Hook URL - use the same webhook URL copied at step #4.1
    • Request Type POST
    • Authorization No Authorization
    • Content Type application/json
    • Body of request:

{
 "dimensionCode":"dimension name for storing the Accounts from MS Dynamics",
 "dimensionValueCode":"{ACCOUNT_ID}",
 "dimensionValueName":"{ACCOUNT_NAME}"
}

Note: Create a new webhook for Groups under the same conditions as for the Client entity.

8. Create webhook - Deposit Account Created: repeat the same actions as in step #4 to create a new webhook.
    • Option select Opt-out
    • Target Clients
    • On Event Deposit Account Created
    • Web Hook URL - use the same webhook URL copied at step #4.1
    • Request Type POST
    • Authorization No Authorization
    • Content Type application/json
    • Body of request:

{
 "dimensionCode":"dimension name for storing the Accounts from MS Dynamics",
 "dimensionValueCode":"{ACCOUNT_ID}",
 "dimensionValueName":"{ACCOUNT_NAME}"
}

Note: Create a new webhook for Groups under the same conditions as for the Client entity.

9. Login to your Azure account and take note of the corresponding values for:
    • client ID
    • tenant ID
    • client secret
client/tenat id

secret id

10. Request an authorization code:
  10.1. Go to Postman and create a GET call:
    Method: GET
    URL: https://login.windows.net/{tenant ID}/oauth2/authorize?resource=https://api.businesscentral.dynamics.com
    Headers:Content-Type application/x-www-form-urlencoded
    Params:
    client_id:{client ID}
    response_type:code
    redirect_uri:{redirect_uri}
    response_mode:query
    resource:https://api.businesscentral.dynamics.com
common setup

  10.2. The authorization code can be obtained by accessing the URL generated by Postman in the GET request in your browser. As a first step, you will need to input your credentials in order to complete the authentication.
common setup

Once you have been authenticated and granted consent the authorization code is generated. Take note of the code.
code

Note
Authorization codes are short lived, typically they expire after about 10 minutes.

11. In the MPO environment, open the Common setup process, switch to View mode and press New task. Fill in all the required parameters and click on Add task button. Wait until the task is processed.
common setup

Alternatively, you can use the following JSON. Modify and paste it into the Code editor tab.

{
 "mambuConfigReference": "always `mambu`",
 "mambuUser": "Mambu user",
 "mambuPassword": "Mambu password",
 "mambuUrl": "Mambu tenant URL",
 "code": "authentication code generated for MSD setup",
 "generalJournalName": "General Journal name (max 10 chars)",
 "journalId": "journal id",
 "msdClientId": "MSD client id",
 "msdClientSecret": "MSD client secret",
 "msdUrlV1": "MSD URL - API version V1",
 "msdUrlV2": "MSD URL - API version V2",
 "tenantID": "MSD tenant id",
 "redirectURI": "MSD redirect URI",
 "accountDimenssionCode": "MSD account dimension name",
 "branchDimensionCode": "MSD branch dimension name",
 "clientDimensionCode": "MSD client dimension name",
 "productDimensionCode": "MSD product dimension name",
 "msdConfigReference": "always `msd`",
 "notificationChannel": "`task` for Mambu task or other configurable value",
 "assignedUserKey": "Mambu assigned user key for task creation",
 "timezone": "Mambu tenant timezone. Ex: Europe/London"
}

Note:

  1. The endpoint for the msdUrlV2 should be retrieved from the MS Dynamics environment as it is configurable and might differ from a tenant to another. Also, the the API process endpoint needs updated with the correct web service name for dimension value creation.
  2. If the General Journal has already been manually created in MS Dynamics, its ID must be provided in the Setup process as value for the journalId parameter. Otherwise, a new General Journal will be created when running the setup process and the only required parameter in this case is generalJournalName.

12. Open the process Setup- create dimensionsValues: branch, loan/savings products, switch to View mode, press New task and click on the Add task button.
create dimension setup

Note:

  1. Mambu should be 100% configured. All the branches or products that are created after running this process should be manually created as dimension values in MS Dynamics.
  2. The dimension value description is limited to 50 characters in MS dynamics.

13. Open the process Refresh token, switch to View mode, press New task and click Add task button.
refresh token

Please Note
If import is used to migrate existing data in Mambu, the dimension values for client and account will not be created automatically in MS Dynamics (webhooks cannot be triggered by import) unless the clients and accounts are imported in pre-approved states and then approved manually.
Was This Article Helpful?