Skip to content

Purchase Invoice

สำหรับ ส่งรายการบิลซื้อเข้ามาในระบบ

TypeValue
URL/SMLJavaRESTService/restapi/purchaseinvoice
MethodPOST
Content-TypeApplication/json

Request Header

NameDescription
GUIDGUID สำหรับการเชื่อมต่อ (smlx เสมอ)
configFIleNameชื่อไฟล์เก็บ Server Config
databaseNameชื่อฐานข้อมูล

Example

{
    "GUID" : "smlx"
    "configFileName" : "SMLConfigBRSMLST.xml"
    "databaseName" : "smlst2016"
}

Data Params

Request ParamsType
doc_noStringเอกสารเลขที่
doc_format_codeStringรหัสเอกสาร
doc_dateStringเอกสารวันที่
doc_timeStringเวลา
cust_codeStringรหัสเจ้าหนี้
inquiry_typeNumberประเภทการซื้อ
  • 0=ซื้อสินค้าเงินเชื่อ
  • 1=ซื้อสินค้าเงินสด
  • 2=ซื้อสินค้าเงินเชื่อ(สินค้าบริการ)
  • 3=ซื้อสินค้าเงินสด(สินค้าบริการ)
vat_typeNumberประเภทภาษี
  • 0=แยกนอก
  • 1=รวมใน
  • 2=อัตราภาษีศูนย์
vat_rateNumberอัตราภาษี
total_valueNumberมูลค่าสินค้า
total_discountNumberมูลค่าส่วนลด
total_before_vatNumberยอดก่อนภาษี
total_vat_valueNumberภาษีมูลค่าเพิ่ม
total_except_vatNumberมูลค่าสินค้ายกเว้นภาษี
total_after_vatNumberมูลค่าหลังคิดภาษี
total_amountNumberมูลค่าสุทธิ
cash_amountNumberยอดเงินสด
chq_amountNumberยอดเช็ค
credit_amountNumberยอดบัตรเครดิต
tranfer_amountNumberยอดเงินโอน
credit_dayNumberจำนวนวันเครดิต**
branch_codeStringสาขา**
remarkStringหมายเหตุ**
diff_amountNumberยอดปัดเศษ (new)**
detailsJSON Arrayรายละเอียดสินค้า
paydetailsJSON Arrayรายละเอียดการชำระเงิน

** Optional Params

Item Detail (รายละเอียดสินค้า)

NameType
item_codeStringรหัสสินค้า
line_numberNumberหมายเลขบรรทัด
is_permiumNumber0=สินค้าปรกติ,1=ของแถม
unit_codeStringหน่วยนับ
wh_codeStringคลังสินค้า
shelf_codeStringที่เก็บสินค้า
qtyNumberจำนวน
priceNumberราคา
price_exclude_vatNumberราคาไม่รวมภาษี
discount_amountNumberส่วนลด
sum_amountNumberรวมมูลค่า
vat_amountNumberยอดภาษี
tax_typeNumberประเภทภาษีของสินค้า (0=มีภาษี,1=ยกเว้นภาษี)
vat_typeNumberประเภทภาษี (0=แยกนอก,1=รวมใน,2=อัตราภาษีศูนย์)
sum_amount_exclude_vatNumberมูลค่าไม่รวมภาษี

Payment Detail (รายละเอียดการชำระเงิน)

NameType
pay_typeNumberประเภทการรับเงิน (1=เงินโอน,2=เช็ค,3=บัตรเครดิต)
pay_trans_numberStringสมุดเงินฝาก/เลขที่เช็ค/เลขที่บัตรเครดิต
credit_card_typeStringประเภทบัตรเครดิต
no_approvedStringเลขที่อนุมัติ
bank_codeStringธนาคาร
pay_amountNumberจำนวนเงิน
chq_due_dateStringวันที่โอน/วันที่บนเช็ค
chargeNumberยอด Charge
sum_amountNumberยอดเงินรวม

Sample Call

{
	"doc_no": "1000767-6002992526",
	"doc_format_code": "PU",
	"doc_date": "2018-03-13",
	"doc_time": "06:00",
	"cust_code": "4012000",
	"tax_doc_date": "2019-06-07",
	"tax_doc_no": "1004/10600512",
	"vat_rate": 7.00,
	"total_value": 1380531.6,
	"total_discount": 0,
	"total_before_vat": 1380531.6,
	"total_vat_value": 96637.21,
	"total_except_vat": 0,
	"total_after_vat": 1477168.81,
	"total_amount": 1477168.81,
	"vat_type": 0,
	"inquiry_type": 0,
	"credit_day": 15,
	"credit_date": "2019-06-22",
	"remark": null,
	"discount_word": null,
	"wh_from": "BRT999",
	"location_from": "LC999",
	"details": [{
			"item_code": "NST8000",
			"line_number": 2,
			"is_permium": 0,
			"unit_code": "UNIT",
			"wh_code": "BRT999",
			"shelf_code": "LC999",
			"qty": 1,
			"price": 4838.4,
			"price_exclude_vat": 4838.4,
			"sum_amount_exclude_vat": 4838.4,
			"discount_amount": 0,
			"sum_amount": 4838.4,
			"tax_type": 0,
			"vat_type": 0
		}, {
			"item_code": "1000922",
			"line_number": 1,
			"is_permium": 0,
			"unit_code": "CV",
			"wh_code": "BRT999",
			"shelf_code": "LC999",
			"qty": 2520,
			"price": 545.91,
			"price_exclude_vat": 1375693.2,
			"sum_amount_exclude_vat": 1375693.2,
			"discount_amount": 0,
			"sum_amount": 1375693.2,
			"tax_type": 0,
			"vat_type": 0
		}
	]
}

Response

Response Success
HTTP Status201

Response Success JSON Message

{
    "status" :  "success", 
    "message" : "create success"
}
Response Error
HTTP Status400

Response Success JSON Message

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