v5 Master: Inventory
Dynamic Document API สำหรับข้อมูลสินค้า
Module
ic.inventory
EndPoint
http
POST /SMLJavaRESTService/v5/api/documents/ic.inventory
GET /SMLJavaRESTService/v5/api/documents/ic.inventory/{code}Table Mapping
| Section | Table | Type | Link |
|---|---|---|---|
header | ic_inventory | object | key: code |
details | ic_inventory_detail | array | ic_inventory_detail.ic_code = header.code |
POST Example
json
{
"items": [
{
"header": {
"code": "ITEM260609001",
"name_1": "สินค้า A",
"unit_type": 0,
"item_type": 0,
"status": 0
},
"details": [
{
"barcode": "885000000001",
"unit_code": "PCS",
"stand_value": 1,
"divide_value": 1
}
]
},
{
"header": {
"code": "ITEM260609002",
"name_1": "สินค้า B",
"unit_type": 0,
"item_type": 0,
"status": 0
},
"details": [
{
"barcode": "885000000002",
"unit_code": "PCS",
"stand_value": 1,
"divide_value": 1
}
]
}
]
}GET Example
http
GET http://localhost:8086/SMLJavaRESTService/v5/api/documents/ic.inventory/ITEM260609001json
{
"success": true,
"data": {
"items": [
{
"header": {
"code": "ITEM260609001",
"name_1": "สินค้า A",
"unit_type": 0,
"item_type": 0,
"status": 0
},
"details": [
{
"ic_code": "ITEM260609001",
"barcode": "885000000001",
"unit_code": "PCS",
"stand_value": 1,
"divide_value": 1
}
]
}
]
}
}Rules
header.codeเป็น key หลัก- ถ้าไม่ส่ง
details[].ic_codeระบบจะเติมจากheader.code - field ที่ไม่มีใน
ic_inventoryหรือic_inventory_detailจะ errorFIELD_NOT_FOUND