Background supergraphic

Nomor Pokok Wajib Pajak (NPWP)

Nomor Pokok Wajib Pajak (NPWP).

NPWP Object

  • Name
    status
    Type
    string
    Description

    Enum code indicating the status of the reading result.

    1. SUCCESS
    2. NO_FILE
    3. FILE_INVALID_FORMAT
    4. FAILED
  • 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 fields has confidence (in percentage) and value (the reading).

    • 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.


POST/ocr/v1/npwp

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

POST
/ocr/v1/npwp
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
{ "status": "SUCCESS", "reason": "File Successfully Read", "read": { "alamat": { "confidence": 97, "value": "JL. PELELANGAN IKAN NO. RT.002 RW.002\nKEL.MA,JAKERTA KEC.BALONGAN\nINDRAMAYU, JAWA BARAT" }, "nama": { "confidence": 99, "value": "BERSATU" }, "nik": { "confidence": 0, "value": "" }, "noNpwp": { "confidence": 99, "value": "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", //..., }