Skip to content

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

SectionTableTypeLink
headerar_customerobjectkey: code
detailsar_customer_detailarrayar_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/AR260609001
json
{
  "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 จะ error FIELD_NOT_FOUND