
Nomor Pokok Wajib Pajak (NPWP)
Nomor Pokok Wajib Pajak (NPWP).
Before using the NPWP OCR service, please review the OCR limitations that may affect text recognition accuracy.
NPWP Object
- Name
status- Type
- string
- Description
Enum code indicating the status of the reading result.
SUCCESSNO_FILEFILE_INVALID_FORMATFAILED
- Name
reason- Type
- string
- Description
A human-readable message providing more details about the reading result.
- Name
read- Type
- object
- Description
Contains the reading for each NPWP fields. Each field contains:
confidence(number): Overall confidence score in percentagevalue(string): The processed/extracted valuevalue_original(string): The original text as read from the documentconfidence_text(number): Text recognition confidence in percentagepolygon(array): Array of coordinate pairs[x, y]representing the bounding box of the fieldpage_index(number): Page number where the field was found (0-indexed)
The response format for the
/ocr/v1/npwpendpoint may differ from other OCR endpoints. This endpoint returns additional metadata including polygon coordinates and page indices.- Name
alamat- Type
- object
- Description
Address.
- Name
nama- Type
- object
- Description
Name.
- Name
nik- Type
- object
- Description
KTP number.
- Name
noNpwp- Type
- object
- Description
NPWP number.
Read NPWP
Detects a valid NPWP image and returns the information as text.
Required parameter
- Name
image- Type
- file (.png, .jpg, .jpeg, .pdf, .tiff)
- Description
The image file for the NPWP.
Sample Request
1
2
3
4
5
import ApiClient from '@glair/vision';
const vision = new Vision({ apiKey: 'api-key', username: 'username', password: 'password' });
await vision.ocr.npwp({ image: '/path/to/image/NPWP.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
{
"status": "SUCCESS",
"reason": "File Successfully Read",
"read": {
"alamat": {
"confidence": 97,
"confidence_text": 99.99,
"polygon": [
[121, 87],
[223, 87],
[223, 100],
[121, 100]
],
"page_index": 0,
"value": "JL. PELELANGAN IKAN NO. RT.002 RW.002\nKEL.MA,JAKERTA KEC.BALONGAN\nINDRAMAYU, JAWA BARAT",
"value_original": "JL. PELELANGAN IKAN NO. RT.002 RW.002\nKEL.MA,JAKERTA KEC.BALONGAN\nINDRAMAYU, JAWA BARAT"
},
"nama": {
"confidence": 99,
"confidence_text": 99.99,
"polygon": [
[121, 87],
[223, 87],
[223, 100],
[121, 100]
],
"page_index": 0,
"value": "BERSATU",
"value_original": "BERSATU"
},
"nik": {
"confidence": 0,
"confidence_text": 99.99,
"polygon": [
[121, 87],
[223, 87],
[223, 100],
[121, 100]
],
"page_index": 0,
"value": "",
"value_original": ""
},
"noNpwp": {
"confidence": 99,
"confidence_text": 99.99,
"polygon": [
[121, 87],
[223, 87],
[223, 100],
[121, 100]
],
"page_index": 0,
"value": "70.943.997.0-437.000",
"value_original": "70.943.997.0-437.000"
}
}
}
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 NPWP image
Response
1
2
3
4
5
{
"status": "SUCCESS",
"reason": "File Successfully Read",
//...,
}
200 - OK
Request with non NPWP image
Response
1
2
3
4
5
{
"status": "SUCCESS",
"reason": "File successfully read. Some fields are invalid.",
//...,
}
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",
//...,
}