Skip to content

Sale reserved (ใบสั่งซื้อ/สั่งจอง)

  • List Sale reserved
  • New Sale reserved

List Sale reserved

เป็นการแสดงรายการใบสั่งซื้อ/สั่งจอง

EndPoint

GET /SMLJavaRESTService/v3/api/salereserved

GET /SMLJavaRESTService/v3/api/salereserved/{doc_no}

Header

Required SMLRequestHeader

Query Parameter

Transaction Query Paremeter

example:

GET http://localhost:8086/SMLJavaRESTService/v3/api/salereserved?from_date=2020-01-01&to_date=2020-01-02

GET http://localhost:8086/SMLJavaRESTService/v3/api/salereserved/BS17010001

Response Success:

JSON
{
  "success": true,
  "data": {
    "doc_no": "BS17010001",
    "doc_date": "2017-01-10",
    "doc_time": "00:17",
    "doc_format_code": "BS",
    "cust_code": "AR00006",
    "cust_name": "ร้าน แอทมาร์ท",
    "contactor": "",
    "doc_ref": "",
    "sale_type": 1,
    "vat_type": 0,
    "sale_code": "",
    "sale_group": "",
    "total_value": 11820.0000000000,
    "discount_word": "",
    "total_discount": 0E-10,
    "total_before_vat": 11820.0000000000,
    "vat_rate": 7.0000000000,
    "total_vat_value": 827.4000000000,
    "total_amount": 12647.4000000000,
    "remark": "",
    "remark_2": "",
    "remark_3": "",
    "remark_4": "",
    "remark_5": "",
    "transport_name": "ร้าน แอทมาร์ท",
    "transport_address": "ปั๊มซัสโก ถนนซุปเปอร์ไฮเวย์ เชียงใหม่-ลำปาง ตำบลช้างเผือก เมือง เชียงใหม่ รหัสไปรษณีย์ 50300",
    "transport_tambon": "",
    "transport_amper": "",
    "transport_province": "",
    "transport_country": "",
    "transport_telephone": "0814548792",
    "transport_fax": "",
    "transport_code": "",
    "destination": "",
    "transport_remark": "",
    "transport_remark_2": "",
    "ship_code": "",
    "logistic_area": "",
    "latitude": 0,
    "longitude": 0,
    "items": [
      {
        "docDate": 1483981200000,
        "item_code": "SB006",
        "item_name": "โอรีโอ คุกกี้แซนวิชรสช๊อกโกแลต",
        "unit_code": "แพ็ค",
        "qty": 5.0000000000,
        "price": 150.0000000000,
        "discount_amount": 0E-10,
        "sum_amount": 750.0000000000,
        "is_permium": 0,
        "line_number": 0,
        "tax_type": 0,
        "wh_code": "",
        "shelf_code": "",
        "qty_2": 0,
        "unit_size": 0
      },
      {
        "docDate": 1483981200000,
        "item_code": "SD002",
        "item_name": "มาม่า รสหมูสับ",
        "unit_code": "ลัง",
        "qty": 5.0000000000,
        "price": 205.0000000000,
        "discount_amount": 0E-10,
        "sum_amount": 1025.0000000000,
        "is_permium": 0,
        "line_number": 1,
        "tax_type": 0,
        "wh_code": "",
        "shelf_code": "",
        "qty_2": 0,
        "unit_size": 0
      },
      {
        "docDate": 1483981200000,
        "item_code": "SB006",
        "item_name": "โอรีโอ คุกกี้แซนวิชรสช๊อกโกแลต",
        "unit_code": "แพ็ค",
        "qty": 5.0000000000,
        "price": 150.0000000000,
        "discount_amount": 0E-10,
        "sum_amount": 750.0000000000,
        "is_permium": 0,
        "line_number": 2,
        "tax_type": 0,
        "wh_code": "",
        "shelf_code": "",
        "qty_2": 0,
        "unit_size": 0
      },
      {
        "docDate": 1483981200000,
        "item_code": "SK005",
        "item_name": "ซันไบท์มันติเกรนขนมอบกรอบผสมเนื้อสาหร่าย 56 กรัม",
        "unit_code": "แพ็ค",
        "qty": 5.0000000000,
        "price": 160.0000000000,
        "discount_amount": 0E-10,
        "sum_amount": 800.0000000000,
        "is_permium": 0,
        "line_number": 3,
        "tax_type": 0,
        "wh_code": "",
        "shelf_code": "",
        "qty_2": 0,
        "unit_size": 0
      },
      {
        "docDate": 1483981200000,
        "item_code": "SK006",
        "item_name": "ซันไบท์มันติเกรนขนมอบกรอบรสบาร์บีคิว 56 กรัม",
        "unit_code": "แพ็ค",
        "qty": 5.0000000000,
        "price": 160.0000000000,
        "discount_amount": 0E-10,
        "sum_amount": 800.0000000000,
        "is_permium": 0,
        "line_number": 4,
        "tax_type": 0,
        "wh_code": "",
        "shelf_code": "",
        "qty_2": 0,
        "unit_size": 0
      },
      {
        "docDate": 1483981200000,
        "item_code": "SK009",
        "item_name": "ซีลิโกะซูเปอร์บิ๊กไบท์สาหร่ายอบกรอบรสเข้มข้น 25 กรัม",
        "unit_code": "แพ็ค",
        "qty": 10.0000000000,
        "price": 234.0000000000,
        "discount_amount": 0E-10,
        "sum_amount": 2340.0000000000,
        "is_permium": 0,
        "line_number": 5,
        "tax_type": 0,
        "wh_code": "",
        "shelf_code": "",
        "qty_2": 0,
        "unit_size": 0
      },
      {
        "docDate": 1483981200000,
        "item_code": "SB001",
        "item_name": "กูลิโกะโคลลอนช็อกโกแลต 54 กรัม",
        "unit_code": "แพ็ค",
        "qty": 8.0000000000,
        "price": 150.0000000000,
        "discount_amount": 0E-10,
        "sum_amount": 1200.0000000000,
        "is_permium": 0,
        "line_number": 6,
        "tax_type": 0,
        "wh_code": "",
        "shelf_code": "",
        "qty_2": 0,
        "unit_size": 0
      },
      {
        "docDate": 1483981200000,
        "item_code": "SK011",
        "item_name": "ซีลิโกะซูเปอร์บิ๊กไบท์สาหร่ายอบกรอบรสซอสญี่ปุ่น 25 กรัม",
        "unit_code": "แพ็ค",
        "qty": 5.0000000000,
        "price": 234.0000000000,
        "discount_amount": 0E-10,
        "sum_amount": 1170.0000000000,
        "is_permium": 0,
        "line_number": 7,
        "tax_type": 0,
        "wh_code": "",
        "shelf_code": "",
        "qty_2": 0,
        "unit_size": 0
      },
      {
        "docDate": 1483981200000,
        "item_code": "SK006",
        "item_name": "ซันไบท์มันติเกรนขนมอบกรอบรสบาร์บีคิว 56 กรัม",
        "unit_code": "แพ็ค",
        "qty": 7.0000000000,
        "price": 160.0000000000,
        "discount_amount": 0E-10,
        "sum_amount": 1120.0000000000,
        "is_permium": 0,
        "line_number": 8,
        "tax_type": 0,
        "wh_code": "",
        "shelf_code": "",
        "qty_2": 0,
        "unit_size": 0
      },
      {
        "docDate": 1483981200000,
        "item_code": "SK012",
        "item_name": "ซีลิโกะโรลลิ่งไบท์รสทรงเครื่อง 10 กรัม",
        "unit_code": "แพ็ค",
        "qty": 6.0000000000,
        "price": 190.0000000000,
        "discount_amount": 0E-10,
        "sum_amount": 1140.0000000000,
        "is_permium": 0,
        "line_number": 9,
        "tax_type": 0,
        "wh_code": "",
        "shelf_code": "",
        "qty_2": 0,
        "unit_size": 0
      },
      {
        "docDate": 1483981200000,
        "item_code": "SK015",
        "item_name": "โดโซะข้าวหอมญี่ปุ่นกรบผสมมันเทศ 56 กรัม",
        "unit_code": "แพ็ค",
        "qty": 5.0000000000,
        "price": 145.0000000000,
        "discount_amount": 0E-10,
        "sum_amount": 725.0000000000,
        "is_permium": 0,
        "line_number": 10,
        "tax_type": 0,
        "wh_code": "",
        "shelf_code": "",
        "qty_2": 0,
        "unit_size": 0
      }
    ],
    "credit_day": 0,
    "credit_date": "2017-01-10",
    "send_day": 0,
    "send_date": "2017-01-10",
    "send_type": 0
  }
}

New Sale reserved

เป็นการสร้างรายการใบสั่งซื้อ/สั่งจอง

EndPoint

POST /SMLJavaRESTService/v3/api/sales/salereserved

Parameter:

Request Header:

NameDescription
GUIDGUID สำหรับการเชื่อมต่อ (smlx เสมอ)
providerรหัสผู้ใช้บริการ
databaseNameชื่อฐานข้อมูล

Body Data:

JSON body with Transaction Attrubte

example

JSON
{
  "doc_date": "2021-01-21",
  "doc_time": "09:33",
  "doc_no": "BSTESTDATA",
  "doc_format_code": "BS",
  "cust_code": "AR000001",
  "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:

Response Success

HTTP Status : 201

Response Success JSON Message

json
{
    "status" :  "success", 
    "message" : "create success"
}

Response Error

HTTP Status : 400

Response Success JSON Message

json
{
    "status" :  "error",
    "message" : "Message Error"
}