Appearance
ProductDsicount Service
API ระบบส่วนลดสินค้า
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 |
ProductDsicount List
แสดงข้อมูลสินค้าทีละหลาย ๆ รายการ
EndPoint
GET /SMLJavaRESTService/discount/v4
Query Request
Field | Description |
---|---|
page | number of page |
size | page size |
Example:
GET localhost:8084/SMLJavaRESTService/discount/v4?page=1&size=2
ProductDsicount Information
เป็นการดึงข้อมูลส่วนลดสินค้ามาแสดงทีละ 1 รายการโดยจะต้องระบุรหัสส่วนลดสินค้า
EndPoint
GET /SMLJavaRESTService/discount/v4/{code}
Path Parameter:
Name | Description | Example |
---|---|---|
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 Name | Field Type | Length | Description | Required |
---|---|---|---|---|
code | String | 25 | รหัสสินค้า | |
name_1 | String | 100 | ชื่อ | |
name_2 | String | 100 | ชื่อ (ภาษาอังกฤษ) | |
inventory_discount | ArrayObject | ส่วนลดสินค้าย่อย | ||
inventory_discount_customer | ArrayObject | ส่วนลดสินค้าตามลูกค้า | ||
inventory_discount_group | ArrayObject | ส่วนลดสินค้าตามกลุ่มลูกค้า |
ProductDsicount Detail
Field Name | Field Type | Length | Description |
---|---|---|---|
ic_code | String | 25 | รหัสสินค้า |
unit_code | String | 100 | หน่วยนับ |
from_qty | Float | 0 | จากจำนวน |
to_qty | Float | 0 | ถึงจำนวน |
from_date | Date | 0 | จากวันที่ |
to_date | Date | 0 | ถึงวันที่ |
sale_type | Integer | 0 | ประเภทการขาย |
transport_type | Integer | 0 | เงื่อนไขการส่ง |
discount | String | 255 | ส่วนลด |
discount_type | Integer | 0 | ประเภทราคา (0=ลดทั่วไป,1=ตามกลุ่มลูกค้า,2=ตามลูกค้า) |
cust_code | String | 25 | รหัสลูกค้า |
cust_group_1 | String | 25 | กลุ่มลูกค้าหลัก |
cust_group_2 | String | 25 | กลุ่มลูกค้าย่อย |
olddate | String | 55 | olddate |
currency_code | String | 25 | สกุลเงิน |