Skip to content

Supplier Service

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


Header Request

FieldValue
GUIDGUID สำหรับการเชื่อมต่อ (smlx เสมอ)
providerชื่อผู้ใช้บริการ
databaseNameชื่อฐานข้อมูล
configFileNameไฟล์ตั้งค่าผู้ให้บริการ
ใส่ SMLConfig และตามด้วยชื่อผู้ให้บริการ และตามด้วย .xml (SMLConfig___.xml)

Header Example

{
  "GUID" : "smlx"
  "provider" : "DATA"
  "databaseName" : "data1"
  "configFileName" : "SMLConfigDATA.xml"
}

HTTP Response

StatusDescripton
200Success return with data
500Bas Request
401Unauthorize

Supplier List

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

EndPoint

GET /SMLJavaRESTService/supplier/v4

Query Request

FieldDescription
pagenumber of page
sizepage size

Example:

GET localhost:8084/SMLJavaRESTService/supplier/v4?page=1&size=2

Supplier Information

เป็นการดึงข้อมูลเจ้าหนี้มาแสดงทีละ 1 รายการโดยจะต้องระบุรหัสเจ้าหนี้

EndPoint

GET /SMLJavaRESTService/supplier/v4/{code}

Path Parameter:

NameDescriptionExample
codeรหัสเจ้าหนี้AP001

example:

GET localhost:8084/SMLJavaRESTService/supplier/v4/AP001

Response Success

{
    "success": true,
    "data": {
        "code": "AP001",
        "code_old": "",
        "name_1": "เจ้าหนี้ทั่วไป",
        "prefixname": "",
        "firstname": "",
        "lastname": "",
        "address": "ที่อยู่",
        "remark": "",
        "status": 0,
        "debt_balance": 0.0,
        "chq_balance": 0.0,
        "bill_balance": 0.0,
        "ap_status": 1,
        "supplier_detail": {
            "ap_code": "AP020",
            "tax_rate": 0.0
        }
    }
}

Response Error

  {
    "error": true,
    "code": "99",
    "message": "error message"
  }

Add Supplier

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

EndPoint

POST /SMLJavaRESTService/supplier/v4/

Body Data:

JSON body with Supplier Request Attribute

example:

{
    "code": "AP001",
    "code_old": "",
    "name_1": "เจ้าหนี้ จาก API",
    "prefixname": "",
    "firstname": "",
    "lastname": "",
    "ap_status": 1,
    "address": "",
    "remark": "",
    "supplier_detail": {
        "ap_code": "AP019",
        "account_code": "212010",
        "group_main": "APG-001",
        "group_sub_1": "APGS1-001"
    }
}

Edit Supplier

แก้ไขข้อมูลเจ้าหนี้ใหม่

EndPoint

PUT /SMLJavaRESTService/supplier/v4/{code}

Path Parameter:

NameDescriptionExample
codeรหัสเจ้าหนี้AP001

example:

PUT localhost:8084/SMLJavaRESTService/supplier/v4/AP001

Body Data:

JSON body with Supplier Request Attribute

example:

{
    "code": "AP001",
    "code_old": "",
    "name_1": "เจ้าหนี้แก้ไข จาก API",
    "prefixname": "",
    "firstname": "",
    "lastname": "",
    "ap_status": 1,
    "address": "",
    "remark": "",
    "supplier_detail": {
        "ap_code": "AP019"
    }
}

Supplier Attribute

Field NameField TypeLengthDescriptionRequired
codeString25รหัสT
code_oldString25รหัสเก่า
name_1String100ชื่อ 1T
name_2String100ชื่อ 2
name_eng_1String100ชื่อ (ภาษาอังกฤษ) 1
name_eng_2String100ชื่อ (ภาษาอังกฤษ) 2
prefixnameString15คำนำหน้า
firstnameString50ชื่อ
lastnameString70นามสกุล
addressString255ที่อยู่
address_engString255ที่อยู่ (ภาษาอังกฤษ)
tambonString25ตำบล/แขวง
amperString25อำเภอ/เขต
provinceString25จังหวัด
zip_codeString10รหัสไปรษณีย์
telephoneString150หมายเลขโทรศัพท์
faxString50หมายเลขโทรสาร
emailString255อีเมล์
websiteString255เวบไซด์
descriptionString255รายละเอียด
ap_typeString25ประเภทเจ้าหนี้
remarkString255หมายเหตุ
statusInteger0สถานะ
guid_codeString35GUID
debt_balancefloat0ยอดคงเหลือ
chq_balancefloat0ยอดเช็ครอขึ้นเงิน
bill_balancefloat0ยอดรับวางบิลรอจ่าย
ap_statusInteger0ชนิดเจ้าหนี้
doc_format_codeString25รหัสเอกสาร
countryString255ประเทศ
intercoString255INTERCO
create_datetimeDate0วันที่สร้าง
last_update_date_timeDate0วันที่แก้ไขล่าสุด
create_codeString50ผู้สร้าง
last_update_codeString50ผู้แก้ไขล่าสุด
use_partnersInteger0ใช้ระบบคู่ค้า
ap_web_serviceString255web service url
ap_database_nameString255ชื่อฐานข้อมูล
use_ar_codeString255รหัสลูกนี้ที่ใช้กับคู่ค้า
supplier_detailArrayObjectรายละเอียดเจ้าหนี้

Supplier Detail

Field NameField TypeLengthDescriptionRequired
ap_codeString25รหัสผู้จำหน่ายT
staff_pay_codeString25พนักงานเตรียมจ่าย
payment_wayString255ช่องทางการจ่ายเงิน
pay_bill_wayString25ช่องทางการวางบิล
pay_conditionString255เงิ่อนไขการจ่ายเงิน
credit_purchaseInteger0เครดิตซื้อ
credit_codeString25รหัสเครดิต
form_nameString255ชื่อฟอร์มรายเจ้าหนี้
discount_itemString50ส่วนลดต่อรายการ
discount_billString50ส่วนลดท้ายบิล
credit_dayInteger0จำนวนวันเครดิต
trade_licenseString50ทะเบียนการค้า
tax_idString50เลขประจำตัวผู้เสียภาษี
tax_typeString25ประเภทภาษี
tax_ratefloat0อัตราภาษี
account_codeString25บัญชีเจ้าหนี้รายตัว
shipping_typeString25ประเภทการส่งมอบ
close_reasonString255เหตุผลในการปิด
close_dateDate0วันที่ปิด
group_mainString25กลุ่มหลัก
group_sub_1String25กลุ่มย่อย 1
group_sub_2String25กลุ่มย่อย 2
group_sub_3String25กลุ่มย่อย 3
group_sub_4String25กลุ่มย่อย 4
picture_1String255รูปภาพ 1
picture_2String255รูปภาพ 2
picture_3String255รูปภาพ 3
picture_4String255รูปภาพ 4
ref_doc_1String255เอกสารอ้างอิง 1
ref_doc_2String255เอกสารอ้างอิง 2
ref_doc_3String255เอกสารอ้างอิง 3
dimension_1String100มิติ 1
dimension_2String100มิติ 2
dimension_3String100มิติ 3
dimension_4String100มิติ 4
dimension_5String100มิติ 5
currency_codeString25รหัสสกุลเงิน
card_idString50เลขที่บัตรประชาชน
passbook_codeString25สมุดเงินฝาก
set_tax_typeInteger0ระบุประเภทภาษี
branch_typeInteger0สถานประกอบการ
branch_codeString25เลขที่สาขา
dimension_6String255มิติ 6
dimension_7String255มิติ 7
dimension_8String255มิติ 8
dimension_9String255มิติ 9
dimension_10String255มิติ 10
lead_timeInteger0ระยะเวลาสั่งสินค้า
is_vendor_approvedInteger0เป็นผู้ขายที่ได้รับการอนุมัติแล้ว