Bank Statement (Bank Statement)
Bank Statement (Bank Statement).
Bank Statement Object
- Name
status
- Type
- string
- Description
Enum code indicating the status of the reading result.
SUCCESS
NO_FILE
FILE_INVALID_FORMAT
FAILED
- Name
reason
- Type
- string
- Description
A human-readable message providing more details about the reading result.
- Name
read
- Type
- object
- Description
Contains the extracted information for each field in the Bank Statement. Each fields has
value
(The reading),page_index
,polygon
(coordinates of the value: top-left, top-right, bottom-right,bottom-left),confidence
(in percentage), andconfidence_text
.- Name
bank_name
- Type
- string
- Description
The name of the bank
- Name
account_number
- Type
- string
- Description
The account number of the customer
- Name
account_name
- Type
- string
- Description
The account owner name
- Name
currency
- Type
- string
- Description
The currency used in the bank statement.
- Name
beginning_balance
- Type
- string
- Description
The balance that is carried forward from the previous period
- Name
total_debit_transaction
- Type
- string
- Description
The total amount of debit recorded in the statement
- Name
total_credit_transaction
- Type
- string
- Description
The total amount of credit recorded in the statement
- Name
product_name
- Type
- string
- Description
The bank product which the customer applied for. The example is savings account, deposit, foreign exchange services, etc
- Name
start_period
- Type
- string
- Description
The start period of the bank statement records (generally in date format)
- Name
end_period
- Type
- string
- Description
The end period of the bank statement records (generally in date format)
- Name
transactions
- Type
- array of object
- Description
Information of all recorded transactions
- Name
posting_date
- Type
- string
- Description
The date on which a transaction is posted or entered into the system
- Name
posting_time
- Type
- string
- Description
The time on which a transaction is posted or entered into the system
- Name
effective_date
- Type
- string
- Description
The date on which a transaction actually takes place or becomes effective
- Name
effective_time
- Type
- string
- Description
The time on which a transaction actually takes place or becomes effective
- Name
description
- Type
- string
- Description
The transaction's description
- Name
debit_transaction
- Type
- string
- Description
The debit transaction amount
- Name
credit_transaction
- Type
- string
- Description
The credit transaction amount
- Name
signed_amount
- Type
- string
- Description
The account balance amount
Read Bank Statement
Detects a valid Bank Statement image and returns the information as text.
Required parameter
- Name
image
- Type
- file (.png, .jpg, .jpeg, .tiff, .pdf)
- Description
The image file for the Bank Statement.
Sample Request
1
2
3
4
5
import { Vision } from '@glair/vision';
const vision = new Vision({ apiKey: 'api-key', username: 'username', password: 'password' });
await vision.ocr.bankStatement({ image: '/path/to/image/Bank-Statement.jpg' });
Sample Response
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
{
"status": "SUCCESS",
"reason": "File Successfully Read",
"read": {
"bank_name": {
"value": "BCA",
"page_index": 0,
"polygon": [[0, 0], [1, 0], [1, 1], [0, 1]],
"confidence": 98,
"confidence_text": 98
},
"start_period": {
"value": "2018-05-01",
"page_index": 0,
"polygon": [[0, 0], [1, 0], [1, 1], [0, 1]],
"confidence": 98,
"confidence_text": 98
},
"end_period": {
"value": "2018-05-31",
"page_index": 0,
"polygon": [[0, 0], [1, 0], [1, 1], [0, 1]],
"confidence": 98,
"confidence_text": 98
},
"account_number": {
"value": "080989999",
"page_index": 0,
"polygon": [[0, 0], [1, 0], [1, 1], [0, 1]],
"confidence": 62,
"confidence_text": 62
},
"account_name": {
"value": "Nama orang / PT bersangkutan",
"page_index": 0,
"polygon": [[0, 0], [1, 0], [1, 1], [0, 1]],
"confidence": 87,
"confidence_text": 87
},
"beginning_balance": {
"value": 10000000,
"page_index": 0,
"polygon": [[0, 0], [1, 0], [1, 1], [0, 1]],
"confidence": 98,
"confidence_text": 98
},
"total_debit_transaction": {
"value": 2500000,
"page_index": 0,
"polygon": [[0, 0], [1, 0], [1, 1], [0, 1]],
"confidence": 98,
"confidence_text": 98
},
"total_credit_transaction": {
"value": 3000000,
"page_index": 0,
"polygon": [[0, 0], [1, 0], [1, 1], [0, 1]],
"confidence": 98,
"confidence_text": 98
},
"currency": {
"value": "IDR",
"page_index": 0,
"polygon": [[0, 0], [1, 0], [1, 1], [0, 1]],
"confidence": 98,
"confidence_text": 98
},
"product_name": {
"value": "Savings",
"page_index": 0,
"polygon": [[0, 0], [1, 0], [1, 1], [0, 1]],
"confidence": 98,
"confidence_text": 98
},
"total_transactions": {
"value": 1000000,
"page_index": 0,
"polygon": [[0, 0], [1, 0], [1, 1], [0, 1]],
"confidence": 98,
"confidence_text": 98
},
"transactions": [
{
"posting_date": {
"value": "2022-03-21",
"page_index": 0,
"polygon": [[0, 0], [1, 0], [1, 1], [0, 1]],
"confidence": 95,
"confidence_text": 95
},
"posting_time": {
"value": "10:01:00",
"page_index": 0,
"polygon": [[0, 0], [1, 0], [1, 1], [0, 1]],
"confidence": 95,
"confidence_text": 95
},
"effective_date": {
"value": "2022-03-21",
"page_index": 0,
"polygon": [[0, 0], [1, 0], [1, 1], [0, 1]],
"confidence": 95,
"confidence_text": 95
},
"effective_time": {
"value": "10.01.00",
"page_index": 0,
"polygon": [[0, 0], [1, 0], [1, 1], [0, 1]],
"confidence": 95,
"confidence_text": 95
},
"description": {
"value": "Auto debet",
"page_index": 0,
"polygon": [[0, 0], [1, 0], [1, 1], [0, 1]],
"confidence": 95,
"confidence_text": 95
},
"debit_transaction": {
"value": 450000,
"page_index": 0,
"polygon": [[0, 0], [1, 0], [1, 1], [0, 1]],
"confidence": 95,
"confidence_text": 95
},
"credit_transaction": {
"value": 450000,
"page_index": 0,
"polygon": [[0, 0], [1, 0], [1, 1], [0, 1]],
"confidence": 95,
"confidence_text": 95
},
"mutation_amount": {
"value": 450000,
"page_index": 0,
"polygon": [[0, 0], [1, 0], [1, 1], [0, 1]],
"confidence": 95,
"confidence_text": 95
},
"signed_amount": {
"value": 450000,
"page_index": 0,
"polygon": [[0, 0], [1, 0], [1, 1], [0, 1]],
"confidence": 95,
"confidence_text": 95
}
}
]
}
}
Request ID
An associated request identifier is generated for every request made to this endpoint.
This value can be found in the response headers under Request-Id
Responses
Various responses for this endpoint, in addition to general responses specified in Errors.
200 - OK
Request with readable Bank Statement image
Response
1
2
3
4
5
{
"status": "SUCCESS",
"reason": "File Successfully Read",
//...,
}
// TODO: no "Request with non Bank Statement File"?
400 - Bad Request
Request without form-data image
Response
1
2
3
4
5
{
"status": "NO_FILE",
"reason": "No file in request body",
//...,
}
415 - Unsupported Media Type
Request with non-image file format
Response
1
2
3
4
5
{
"status": "FILE_INVALID_FORMAT",
"reason": "Failed to process invalid file format. Please upload the correct file format",
//...,
}