Appearance
Product Service
API ระบบสินค้า
- ดึงข้อมูลสินค้าทั้งหมด
- ดึงข้อมูลสินค้ารายตัว
- ดึงข้อมูลสินค้ารายตัว(เพิ่มรายละเอียด)
- สร้างข้อมูลสินค้าใหม่
- แก้ไขข้อมูลสินค้า
- Product 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 |
Product List
แสดงข้อมูลสินค้าทีละหลาย ๆ รายการ
EndPoint
GET /SMLJavaRESTService/product/v4
Query Request
Field | Description |
---|---|
page | number of page |
size | page size |
Example:
GET localhost:8084/SMLJavaRESTService/product/v4?page=1&size=2
Product Information
เป็นการดึงข้อมูลสินค้ามาแสดงทีละ 1 รายการโดยจะต้องระบุรหัสสินค้า
EndPoint
GET /SMLJavaRESTService/product/v4/{code}
Path Parameter:
Name | Description | Example |
---|---|---|
code | รหัสสินค้า | AC-00001 |
example:
GET localhost:8084/SMLJavaRESTService/product/v4/AC-00001
Response Success
{
"success": true,
"data": {
"code": "AC-00001",
"code_old": "",
"name_1": "แจ็คโทรศัพท์",
"name_eng_1": "name_eng_1",
"name_market": "",
"name_for_bill": "",
"short_name": "",
"name_for_pos": "",
"name_for_search": "",
"item_type": 0,
"item_category": "AC-001",
"group_main": "AC",
"item_size": "",
"item_color": "",
"item_character": "",
"item_status": 1,
"unit_type": 0,
"cost_type": 1,
"tax_type": 0,
"item_sale_type": 0,
"item_rent_type": 0,
"unit_standard": "แพ็ค",
"unit_cost": "แพ็ค",
"ic_serial_no": 0,
"status": 0,
"average_cost": 5.77,
"item_in_stock": 0.0,
"balance_qty": 165.0,
"accrued_in_qty": 37.0,
"accrued_out_qty": 67.0,
"unit_standard_name": "แพ็ค",
"update_price": 1,
"update_detail": 1,
"account_code_1": "114010",
"account_code_2": "519000",
"account_code_3": "410010",
"account_code_4": "410080",
"book_out_qty": 16.0,
"doc_format_code": "",
"unit_standard_stand_value": 1.0,
"unit_standard_divide_value": 1.0,
"fixed_cost": 0.0,
"drink_type": 0,
"average_cost_1": 0.0,
"group_sub": "AC01",
"use_expire": 0,
"barcode_checker_print": 0,
"print_order_per_unit": 0,
"production_period": 0,
"is_new_item": 0,
"is_eordershow": 0,
"no_discount": 0,
"pos_no_sum": 0,
"item_promote": 0,
"sum_sale_1": 0.0,
"is_speech": 0,
"medicine_register_number": "",
"medicine_standard_code": "",
"quantity": "",
"degree": "",
"is_product_boonrawd": 0,
"group_sub2": "AC01-01",
"last_update_date_time": "2022-07-22 09:46:20.606",
"last_update_code": "SUPERADMIN",
"normal_vendor_max_purchase_qty": 0.0,
"inventory_detail": {
"ic_code": "AC-00001",
"formular": "",
"po_over": 0,
"so_over": 0,
"account_group": "",
"serial_number": "",
"tax_import": "",
"tax_rate": 0.0,
"purchase_manager": "",
"sale_manager": "",
"start_purchase_wh": "CENTER",
"start_purchase_shelf": "CENTER",
"start_purchase_unit": "แพ็ค",
"start_sale_wh": "CENTER",
"start_sale_shelf": "CENTER",
"start_sale_unit": "แพ็ค",
"cost_produce": 0.0,
"cost_standard": 0.0,
"unit_for_stock": "",
"ic_reserve_wh": "",
"reserve_status": 0,
"purchase_point": 0.0,
"unit_2_code": "",
"unit_2_qty": 0,
"unit_2_average": 0,
"unit_2_average_value": 0.0,
"user_status": 0,
"close_reason": "",
"ref_file_1": "",
"ref_file_2": "",
"ref_file_3": "",
"ref_file_4": "",
"ref_file_5": "",
"dimension_1": "AC-001",
"sale_price_1": 0.0,
"sale_price_2": 0.0,
"sale_price_3": 0.0,
"sale_price_4": 0.0,
"maximum_qty": 0.0,
"minimum_qty": 50.0,
"accrued_control": 0,
"lock_price": 0,
"lock_discount": 0,
"lock_cost": 0,
"is_end": 0,
"is_hold_purchase": 0,
"is_hold_sale": 0,
"is_stop": 0,
"balance_control": 0,
"have_point": 0,
"is_premium": 0
},
"inventory_barcode": [
{
"ic_code": "AC-00001",
"barcode": "8850338009945",
"description": "แจ็คโทรศัพท์",
"wh_code": "",
"shelf_code": "",
"unit_code": "แพ็ค",
"price": 45.0,
"status": 0,
"line_number": 0,
"price_2": 0.0,
"price_3": 0.0,
"price_4": 0.0,
"hidden_text": 0,
"price_member": 0.0,
"price_member_2": 0.0,
"price_member_3": 0.0,
"price_member_4": 0.0,
"no_point": 0
},
{
"ic_code": "AC-00001",
"barcode": "5691792014594",
"description": "แจ็คโทรศัพท์",
"wh_code": "",
"shelf_code": "",
"unit_code": "แพ็ค",
"price": 51.0,
"status": 0,
"line_number": 0,
"price_2": 0.0,
"price_3": 0.0,
"price_4": 0.0,
"hidden_text": 1,
"price_member": 55.0,
"price_member_2": 0.0,
"price_member_3": 0.0,
"price_member_4": 0.0,
"no_point": 0
},
{
"ic_code": "AC-00001",
"barcode": "5263209425301",
"description": "แจ็คโทรศัพท์",
"wh_code": "",
"shelf_code": "",
"unit_code": "แพ็ค",
"price": 0.0,
"status": 0,
"line_number": 0,
"price_2": 0.0,
"price_3": 0.0,
"price_4": 0.0,
"hidden_text": 0,
"price_member": 0.0,
"price_member_2": 0.0,
"price_member_3": 0.0,
"price_member_4": 0.0,
"no_point": 0
}
],
"inventory_unit": [
{
"code": "แพ็ค",
"line_number": 0,
"stand_value": 1.0,
"divide_value": 1.0,
"ratio": 1.0,
"row_order": 1,
"ic_code": "AC-00001",
"remark": "",
"weight": "2",
"status": 1,
"unit_size": 0.0
}
],
"inventory_price": [
{
"ic_code": "AC-00001",
"unit_code": "แพ็ค",
"from_qty": 10.0,
"to_qty": 100.0,
"from_date": "2018-05-01",
"to_date": "2018-05-31",
"sale_type": 0,
"transport_type": 0,
"sale_price1": 51.0,
"status": 1,
"price_type": 1,
"cust_code": "",
"sale_price2": 51.0,
"cust_group_1": "",
"cust_group_2": "",
"price_mode": 0,
"olddate": "",
"line_number": 0,
"price_currency": 0,
"currency_code": ""
},
{
"ic_code": "AC-00001",
"unit_code": "แพ็ค",
"from_qty": 1.0,
"to_qty": 99999.0,
"from_date": "2018-03-01",
"to_date": "2018-03-31",
"sale_type": 0,
"transport_type": 0,
"sale_price1": 66.0,
"status": 1,
"price_type": 2,
"cust_code": "",
"sale_price2": 61.0,
"cust_group_1": "001",
"price_mode": 0,
"olddate": "",
"line_number": 0,
"price_currency": 0,
"currency_code": ""
},
{
"ic_code": "AC-00001",
"unit_code": "แพ็ค",
"from_qty": 5.0,
"to_qty": 50.0,
"from_date": "2018-05-01",
"to_date": "2018-05-31",
"sale_type": 0,
"transport_type": 0,
"sale_price1": 56.0,
"status": 1,
"price_type": 3,
"cust_code": "AR00016",
"sale_price2": 56.0,
"cust_group_1": "",
"cust_group_2": "",
"price_mode": 0,
"olddate": "",
"line_number": 0,
"price_currency": 0,
"currency_code": ""
},
{
"ic_code": "AC-00001",
"unit_code": "แพ็ค",
"from_qty": 10.0,
"to_qty": 50.0,
"from_date": "2018-05-01",
"to_date": "2018-05-31",
"sale_type": 0,
"transport_type": 0,
"sale_price1": 77.0,
"status": 1,
"price_type": 1,
"cust_code": "",
"sale_price2": 71.0,
"cust_group_1": "",
"cust_group_2": "",
"price_mode": 1,
"olddate": "",
"line_number": 0,
"price_currency": 0,
"currency_code": ""
},
{
"ic_code": "AC-00001",
"unit_code": "แพ็ค",
"from_qty": 20.0,
"to_qty": 50.0,
"from_date": "2018-05-01",
"to_date": "2018-05-31",
"sale_type": 0,
"transport_type": 0,
"sale_price1": 99.0,
"status": 1,
"price_type": 2,
"cust_code": "",
"sale_price2": 68.0,
"cust_group_1": "001",
"price_mode": 1,
"olddate": "",
"line_number": 0,
"price_currency": 0,
"currency_code": ""
},
{
"ic_code": "AC-00001",
"unit_code": "แพ็ค",
"from_qty": 20.0,
"to_qty": 50.0,
"from_date": "2018-05-01",
"to_date": "2018-05-01",
"sale_type": 0,
"transport_type": 0,
"sale_price1": 66.0,
"status": 1,
"price_type": 3,
"cust_code": "AR00011",
"sale_price2": 66.0,
"cust_group_1": "",
"cust_group_2": "",
"price_mode": 1,
"olddate": "",
"line_number": 0,
"price_currency": 0,
"currency_code": ""
}
],
"inventory_price_formula": [
{
"ic_code": "AC-00001",
"unit_code": "แพ็ค",
"sale_type": 0,
"price_0": "60.00",
"price_1": "50",
"price_2": "+3%",
"price_3": "-7",
"price_4": "-2%",
"price_5": "+10",
"price_6": "-10%",
"price_7": "61",
"tax_type": 0,
"price_currency": 0,
"currency_code": ""
}
]
}
}
Response Error
{
"error": true,
"code": "99",
"message": "error message"
}
Product Information (Detail)
เป็นการดึงข้อมูลสินค้ามาแสดงทีละ 1 รายการโดยจะต้องระบุรหัสสินค้า
EndPoint
GET /SMLJavaRESTService/product/Detail/{code}
Path Parameter:
Name | Description | Example |
---|---|---|
code | รหัสสินค้า | BB003 |
example:
GET localhost:8084/SMLJavaRESTService/product/Detail/BB003
Response Success
{
"code": "BB003",
"code_old": "",
"name_1": "กูลิโกะป๊อกกี้ช็อกโกแลต 47 กรัม",
"name_2": "",
"name_eng_1": "KURIKO",
"name_eng_2": "",
"name_market": "",
"name_for_bill": "",
"short_name": "",
"name_for_pos": "",
"name_for_search": "",
"item_type": 0,
"item_category": "",
"group_main": "",
"item_brand": "กูลิโก๊ะ",
"item_brand_name": "กูลิโก๊ะ",
"item_pattern": "",
"item_design": "",
"item_grade": "",
"item_class": "",
"item_size": "",
"item_color": "",
"item_character": "",
"item_status": 1,
"unit_type": 1,
"unit_type_name": 1,
"cost_type": 0,
"tax_type": 0,
"item_sale_type": 0,
"item_rent_type": 0,
"unit_standard": "กล่อง",
"unit_cost": "กล่อง",
"unit_cost_name": "กล่อง",
"income_type": "",
"description": "",
"item_model": "",
"ic_serial_no": 0,
"remark": "",
"status": 0,
"average_cost": 17.22,
"item_in_stock": 0.0,
"balance_qty": 60467.0,
"accrued_in_qty": 9.9,
"accrued_out_qty": 0.0,
"unit_standard_name": "กล่อง",
"update_price": 1,
"update_detail": 1,
"account_code_1": "114010",
"account_code_1_name": "สินค้าสำเร็จรูปคงเหลือ",
"account_code_2": "519000",
"account_code_2_name": "ต้นทุนขาย",
"account_code_3": "410010",
"account_code_3_name": "รายได้จากการขายสินค้า",
"account_code_4": "",
"book_out_qty": 100.0,
"doc_format_code": "",
"unit_standard_stand_value": 1.0,
"unit_standard_divide_value": 1.0,
"sign_code": "",
"supplier_code": "AP001",
"supplier_code_name": "บริษัท เอส เจ ที เซลล์ จำกัด",
"fixed_cost": 0.0,
"drink_type": 0,
"average_cost_1": 0.0,
"group_sub": "",
"use_expire": 0,
"barcode_checker_print": 0,
"print_order_per_unit": 0,
"production_period": 0,
"is_new_item": 0,
"commission_rate": "",
"is_eordershow": 0,
"no_discount": 0,
"serial_no_format": "",
"pos_no_sum": 0,
"item_promote": 0,
"sum_sale_1": 0.0,
"is_speech": 0,
"medicine_register_number": "",
"medicine_standard_code": "",
"quantity": "",
"degree": "",
"is_product_boonrawd": 0,
"tpu_code": "",
"gpu_code": "",
"group_sub2": "",
"ic_discount_group": "",
"name_from_remark": 0,
"manufacturer_code": "",
"last_update_date_time": "2022-11-02 16:43:39.936",
"create_code": "",
"last_update_code": "SUPERADMIN",
"have_take_away": 0,
"topping_product": 0,
"product_age": 0,
"qty_per_pallet": 0,
"qc_product": 0,
"qc_product_retest_day": 0,
"require_purchase_from_approve_vendor": 0,
"normal_vendor_max_purchase_qty": 0.0,
"inventory_detail": {
"ic_code": "BB003",
"formular": "",
"po_over": 0,
"so_over": 0,
"account_group": "",
"serial_number": "",
"tax_import": "",
"tax_rate": 0.0,
"purchase_manager": "",
"sale_manager": "",
"start_purchase_wh": "",
"start_purchase_shelf": "",
"start_purchase_unit": "",
"start_sale_wh": "",
"start_sale_shelf": "",
"start_sale_unit": "",
"cost_produce": 0.0,
"cost_standard": 0.0,
"unit_for_stock": "",
"ic_out_wh": "",
"ic_out_shelf": "",
"ic_reserve_wh": "",
"reserve_status": 0,
"discount": "",
"purchase_point": 5.0,
"unit_2_code": "",
"unit_2_qty": 0,
"unit_2_average": 0,
"unit_2_average_value": 0.0,
"user_group_for_purchase": "",
"user_group_for_sale": "",
"user_group_for_manage": "",
"user_group_for_warehouse": "",
"user_status": 0,
"close_reason": "",
"ref_file_1": "",
"ref_file_2": "",
"ref_file_3": "",
"ref_file_4": "",
"ref_file_5": "",
"dimension_1": "",
"dimension_2": "",
"dimension_3": "",
"dimension_4": "",
"dimension_5": "",
"dimension_6": "",
"dimension_7": "",
"dimension_8": "",
"dimension_9": "",
"dimension_10": "",
"sale_price_1": 0.0,
"sale_price_2": 0.0,
"sale_price_3": 0.0,
"sale_price_4": 0.0,
"maximum_qty": 0.0,
"minimum_qty": 0.0,
"dimension_11": "",
"dimension_12": "",
"dimension_13": "",
"dimension_14": "",
"dimension_15": "",
"dimension_16": "",
"dimension_17": "",
"dimension_18": "",
"dimension_19": "",
"dimension_20": "",
"accrued_control": 0,
"lock_price": 1,
"lock_discount": 1,
"lock_cost": 0,
"is_end": 0,
"is_hold_purchase": 0,
"is_hold_sale": 0,
"is_stop": 0,
"balance_control": 0,
"have_point": 0,
"start_unit_code": "",
"dimension_21": "",
"dimension_22": "",
"dimension_23": "",
"dimension_24": "",
"dimension_25": "",
"is_premium": 0,
"dimension_26": "",
"dimension_27": "",
"dimension_28": "",
"dimension_29": "",
"dimension_30": "",
"dimension_31": "",
"dimension_32": "",
"dimension_33": "",
"dimension_34": "",
"dimension_35": "",
"dimension_36": "",
"dimension_37": "",
"dimension_38": "",
"dimension_39": "",
"dimension_40": "",
"dimension_41": "",
"dimension_42": "",
"dimension_43": "",
"dimension_44": "",
"dimension_45": "",
"before_sale_unit": ""
},
"inventory_barcode": [
{
"ic_code": "BB003",
"barcode": "7716594751831",
"description": "กูลิโกะป๊อกกี้ช็อกโกแลต 47 กรัม",
"wh_code": "",
"shelf_code": "",
"unit_code": "กล่อง",
"unit_code_name": "กล่อง",
"price": 18.0,
"status": 0,
"line_number": 0,
"price_2": 0.0,
"price_3": 0.0,
"price_4": 0.0,
"hidden_text": 0,
"price_member": 18.0,
"price_member_2": 0.0,
"price_member_3": 0.0,
"price_member_4": 0.0,
"no_point": 0
},
{
"ic_code": "BB003",
"barcode": "5181045994228",
"description": "กูลิโกะป๊อกกี้ช็อกโกแลต 47 กรัม",
"wh_code": "",
"shelf_code": "",
"unit_code": "แพ็ค",
"unit_code_name": "แพ็ค",
"price": 150.0,
"status": 0,
"line_number": 0,
"price_2": 0.0,
"price_3": 0.0,
"price_4": 0.0,
"hidden_text": 0,
"price_member": 150.0,
"price_member_2": 0.0,
"price_member_3": 0.0,
"price_member_4": 0.0,
"no_point": 0
}
],
"inventory_unit": [
{
"code": "กล่อง",
"unit_code_name": "กล่อง",
"line_number": 0,
"stand_value": 1.0,
"divide_value": 1.0,
"ratio": 1.0,
"row_order": 1,
"width_length_height": "",
"ic_code": "BB003",
"ic_code_name": "กูลิโกะป๊อกกี้ช็อกโกแลต 47 กรัม",
"remark": "",
"weight": "",
"status": 1,
"unit_size": 0.0
},
{
"code": "แพ็ค",
"unit_code_name": "แพ็ค",
"line_number": 1,
"stand_value": 10.0,
"divide_value": 1.0,
"ratio": 10.0,
"row_order": 2,
"width_length_height": "",
"ic_code": "BB003",
"ic_code_name": "กูลิโกะป๊อกกี้ช็อกโกแลต 47 กรัม",
"remark": "",
"weight": "",
"status": 1,
"unit_size": 0.0
},
{
"code": "ลัง",
"unit_code_name": "ลัง",
"line_number": 2,
"stand_value": 90.0,
"divide_value": 1.0,
"ratio": 90.0,
"row_order": 3,
"width_length_height": "",
"ic_code": "BB003",
"ic_code_name": "กูลิโกะป๊อกกี้ช็อกโกแลต 47 กรัม",
"remark": "",
"weight": "",
"status": 1,
"unit_size": 0.0
}
],
"inventory_price": [
{
"ic_code": "BB003",
"ic_code_name": "กูลิโกะป๊อกกี้ช็อกโกแลต 47 กรัม",
"unit_code": "กล่อง",
"from_qty": 1.0,
"to_qty": 99999.0,
"from_date": "2017-01-01",
"to_date": "2020-12-31",
"sale_type": 1,
"transport_type": 0,
"sale_price1": 18.0,
"status": 1,
"price_type": 1,
"cust_code": "",
"sale_price2": 18.0,
"cust_group_1": "",
"cust_group_2": "",
"price_mode": 0,
"olddate": "",
"line_number": 0,
"price_currency": 0,
"currency_code": ""
}
],
"inventory_price_formula": [
{
"ic_code": "BB003",
"ic_code_name": "กูลิโกะป๊อกกี้ช็อกโกแลต 47 กรัม",
"unit_code": "กล่อง",
"unit_code_name": "กล่อง",
"sale_type": 0,
"price_0": "25",
"price_1": "25",
"price_2": "28",
"price_3": "",
"price_4": "",
"price_5": "",
"price_6": "",
"price_7": "",
"price_8": "",
"price_9": "",
"tax_type": 0,
"price_currency": 0,
"currency_code": ""
}
]
}
Response Error
{
"error": true,
"code": "99",
"message": "error message"
}
Add Product
เพิ่มข้อมูลสินค้าใหม่
EndPoint
POST /SMLJavaRESTService/product/v4/
Body Data:
JSON
body with Product Request Attribute
example:
{
"code": "REST-00001",
"name_1": "สินค้าจาก API",
"item_type": 0,
"group_main": "AC",
"item_status": 1,
"unit_type": 1,
"cost_type": 1,
"tax_type": 0,
"item_sale_type": 0,
"item_rent_type": 0,
"unit_standard": "EA",
"unit_cost": "EA",
"unit_standard_name": "EA",
"ic_serial_no": 0,
"status": 0,
"update_price": 1,
"update_detail": 1,
"account_code_1": "114010",
"account_code_2": "519000",
"account_code_3": "410010",
"account_code_4": "410080",
"group_sub": "AC01",
"inventory_detail": {
"ic_code": "REST-00001"
},
"inventory_barcode": [
{
"ic_code": "REST-00001",
"barcode": "REST-00001-1",
"description": "สินค้าจาก API",
"unit_code": "EA",
"price": 8.0
},
{
"ic_code": "REST-00001",
"barcode": "REST-00001-2",
"description": "สินค้าจาก API",
"unit_code": "EA",
"price": 10.0
}
],
"inventory_unit": [
{
"code": "EA",
"line_number": 0,
"stand_value": 1.0,
"divide_value": 1.0,
"ratio": 1.0,
"row_order": 1,
"width_length_height": "10x5x5xM",
"ic_code": "REST-00001",
"remark": "",
"status": 1
},
{
"code": "ม้วน",
"line_number": 1,
"stand_value": 100.0,
"divide_value": 1.0,
"ratio": 100.0,
"row_order": 2,
"width_length_height": "10x11x12xM",
"ic_code": "REST-00001",
"remark": "",
"weight": "ทดสอบ บรรจุ 2",
"status": 1,
"unit_size": 0.0
}
],"inventory_price": [
{
"ic_code": "REST-00001",
"unit_code": "EA",
"from_qty": 10.0,
"to_qty": 100.0,
"from_date": "2022-01-01",
"to_date": "2022-12-31",
"sale_type": 0,
"transport_type": 0,
"sale_price1": 51.0,
"status": 1,
"price_type": 1,
"cust_code": "",
"sale_price2": 51.0,
"cust_group_1": "",
"cust_group_2": "",
"price_mode": 0,
"olddate": "",
"line_number": 0,
"price_currency": 0,
"currency_code": ""
},
{
"ic_code": "REST-00001",
"unit_code": "EA",
"from_qty": 1.0,
"to_qty": 99999.0,
"from_date": "2022-01-01",
"to_date": "2022-12-31",
"sale_type": 0,
"transport_type": 0,
"sale_price1": 66.0,
"status": 1,
"price_type": 2,
"cust_code": "",
"sale_price2": 61.0,
"cust_group_1": "001",
"price_mode": 0,
"olddate": "",
"line_number": 0,
"price_currency": 0,
"currency_code": ""
},
{
"ic_code": "REST-00001",
"unit_code": "EA",
"from_qty": 5.0,
"to_qty": 50.0,
"from_date": "2022-01-01",
"to_date": "2022-12-31",
"sale_type": 0,
"transport_type": 0,
"sale_price1": 56.0,
"status": 1,
"price_type": 3,
"cust_code": "AR00016",
"sale_price2": 56.0,
"cust_group_1": "",
"cust_group_2": "",
"price_mode": 0,
"olddate": "",
"line_number": 0,
"price_currency": 0,
"currency_code": ""
},
{
"ic_code": "REST-00001",
"unit_code": "EA",
"from_qty": 10.0,
"to_qty": 50.0,
"from_date": "2022-01-01",
"to_date": "2022-12-31",
"sale_type": 0,
"transport_type": 0,
"sale_price1": 77.0,
"status": 1,
"price_type": 1,
"cust_code": "",
"sale_price2": 71.0,
"cust_group_1": "",
"cust_group_2": "",
"price_mode": 1,
"olddate": "",
"line_number": 0,
"price_currency": 0,
"currency_code": ""
},
{
"ic_code": "REST-00001",
"unit_code": "EA",
"from_qty": 20.0,
"to_qty": 50.0,
"from_date": "2022-01-01",
"to_date": "2022-12-31",
"sale_type": 0,
"transport_type": 0,
"sale_price1": 99.0,
"status": 1,
"price_type": 2,
"cust_code": "",
"sale_price2": 68.0,
"cust_group_1": "001",
"price_mode": 1,
"olddate": "",
"line_number": 0,
"price_currency": 0,
"currency_code": ""
},
{
"ic_code": "REST-00001",
"unit_code": "EA",
"from_qty": 20.0,
"to_qty": 50.0,
"from_date": "2022-01-01",
"to_date": "2022-12-31",
"sale_type": 0,
"transport_type": 0,
"sale_price1": 66.0,
"status": 1,
"price_type": 3,
"cust_code": "AR00011",
"sale_price2": 66.0,
"cust_group_1": "",
"cust_group_2": "",
"price_mode": 1,
"olddate": "",
"line_number": 0,
"price_currency": 0,
"currency_code": ""
}
],
"inventory_price_formula": [
{
"ic_code": "REST-00001",
"unit_code": "EA",
"sale_type": 0,
"price_0": "60.00",
"price_1": "50",
"price_2": "+3%",
"price_3": "-7",
"price_4": "-2%",
"price_5": "+10",
"price_6": "-10%",
"price_7": "61",
"tax_type": 0,
"price_currency": 0,
"currency_code": ""
}
]
}
Edit Product
แก้ไขข้อมูลสินค้าใหม่
EndPoint
PUT /SMLJavaRESTService/product/v4/{code}
Path Parameter:
Name | Description | Example |
---|---|---|
code | รหัสสินค้า | REST-00001 |
example:
PUT localhost:8084/SMLJavaRESTService/product/v4/AC-00001
Body Data:
JSON
body with Product Request Attribute
example:
{
"code": "REST-00001",
"name_1": "สินค้าจาก API แก้ไข 1",
"item_type": 0,
"group_main": "AC",
"item_status": 1,
"unit_type": 1,
"cost_type": 1,
"tax_type": 0,
"item_sale_type": 0,
"item_rent_type": 0,
"unit_standard": "EA",
"unit_cost": "EA",
"ic_serial_no": 0,
"status": 0,
"update_price": 1,
"update_detail": 1,
"account_code_1": "114010",
"account_code_2": "519000",
"account_code_3": "410010",
"account_code_4": "410080",
"group_sub": "AC01",
"inventory_detail": {
},
"inventory_barcode": [
{
"ic_code": "REST-00001",
"barcode": "REST-00001-1",
"description": "สินค้าจาก API",
"unit_code": "EA",
"price": 8.0
},
{
"ic_code": "REST-00001",
"barcode": "REST-00001-2",
"description": "สินค้าจาก API",
"unit_code": "EA",
"price": 11.0
}
],
"inventory_unit": [
{
"code": "EA",
"line_number": 0,
"stand_value": 1.0,
"divide_value": 1.0,
"ratio": 1.0,
"row_order": 1,
"width_length_height": "10x5x5xM",
"ic_code": "REST-00001",
"remark": "",
"status": 1
},
{
"code": "ม้วน",
"line_number": 1,
"stand_value": 100.0,
"divide_value": 1.0,
"ratio": 100.0,
"row_order": 2,
"width_length_height": "10x11x12xM",
"ic_code": "CB-00001",
"remark": "",
"weight": "ทดสอบ บรรจุ 2",
"status": 1,
"unit_size": 0.0
}
],
"Inventory_price": []
}
Product Attribute
remark เพิ่มข้อมูลรายละเอียดสินค้า ในเส้น /product/Detail/{code}
จะมีการเพิ่มชื่อของรหัสต่างๆภายในสินค้า เช่น unit_code เพิ่ม unit_code_name เพื่อแสดงชื่อของหน่วยนับ wh_code เพิ่ม wh_code_name เพื่อแสดงชื่อของคลังสินค้า
Field Name | Field Type | Length | Description | Required |
---|---|---|---|---|
account_code_1 | String | 25 | รหัสผังบัญชีสินค้า | |
account_code_2 | String | 25 | รหัสผังบัญชีต้นทุน | |
account_code_3 | String | 25 | รหัสผังบัญชีรายได้ | |
account_code_4 | String | 25 | รหัสผังบัญชีรับคืน | |
accrued_in_qty | Float | 0 | ยอดค้างรับ | |
accrued_out_qty | Float | 0 | ยอดค้างส่ง | |
average_cost | Float | 0 | ต้นทุนเฉลี่ย | |
average_cost_1 | Float | 0 | ต้นทุนเฉลี่ยแฝงบริหาร | |
balance_qty | Float | 0 | ยอดคงเหลือ | |
barcode_checker_print | Integer | 0 | พิมพ์บาร์โค๊ดตรวจสอบ | |
book_out_qty | Float | 0 | ยอดค้างจอง | |
code | String | 25 | รหัสสินค้า | T |
code_old | String | 25 | รหัสสินค้าเก่า | |
commission_rate | String | 50 | อัตราค่าคอมมิสชั่น | |
cost_type | Integer | 0 | ประเภทต้นทุน | |
create_code | String | 25 | ผู้สร้าง | |
create_datetime | Date | 0 | วันที่สร้าง | |
degree | String | 50 | ดีกรี | |
description | String | 255 | รายละเอียด | |
doc_format_code | String | 25 | รหัสเอกสาร | |
drink_type | Integer | 0 | ประเภทเครื่องดื่ม | |
fixed_cost | Float | 0 | ต้นทุนคงที่ | |
gpu_code | String | 20 | GPU | |
group_main | String | 25 | กลุ่มสินค้าหลัก | |
group_sub | String | 25 | กลุ่มสินค้าย่อย | |
group_sub2 | String | 25 | กลุ่มสินค้าย่อย2 | |
guid_code | String | 35 | GUID | |
have_take_away | Integer | 0 | เลือภาชนะ ทานที่ร้าน/กลับบ้าน | |
ic_discount_group | String | 25 | กลุ่มส่วนลด | |
ic_serial_no | Integer | 0 | สินค้ามี Serial | |
income_type | String | 25 | ประเภทรายได้ | |
is_eordershow | Integer | 0 | แสดงในระบบ e-Order | |
is_new_item | Integer | 0 | เป็นสินค้าใหม่ | |
is_product_boonrawd | Integer | 0 | สินค้าบุญรอด | |
is_speech | Integer | 0 | พูดรายการอาหาร | |
item_brand | String | 25 | ยี่ห้อสินค้า | |
item_category | String | 25 | หมวดสินค้า | |
item_character | String | 25 | ลักษณะสินค้า | |
item_class | String | 25 | ระดับสินค้า | |
item_color | String | 25 | สีสินค้า | |
item_design | String | 25 | รูปทรงสินค้า | |
item_grade | String | 25 | เกรดสินค้า | |
item_in_stock | Float | 0 | จำนวนสินค้า | |
item_model | String | 50 | รุ่นสินค้า | |
item_pattern | String | 25 | รูปแบบสินค้า | |
item_promote | Integer | 0 | เป็นสินค้าแนะนำ | |
item_rent_type | Integer | 0 | สินค้าเช่า | |
item_sale_type | Integer | 0 | สินค้าฝากขาย | |
item_size | String | 25 | ขนาดสินค้า | |
item_status | Integer | 0 | สถานะสินค้า | |
item_type | Integer | 0 | ประเภทสินค้า | |
last_movement_date | Date | 0 | วันที่เคลื่อนไหวล่าสุด | |
last_update_code | String | 25 | ผู้แก้ไขล่าสุด | |
last_update_date_time | Date | 0 | วันที่แก้ไขล่าสุด | |
manufacturer_code | String | 25 | ผู้ผลิต | |
medicine_register_number | String | 50 | เลขทะเบียนยา | |
medicine_standard_code | String | 50 | เลขทะเบียนยา 24 | |
name_1 | String | 255 | ชื่อสินค้า 1 | T |
name_2 | String | 255 | ชื่อสินค้า 2 | |
name_eng_1 | String | 255 | ชื่อ (ภาษาอังกฤษ) 1 | |
name_eng_2 | String | 255 | ชื่อ (ภาษาอังกฤษ) 2 | |
name_for_bill | String | 255 | ชื่อสำหรับออกบิล | |
name_for_pos | String | 255 | ชื่อสำหรับขายหน้าร้าน | |
name_for_search | String | 255 | ชื่อสำหรับการค้นหา | |
name_from_remark | Integer | 0 | แสดงชื่อสินค้าจากหมายเหตุ | |
name_market | String | 255 | ชื่อทางการตลาด | |
no_discount | Integer | 0 | สินค้าไม่ลดราคา | |
normal_vendor_max_purchase_qty | Float | 0 | จำนวนสูงสุดในการสั่งซื้อกับผู้ค้าทั่วไป | |
pos_no_sum | Integer | 0 | ไม่รวมรายการในระบบ POS | |
print_order_per_unit | Integer | 0 | พิมพ์ใบจัดรายการแบบแยก | |
product_age | Integer | 0 | อายุสินค้า/วัน | |
production_period | Integer | 0 | ระยะเวลาในการผลิต(นาที) | |
qc_product | Integer | 0 | เป็นสินค้าควบคุมคุณภาพ | |
qc_product_retest_day | Integer | 0 | Retest Days | |
qty_per_pallet | Integer | 0 | จำนวนต่อพาเลท | |
quantity | String | 50 | ปริมาณ | |
remark | String | 255 | หมายเหตุ | |
require_purchase_from_approve_vendor | Integer | 0 | เป็นสินค้าที่ต้องซื้อจากผู้อนุมัติเท่านั้น | |
serial_no_format | String | 255 | รูปแบบ Serial | |
short_name | String | 255 | ชื่อสินค้าแบบย่อ | |
sign_code | String | 25 | เครื่องหมาย | |
status | Integer | 0 | สถานะ | |
sum_sale_1 | Float | 0 | ยอดขายตามจำนวน | |
supplier_code | String | 25 | ผู้จัดจำหน่ายหลัก | |
tax_type | Integer | 0 | ประเภทภาษี | |
topping_product | Integer | 0 | เป็นสินค้า Topping | |
tpu_code | String | 20 | TPU | |
unit_cost | String | 25 | หน่วยต้นทุน | T |
unit_standard | String | 25 | หน่วยยอดคงเหลือ | |
unit_standard_divide_value | Float | 0 | อัตราส่วนยอดคงเหลือตัวหาร | |
unit_standard_name | String | 100 | หน่วยคงเหลือ | |
unit_standard_stand_value | Float | 0 | อัตราส่วนยอดคงเหลือตัวตั้ง | |
unit_type | Integer | 0 | ประเภทหน่วยนับ | |
update_detail | Integer | 0 | แก้ไขรายละเอียดประกอบ | |
update_price | Integer | 0 | แก้ไขตารางราคา | |
use_expire | Integer | 0 | ใช้ระบบหมดอายุ | |
inventory_detail | ArrayObject | รายละเอียดสินค้า | ||
inventory_barcode | ArrayObject | รายละเอียดบาร์โค้ด | ||
inventory_unit | ArrayObject | รายละเอียดหน่วยนับ | ||
Inventory_price | ArrayObject | รายละเอียดราคาสินค้า | ||
inventory_price_formula | ArrayObject | รายละเอียดราคาสินค้าตามสูตร |
Product Detail
Field Name | Field Type | Length | Description |
---|---|---|---|
account_group | String | 25 | รหัสกลุ่มบัญชี |
accrued_control | Integer | 0 | อนุญาติให้ขายสินค้าค้างส่ง |
balance_control | Integer | 0 | อนุญาติให้ยอดคงเหลือติดลบ |
before_sale_unit | String | 25 | หน่วยช่วยขาย |
close_date | Date | 0 | วันที่ปิด |
close_reason | String | 255 | เหตุผลในการปิด |
cost_produce | Float | 0 | ต้นทุนการผลิต |
cost_standard | Float | 0 | ต้นทุนมาตรฐาน |
dimension_1 | String | 25 | มิติ 1 |
dimension_10 | String | 25 | มิติ 10 |
dimension_11 | String | 25 | มิติ 11 |
dimension_12 | String | 25 | มิติ 12 |
dimension_13 | String | 25 | มิติ 13 |
dimension_14 | String | 25 | มิติ 14 |
dimension_15 | String | 25 | มิติ 15 |
dimension_16 | String | 25 | มิติ 16 |
dimension_17 | String | 25 | มิติ 17 |
dimension_18 | String | 25 | มิติ 18 |
dimension_19 | String | 25 | มิติ 19 |
dimension_2 | String | 25 | มิติ 2 |
dimension_20 | String | 25 | มิติ 20 |
dimension_21 | String | 255 | มิติ 21 |
dimension_22 | String | 255 | มิติ 22 |
dimension_23 | String | 255 | มิติ 23 |
dimension_24 | String | 255 | มิติ 24 |
dimension_25 | String | 255 | มิติ 25 |
dimension_26 | String | 255 | มิติ 26 |
dimension_27 | String | 255 | มิติ 27 |
dimension_28 | String | 255 | มิติ 28 |
dimension_29 | String | 255 | มิติ 29 |
dimension_3 | String | 25 | มิติ 3 |
dimension_30 | String | 255 | มิติ 30 |
dimension_31 | String | 255 | มิติ 31 |
dimension_32 | String | 255 | มิติ 32 |
dimension_33 | String | 255 | มิติ 33 |
dimension_34 | String | 255 | มิติ 34 |
dimension_35 | String | 255 | มิติ 35 |
dimension_36 | String | 255 | มิติ 36 |
dimension_37 | String | 255 | มิติ 37 |
dimension_38 | String | 255 | มิติ 38 |
dimension_39 | String | 255 | มิติ 39 |
dimension_4 | String | 25 | มิติ 4 |
dimension_40 | String | 255 | มิติ 40 |
dimension_41 | String | 255 | มิติ 41 |
dimension_42 | String | 255 | มิติ 42 |
dimension_43 | String | 255 | มิติ 43 |
dimension_44 | String | 255 | มิติ 44 |
dimension_45 | String | 255 | มิติ 45 |
dimension_5 | String | 25 | มิติ 5 |
dimension_6 | String | 25 | มิติ 6 |
dimension_7 | String | 25 | มิติ 7 |
dimension_8 | String | 25 | มิติ 8 |
dimension_9 | String | 25 | มิติ 9 |
discount | String | 50 | ส่วนลดต่อรายการ |
formular | String | 25 | รหัสสูตรการผลิต |
have_point | Integer | 0 | เข้าสะสมแต้ม |
ic_code | String | 25 | รหัสสินค้า |
ic_out_shelf | String | 25 | ที่เก็บสินค้าชำรุด |
ic_out_wh | String | 25 | คลังสินค้าชำรุด |
ic_reserve_wh | String | 25 | คลังสินค้าจอง |
is_end | Integer | 0 | สินค้าเลิกผลิตแล้ว |
is_hold_purchase | Integer | 0 | สินค้าหยุดซื้อ |
is_hold_sale | Integer | 0 | สินค้าหยุดขาย |
is_premium | Integer | 0 | สินค้าสมนาคุณ |
is_stop | Integer | 0 | ห้ามใช้ |
lock_cost | Integer | 0 | ห้ามขายต่ำกว่าต้นทุน |
lock_discount | Integer | 0 | ห้ามแก้ส่วนลดขาย |
lock_price | Integer | 0 | ห้ามแก้ราคาขาย |
maximum_qty | Float | 0 | จุดสูงสุด |
minimum_qty | Float | 0 | จุดต่ำสุด |
po_over | Integer | 0 | รับเกินที่สั่งซื้อได้ |
purchase_manager | String | 25 | ผู้รับผิดชอบการซื้อ |
purchase_point | Float | 0 | จุดสั่งซื้อ |
ref_file_1 | String | 255 | ไฟล์อ้างอิง 1 |
ref_file_2 | String | 255 | ไฟล์อ้างอิง 2 |
ref_file_3 | String | 255 | ไฟล์อ้างอิง 3 |
ref_file_4 | String | 255 | ไฟล์อ้างอิง 4 |
ref_file_5 | String | 255 | ไฟล์อ้างอิง 5 |
reserve_status | Integer | 0 | สถานะการจอง |
sale_manager | String | 25 | ผู้รับผิดชอบการขาย |
sale_price_1 | Float | 0 | ราคาขาย 1 |
sale_price_2 | Float | 0 | ราคาขาย 2 |
sale_price_3 | Float | 0 | ราคาขาย 3 |
sale_price_4 | Float | 0 | ราคาขาย 4 |
serial_number | String | 25 | serial number |
so_over | Integer | 0 | เบิกเกินสั่งขายได้ |
start_purchase_shelf | String | 25 | ที่เก็บเริ่มต้นซื้อ |
start_purchase_unit | String | 25 | หน่วยเริ่มต้นซื้อ |
start_purchase_wh | String | 25 | คลังเริ่มต้นซื้อ |
start_sale_shelf | String | 25 | ที่เก็บเริ่มต้นขาย |
start_sale_unit | String | 25 | หน่วยเริ่มต้นขาย |
start_sale_wh | String | 25 | คลังเริ่มต้นขาย |
start_unit_code | String | 25 | หน่วยเริ่มต้นสินค้า |
tax_import | String | 100 | % ภาษีนำเข้า |
tax_rate | Float | 0 | พิกัดศุลกากร |
unit_2_average | Integer | 0 | เฉลี่ยค่าระหว่างหน่วยนับ |
unit_2_average_value | Float | 0 | ค่าเฉลี่ยระหว่างหน่วยนับ |
unit_2_code | String | 25 | หน่วยนับที่ 2 |
unit_2_qty | Integer | 0 | ปริมาณหน่วยนับ 2 |
unit_for_stock | String | 25 | หน่วยนับสต็อก |
user_group_for_manage | String | 25 | กลุ่มผู้รับผิดชอบการจัดการ |
user_group_for_purchase | String | 25 | กลุ่มผู้รับผิดชอบการซื้อ |
user_group_for_sale | String | 25 | กลุ่มผู้รับผิดชอบการขาย |
user_group_for_warehouse | String | 25 | กลุ่มผู้รับผิดชอบคลังสินค้า |
user_status | Integer | 0 | สถานะผู้มีสิทธิใช้งาน |
Product Barcode
Field Name | Field Type | Length | Description |
---|---|---|---|
barcode | String | 25 | บาร์โค้ด |
description | String | 255 | รายละเอียด |
guid_code | String | 35 | GUID |
hidden_text | Integer | 0 | ไม่แสดง |
ic_code | String | 25 | รหัสสินค้า |
line_number | Integer | 0 | บรรทัด |
no_point | Integer | 0 | ไม่สะสมแต้ม |
price | Float | 0 | ราคาทั่วไป |
price_2 | Float | 0 | ราคาทั่วไป |
price_3 | Float | 0 | ราคาทั่วไป |
price_4 | Float | 0 | ราคาทั่วไป |
price_member | Float | 0 | ราคาสมาชิก |
price_member_2 | Float | 0 | ราคาสมาชิก |
price_member_3 | Float | 0 | ราคาสมาชิก |
price_member_4 | Float | 0 | ราคาสมาชิก |
shelf_code | String | 25 | ที่เก็บสินค้า |
status | Integer | 0 | สถานะ |
unit_code | String | 25 | หน่วยนับ |
wh_code | String | 25 | คลังสินค้า |
Product Unit
Field Name | Field Type | Length | Description |
---|---|---|---|
code | String | 25 | รหัส |
divide_value | Float | 0 | ตัวหาร |
ic_code | String | 25 | รหัสสินค้า |
line_number | Integer | 0 | ลำดับ |
ratio | Float | 0 | อัตราส่วน |
remark | String | 255 | หมายเหตุ |
row_order | Integer | 0 | ลำดับที่ |
stand_value | Float | 0 | ตัวตั้ง |
status | Integer | 0 | สถานะ |
unit_size | Float | 0 | ขนาดสินค้า |
weight | String | 100 | น้ำหนัก(กก) |
width_length_height | String | 100 | กว้างxยาวxสูง |
Product Price
Field Name | Field Type | Length | Description |
---|---|---|---|
currency_code | String | 25 | สกุลเงิน |
cust_code | String | 25 | รหัสลูกค้า |
cust_group_1 | String | 25 | กลุ่มลูกค้าหลัก |
cust_group_2 | String | 25 | กลุ่มลูกค้าย่อย |
from_date | Date | 0 | จากวันที่ |
from_qty | Float | 0 | จากจำนวน |
ic_code | String | 25 | รหัสสินค้า |
line_number | Integer | 0 | หมายเลขบรรทัด |
olddate | String | 55 | olddate |
price_currency | Integer | 0 | ราคาสกุลเงิน |
price_mode | Integer | 0 | ประเภท (0=ราคาขายหลัก,1=ราคาขายทั่วไป) |
price_type | Integer | 0 | ประเภทราคา |
sale_price1 | Float | 0 | ราคาแยกภาษี |
sale_price2 | Float | 0 | ราคารวมภาษี |
sale_type | Integer | 0 | ประเภทการขาย |
status | Integer | 0 | สถานะ |
to_date | Date | 0 | ถึงวันที่ |
to_qty | Float | 0 | ถึงจำนวน |
transport_type | Integer | 0 | เงื่อนไขการส่ง |
unit_code | String | 25 | หน่วยนับ |
Product Price Formula
Field Name | Field Type | Length | Description |
---|---|---|---|
currency_code | String | 25 | สกุลเงิน |
ic_code | String | 25 | รหัสสินค้า |
price_0 | String | 50 | ราคากลาง |
price_1 | String | 50 | ราคา 1 |
price_2 | String | 50 | ราคา 2 |
price_3 | String | 50 | ราคา 3 |
price_4 | String | 50 | ราคา 4 |
price_5 | String | 50 | ราคา 5 |
price_6 | String | 50 | ราคา 6 |
price_7 | String | 50 | ราคา 7 |
price_8 | String | 50 | ราคา 8 |
price_9 | String | 50 | ราคา 9 |
price_currency | Float | 0 | ราคาสกุลเงิน |
sale_type | Integer | 0 | ประเภทการขาย |
tax_type | Integer | 0 | ประเภทภาษี |
unit_code | String | 25 | หน่วยนับ |