You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.toDate("01/04/2021") // Optional: Default value 1 day less than current date
170
170
.bank("sbi") // Optional: Short code of the bank
171
171
.mode(PDF) // Optional: PDF Mode
172
+
.mobileNumber("9876543210") // Optional: Mobile number
173
+
.journeyMode(MULTI_PDF) // Optional: Multi PDF journey
174
+
.aaJourneyMode(ONLY_RECURRING) // Optional: Recurring AA pulls
175
+
.aaRecurringTenureMonthCount(3) // Optional: Consent duration is valid for 3 months
176
+
.aaRecurringFrequecyUnit(TimeUnit.DAYS) // Optional: Frequency value is in Days
177
+
.aaRecurringFrequencyValue(2) // Optional: Number of times to pull the data
172
178
.build()
173
179
```
174
180
@@ -183,6 +189,12 @@ new FinBoxBankConnect.Builder(getApplicationContext())
183
189
.toDate("01/04/2021") // Optional: Default value 1 day less than current date
184
190
.bank("sbi") // Optional: Short code of the bank
185
191
.mode(PDF) // Optional: PDF Mode
192
+
.mobileNumber("9876543210") // Optional: Mobile number
193
+
.journeyMode(MULTI_PDF) // Optional: Multi PDF journey
194
+
.aaJourneyMode(ONLY_RECURRING) // Optional: Recurring AA pulls
195
+
.aaRecurringTenureMonthCount(3) // Optional: Consent duration is valid for 3 months
196
+
.aaRecurringFrequecyUnit(TimeUnit.DAYS) // Optional: Frequency value is in Days
197
+
.aaRecurringFrequencyValue(2) // Optional: Number of times to pull the data
186
198
.build();
187
199
```
188
200
@@ -197,6 +209,12 @@ new FinBoxBankConnect.Builder(getApplicationContext())
197
209
|`toDate`| specifies the end period of the statement in `DD/MM/YYYY` format | No |
198
210
|`bank`| pass the [bank identifier](/bank-connect/appendix.html#bank-identifiers) to skip the bank selection screen and directly open a that bank's screen instead | No |
199
211
|`mode`| set the mode as pdf (manual upload) or aa (Account Aggregator) or online (Net Banking) | No |
212
+
|`mobile_number`| Prefills phone number in Account Aggregator mode | No |
213
+
|`journey_mode`| Optional parameter to set the journey (i.e.multi_pdf or multi_banking) | No |
214
+
|`aa_journey_mode`| set the journey mode for AA (i.e only_once or only_recurring) | No |
215
+
|`aa_recurring_tenure_month_count`| set the recurring consent duration (min: 1 and max: 24) | No |
216
+
|`aa_recurring_frequecy_unit`| set the frequency unit to pull the data during the recurring consent duration (year, month, day, hour) | No |
217
+
|`aa_recurring_frequency_value`| set the frequency value to pull the data during the recurring consent duration (min: 1 and max: 3) | No |
200
218
201
219
`fromDate` and `toDate` specify the period for which the statements will be fetched. For example, if you need the last 6 months of statements, `fromDate` will be today's date - 6 months and `toDate` will be today's date - 1 day. If not provided the default date range is 6 months from the current date. It should be in `DD/MM/YYYY` format.
| `toDate` | specifies the end period of the statement in `DD/MM/YYYY` format | No |
122
122
| `bank` | pass the [bank identifier](/bank-connect/appendix.html#bank-identifiers) to skip the bank selection screen and directly open a that bank's screen instead | No |
123
123
| `mode` | set the mode as pdf (manual upload) or aa (Account Aggregator) or online (Net Banking) | No |
124
+
| `mobile_number` | Prefills phone number in Account Aggregator mode | No |
125
+
| `journey_mode` | Optional parameter to set the journey (i.e.multi_pdf or multi_banking) | No |
126
+
| `aa_journey_mode` | set the journey mode for AA (i.e only_once or only_recurring) | No |
127
+
| `aa_recurring_tenure_month_count` | set the recurring consent duration (min: 1 and max: 24) | No |
128
+
| `aa_recurring_frequecy_unit` | set the frequency unit to pull the data during the recurring consent duration (year, month, day, hour) | No |
129
+
| `aa_recurring_frequency_value` | set the frequency value to pull the data during the recurring consent duration (min: 1 and max: 3) | No |
124
130
125
131
`fromDate`and `toDate` specify the period for which the statements will be fetched. For example, if you need the last 6 months of statements, `fromDate` will be today's date - 6 months and `toDate` will be today's date - 1 day. If not provided the default date range is 6 months from the current date. It should be in `DD/MM/YYYY` format.
Copy file name to clipboardExpand all lines: docs/bank-connect/javascript.md
+36-7
Original file line number
Diff line number
Diff line change
@@ -3,21 +3,25 @@ base_url: https://apis.bankconnect.finbox.in/bank-connect #base URL for the API
3
3
version: v1# version of API
4
4
---
5
5
# BankConnect: JavaScript
6
+
6
7
The JavaScript SDK helps user submit their bank statements via upload or net banking credentials in your Web applications. The SDK will be opened via a web URL.
7
8
8
9
The first step in integration involves calling the [Session API](/bank-connect/javascript.html#session-api)
9
10
Then the workflow can be implemented in one of the following ways:
11
+
10
12
-[Load in a new page with redirect URL](/bank-connect/javascript.html#redirect-workflow)
11
13
-[Embedding inside an Inline Frame (`<iframe>`)](/bank-connect/javascript.html#inline-frame-workflow)
12
14
13
15
## Session API
16
+
14
17
To start with the integration, call the following API to create a session:
15
18
16
19
::: tip Endpoint
17
20
POST **{{$page.frontmatter.base_url}}/{{$page.frontmatter.version}}/session/**
18
21
:::
19
22
20
23
### Parameters
24
+
21
25
| Name | Type | Description | Required | Default |
22
26
| - | - | - | - | - |
23
27
| link_id | string | link_id value | Yes | - |
@@ -28,31 +32,42 @@ POST **{{$page.frontmatter.base_url}}/{{$page.frontmatter.version}}/session/**
28
32
| logo_url | string | An optional parameter to show logo branding in bankconnect SDK. Should be a URL.| No | - |
29
33
| bank_name | string | pass the [bank identifier](/bank-connect/appendix.html#bank-identifiers) to skip the bank selection screen and directly open a that bank's screen instead | No | - |
30
34
| mode | string | optional parameter to set the mode(i.e. pdf, aa, and online) | No | - |
35
+
| mobile_number | string | Prefills phone number in Account Aggregator mode | No | - |
36
+
| journey_mode | string | Optional parameter to set the journey (i.e.multi_pdf or multi_banking) | No | - |
37
+
| aa_journey_mode | string | set the journey mode for AA (i.e only_once or only_recurring) | No | - |
38
+
| aa_recurring_tenure_month_count | integer | set the recurring consent duration (min: 1 and max: 24) | No | - |
39
+
| aa_recurring_frequecy_unit | string | set the frequency unit to pull the data during the recurring consent duration (year, month, day, hour) | No | - |
40
+
| aa_recurring_frequency_value | integer | set the frequency value to pull the data during the recurring consent duration (min: 1 and max: 3) | No | - |
31
41
32
42
`from_date` and `to_date` specify the period for which the statements will be fetched. For example, if you need the last 6 months of statements, `from_date` will be today's date - 6 months and `to_date` will be today's date - 1 day. If not provided the default date range is 6 months from the current date. It should be in `DD/MM/YYYY` format.
33
43
34
44
<b>Note</b>: If the `to-date` lies in the first week of the month, the respective month is not considered in the journey.
35
45
36
46
::: warning NOTE
47
+
37
48
-`redirect_url` in request is a compulsory field in [Redirect Workflow](/bank-connect/javascript.html#redirect-workflow) but is not required with the [Inline Frame workflow](/bank-connect/javascript.html#inline-frame-workflow)
38
49
- Please make sure `from_date` is always less than `to_date`
39
50
- Make sure `to_date` is never today's date, the maximum possible value for it is today's date - 1 day
40
51
:::
41
52
42
53
### Response
54
+
43
55
On successful API call, it gives a **200 HTTP code** with a response in following format:
- Create a session using [Session API](/bank-connect/javascript.html#session-api)
72
88
- Get the URL received from above API and embed it in an `<iframe>`
73
89
- You'll [receive callbacks](/bank-connect/javascript.html#receive-callbacks) by implementing an event listener. Based on the event you can close / hide the inline frame.
74
90
75
91
## Receive callbacks
92
+
76
93
1. To receive callbacks in `<iframe>` workflow, you need to implement an event listener. It can be implemented as follows:
77
94
78
95
```html
@@ -90,20 +107,25 @@ The flow for this involves the following steps:
90
107
```
91
108
92
109
2. To receive callbacks in `Android WebView`, a [Javascript Interface](https://developer.android.com/guide/webapps/webview#UsingJavaScript) can be used to get the events.
110
+
93
111
- Interface Name: `BankConnectAndroid`
94
112
- Callback Functions
95
-
- All Events: `onResult`
96
-
- Error: `onError`
97
-
- Exit: `onExit`
98
-
- Success: `onSuccess`
99
-
- Extra Info: `onInfo`
113
+
- All Events: `onResult`
114
+
- Error: `onError`
115
+
- Exit: `onExit`
116
+
- Success: `onSuccess`
117
+
- Extra Info: `onInfo`
100
118
101
119
### Event Object
120
+
102
121
The `event` object received by the listener can be one of the following:
122
+
103
123
#### Success
124
+
104
125
This is received when user completes the upload process.
105
126
106
127
1. Iframe
128
+
107
129
```js
108
130
{
109
131
type:"finbox-bankconnect",
@@ -118,6 +140,7 @@ This is received when user completes the upload process.
118
140
2. WebView
119
141
120
142
`BankConnectAndroid.onSuccess`
143
+
121
144
```js
122
145
{
123
146
"entityId":"1d1f-sfdrf-17hf-asda", //Unique ID that will used to fetch statement data
@@ -126,9 +149,11 @@ This is received when user completes the upload process.
126
149
```
127
150
128
151
#### Exit
152
+
129
153
This is received when user exits the SDK.
130
154
131
155
1. Iframe
156
+
132
157
```js
133
158
{
134
159
type:"finbox-bankconnect",
@@ -151,9 +176,11 @@ This is received when user exits the SDK.
151
176
```
152
177
153
178
#### Error
179
+
154
180
This is received whenever any error occurs in the user flow.
155
181
156
182
1. Iframe
183
+
157
184
```js
158
185
{
159
186
type:"finbox-bankconnect",
@@ -182,11 +209,12 @@ In case an error occurs, you'll receive `OnError` event payload, and then if the
182
209
:::
183
210
184
211
##### Error types
212
+
185
213
In case of Error, error_type of ```MUXXX``` implies an error in Manual PDF Upload and ```NBXXX``` implies its from Netbanking.
186
214
187
215
| Case | error_type | Sample payload|
188
216
| - | - | - |
189
-
| Trial Expired for Dev Credentials | MU002 |```{"reason:"Trial Expired for Dev Credentials",linkID:"<USER_ID_PASSED>","error_type":"MU002"}```|
217
+
| Trial Expired for Dev Credentials | MU002 |```{"reason:"Trial Expired for Dev Credentials",linkID:"<USER_ID_PASSED>","error_type":"MU002"}```|
190
218
| PDF Password Incorrect | MU003 |```{"reason:"Password Incorrect",linkID:"<USER_ID_PASSED>","error_type":"MU003"}```|
191
219
| Specified bank doesn't match with detected bank | MU004 |```{"reason:"Not axis statement",linkID:"<USER_ID_PASSED>","error_type":"MU004"}```|
192
220
| Non Parsable PDF - PDF file is corrupted or has no selectable text (only scanned images)| MU006 |```{"reason:"",linkID:"<USER_ID_PASSED>","error_type":"MU006"}```|
@@ -197,11 +225,12 @@ In case of Error, error_type of ```MUXXX``` implies an error in Manual PDF Uplo
0 commit comments