Our services allow you to make recurring reads of your clients' bank accounts. Two different functionalities are involved in this process: tokenization of your client's bank credentials, and using those credentials to perform the reading.



assignment_late You will need to register the “fitnance_read” webhook event in order to complete the Bank Read process.

assignment_late You will need to register the “event_credential_token_creation” webhook event in order to get the tokenized credentials.


More on webhooks https://sandbox.unnax.com/3.0/webhooks/webhooks-events



Step 1- Include this HTML code in the template that will host the Payments widget:


<iframe id="frame" name="frame" frameborder="0" width="500" height="680">
</iframe>

This iframe will render the UNNAX Bank Aggregation Widget


Step 2- Expect the {{widget_url}} in your template and render it in your iframe. Include this at the end of your HTML body. 


<script type="text/javascript">
    document.getElementById(“iframe”).src = {{widget_url}}
</script>

 You will get the {{widget_url}} variable in the next step.


Step 3-  Initialize your Widget. Call our Tokenize Credential API Init endpoint with your credentials and transaction information. You will receive a response that looks like this:


{
  "data": {
    "banks": [{...}],
    "products": ["fitnance","fit_cats"],
    "widget_url": "https://integration.unnax.com/widget/reader/?sid=s_400397f2a2044a2595cade39bed8c814",
    "sid": "s_400397f2a2044a2595cade39bed8c814"
  }
} 

For details on how to work with this endpoint, please refer to: 


https://sandbox.unnax.com/3.0/reader-or-account-aggregation/reader-init-api


Step 4- Render your view and pass the {{widget_url}} as a parameter. When rendered inside your iframe, it will display the Unnax Widget. Your client will be able to introduce his credentials and complete the login process. The result will be sent to the Webhook URL set for “event_credential_token_creation” event   



Step 5- Expect the callback. 



assignment_late This Interaction will tokenize the credentials provided, as it is an asynchronous call you will receive the response in the URL set for the “event_credential_token_creation” event webhook.



Step 6- Request a bank read.


If you’ve completed the steps 1 through 5, then you are ready to make recurring reads with the tokenized credentials.



warningYou only have to go through steps 1-5 once for each set of credentials. Once you have tokenized the credential set for a user in a bank, you can jump directly to step 6



In order to make a tokenized read you must use our Api Reader Tokenized endpoint. Here is an example of the request that you would send:


{
    "token_key": "02C2laf93aqberI32yerjm8gPASO34A32",
    "token_id": "25",
    "request_code": "reader_request_code",
    "start_date" : "2016-01-01"
}

Step 7- Expect the callback


You will receive the result of the read in a callback



assignment_late Register the “fitnance_read” event in order to get the result of the tokenized read.