Skip to content

ProductDsicount 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

ProductDsicount List

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

EndPoint

GET /SMLJavaRESTService/discount/v4

Query Request

FieldDescription
pagenumber of page
sizepage size

Example:

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

ProductDsicount Information

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

EndPoint

GET /SMLJavaRESTService/discount/v4/{code}

Path Parameter:

NameDescriptionExample
codeรหัสส่วนลดสินค้าBB001

example:

GET localhost:8084/SMLJavaRESTService/discount/v4/002

Response Success

{
    "success": true,
    "data": {
        "code": "BB001",
        "name_1": "test007",
        "name_eng_1": "ทดสอบคู่ค้า sml1",
        "inventory_discount": [
            {
                "ic_code": "BB001",
                "unit_code": "กล่อง",
                "from_qty": 1.0,
                "to_qty": 1.0,
                "from_date": "2019-02-01",
                "to_date": "2021-02-28",
                "sale_type": 0,
                "discount": "10%",
                "status": 1,
                "cust_code": "",
                "cust_group_1": "",
                "cust_group_2": "",
                "olddate": "",
                "line_number": 0,
                "price_currency": 0,
                "currency_code": ""
            }
        ],
        "inventory_discount_group": [
            {
                "ic_code": "BB001",
                "unit_code": "กล่อง",
                "from_qty": 1.0,
                "to_qty": 9999999.0,
                "from_date": "2020-12-01",
                "to_date": "2021-12-31",
                "sale_type": 0,
                "discount": "10%",
                "status": 1,
                "cust_code": "",
                "cust_group_1": "001",
                "cust_group_2": "",
                "olddate": "",
                "line_number": 0,
                "price_currency": 0,
                "currency_code": ""
            }
        ],
        "inventory_discount_customer": [
            {
                "ic_code": "BB001",
                "unit_code": "กล่อง",
                "from_qty": 1.0,
                "to_qty": 9999999.0,
                "from_date": "2020-12-01",
                "to_date": "2021-12-31",
                "sale_type": 0,
                "discount": "10%",
                "status": 1,
                "cust_code": "",
                "cust_group_1": "001",
                "cust_group_2": "",
                "olddate": "",
                "line_number": 0,
                "price_currency": 0,
                "currency_code": ""
            }
        ]
    }
}

Response Error

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

ProductDsicount Attribute

Field NameField TypeLengthDescriptionRequired
codeString25รหัสสินค้า
name_1String100ชื่อ
name_2String100ชื่อ (ภาษาอังกฤษ)
inventory_discountArrayObjectส่วนลดสินค้าย่อย
inventory_discount_customerArrayObjectส่วนลดสินค้าตามลูกค้า
inventory_discount_groupArrayObjectส่วนลดสินค้าตามกลุ่มลูกค้า

ProductDsicount Detail

Field NameField TypeLengthDescription
ic_codeString25รหัสสินค้า
unit_codeString100หน่วยนับ
from_qtyFloat0จากจำนวน
to_qtyFloat0ถึงจำนวน
from_dateDate0จากวันที่
to_dateDate0ถึงวันที่
sale_typeInteger0ประเภทการขาย
transport_typeInteger0เงื่อนไขการส่ง
discountString255ส่วนลด
discount_typeInteger0ประเภทราคา (0=ลดทั่วไป,1=ตามกลุ่มลูกค้า,2=ตามลูกค้า)
cust_codeString25รหัสลูกค้า
cust_group_1String25กลุ่มลูกค้าหลัก
cust_group_2String25กลุ่มลูกค้าย่อย
olddateString55olddate
currency_codeString25สกุลเงิน