Skip to content

Customer 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

Customer List

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

EndPoint

GET /SMLJavaRESTService/customer/v4

Query Request

FieldDescription
pagenumber of page
sizepage size

Example:

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

Customer Information

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

EndPoint

GET /SMLJavaRESTService/customer/v4/{code}

Path Parameter:

NameDescriptionExample
codeรหัสลูกค้าAR00001

example:

GET localhost:8084/SMLJavaRESTService/customer/v4/AR00001

Response Success

{
    "success": true,
    "data": {
        "code": "AR00001",
        "name_1": "ลูกค้าทั่วไป",
        "name_eng_2": "",
        "address": "0\n0",
        "address_eng": "",
        "tambon": "100101",
        "amper": "1001",
        "province": "10",
        "zip_code": "0",
        "telephone": "99999999",
        "description": "",
        "status": 0,
        "ar_status": 0,
        "doc_format_code": "",
        "price_level": 0,
        "point_balance": 0.0,
        "sale_shift_id": "",
        "home_address": "",
        "home_name": "",
        "moo": "",
        "soi": "",
        "road": "",
        "room_no": "",
        "floor": "",
        "building": "",
        "sex": 0,
        "ar_branch_code": "",
        "arm_approve": 0,
        "arm_approve_date": -62135794800000,
        "arm_tier": 0,
        "last_update_time": 1613934924129,
        "arm_register_date": -2209014000000,
        "arm_register": 0,
        "last_update_date_time": "2021-02-22 02:15:24.129",
        "last_update_code": "SMLADMIN",
        "ar_tier_code": "TEST",
        "customer_detail": {
            "ar_code": "AR00001",
            "sale_code": "SMLADMIN",
            "pay_bill_code": "",
            "keep_chq_code": "",
            "pay_bill_date": 0,
            "keep_chq_date": 0,
            "sale_price_level": 0,
            "credit_sale": 0,
            "credit_code": "",
            "form_name": "",
            "pay_bill_condition": "",
            "keep_money_condition": "",
            "payment_person": "",
            "credit_person": "",
            "keep_money_person": "",
            "credit_group": 0,
            "credit_group_code": "",
            "credit_money": 0.0,
            "credit_money_max": 0.0,
            "credit_day": 0,
            "credit_reason": "",
            "credit_status": 0,
            "credit_status_reason": "",
            "tax_type": 0,
            "tax_rate": 0.0,
            "account_code": "113010",
            "shipping_type": 0,
            "picture_3": "",
            "picture_4": "",
            "ref_doc_1": "",
            "ref_doc_2": "",
            "ref_doc_3": "",
            "currency_code": "",
            "latitude": 0.0,
            "longitude": 0.0,
            "passbook_code": "",
            "set_tax_type": 0,
            "branch_type": 0,
            "area_paybill": "",
            "reason_disable_credit": "",
            "close_reason_1": 0,
            "close_reason_2": 0,
            "close_reason_3": 0,
            "close_reason_4": 0,
            "disable_auto_close_credit": 0,
            "sale_type": 0,
            "customer_type_code": "",
            "ar_channel_code": "",
            "ar_location_type_code": "",
            "br_cust_code": "",
            "ar_sub_type_1_code": "",
            "ar_vehicle_code": "",
            "ar_equipment_code": "",
            "ar_sub_equipment": "",
            "ar_project_code": "",
            "ar_shoptype1_code": "",
            "ar_shoptype2_code": "",
            "ar_shoptype3_code": "",
            "ar_shoptype4_code": "",
            "ar_shoptype5_code": "",
            "sub_ar_shoptype5_code": "",
            "ar_project_code_name": 0,
            "ar_shoptype6_code": "",
            "ar_shoptype7_code": "",
            "nfc_asset": "",
            "past_due_day": 0,
            "mobile_sales": 0,
            "close_over_credit_warning": 0
        }
    }
}

Response Error

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

Add Customer

เพิ่มข้อมูลลูกค้าใหม่

EndPoint

POST /SMLJavaRESTService/customer/v4/

Body Data:

JSON body with Customer Request Attribute

example:

{
  "code": "AR00033",
  "name_1": "ลูกค้า-API-v4",
  "address": "TEST",
  "tambon": "07",
  "amper": "1001",
  "province": "10",
  "point_balance": 0.0,
  "ar_tier_code": "",
  "customer_detail": {
      "ar_code": "AR00033",
      "credit_money": 0.0,
      "credit_money_max": 0.0,
      "tax_rate": 0.0,
      "latitude": 0.0,
      "longitude": 0.0,
      "close_over_credit_warning": 0
  }
}

Edit Customer

แก้ไขข้อมูลลูกค้าใหม่

EndPoint

PUT /SMLJavaRESTService/customer/v4/{code}

Path Parameter:

NameDescriptionExample
codeรหัสลูกค้าAR00001

example:

PUT localhost:8084/SMLJavaRESTService/customer/v4/AR00001

Body Data:

JSON body with Customer Request Attribute

example:

{
    "code": "AR00033",
    "name_1": "ลูกค้า-API-v4",
    "address": "ทดสอบแก้ไข v4",
    "tambon": "09",
    "amper": "1001",
    "province": "10",
    "point_balance": 0.0,
    "ar_tier_code": "",
    "customer_detail": {
        "ar_code": "AR00033",
        "credit_money": 0.0,
        "credit_money_max": 0.0,
        "tax_rate": 0.0,
        "latitude": 0.0,
        "longitude": 0.0,
        "close_over_credit_warning": 0
    }
}

Customer Attribute

Field NameField TypeLengthDescriptionRequired
codeString25รหัสT
code_oldString25รหัสเก่า
name_1String255ชื่อ 1T
name_2String255ชื่อ 2
name_eng_1String255ชื่อ (ภาษาอังกฤษ) 1
name_eng_2String255ชื่อ (ภาษาอังกฤษ) 2
addressString255ที่อยู่
address_engString255ที่อยู่ (ภาษาอังกฤษ)
tambonString25ตำบล/แขวง
amperString25อำเภอ/เขต
provinceString25จังหวัด
zip_codeString10รหัสไปรษณีย์
telephoneString150หมายเลขโทรศัพท์
faxString50หมายเลขโทรสาร
emailString150อีเมล์
websiteString150เวบไซด์
descriptionString255รายละเอียด
birth_dayDate0วันเกิด/วันที่จดทะเบียน
ar_typeString25ประเภทลูกหนี้
remarkString255หมายเหตุ
statusInteger0สถานะ
guid_codeString35GUID
ar_statusInteger0ชนิดลูกค้า
doc_format_codeString25รหัสเอกสาร
prefixnameString15คำนำหน้า
first_nameString50ชื่อ
last_nameString70นามสกุล
price_levelInteger0ระดับราคาขาย
point_balancefloat0แต้มสะสม
sale_shift_idString50รอบการขาย
sms_phonenumberString10หมายเลข SMS
home_addressString255บ้านเลขที่
home_nameString255หมู่บ้าน
mooString25หมู่
soiString255ซอย
roadString255ถนน
room_noString50ห้อง
floorString25ชั้น
buildingString50อาคาร
sexInteger0เพศ
countryString255ประเทศ
register_dateDate0วันลงทะเบียน
arm_codeString25รหัสสมาชิก
ar_code_mainString50รหัสลูกค้าหลัก
ar_branch_codeString50ใช้เฉพาะสาขา
arm_approveInteger0อนุมัติโครงการ
arm_approve_dateDate0วันที่อนุมัติ ARM Code
nfc_idString255NFC ID
arm_tierInteger0Tier
last_update_timeDate0วันเวลาทีแก้ไขล่าสุด
intercoString255INTERCO
arm_register_dateDate0วันที่สมัคร ARM Code
arm_registerInteger0สมัคร อาร์ม
create_datetimeDate0วันที่สร้าง
last_update_date_timeDate0วันที่แก้ไขล่าสุด
create_codeString50ผู้สร้าง
last_update_codeString50ผู้แก้ไขล่าสุด
cisString255CIS
code_ref1String255code ref1
ar_tier_codeString25Tier
customer_detailArrayObjectรายละเอียดลูกหนี้

Customer Detail

Field NameField TypeLengthDescriptionRequired
ar_codeString25รหัสลูกค้าT
area_codeString25เขตการขาย
sale_codeString25รหัสพนักงานขาย
logistic_areaString25เขตการขนส่ง
pay_bill_codeString25รหัสวางบิล
keep_chq_codeString25รหัสเก็บเช็ค
pay_bill_dateInteger0วางบิลได้ทุกวันที่
keep_chq_dateInteger0เก็บเช็คได้ทุกวันที่
sale_price_levelInteger0ระดับราคาขาย
credit_saleInteger0ขายเครดิต
credit_codeString25รหัสเครดิต
form_nameString255ชื่อฟอร์มรายลูกค้า
pay_bill_conditionString25เงื่อนไขการวางบิล
keep_money_conditionString25เงื่อนไขการเก็บเงิน
payment_personString25กลุ่มพนักงานวางบิล
credit_personString25กลุ่มพนักงานสินเชื่อ
keep_money_personString25กลุ่มพนักงานเก็บเงิน
discount_itemString50ส่วนลดต่อรายการ
discount_billString50ส่วนลดท้ายบิล
credit_groupInteger0ใช้วงเงินกลุ่ม
credit_group_codeString25รหัสกลุ่มวงเงิน
credit_moneyfloat0วงเงินเครดิต
credit_money_maxfloat0วงเงินเครดิตสูงสุด
credit_dayInteger0จำนวนวันเครดิต
credit_reasonString25เหตุผลลงเครดิต
credit_statusInteger0สถานะเครดิต
credit_dateDate0วันที่ลงสถานะเครดิต
credit_status_reasonString25เหตุผลลงสถานะเครดิต
trade_licenseString50ทะเบียนการค้า
vat_licenseString50ทะเบียนภาษีมูลค่าเพิ่ม
tax_idString50เลขประจำตัวผู้เสียภาษี
tax_typeInteger0ประเภทภาษี
tax_ratefloat0อัตราภาษี
account_codeString25บัญชีลูกค้ารายตัว
shipping_typeInteger0ประเภทการส่งมอบ
close_reasonString255เหตุผลในการปิด
close_dateDate0วันที่ปิด
group_mainString25กลุ่มหลัก
group_sub_1String25กลุ่มย่อย 1
group_sub_2String25กลุ่มย่อย 2
group_sub_3String25กลุ่มย่อย 3
group_sub_4String25กลุ่มย่อย 4
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_codeString20รหัสสกุลเงิน
latitudefloat0ละติจูด
longitudefloat0ลองจิจูด
card_idString100เลขที่บัตรประชาชน
passbook_codeString25สมุดเงินฝาก
set_tax_typeInteger0ระบุประเภทภาษี
branch_typeInteger0สถานประกอบการ
branch_codeString25เลขที่สาขา
area_paybillString25เขตเก็บเงิน
reason_disable_creditString500เหตุผลปิดวงเงินชั่วคราว
close_credit_dateDate0วันที่ปิดเครดิต
close_reason_1Integer0ชำระเช็คเกินกำหนด
close_reason_2Integer0ใหม่ยอดเกินวงเงินเครดิต
close_reason_3Integer0ผิดเงื่อนไขการชำระ
close_reason_4Integer0อื่น ๆ
dimension_6String255มิติ 6
dimension_7String255มิติ 7
dimension_8String255มิติ 8
dimension_9String255มิติ 9
dimension_10String255มิติ 10
disable_auto_close_creditInteger0ไม่คำณวนปิดสถานะเครดิต
ap_code_refString25อ้างอิงรหัสเจ้าหนี้
sale_typeInteger0ประเภทการขาย
line_idString255line id
facebookString255facebook
customer_type_codeString25Type
ar_channel_codeString25Channel
ar_location_type_codeString25ประเภทสถานที่ตั้ง
br_cust_codeString25รหัสกลาง
ar_sub_type_1_codeString25Sub Type 1
ar_vehicle_codeString25Vehicle
ar_equipment_codeString25Equipment
ar_sub_equipmentString25Sub Equipment
ar_project_codeString25ชื่อโครงการ
ar_shoptype1_codeString25ค้าส่ง
ar_shoptype2_codeString25ค้าปลีก
ar_shoptype3_codeString25ห้างท้องถิ่น
ar_shoptype4_codeString25On-Premise,HORECA
ar_shoptype5_codeString25ช่องทางพิเศษ
sub_ar_shoptype5_codeString25ช่องทางพิเศษย่อย
ar_project_code_nameInteger0โครงการ
ar_shoptype6_codeString25Modern Trade
ar_shoptype7_codeString25อื่นๆ
ar_project_date_endDate0วันที่สินสุดโครงการ
nfc_assetString255NFC Asset
past_due_dayInteger0จำนวนวันที่เกินกำหนดชำระได้
mobile_salesInteger0Mobile Sales
close_over_credit_warningInteger0ไม่เตือนเมื่อเกินวงเงิน