Payslip OCR

Response Definition

HTTP StatusCodeMessageDescription

200

-

success

OCR success.

206

partial_content

partial content

Some pages might not be a valid payslip document.

400

bad_request

Bad Request

Not a valid base64 image request (must be .jpg, .jpeg, .png, .pdf) or invalid size, request schema.

413

request_entity_too_large

Request entity too large

Request image’s size is too large.

500

internal_server_error

Internal server error

some errors occur at the server side.

Extract Shipping Invoice Information

POST https://apis.aigen.online/aiscript/payslip/v2

Request Body

NameTypeDescription

image*

String

Base64 image encoded stringBase64 image encoded string

{'response_id': '',
 'status': 'success',
 'error': [],
 'data': [{'name': {'value': 'Chaiyasit',
    'bboxes': [[[756, 355], [1332, 355], [1332, 406], [756, 406]]],
    'bboxes_norm': [[[0.3048, 0.1012],
      [0.5371, 0.1012],
      [0.5371, 0.1158],
      [0.3048, 0.1158]]],
    'confidence': 0.9627},
   'lastname': {'value': 'Kumtornkittikul',
    'bboxes': [[[756, 355], [1332, 355], [1332, 406], [756, 406]]],
    'bboxes_norm': [[[0.3048, 0.1012],
      [0.5371, 0.1012],
      [0.5371, 0.1158],
      [0.3048, 0.1158]]],
    'confidence': 0.9833},
   'company_name': {'value': 'Mitsubishi Electric Factory Automation (Thailand) MlecTac Charges for the Better Co.,Ltd.',
    'bboxes': [[[306, 164], [1360, 164], [1360, 234], [306, 234]],
     [[1742, 125], [1968, 125], [1968, 258], [1742, 258]],
     [[1626, 222], [1957, 222], [1957, 288], [1626, 288]],
     [[750, 251], [921, 251], [921, 326], [750, 326]]],
    'bboxes_norm': [[[0.1234, 0.0468],
      [0.5484, 0.0468],
      [0.5484, 0.0667],
      [0.1234, 0.0667]],
     [[0.7024, 0.0356], [0.7935, 0.0356], [0.7935, 0.0736], [0.7024, 0.0736]],
     [[0.6556, 0.0633], [0.7891, 0.0633], [0.7891, 0.0821], [0.6556, 0.0821]],
     [[0.3024, 0.0716], [0.3714, 0.0716], [0.3714, 0.093], [0.3024, 0.093]]],
    'confidence': 0.7891},

import requests

api = "https://apis.aigen.online/aiscript/payslip/v2"
headers = {"x-aigen-key": "<key>"}
data = {"image": "<base64_string>"}

res = requests.post(api, json=data, headers=headers)
print(res.json())

Last updated