Customer Service
API ระบบลูกค้า
- ดึงข้อมูลลูกหนี้ทั้งหมด
- ดึงข้อมูลลูกหนี้รายตัว
- สร้างข้อมูลลูกหนี้ใหม่
- แก้ไขข้อมูลลูกหนี้
- Customer Attribute
Header Request
| Field | Value |
|---|---|
| GUID | GUID สำหรับการเชื่อมต่อ (smlx เสมอ) |
| provider | ชื่อผู้ใช้บริการ |
| databaseName | ชื่อฐานข้อมูล |
| configFileName | ไฟล์ตั้งค่าผู้ให้บริการ ใส่ SMLConfig และตามด้วยชื่อผู้ให้บริการ และตามด้วย .xml (SMLConfig___.xml) |
Header Example
{
"GUID" : "smlx"
"provider" : "DATA"
"databaseName" : "data1"
"configFileName" : "SMLConfigDATA.xml"
}HTTP Response
| Status | Descripton |
|---|---|
| 200 | Success return with data |
| 500 | Bas Request |
| 401 | Unauthorize |
Customer List
แสดงข้อมูลลูกค้าทีละหลาย ๆ รายการ
EndPoint
GET /SMLJavaRESTService/customer/v4
Query Request
| Field | Description |
|---|---|
| page | number of page |
| size | page size |
Example:
GET localhost:8084/SMLJavaRESTService/customer/v4?page=1&size=2Customer Information
เป็นการดึงข้อมูลลูกค้ามาแสดงทีละ 1 รายการโดยจะต้องระบุรหัสลูกค้า
EndPoint
GET /SMLJavaRESTService/customer/v4/{code}
Path Parameter:
| Name | Description | Example |
|---|---|---|
| code | รหัสลูกค้า | AR00001 |
example:
GET localhost:8084/SMLJavaRESTService/customer/v4/AR00001Response 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:
| Name | Description | Example |
|---|---|---|
| code | รหัสลูกค้า | AR00001 |
example:
PUT localhost:8084/SMLJavaRESTService/customer/v4/AR00001Body 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 Name | Field Type | Length | Description | Required |
|---|---|---|---|---|
| code | String | 25 | รหัส | T |
| code_old | String | 25 | รหัสเก่า | |
| name_1 | String | 255 | ชื่อ 1 | T |
| name_2 | String | 255 | ชื่อ 2 | |
| name_eng_1 | String | 255 | ชื่อ (ภาษาอังกฤษ) 1 | |
| name_eng_2 | String | 255 | ชื่อ (ภาษาอังกฤษ) 2 | |
| address | String | 255 | ที่อยู่ | |
| address_eng | String | 255 | ที่อยู่ (ภาษาอังกฤษ) | |
| tambon | String | 25 | ตำบล/แขวง | |
| amper | String | 25 | อำเภอ/เขต | |
| province | String | 25 | จังหวัด | |
| zip_code | String | 10 | รหัสไปรษณีย์ | |
| telephone | String | 150 | หมายเลขโทรศัพท์ | |
| fax | String | 50 | หมายเลขโทรสาร | |
| String | 150 | อีเมล์ | ||
| website | String | 150 | เวบไซด์ | |
| description | String | 255 | รายละเอียด | |
| birth_day | Date | 0 | วันเกิด/วันที่จดทะเบียน | |
| ar_type | String | 25 | ประเภทลูกหนี้ | |
| remark | String | 255 | หมายเหตุ | |
| status | Integer | 0 | สถานะ | |
| guid_code | String | 35 | GUID | |
| ar_status | Integer | 0 | ชนิดลูกค้า | |
| doc_format_code | String | 25 | รหัสเอกสาร | |
| prefixname | String | 15 | คำนำหน้า | |
| first_name | String | 50 | ชื่อ | |
| last_name | String | 70 | นามสกุล | |
| price_level | Integer | 0 | ระดับราคาขาย | |
| point_balance | float | 0 | แต้มสะสม | |
| sale_shift_id | String | 50 | รอบการขาย | |
| sms_phonenumber | String | 10 | หมายเลข SMS | |
| home_address | String | 255 | บ้านเลขที่ | |
| home_name | String | 255 | หมู่บ้าน | |
| moo | String | 25 | หมู่ | |
| soi | String | 255 | ซอย | |
| road | String | 255 | ถนน | |
| room_no | String | 50 | ห้อง | |
| floor | String | 25 | ชั้น | |
| building | String | 50 | อาคาร | |
| sex | Integer | 0 | เพศ | |
| country | String | 255 | ประเทศ | |
| register_date | Date | 0 | วันลงทะเบียน | |
| arm_code | String | 25 | รหัสสมาชิก | |
| ar_code_main | String | 50 | รหัสลูกค้าหลัก | |
| ar_branch_code | String | 50 | ใช้เฉพาะสาขา | |
| arm_approve | Integer | 0 | อนุมัติโครงการ | |
| arm_approve_date | Date | 0 | วันที่อนุมัติ ARM Code | |
| nfc_id | String | 255 | NFC ID | |
| arm_tier | Integer | 0 | Tier | |
| last_update_time | Date | 0 | วันเวลาทีแก้ไขล่าสุด | |
| interco | String | 255 | INTERCO | |
| arm_register_date | Date | 0 | วันที่สมัคร ARM Code | |
| arm_register | Integer | 0 | สมัคร อาร์ม | |
| create_datetime | Date | 0 | วันที่สร้าง | |
| last_update_date_time | Date | 0 | วันที่แก้ไขล่าสุด | |
| create_code | String | 50 | ผู้สร้าง | |
| last_update_code | String | 50 | ผู้แก้ไขล่าสุด | |
| cis | String | 255 | CIS | |
| code_ref1 | String | 255 | code ref1 | |
| ar_tier_code | String | 25 | Tier | |
| customer_detail | ArrayObject | รายละเอียดลูกหนี้ |
Customer Detail
| Field Name | Field Type | Length | Description | Required |
|---|---|---|---|---|
| ar_code | String | 25 | รหัสลูกค้า | T |
| area_code | String | 25 | เขตการขาย | |
| sale_code | String | 25 | รหัสพนักงานขาย | |
| logistic_area | String | 25 | เขตการขนส่ง | |
| pay_bill_code | String | 25 | รหัสวางบิล | |
| keep_chq_code | String | 25 | รหัสเก็บเช็ค | |
| pay_bill_date | Integer | 0 | วางบิลได้ทุกวันที่ | |
| keep_chq_date | Integer | 0 | เก็บเช็คได้ทุกวันที่ | |
| sale_price_level | Integer | 0 | ระดับราคาขาย | |
| credit_sale | Integer | 0 | ขายเครดิต | |
| credit_code | String | 25 | รหัสเครดิต | |
| form_name | String | 255 | ชื่อฟอร์มรายลูกค้า | |
| pay_bill_condition | String | 25 | เงื่อนไขการวางบิล | |
| keep_money_condition | String | 25 | เงื่อนไขการเก็บเงิน | |
| payment_person | String | 25 | กลุ่มพนักงานวางบิล | |
| credit_person | String | 25 | กลุ่มพนักงานสินเชื่อ | |
| keep_money_person | String | 25 | กลุ่มพนักงานเก็บเงิน | |
| discount_item | String | 50 | ส่วนลดต่อรายการ | |
| discount_bill | String | 50 | ส่วนลดท้ายบิล | |
| credit_group | Integer | 0 | ใช้วงเงินกลุ่ม | |
| credit_group_code | String | 25 | รหัสกลุ่มวงเงิน | |
| credit_money | float | 0 | วงเงินเครดิต | |
| credit_money_max | float | 0 | วงเงินเครดิตสูงสุด | |
| credit_day | Integer | 0 | จำนวนวันเครดิต | |
| credit_reason | String | 25 | เหตุผลลงเครดิต | |
| credit_status | Integer | 0 | สถานะเครดิต | |
| credit_date | Date | 0 | วันที่ลงสถานะเครดิต | |
| credit_status_reason | String | 25 | เหตุผลลงสถานะเครดิต | |
| trade_license | String | 50 | ทะเบียนการค้า | |
| vat_license | String | 50 | ทะเบียนภาษีมูลค่าเพิ่ม | |
| tax_id | String | 50 | เลขประจำตัวผู้เสียภาษี | |
| tax_type | Integer | 0 | ประเภทภาษี | |
| tax_rate | float | 0 | อัตราภาษี | |
| account_code | String | 25 | บัญชีลูกค้ารายตัว | |
| shipping_type | Integer | 0 | ประเภทการส่งมอบ | |
| close_reason | String | 255 | เหตุผลในการปิด | |
| close_date | Date | 0 | วันที่ปิด | |
| group_main | String | 25 | กลุ่มหลัก | |
| group_sub_1 | String | 25 | กลุ่มย่อย 1 | |
| group_sub_2 | String | 25 | กลุ่มย่อย 2 | |
| group_sub_3 | String | 25 | กลุ่มย่อย 3 | |
| group_sub_4 | String | 25 | กลุ่มย่อย 4 | |
| picture_3 | String | 255 | รูปภาพ 3 | |
| picture_4 | String | 255 | รูปภาพ 4 | |
| ref_doc_1 | String | 255 | เอกสารอ้างอิง 1 | |
| ref_doc_2 | String | 255 | เอกสารอ้างอิง 2 | |
| ref_doc_3 | String | 255 | เอกสารอ้างอิง 3 | |
| dimension_1 | String | 100 | มิติ 1 | |
| dimension_2 | String | 100 | มิติ 2 | |
| dimension_3 | String | 100 | มิติ 3 | |
| dimension_4 | String | 100 | มิติ 4 | |
| dimension_5 | String | 100 | มิติ 5 | |
| currency_code | String | 20 | รหัสสกุลเงิน | |
| latitude | float | 0 | ละติจูด | |
| longitude | float | 0 | ลองจิจูด | |
| card_id | String | 100 | เลขที่บัตรประชาชน | |
| passbook_code | String | 25 | สมุดเงินฝาก | |
| set_tax_type | Integer | 0 | ระบุประเภทภาษี | |
| branch_type | Integer | 0 | สถานประกอบการ | |
| branch_code | String | 25 | เลขที่สาขา | |
| area_paybill | String | 25 | เขตเก็บเงิน | |
| reason_disable_credit | String | 500 | เหตุผลปิดวงเงินชั่วคราว | |
| close_credit_date | Date | 0 | วันที่ปิดเครดิต | |
| close_reason_1 | Integer | 0 | ชำระเช็คเกินกำหนด | |
| close_reason_2 | Integer | 0 | ใหม่ยอดเกินวงเงินเครดิต | |
| close_reason_3 | Integer | 0 | ผิดเงื่อนไขการชำระ | |
| close_reason_4 | Integer | 0 | อื่น ๆ | |
| dimension_6 | String | 255 | มิติ 6 | |
| dimension_7 | String | 255 | มิติ 7 | |
| dimension_8 | String | 255 | มิติ 8 | |
| dimension_9 | String | 255 | มิติ 9 | |
| dimension_10 | String | 255 | มิติ 10 | |
| disable_auto_close_credit | Integer | 0 | ไม่คำณวนปิดสถานะเครดิต | |
| ap_code_ref | String | 25 | อ้างอิงรหัสเจ้าหนี้ | |
| sale_type | Integer | 0 | ประเภทการขาย | |
| line_id | String | 255 | line id | |
| String | 255 | |||
| customer_type_code | String | 25 | Type | |
| ar_channel_code | String | 25 | Channel | |
| ar_location_type_code | String | 25 | ประเภทสถานที่ตั้ง | |
| br_cust_code | String | 25 | รหัสกลาง | |
| ar_sub_type_1_code | String | 25 | Sub Type 1 | |
| ar_vehicle_code | String | 25 | Vehicle | |
| ar_equipment_code | String | 25 | Equipment | |
| ar_sub_equipment | String | 25 | Sub Equipment | |
| ar_project_code | String | 25 | ชื่อโครงการ | |
| ar_shoptype1_code | String | 25 | ค้าส่ง | |
| ar_shoptype2_code | String | 25 | ค้าปลีก | |
| ar_shoptype3_code | String | 25 | ห้างท้องถิ่น | |
| ar_shoptype4_code | String | 25 | On-Premise,HORECA | |
| ar_shoptype5_code | String | 25 | ช่องทางพิเศษ | |
| sub_ar_shoptype5_code | String | 25 | ช่องทางพิเศษย่อย | |
| ar_project_code_name | Integer | 0 | โครงการ | |
| ar_shoptype6_code | String | 25 | Modern Trade | |
| ar_shoptype7_code | String | 25 | อื่นๆ | |
| ar_project_date_end | Date | 0 | วันที่สินสุดโครงการ | |
| nfc_asset | String | 255 | NFC Asset | |
| past_due_day | Integer | 0 | จำนวนวันที่เกินกำหนดชำระได้ | |
| mobile_sales | Integer | 0 | Mobile Sales | |
| close_over_credit_warning | Integer | 0 | ไม่เตือนเมื่อเกินวงเงิน |