Skip to content

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

SectionTableTypeLink
headeric_inventoryobjectkey: code
detailsic_inventory_detailarrayic_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/ITEM260609001
json
{
  "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 จะ error FIELD_NOT_FOUND