Appearance
Sales Order (ใบสั่งขาย)
การดึงรายการใบสั่งขาย
Endpoint
GET /SMLJavaRESTService/v3/api/saleorder
Header
Required
SMLRequestHeader
Query Parameter
example
GET http://localhost:8086/SMLJavaRESTService/v3/api/saleorder?from_date=2020-01-01&to_date=2020-01-02
GUID: smlx
databaseName: surin
provider: MAINTEST
configFilename: SMLConfigMAINTEST.xml
Content-Type: application/json
result
json
{
"success": true,
"data": [
{
"doc_no": "SO59120001",
"doc_date": "2016-12-01",
"doc_time": "09:00",
"doc_format_code": "SO",
"cust_code": "AR015",
"cust_name": "บริษัท ซีโน-แปซิฟิค เทรดดิ้ง (ไทยแลนด์) จำกัด (สำนักงานใหญ่)",
"sale_type": 1,
"vat_type": 0,
"sale_code": "1056",
"total_value": 90.0000,
"total_discount": 0,
"total_before_vat": 90.0000,
"vat_rate": 7.0000,
"total_vat_value": 6.3000,
"total_amount": 96.3000,
"transport_name": "บริษัท ซีโน-แปซิฟิค เทรดดิ้ง (ไทยแลนด์) จำกัด (สำนักงานใหญ่)",
"transport_address": "122/2-3 ถ.นนทรี แขวงช่องนนทรี เขตยานนาวา กทม 10120",
"transport_telephone": "111",
"transport_fax": "2222",
"transport_code": "KL",
"transport_remark": "",
"transport_remark_2": "",
"items": [
{
"docDate": 1480525200000,
"item_code": "1-B-01",
"item_name": "เบอร์ดี้ เอสเพรสโซ เขียว 180 มล.",
"unit_code": "กระป๋อง",
"qty": 1.00,
"price": 90.0000,
"discount_amount": 0,
"sum_amount": 90.0000,
"is_permium": 0,
"line_number": 0,
"tax_type": 0,
"wh_code": "B00001",
"shelf_code": "1"
}
]
}
],
"pages": {
"size": 20,
"page": 1,
"total_record": 1,
"max_page": 1
}
}
การสร้างใบสั่งขาย ด้วย API
EndPoint
POST /SMLJavaRESTService/v3/api/saleorder
Header
Required
SMLRequestHeader
Body Data:
JSON
body with Transaction Attrubte
example
JSON
{
"doc_date" : "2021-01-21",
"doc_time" : "09:33",
"doc_no" : "20210121-0001",
"doc_format_code" : "RU",
"cust_code" : "999",
"contactor" : "ชัย จอระ",
"vat_type" : 2,
"doc_ref" : "REF1",
"doc_ref_date": "2021-01-20",
"sale_code" : "01",
"sale_group" : "002",
"expire_day" : 3,
"expire_date": "2020-12-20",
"credit_day" : 3,
"credit_date": "2020-12-20",
"send_day" : 3,
"send_date": "2020-12-20",
"send_type": 1,
"vat_rate": 7,
"total_value": 19200,
"discount_word": "",
"total_discount": 0,
"total_before_vat": 473103.00,
"total_vat_value": 33117.21,
"total_after_vat": 506220.21,
"total_except_vat": 0,
"total_amount" : 19200,
"branch_code" : "001",
"allocate_code" : "allocate_code",
"department_code" : "department_code",
"job_code" : "job_code",
"side_code" : "side_code",
"project_code" : "project_code",
"remark": "Remark",
"remark2": "Remark2",
"remark3": "Remark3",
"remark4": "Remark4",
"remark5": "Remark5",
"items" : [
{
"item_code" : "A-00011",
"item_name" : "ข้ามหอมมะลิ",
"unit_code" : "กระป๋อง",
"wh_code" : "01",
"shelf_code" : "01",
"qty": 100,
"price": 697.8900,
"price_exclude_vat": 697.89,
"sum_amount": 69789.00,
"vat_amount": 4885.23,
"tax_type": 0,
"sum_amount_exclude_vat": 69789.00
}
],
"shipment" : {
"transport_name": "ส.สุรินทร์",
"transport_address": "122/2-3 ถ.นนทรี แขวงช่องนนทรี เขตยานนาวา กทม 10120",
"transport_province": "กรุงเทพมหานคร",
"transport_amper": "เขตยานนาวา",
"transport_tambon": "แขวงช่องนนทรี",
"transport_country": "ประเทศไทย",
"transport_telephone": "โทร",
"transport_fax": "แฟกซ์",
"transport_code": "KL",
"destination": "destination",
"ship_code": "ship_code",
"logistic_area": "logistic_area",
"latitude": 11,
"longitude": 10,
"remark": "",
"remark2": ""
}
}
Response Success
Response Success JSON Message
json
{
"status" : "success",
"data" : {
"doc_no" : "SR59120001"
}
}
Response Error
Response Success JSON Message
json
{
"error" : true,
"message" : "Message Error",
"code" : "00"
}