[API Update Sale Orders] Không update được chi tiết hàng hóa trong đơn hàng [Closed]

Vũ Xuân Quỳnh

Moderator
Nhân viên MISA
Bên em đã hỗ trợ anh submit thành công api cập nhật đơn hàng bằng cách thêm property amount_summary vào đơn hàng. Nhưng số lượng của chi tiết hàng hóa bị set về = 0

CURL
Mã:
curl -X PUT "https://crmconnect.misa.vn/api/v2/SaleOrders" -H  "accept: */*" -H  "Clientid: tuantucrm" -H  "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb21wYW55Y29kZSI6Ikw3Y1NNTmtjTk80K3J2M2FVYk5Na2c9PSIsImNsaWVudGlkIjoiODZFdGhPanMwc2FlY0kramxPQXZCUT09IiwiZXhwaXJlcyI6IlpRDhGQmRCbm5GZEhCQnFWNkQ1eStBTkVRN21iTWZxcWdFR2M9IiwiaXNwbGF0Zm9ybSI6IjQ4QXNZMWpsV1JFZ2VDQ3JvQ1R1TVE9PSIsInVzZXJpZCI6IkVEYjZvek84UXp4eDZMTGZmSnhVaXplcC9ySjJvZ3RRd2l5dzFySWlvMGtZaEVraDJpWjl1cWZGT0FVeGNHNDciLCJuYmYiOjE2OTcyMTY4NzcsImV4cCI6MTY5NzMwMzI3NywiaXNzIjoiTUlTQSIsImF1ZCI6IkFNSVNDUk0yIn0.sw0oTC7kWi0Iur0H_7Sng8es5LmtSpBCQITTNOSMXhY" -H  "Content-Type: application/json-patch+json" -d "[{\"form_layout\":37,\"id\":null,\"sale_order_no\":\"DH0001167\",\"sale_order_name\":\"Đơn hàng bán cho diem test\",\"sale_order_date\":\"2023-10-11T00:00:00+07:00\",\"account_name\":\"KH006661\",\"status\":\"Chưa thực hiện\",\"billing_address\":\"120 hoa mai\",\"shipping_address\":\"120 hoa mai\",\"phone\":\"0923508810\",\"sale_order_amount\":272913,\"amount_summary\":18,\"sale_order_product_mappings\":[{\"tax_percent\":\"8%\",\"amount\":15,\"to_currency\":245236.05,\"description\":\"Thùng carton - 600D x 600R x 400C - 3 lớp( Kiểu A1 - QT_ND125/XDT100/XDT100-B)\",\"stock_name\":\"KHO TP\",\"discount\":0,\"price\":16349.07,\"product_code\":\"TP02038\",\"tax\":19618.88,\"total\":264854.93},{\"tax_percent\":\"8%\",\"amount\":3,\"to_currency\":7461.12,\"description\":\"Hộp carton - 100D x 100R x 200C - 3 lớp( Kiểu A1 - CL_2N.120+X.95-C)\",\"stock_name\":\"KHO TP\",\"discount\":0,\"price\":2487.04,\"product_code\":\"TP01836\",\"tax\":596.89,\"total\":8058.01}]}]"

JSON
JSON:
[
  {
    "form_layout": 37,
    "sale_order_no": "DH0001167",
    "sale_order_name": "Đơn hàng bán cho diem test",
    "sale_order_date": "2023-10-11T00:00:00+07:00",
    "account_name": "KH006661",
    "status": "Chưa thực hiện",
    "billing_address": "120 hoa mai",
    "shipping_address": "120 hoa mai",
    "phone": "0923508810",
    "sale_order_amount": 272913,
    "amount_summary": 18,
    "sale_order_product_mappings": [
      {
        "tax_percent": "8%",
        "amount": 15,
        "to_currency": 245236.05,
        "description": "Thùng carton - 600D x 600R x 400C - 3 lớp( Kiểu A1 - QT_ND125/XDT100/XDT100-B)",
        "stock_name": "KHO TP",
        "discount": 0,
        "price": 16349.07,
        "product_code": "TP02038",
        "tax": 19618.88,
        "total": 264854.93
      },
      {
        "tax_percent": "8%",
        "amount": 3,
        "to_currency": 7461.12,
        "description": "Hộp carton - 100D x 100R x 200C - 3 lớp( Kiểu A1 - CL_2N.120+X.95-C)",
        "stock_name": "KHO TP",
        "discount": 0,
        "price": 2487.04,
        "product_code": "TP01836",
        "tax": 596.89,
        "total": 8058.01
      }
    ]
  }
]
MISA xin ghi nhận thông tin và chuyển kỹ thuật kiểm tra ạ
 
Học thêm kiến thức tại: AMIS Blog | MISA Academy
Top