PP 30 OCR
API Documentation for PP 30 OCR
Extract PP30 information from image
Error Definition
http status | error_code | error_message |
---|---|---|
200 | - | - |
400 | 001 | cannot convert image please check your image (image must be base64 of png,jpg,tif,tiff,pdf) |
400 | 002 | cannot convert image please check your image (image must be base64 and image size must between 500x500 and 10000x10000) |
400 | 003 | cannot find any field in document please check your image data |
500 | 500 | some error occur in serverside |
Key Definition
key name | key thai |
---|---|
tax_id_number | เลขประจำตัวผู้เสียภาษี |
monthly_sales | ยอดขายในเดือนนี้ (หัวข้อ 1) |
type_document | แบบที่ยื่น |
entrepreneur_name | ชื่อผู้ประกอบการ |
establishment | ชื่อสถานประกอบการ |
tax_summary_11 | ภาษีสุทธิ ต้องชำระ (หัวข้อ 11) |
tax_summary_12 | ภาษีสุทธิ ชำระเกิน (หัวข้อ 12) |
type_tax_filling | แบบที่ยื่น |
month_tax_filling | เดือนภาษี |
PP 30 OCR
POST https://apis.aigen.online/aiscript/pp-30/v1
Request Body
Name | Type | Description |
---|---|---|
image* | String | Base64 image encoded string |
- 200: OK Successful response
- 400: Bad Request Bad request
- 422: Unprocessable Entity Missing or invalid input
{
"status": "200",
"message": "success",
"respones_id": "string",
"error_list": [
{
"code": "string",
"message": "string"
}
],
"result": [
{
"key": "sales",
"text": "4516.50",
"bboxes": [
[
[
0
]
]
]
}
]
}
{
"status": "001",
"message": "error",
"respones_id": "string",
"error_list": "cannot convert image please check your image (image must be base64 of png,jpg,tif,tiff,pdf)",
"result": null
}
{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}
Example code
- Python
- Nodejs
import requests
import json
api = "https://apis.aigen.online/aiscript/pp-30/v1"
headers = {"x-aigen-key": "<key>", "content-type": "application/json"}
data = json.dumps({"image": "<base64_string>"})
res = requests.post(api, data=data, headers=headers)
print(res.json())
const axios = require("axios");
const api = "https://apis.aigen.online/aiscript/pp-30/v1";
const headers = {
"x-aigen-key": "<key>",
};
const data = { image: "<base64_string>" };
axios
.post(api, data, { headers: headers })
.then((res) => {
console.log(res.data);
})
.catch((err) => {
console.error(err.response.data);
});