Skip to content

Product 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

Product List

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

EndPoint

GET /SMLJavaRESTService/product/v4

Query Request

FieldDescription
pagenumber of page
sizepage size

Example:

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

Product Information

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

EndPoint

GET /SMLJavaRESTService/product/v4/{code}

Path Parameter:

NameDescriptionExample
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:

NameDescriptionExample
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:

NameDescriptionExample
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 NameField TypeLengthDescriptionRequired
account_code_1String25รหัสผังบัญชีสินค้า
account_code_2String25รหัสผังบัญชีต้นทุน
account_code_3String25รหัสผังบัญชีรายได้
account_code_4String25รหัสผังบัญชีรับคืน
accrued_in_qtyFloat0ยอดค้างรับ
accrued_out_qtyFloat0ยอดค้างส่ง
average_costFloat0ต้นทุนเฉลี่ย
average_cost_1Float0ต้นทุนเฉลี่ยแฝงบริหาร
balance_qtyFloat0ยอดคงเหลือ
barcode_checker_printInteger0พิมพ์บาร์โค๊ดตรวจสอบ
book_out_qtyFloat0ยอดค้างจอง
codeString25รหัสสินค้าT
code_oldString25รหัสสินค้าเก่า
commission_rateString50อัตราค่าคอมมิสชั่น
cost_typeInteger0ประเภทต้นทุน
create_codeString25ผู้สร้าง
create_datetimeDate0วันที่สร้าง
degreeString50ดีกรี
descriptionString255รายละเอียด
doc_format_codeString25รหัสเอกสาร
drink_typeInteger0ประเภทเครื่องดื่ม
fixed_costFloat0ต้นทุนคงที่
gpu_codeString20GPU
group_mainString25กลุ่มสินค้าหลัก
group_subString25กลุ่มสินค้าย่อย
group_sub2String25กลุ่มสินค้าย่อย2
guid_codeString35GUID
have_take_awayInteger0เลือภาชนะ ทานที่ร้าน/กลับบ้าน
ic_discount_groupString25กลุ่มส่วนลด
ic_serial_noInteger0สินค้ามี Serial
income_typeString25ประเภทรายได้
is_eordershowInteger0แสดงในระบบ e-Order
is_new_itemInteger0เป็นสินค้าใหม่
is_product_boonrawdInteger0สินค้าบุญรอด
is_speechInteger0พูดรายการอาหาร
item_brandString25ยี่ห้อสินค้า
item_categoryString25หมวดสินค้า
item_characterString25ลักษณะสินค้า
item_classString25ระดับสินค้า
item_colorString25สีสินค้า
item_designString25รูปทรงสินค้า
item_gradeString25เกรดสินค้า
item_in_stockFloat0จำนวนสินค้า
item_modelString50รุ่นสินค้า
item_patternString25รูปแบบสินค้า
item_promoteInteger0เป็นสินค้าแนะนำ
item_rent_typeInteger0สินค้าเช่า
item_sale_typeInteger0สินค้าฝากขาย
item_sizeString25ขนาดสินค้า
item_statusInteger0สถานะสินค้า
item_typeInteger0ประเภทสินค้า
last_movement_dateDate0วันที่เคลื่อนไหวล่าสุด
last_update_codeString25ผู้แก้ไขล่าสุด
last_update_date_timeDate0วันที่แก้ไขล่าสุด
manufacturer_codeString25ผู้ผลิต
medicine_register_numberString50เลขทะเบียนยา
medicine_standard_codeString50เลขทะเบียนยา 24
name_1String255ชื่อสินค้า 1T
name_2String255ชื่อสินค้า 2
name_eng_1String255ชื่อ (ภาษาอังกฤษ) 1
name_eng_2String255ชื่อ (ภาษาอังกฤษ) 2
name_for_billString255ชื่อสำหรับออกบิล
name_for_posString255ชื่อสำหรับขายหน้าร้าน
name_for_searchString255ชื่อสำหรับการค้นหา
name_from_remarkInteger0แสดงชื่อสินค้าจากหมายเหตุ
name_marketString255ชื่อทางการตลาด
no_discountInteger0สินค้าไม่ลดราคา
normal_vendor_max_purchase_qtyFloat0จำนวนสูงสุดในการสั่งซื้อกับผู้ค้าทั่วไป
pos_no_sumInteger0ไม่รวมรายการในระบบ POS
print_order_per_unitInteger0พิมพ์ใบจัดรายการแบบแยก
product_ageInteger0อายุสินค้า/วัน
production_periodInteger0ระยะเวลาในการผลิต(นาที)
qc_productInteger0เป็นสินค้าควบคุมคุณภาพ
qc_product_retest_dayInteger0Retest Days
qty_per_palletInteger0จำนวนต่อพาเลท
quantityString50ปริมาณ
remarkString255หมายเหตุ
require_purchase_from_approve_vendorInteger0เป็นสินค้าที่ต้องซื้อจากผู้อนุมัติเท่านั้น
serial_no_formatString255รูปแบบ Serial
short_nameString255ชื่อสินค้าแบบย่อ
sign_codeString25เครื่องหมาย
statusInteger0สถานะ
sum_sale_1Float0ยอดขายตามจำนวน
supplier_codeString25ผู้จัดจำหน่ายหลัก
tax_typeInteger0ประเภทภาษี
topping_productInteger0เป็นสินค้า Topping
tpu_codeString20TPU
unit_costString25หน่วยต้นทุนT
unit_standardString25หน่วยยอดคงเหลือ
unit_standard_divide_valueFloat0อัตราส่วนยอดคงเหลือตัวหาร
unit_standard_nameString100หน่วยคงเหลือ
unit_standard_stand_valueFloat0อัตราส่วนยอดคงเหลือตัวตั้ง
unit_typeInteger0ประเภทหน่วยนับ
update_detailInteger0แก้ไขรายละเอียดประกอบ
update_priceInteger0แก้ไขตารางราคา
use_expireInteger0ใช้ระบบหมดอายุ
inventory_detailArrayObjectรายละเอียดสินค้า
inventory_barcodeArrayObjectรายละเอียดบาร์โค้ด
inventory_unitArrayObjectรายละเอียดหน่วยนับ
Inventory_priceArrayObjectรายละเอียดราคาสินค้า
inventory_price_formulaArrayObjectรายละเอียดราคาสินค้าตามสูตร

Product Detail

Field NameField TypeLengthDescription
account_groupString25รหัสกลุ่มบัญชี
accrued_controlInteger0อนุญาติให้ขายสินค้าค้างส่ง
balance_controlInteger0อนุญาติให้ยอดคงเหลือติดลบ
before_sale_unitString25หน่วยช่วยขาย
close_dateDate0วันที่ปิด
close_reasonString255เหตุผลในการปิด
cost_produceFloat0ต้นทุนการผลิต
cost_standardFloat0ต้นทุนมาตรฐาน
dimension_1String25มิติ 1
dimension_10String25มิติ 10
dimension_11String25มิติ 11
dimension_12String25มิติ 12
dimension_13String25มิติ 13
dimension_14String25มิติ 14
dimension_15String25มิติ 15
dimension_16String25มิติ 16
dimension_17String25มิติ 17
dimension_18String25มิติ 18
dimension_19String25มิติ 19
dimension_2String25มิติ 2
dimension_20String25มิติ 20
dimension_21String255มิติ 21
dimension_22String255มิติ 22
dimension_23String255มิติ 23
dimension_24String255มิติ 24
dimension_25String255มิติ 25
dimension_26String255มิติ 26
dimension_27String255มิติ 27
dimension_28String255มิติ 28
dimension_29String255มิติ 29
dimension_3String25มิติ 3
dimension_30String255มิติ 30
dimension_31String255มิติ 31
dimension_32String255มิติ 32
dimension_33String255มิติ 33
dimension_34String255มิติ 34
dimension_35String255มิติ 35
dimension_36String255มิติ 36
dimension_37String255มิติ 37
dimension_38String255มิติ 38
dimension_39String255มิติ 39
dimension_4String25มิติ 4
dimension_40String255มิติ 40
dimension_41String255มิติ 41
dimension_42String255มิติ 42
dimension_43String255มิติ 43
dimension_44String255มิติ 44
dimension_45String255มิติ 45
dimension_5String25มิติ 5
dimension_6String25มิติ 6
dimension_7String25มิติ 7
dimension_8String25มิติ 8
dimension_9String25มิติ 9
discountString50ส่วนลดต่อรายการ
formularString25รหัสสูตรการผลิต
have_pointInteger0เข้าสะสมแต้ม
ic_codeString25รหัสสินค้า
ic_out_shelfString25ที่เก็บสินค้าชำรุด
ic_out_whString25คลังสินค้าชำรุด
ic_reserve_whString25คลังสินค้าจอง
is_endInteger0สินค้าเลิกผลิตแล้ว
is_hold_purchaseInteger0สินค้าหยุดซื้อ
is_hold_saleInteger0สินค้าหยุดขาย
is_premiumInteger0สินค้าสมนาคุณ
is_stopInteger0ห้ามใช้
lock_costInteger0ห้ามขายต่ำกว่าต้นทุน
lock_discountInteger0ห้ามแก้ส่วนลดขาย
lock_priceInteger0ห้ามแก้ราคาขาย
maximum_qtyFloat0จุดสูงสุด
minimum_qtyFloat0จุดต่ำสุด
po_overInteger0รับเกินที่สั่งซื้อได้
purchase_managerString25ผู้รับผิดชอบการซื้อ
purchase_pointFloat0จุดสั่งซื้อ
ref_file_1String255ไฟล์อ้างอิง 1
ref_file_2String255ไฟล์อ้างอิง 2
ref_file_3String255ไฟล์อ้างอิง 3
ref_file_4String255ไฟล์อ้างอิง 4
ref_file_5String255ไฟล์อ้างอิง 5
reserve_statusInteger0สถานะการจอง
sale_managerString25ผู้รับผิดชอบการขาย
sale_price_1Float0ราคาขาย 1
sale_price_2Float0ราคาขาย 2
sale_price_3Float0ราคาขาย 3
sale_price_4Float0ราคาขาย 4
serial_numberString25serial number
so_overInteger0เบิกเกินสั่งขายได้
start_purchase_shelfString25ที่เก็บเริ่มต้นซื้อ
start_purchase_unitString25หน่วยเริ่มต้นซื้อ
start_purchase_whString25คลังเริ่มต้นซื้อ
start_sale_shelfString25ที่เก็บเริ่มต้นขาย
start_sale_unitString25หน่วยเริ่มต้นขาย
start_sale_whString25คลังเริ่มต้นขาย
start_unit_codeString25หน่วยเริ่มต้นสินค้า
tax_importString100% ภาษีนำเข้า
tax_rateFloat0พิกัดศุลกากร
unit_2_averageInteger0เฉลี่ยค่าระหว่างหน่วยนับ
unit_2_average_valueFloat0ค่าเฉลี่ยระหว่างหน่วยนับ
unit_2_codeString25หน่วยนับที่ 2
unit_2_qtyInteger0ปริมาณหน่วยนับ 2
unit_for_stockString25หน่วยนับสต็อก
user_group_for_manageString25กลุ่มผู้รับผิดชอบการจัดการ
user_group_for_purchaseString25กลุ่มผู้รับผิดชอบการซื้อ
user_group_for_saleString25กลุ่มผู้รับผิดชอบการขาย
user_group_for_warehouseString25กลุ่มผู้รับผิดชอบคลังสินค้า
user_statusInteger0สถานะผู้มีสิทธิใช้งาน

Product Barcode

Field NameField TypeLengthDescription
barcodeString25บาร์โค้ด
descriptionString255รายละเอียด
guid_codeString35GUID
hidden_textInteger0ไม่แสดง
ic_codeString25รหัสสินค้า
line_numberInteger0บรรทัด
no_pointInteger0ไม่สะสมแต้ม
priceFloat0ราคาทั่วไป
price_2Float0ราคาทั่วไป
price_3Float0ราคาทั่วไป
price_4Float0ราคาทั่วไป
price_memberFloat0ราคาสมาชิก
price_member_2Float0ราคาสมาชิก
price_member_3Float0ราคาสมาชิก
price_member_4Float0ราคาสมาชิก
shelf_codeString25ที่เก็บสินค้า
statusInteger0สถานะ
unit_codeString25หน่วยนับ
wh_codeString25คลังสินค้า

Product Unit

Field NameField TypeLengthDescription
codeString25รหัส
divide_valueFloat0ตัวหาร
ic_codeString25รหัสสินค้า
line_numberInteger0ลำดับ
ratioFloat0อัตราส่วน
remarkString255หมายเหตุ
row_orderInteger0ลำดับที่
stand_valueFloat0ตัวตั้ง
statusInteger0สถานะ
unit_sizeFloat0ขนาดสินค้า
weightString100น้ำหนัก(กก)
width_length_heightString100กว้างxยาวxสูง

Product Price

Field NameField TypeLengthDescription
currency_codeString25สกุลเงิน
cust_codeString25รหัสลูกค้า
cust_group_1String25กลุ่มลูกค้าหลัก
cust_group_2String25กลุ่มลูกค้าย่อย
from_dateDate0จากวันที่
from_qtyFloat0จากจำนวน
ic_codeString25รหัสสินค้า
line_numberInteger0หมายเลขบรรทัด
olddateString55olddate
price_currencyInteger0ราคาสกุลเงิน
price_modeInteger0ประเภท (0=ราคาขายหลัก,1=ราคาขายทั่วไป)
price_typeInteger0ประเภทราคา
sale_price1Float0ราคาแยกภาษี
sale_price2Float0ราคารวมภาษี
sale_typeInteger0ประเภทการขาย
statusInteger0สถานะ
to_dateDate0ถึงวันที่
to_qtyFloat0ถึงจำนวน
transport_typeInteger0เงื่อนไขการส่ง
unit_codeString25หน่วยนับ

Product Price Formula

Field NameField TypeLengthDescription
currency_codeString25สกุลเงิน
ic_codeString25รหัสสินค้า
price_0String50ราคากลาง
price_1String50ราคา 1
price_2String50ราคา 2
price_3String50ราคา 3
price_4String50ราคา 4
price_5String50ราคา 5
price_6String50ราคา 6
price_7String50ราคา 7
price_8String50ราคา 8
price_9String50ราคา 9
price_currencyFloat0ราคาสกุลเงิน
sale_typeInteger0ประเภทการขาย
tax_typeInteger0ประเภทภาษี
unit_codeString25หน่วยนับ