Skip to content

Supplier

API ระบบเจ้าหนี้

Supplier List

ดึงข้อมูลเจ้าหนี้ ทีละหลาย ๆ รายการ

EndPoint

GET /SMLJavaRESTService/v3/api/supplier

Parameter:

Request Header:

Required SMLRequestHeader

Query Parameter:

NameDescriptiondefault
pageหน้าที่ต้องการแสดงข้อมูล1
sizeจำนวนรายการต่อ 1 หน้า20

example:

GET http://localhost:8086/SMLJavaRESTService/v3/api/supplier?page=1&size=2

Response Success:

HTTP Status : 200

Field NameDescriptionExample
successสถานะการดำเนินการtrue
dataรายละเอียดข้อมูลเจ้าหนี้Supplier Data Object
pagesรายละเอียดหน้าข้อมูลPageable Data Object

example:

json
{
  "success": true,
  "data": [
    {
      "code": "AP01-001",
      "name": "บริษัท ทดสอบ 1 จำกัด",
      "address": "ซอยพระรามที่ 2 ซอย 3 แยก 3 แขวงบางมด เขตจอมทอง กรุงเทพฯ 10150\n",
      "telephone": "02-999-9999",
      "status": 0,
      "branch_status": 0,
      "tax_id": "0000000000"
    },
    {
      "code": "AP01-002",
      "name": "บริษัท ทดสอบ 2 จำกัด",
      "address": "ถนนสีลม แขวงสีลม เขตบางรัก กรุงเทพฯ 10500",
      "telephone": "02-636-6111",
      "status": 0,
      "branch_status": 0,
      "tax_id": "0000000000"
    }
  ],
  "pages": {
    "size": 2,
    "page": 1,
    "total_record": 273,
    "max_page": 137
  }
}

Response Error:

HTTP Status : 500

Field NameDescriptionExample
errortrue
codestring
messagestring

example:

json
{
  "error": true,
  "code": "99",
  "message": "Error Message"
}

Add Supplier

เพิ่มข้อมูลเจ้าหนี้

EndPoint

POST /SMLJavaRESTService/v3/api/supplier

Header

Required SMLRequestHeader

Body Data:

JSON body with Supplier Request Attrubte

example

POST /SMLJavaRESTService/v3/api/supplier/
Content-Type: application/json
GUID: SMLX
provider: DEBUG
databaseName: debug

{
  "code" : "AP0001",
  "name1" : "Supplier Name",
  "address" : "Supplier Address",
  "province" : "01",
  "amper" : "0101",
  "tambon" : "010101",
  "telephone" : "",
  "supplier_detail" : {
    "account_code" : "130000",
    "tax_id" : "0000000000000",
    "card_id": "0000000000000"
  }
}

Data Validate

ตรวจสอบข้อมูลเจ้าหนี้ ก่อนทำการ เพิ่ม หรือ แก้ไข

POST /SMLJavaRESTService/v3/api/supplier/validate

{
  "code" : "AP0001",
  "name1" : "Supplier Name",
  "address" : "Supplier Address",
  "province" : "01",
  "amper" : "0101",
  "tambon" : "010101",
  "telephone" : "",
  "supplier_detail" : {
    "account_code" : "130000",
    "tax_id" : "0000000000000",
    "card_id": "0000000000000"
  }
}
json
{
    "success": true,
    "data": {
        "code": "AP0001",
        "name1": "Supplier Name",
        "address": "Supplier Address",
        "tambon": "010101",
        "amper": "0101",
        "province": "01",
        "telephone": "",
        "debtBalance": 0.0,
        "chqBalance": 0.0,
        "billBalance": 0.0,
        "supplierDetail": {
            "taxId": "0000000000000",
            "taxRate": 0.0,
            "accountCode": "130000",
            "cardId": "0000000000000"
        }
    }
}