v5 Master: Customer
Dynamic Document API สำหรับข้อมูลลูกหนี้
Module
ar.customer
EndPoint
http
POST /SMLJavaRESTService/v5/api/documents/ar.customer
GET /SMLJavaRESTService/v5/api/documents/ar.customer/{code}Table Mapping
| Section | Table | Type | Link |
|---|---|---|---|
header | ar_customer | object | key: code |
details | ar_customer_detail | array | ar_customer_detail.ar_code = header.code |
POST Example
json
{
"items": [
{
"header": {
"code": "AR260609001",
"name_1": "บริษัท ตัวอย่าง 001",
"address": "Bangkok",
"telephone": "021111111",
"status": 0
},
"details": [
{
"branch_code": "00000",
"branch_type": 0,
"tax_id": "0105566000001",
"credit_day": 30,
"credit_money": 50000
}
]
},
{
"header": {
"code": "AR260609002",
"name_1": "บริษัท ตัวอย่าง 002",
"address": "Chiang Mai",
"telephone": "053111111",
"status": 0
},
"details": [
{
"branch_code": "00000",
"branch_type": 0,
"tax_id": "0105566000002",
"credit_day": 15,
"credit_money": 30000
}
]
}
]
}GET Example
http
GET http://localhost:8086/SMLJavaRESTService/v5/api/documents/ar.customer/AR260609001json
{
"success": true,
"data": {
"items": [
{
"header": {
"code": "AR260609001",
"name_1": "บริษัท ตัวอย่าง 001",
"address": "Bangkok",
"telephone": "021111111",
"status": 0
},
"details": [
{
"ar_code": "AR260609001",
"branch_code": "00000",
"branch_type": 0,
"tax_id": "0105566000001",
"credit_day": 30,
"credit_money": 50000,
"line_number": 1
}
]
}
]
}
}Rules
header.codeเป็น key หลัก- ถ้าไม่ส่ง
details[].ar_codeระบบจะเติมจากheader.code - field ที่ไม่มีใน
ar_customerหรือar_customer_detailจะ errorFIELD_NOT_FOUND