«

POST /api/M26/draft-orders/with-last-mile - API tạo đơn nháp

  • Header: X-Tenant
  • Request Body: { "skus" (): ["3fa85f64-5717-4562-b3fc-2c963f66afa6"], "addressId" (): "string", "address": "string", "couponCode": "string", "depositOnDemand": 0, "depositRateCode": "string" // Mã tỷ lệ đặt cọc }
    • Given Tài khoản "pamiuoi" đã có danh sách địa chỉ nhận hàng
      addressIdcountryprovincecitydistrictwarddefault
      VN_01Việt NamThành phố Hà NộiQuận Hà ĐôngPhường Yên Nghĩatrue
      VN_02Việt NamThành phố Hà NộiQuận Hoàn KiếmPhường Chương Dương
      VN_03Việt NamTỉnh Bắc GiangHuyện Lục NamXã Trường Giang
      VN_04Việt NamThành phố Hồ Chí MinhQuận 1Phường Bến Nghé
      VN_05Việt NamThành phố Hà NộiQuận Hà ĐôngPhường Văn Quán
      TQ_01中国大陆广东省广州市黄埔区云埔街道
    • And Hệ thống tồn tại bộ cấu hình phí VCLM "Cấu hình phí VCLM" đang được áp dụng với thông tin
      Khu vựcCân nặng (kg)Đơn giá (CNY)Phí niêm yết (Ngoài khoảng niêm yết sẽ tính phí theo mốc)
      Quận Hoàn Kiếm, Thành phố Hà Nội, Việt NamTừ 0 - 33.75
      Quận Hoàn Kiếm, Thành phố Hà Nội, Việt NamTrên 3 - 54.65
      Quận Hoàn Kiếm, Thành phố Hà Nội, Việt NamTrên 5 - 106.35
      Quận Hoàn Kiếm, Thành phố Hà Nội, Việt NamTrên 10 - 1511.3
      Quận Hoàn Kiếm, Thành phố Hà Nội, Việt NamTrên 15 - 2013.9
      Quận Hoàn Kiếm, Thành phố Hà Nội, Việt NamTrên 20 - 2516.2
      Quận Hoàn Kiếm, Thành phố Hà Nội, Việt NamTrên 25 - 999999990.35
      Tỉnh Bắc Giang, Việt NamTừ 0 - 36.05
      Tỉnh Bắc Giang, Việt NamTrên 3 - 58.35
      Tỉnh Bắc Giang, Việt NamTrên 5 - 1012
      Tỉnh Bắc Giang, Việt NamTrên 10 - 1524.5
      Tỉnh Bắc Giang, Việt NamTrên 15 - 2032.5
      Tỉnh Bắc Giang, Việt NamTrên 20 - 2540.5
      Tỉnh Bắc Giang, Việt NamTrên 25 - 999999991.2
    • And Hệ thống đang hỗ trợ tỷ lệ đặt cọc có thông tin
      depositOnDemanddepositRateCodeisDefault
      45rate45true
      70rate70false
      100rate100false
  • Tags: @AUTOMATED, @TNK-3954, @TNK-9052

    Lỗi 401 nếu không gửi token trong request

    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "1688" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_01product_01skuId_01skusId111
    • When Request có header là
      X-Tenantm26
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": [ "${skusId}"],
        "addressId": "${VN_01}"
      }
    • Then Trả về status code 401
  • Tags: @AUTOMATED, @TNK-3954, @TNK-9052

    Lỗi 401 nếu token gửi request đã hết hạn

    • Given Có token hết hạn
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "1688" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_01product_01skuId_01skusId111
    • When Request có header là
      X-Tenantm26
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": ["${skusId}"],
        "addressId": "${VN_01}"
      }
    • Then Trả về status code 401
  • Tags: @AUTOMATED, @TNK-3954, @TNK-9052

    Lỗi 400 nếu request body gửi sku không tồn tại trong giỏ hàng

    • Given Có token của tài khoản "pamiuoi"
    • When Request có header là
      X-Tenantm26
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": ["3fa85f64-5717-4562-b3fc-2c963f66afa6s5689"],
        "addressId": "${VN_01}",
        "depositOnDemand": 100,
        "depositRateCode": "${rate100}"
       }
    • Then Trả về status code 400
    • And Response có body thỏa mãn giá trị như sau
      {
        "title": "Bad Request"
      }
  • Tags: @AUTOMATED, @TNK-3954, @TNK-9052

    Lỗi 400 khi gửi lên list skus rỗng

    • Given Có token của tài khoản "pamiuoi"
    • When Request có header là
      X-Tenantm26
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": [],
        "addressId": "${VN_01}",
        "depositOnDemand": 100,
        "depositRateCode": "${rate100}"
       }
    • Then Trả về status code 400
    • And Response có body thỏa mãn giá trị như sau
      {
      "violations": [
          {
              "field": "skus",
              "message": "must not be empty"
          }
      ]
      }
  • Tags: @AUTOMATED, @TNK-3954

    Trả lỗi 400 khi gửi lên thông tin skus, addressId null

    • Given Có token của tài khoản "pamiuoi"
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "1688" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_01product_01skuId_01skusId111
    • When Request có header là
      X-Tenantm26
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": <skus>,
        "addressId": <addressId>
      }
    • Then Trả về status code 400
    • And Response có body thỏa mãn giá trị như sau
      {
        "title": "Bad Request"
      }

    Examples:

    skus addressId
    "${VN_01}"
    ["${skusId}"]
  • Tags: @AUTOMATED, @TNK-3954

    Trả lỗi 400 khi body không gửi lên skus

    • Given Có token của tài khoản "pamiuoi"
    • When Request có header là
      X-Tenantm26
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "addressId": "${VN_01}"
      }
    • Then Trả về status code 400
    • And Response có body thỏa mãn giá trị như sau
      {
        "title": "Constraint Violation",
        "violations": [
          {
            "field": "skus",
            "message": "must not be empty"
          },
          {
            "field": "skus",
            "message": "must not be null"
          }
        ]
      }
  • Tags: @AUTOMATED, @TNK-3954

    Trả lỗi 400 khi body không gửi addressId

    • Given Có token của tài khoản "pamiuoi"
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "1688" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_01product_01skuId_01skusId111
    • When Request có header là
      X-Tenantm26
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": ["${skusId}"]
      }
    • Then Trả về status code 400
    • And Response có body thỏa mãn giá trị như sau
      {
        "title": "Constraint Violation",
        "violations": [
          {
            "field": "addressId",
            "message": "must not be null"
          }
        ]
      }
  • Tags: @AUTOMATED, @TNK-3954, @TNK-9052

    Lỗi 400 nếu request body gửi address id không tồn tại trong danh sách địa chỉ nhận hàng

    • Given Có token của tài khoản "pamiuoi"
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "1688" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_01product_01skuId_01skusId111
    • When Request có header là
      X-Tenantm26
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": ["${skusId}"],
        "addressId": "0345",
        "depositOnDemand": 100,
        "depositRateCode": "${rate100}"
       }
    • Then Trả về status code 400
    • And Response có body thỏa mãn giá trị như sau
      {
      "title": "addressId_not_found"
      }
  • Tags: @AUTOMATED, @TNK-3954, @TNK-9052

    Trả status 400 khi gửi lên tỷ lệ đặt cọc không phải dạng số

    • Given Có token của tài khoản "pamiuoi"
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "1688" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_01product_01skuId_01skusId111
    • When Request có header là
      X-Tenantm26
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": ["${skusId}"],
        "addressId": "${VN_01}",
        "depositOnDemand": "string",
        "depositRateCode": "${rate100}"
       }
    • Then Trả về status code 400
    • And Response có body thỏa mãn giá trị như sau
      {
      "title": "Bad Request"
      }
  • Tags: @AUTOMATED, @TNK-3954, @TNK-9052

    Đối với đơn có địa chỉ nhận hàng là Trung Quốc, phải đặt cọc 100% đơn hàng.

    Trả status 400 khi gửi lên tỷ lệ đặt cọc khác 100 đối với đơn nháp có địa chỉ nhận hàng là Trung Quốc

    • Given Có token của tài khoản "pamiuoi"
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "1688" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_01product_01skuId_01skusId111
    • And Tài khoản "pamiuoi" đã có danh sách địa chỉ nhận hàng
      addressIdcountryprovincecitydistrictwarddefault
      TQ_01中国大陆广东省广州市黄埔区云埔街道true
    • When Request có header là
      X-Tenantm26
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": [ "${skusId}"],
        "addressId": "${TQ_01}",
        "depositOnDemand": <depositOnDemand>,
        "depositRateCode": "<depositRateCode>",
        "address": "địa chỉ Trung Quốc"
       }
    • Then Trả về status code 400
    • And Response có body thỏa mãn giá trị như sau
      {
        "title": "deposit_on_demand_invalid"
      }

    Examples:

    depositOnDemand depositRateCode
    50 ${rate45}
    70 ${rate70}
  • Tags: @AUTOMATED, @TNK-3954, @TNK-9052

    Trả status 404 khi đơn có địa chỉ VN gửi lên depositRateCode không tồn tại, mặc dù có gửi cả depositOnDemand tồn tại

    • Given Có token của tài khoản "pamiuoi"
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "1688" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_01product_01skuId_01skusId111
    • When Request có header là
      X-Tenantm26
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": [ "${skusId}"],
        "addressId": "${VN_01}",
        "depositOnDemand": <depositOnDemand>,
        "depositRateCode": "rate80",
        "address": "địa chỉ Việt Nam"
       }
    • Then Trả về status code 404
    • And Response có body thỏa mãn giá trị như sau
      {
        "title": "deposit_rate_invalid"
      }

    Examples:

    depositOnDemand
    45
    70
  • Tags: @AUTOMATED, @TNK-11021, @TNK-9052

    Trả status 400 khi body chỉ gửi lên depositOnDemand là các giá trị tỷ giá mới (45%, 70%) nhưng không gửi lên depositRateCode

    • Given Có token của tài khoản "pamiuoi"
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "1688" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_01product_01skuId_01skusId111
    • When Request có header là
      X-Tenantm26
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": [ "${skusId}"],
        "addressId": "${VN_01}",
        "depositOnDemand": 45,
        "address": "địa chỉ Việt Nam"
       }
    • Then Trả về status code 400
    • And Response có body thỏa mãn giá trị như sau
      {
        "title": "deposit_on_demand_invalid"
      }
  • Tags: @AUTOMATED, @TNK-9052

    Tạo đơn nháp thành công nếu chỉ gửi thông tin depositOnDemand với giá trị là 50% và 100%

    • Given Có token của tài khoản "pamiuoi"
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "1688" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_01product_01skuId_01skusId111
    • When Request có header là
      X-Tenantm26
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": [ "${skusId}"],
        "addressId": "${VN_01}",
        "depositOnDemand": <depositOnDemand>,
        "address": "địa chỉ Việt Nam"
       }
    • Then Trả về status code 200
    • And Response có body thỏa mãn giá trị như sau
      {
        "orderViews": [
          {
            "status": "DRAFT",
            "orderItems": [
              {
                  "itemId": "${product_01}",
                  "skuId": "${skuId_01}",
                  "sku": "${skusId}"
              }
            ],
            "depositOnDemand": <depositOnDemand>
          }
        ]
      }

    Examples:

    depositOnDemand
    50
    100
  • Tags: @AUTOMATED, @TNK-3954, @TNK-9052

    Trả status 400 khi gửi request tạo đơn nháp với coupon không tồn tại trên hệ thống

    • Given Có token của tài khoản "pamiuoi"
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "1688" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_01product_01skuId_01skusId111
    • When Request có header là
      X-Tenantm26
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": [ "${skusId}"],
        "addressId": "${VN_01}",
        "address": "địa chỉ Việt Nam",
        "couponCode": "coupon_not_exist"
       }
    • Then Trả về status code 400
    • And Response có body thỏa mãn giá trị như sau
      {
      "title": "coupon_not_found"
      }
  • Tags: @AUTOMATED, @TNK-3954, @TNK-9052

    Trả status 400 khi gửi request tạo đơn nháp với coupon đã hết lượt sử dụng

    • Given Thời gian hiện tại là "A"
    • And Tồn tại coupon với thông tin
      codevalid_fromvalid_toapply_scopesdiscount_typeformulacustomer_limitlimitfee_itemconfigremaining
      coupon_01AA+10["ORDER"]AMOUNT100025[{"fee": "domestic_shipping", "maxValue": "5000"}]{"single": true}0
    • And Có token của tài khoản "pamiuoi"
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "1688" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_01product_01skuId_01skusId111
    • When Request có header là
      X-Tenantm26
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": [ "${skusId}"],
        "addressId": "${VN_01}",
        "address": "địa chỉ Việt Nam",
        "couponCode": "${coupon_01}"
       }
    • Then Trả về status code 400
    • And Response có body thỏa mãn giá trị như sau
      {
      "title": "coupon_limited"
      }
  • Tags: @AUTOMATED, @TNK-3954, @TNK-9052

    Trả status 400 khi gửi request tạo đơn nháp với coupon đã hết hạn sử dụng

    • Given Thời gian hiện tại là "A"
    • And Tồn tại coupon với thông tin
      codevalid_fromvalid_toapply_scopesdiscount_typeformulacustomer_limitlimitfee_itemconfigremaining
      coupon_01A-1A-10["ORDER"]AMOUNT100025[{"fee": "domestic_shipping", "maxValue": "5000"}]{"single": true}5
    • And Có token của tài khoản "pamiuoi"
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "1688" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_01product_01skuId_01skusId111
    • When Request có header là
      X-Tenantm26
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": [ "${skusId}"],
        "addressId": "${VN_01}",
        "address": "địa chỉ Việt Nam",
        "couponCode": "${coupon_01}"
       }
    • Then Trả về status code 400
    • And Response có body thỏa mãn giá trị như sau
      {
      "title": "coupon_currently_invalid"
      }
  • Tags: @AUTOMATED, @TNK-3954, @TNK-9052

    Trả 400 khi gửi request tạo đơn nháp với coupon không áp dụng cho đơn hàng

    • Given Thời gian hiện tại là "A"
    • And Tồn tại coupon với thông tin
      codevalid_fromvalid_toapply_scopesdiscount_typeformulacustomer_limitlimitfee_itemconfigremaining
      coupon_01A-1A+10["SHIPMENT"]AMOUNT100025[{"fee": "domestic_shipping", "maxValue": "5000"}]{"single": true}5
    • And Có token của tài khoản "pamiuoi"
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "1688" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_01product_01skuId_01skusId111
    • When Request có header là
      X-Tenantm26
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": [ "${skusId}"],
        "addressId": "${VN_01}",
        "address": "địa chỉ Việt Nam",
        "couponCode": "${coupon_01}"
       }
    • Then Trả về status code 400
    • And Response có body thỏa mãn giá trị như sau
      {
      "title": "coupon_not_apply_for_order"
      }
  • Tags: @AUTOMATED, @TNK-3954, @TNK-9052

    Không thể áp dụng nhiều hơn 1 coupon trên đơn nháp

    • Given Thời gian hiện tại là "A"
    • And Tồn tại coupon với thông tin
      codevalid_fromvalid_toapply_scopesdiscount_typeformulacustomer_limitlimitfee_itemconfigremaining
      coupon_01A-1A+10["ORDER"]AMOUNT100025[{"fee": "domestic_shipping", "maxValue": "5000"}]{"single": false}5
      coupon_02A-1A+10["ORDER"]AMOUNT100025[{"fee": "domestic_shipping", "maxValue": "5000"}]{"single": false}5
    • And Có token của tài khoản "pamiuoi"
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "1688" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_01product_01skuId_01skusId111
    • When Request có header là
      X-Tenantm26
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": [ "${skusId}"],
        "addressId": "${VN_01}",
        "address": "địa chỉ Việt Nam",
        "couponCode": ["${coupon_01}", "${coupon_02}"]
       }
    • Then Trả về status code 400
    • And Response có body thỏa mãn giá trị như sau
      {
        "title": "Bad Request"
      }
  • Tags: @AUTOMATED, @TNK-3954, @TNK-9052

    Tạo đơn nháp không thành công khi số lượng mua sản phẩm ít hơn số lượng mua tối thiểu mà người bán quy định

    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "1688" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_01product_01skuId_01skusId_011101
    • And Tài khoản "pamiuoi" đã có danh sách địa chỉ nhận hàng
      addressIdcountryprovincecitydistrictwarddefault
      TQ_01中国大陆广东省广州市黄埔区云埔街道true
    • And Có token của tài khoản "pamiuoi"
    • When Request có header là
      X-Tenantm26
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": ["${skusId_01}"],
        "addressId": "${TQ_01}",
        "depositOnDemand": 100,
        "depositRateCode": "${rate100}"
       }
    • Then Trả về status code 400
    • And Response có body thỏa mãn giá trị như sau
      {
      "title": "quantity_product_ineligible"
      }
  • Tags: @AUTOMATED, @TNK-9052

    Có thể tạo đơn nháp thành công khi body gửi lên depositRateCode, mà không cần depositOnDemand

    • Given Có token của tài khoản "pamiuoi"
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "1688" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_01product_01skuId_01skusId111
    • When Request có header là
      X-Tenantm26
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": [ "${skusId}"],
        "addressId": "${VN_01}",
        "depositRateCode": "<depositRateCode>",
        "address": "địa chỉ Việt Nam"
       }
    • Then Trả về status code 200
    • And Response có body thỏa mãn giá trị như sau
      {
        "orderViews": [
          {
            "status": "DRAFT",
            "orderItems": [
              {
                  "itemId": "${product_01}",
                  "skuId": "${skuId_01}",
                  "sku": "${skusId}"
              }
            ],
            "depositOnDemand": <depositOnDemand>
          }
        ]
      }

    Examples:

    depositRateCode depositOnDemand
    ${rate45} 45.00
    ${rate70} 70.00
    ${rate100} 100.00
  • Tags: @AUTOMATED, @TNK-9052

    Trong trường hợp body gửi lên depositRateCode hợp lệ và depositOnDemand không hợp lệ: không thuộc cấu hình tỷ lệ đặt cọc của hệ thống hoặc không tương ứng với depositRateCode,

    hệ thống sẽ lấy giá trị depositRateCode gửi lên và tạo đơn nháp thành công

    • Given Có token của tài khoản "pamiuoi"
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "1688" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_01product_01skuId_01skusId111
    • When Request có header là
      X-Tenantm26
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": [ "${skusId}"],
        "addressId": "${VN_01}",
        "depositRateCode": "${rate45}",
        "depositOnDemand": <depositOnDemand>,
        "address": "địa chỉ Việt Nam"
       }
    • Then Trả về status code 200
    • And Response có body thỏa mãn giá trị như sau
      {
        "orderViews": [
          {
            "status": "DRAFT",
            "orderItems": [
              {
                  "itemId": "${product_01}",
                  "skuId": "${skuId_01}",
                  "sku": "${skusId}"
              }
            ],
            "depositOnDemand": 45.00
          }
        ]
      }

    Examples:

    depositOnDemand
    70
    50
  • Tags: @AUTOMATED, @TNK-10361, @TNK-3954, @TNK-9052

    Nếu tài khoản thuộc nhóm KH có quy định tỷ lệ đặt cọc, thì trong trường hợp body không gửi lên tỷ lệ cọc,

    hệ thống sẽ lấy tỷ lệ cọc của nhóm KH là tỷ lệ đặt cọc của đơn nháp.

    • Given Tồn tại nhóm khách hàng có thông tin
      Mã nhómTỉ lệ cọcBộ cấu hình chính sách
      default50Bieu_phi_ap_dung_ngay_09_03_2024
    • And Khách hàng "pamiuoi" đang thuộc nhóm khách hàng "default"
    • And Có token của tài khoản "pamiuoi"
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "<marketPlace>" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_01product_01skuId_01skusId111
    • When Request có header là
      X-Tenantm26
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": ["${skusId}"],
        "addressId": "${VN_01}"
      }
    • Then Trả về status code 200
    • And Response có body thỏa mãn giá trị như sau
      {
        "orderViews": [
          {
            "status": "DRAFT",
             "marketplace": "<marketPlace>",
            "orderItems": [
              {
                  "itemId": "${product_01}",
                  "skuId": "${skuId_01}",
                  "sku": "${skusId}"
              }
            ],
            "depositOnDemand": 50.00
          }
        ]
      }

    Examples:

    marketPlace
    1688
    taobao
    tmall
  • Tags: @AUTOMATED, @TNK-10361, @TNK-3954, @TNK-9052

    Nếu tài khoản thuộc nhóm KH không có quy định tỷ lệ đặt cọc, thì trong trường hợp body không gửi lên tỷ lệ cọc,

    hệ thống sẽ lấy tỷ lệ cọc của tenant là tỷ lệ đặt cọc của đơn nháp.

    • Given Tồn tại nhóm khách hàng có thông tin
      Mã nhómTỉ lệ cọcBộ cấu hình chính sách
      sabomallBieu_phi_ap_dung_ngay_09_03_2024
    • And Khách hàng "pamiuoi" đang thuộc nhóm khách hàng "sabomall"
    • And Dịch vụ quy định tỷ lệ đặt cọc mặc định là "50"
    • And Có token của tài khoản "pamiuoi"
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "<marketPlace>" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_01product_01skuId_01skusId111
    • When Request có header là
      X-Tenantm26
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": ["${skusId}"],
        "addressId": "${VN_01}"
      }
    • Then Trả về status code 200
    • And Response có body thỏa mãn giá trị như sau
      {
        "orderViews": [
          {
            "status": "DRAFT",
            "orderItems": [
              {
                  "itemId": "${product_01}",
                  "skuId": "${skuId_01}",
                  "sku": "${skusId}"
              }
            ],
            "depositOnDemand": 50.00
          }
        ]
      }

    Examples:

    marketPlace
    1688
    taobao
    tmall
  • Tags: @AUTOMATED, @TNK-3954, @TNK-9052

    Tạo thành công đơn nháp có địa chỉ Trung Quốc, thông tin tỷ lệ đặt cọc hợp lệ (100%)

    Có thể gửi hoặc không gửi address và coupon.

    • Given Thời gian hiện tại là "A"
    • And Tồn tại coupon với thông tin
      codevalid_fromvalid_toapply_scopesdiscount_typeformulacustomer_limitlimitfee_itemconfigremaining
      coupon_01AA+10["ORDER"]AMOUNT125[{"fee": "domestic_shipping", "maxValue": "5000"}]{"single": true}5
    • And Có token của tài khoản "pamiuoi"
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "<marketPlace>" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_01product_01skuId_01skusId111
    • And Tài khoản "pamiuoi" đã có danh sách địa chỉ nhận hàng
      addressIdcountryprovincecitydistrictwarddefault
      TQ_01中国大陆广东省广州市黄埔区云埔街道true
    • When Request có header là
      X-Tenantm26
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": ["${skusId}"],
        "addressId": "${TQ_01}",
        "depositOnDemand": 100,
        "depositRateCode": "${rate100}",
        "address": <address>,
        "couponCode": <couponCode>
      }
    • Then Trả về status code 200
    • And Response có body thỏa mãn giá trị như sau
      {
        "orderViews": [
          {
            "status": "DRAFT",
            "orderItems": [
              {
                  "itemId": "${product_01}",
                  "skuId": "${skuId_01}",
                  "quantity": 1,
                  "currency": "CNY",
                  "sku": "${skusId}"
              }
            ],
            "services": ["domestic_shipping"],
            "addressDisplay": <address>,
            "depositOnDemand": 100,
            "couponCode": <couponCode>
          }
        ]
      }

    Examples:

    marketPlace address couponCode
    1688 null null
    1688 "đây là địa chỉ TQ" "${coupon_01}"
    taobao null null
    taobao "đây là địa chỉ TQ" "${coupon_01}"
    tmall null null
    tmall "đây là địa chỉ TQ" "${coupon_01}"
  • Tags: @AUTOMATED, @TNK-9052

    Có thể tạo thành công đơn nháp có địa chỉ TQ với body gửi lên depositOnDemand là 100% và không có depositRateCode

    • Given Có token của tài khoản "pamiuoi"
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "1688" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_01product_01skuId_01skusId111
    • And Tài khoản "pamiuoi" đã có danh sách địa chỉ nhận hàng
      addressIdcountryprovincecitydistrictwarddefault
      TQ_01中国大陆广东省广州市黄埔区云埔街道true
    • When Request có header là
      X-Tenantm26
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": ["${skusId}"],
        "addressId": "${TQ_01}",
        "depositOnDemand": 100,
        "address": "địa chỉ Trung Quốc"
      }
    • Then Trả về status code 200
    • And Response có body thỏa mãn giá trị như sau
      {
        "orderViews": [
          {
            "status": "DRAFT",
            "orderItems": [
              {
                  "itemId": "${product_01}",
                  "skuId": "${skuId_01}",
                  "quantity": 1,
                  "currency": "CNY",
                  "sku": "${skusId}"
              }
              ],
              "addressDisplay": "địa chỉ Trung Quốc",
              "depositOnDemand": 100
          }
        ]
      }
  • Tags: @AUTOMATED, @TNK-3954, @TNK-9052

    Tạo thành công đơn nháp có địa chỉ Việt Nam, thông tin tỷ lệ đặt cọc là 45%, 70% hoặc 100%

    Có thể gửi hoặc không gửi address và coupon.

    • And Tồn tại coupon với thông tin
      codevalid_fromvalid_toapply_scopesdiscount_typeformulacustomer_limitlimitfee_itemconfigremaining
      coupon_01AA+10["ORDER"]AMOUNT125[{"fee": "normal_shipping", "maxValue": "5000"}]{"single": true}5
    • And Có token của tài khoản "pamiuoi"
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "<marketPlace>" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_01product_01skuId_01skusId111
    • When Request có header là
      X-Tenantm26
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": ["${skusId}"],
        "addressId": "${VN_01}",
        "depositOnDemand": <depositOnDemand>,
        "depositRateCode": "<depositRateCode>",
        "address": <address>,
        "couponCode": <couponCode>
      }
    • Then Trả về status code 200
    • And Response có body thỏa mãn giá trị như sau
      {
        "orderViews": [
          {
            "status": "DRAFT",
            "orderItems": [
              {
                "itemId": "${product_01}",
                "skuId": "${skuId_01}",
                "currency": "CNY",
                "sku": "${skusId}"
              }
          ],
          "addressDisplay": <address>,
          "depositOnDemand": <depositOnDemand>,
          "couponCode": <couponCode>
        }
      ]
      }

    Examples:

    marketPlace address couponCode depositOnDemand depositRateCode
    1688 null "${coupon_01}" 45 ${rate45}
    taobao "đây là địa chỉ TQ" null 70 ${rate70}
    tmall "đây là địa chỉ TQ" "${coupon_01}" 100 ${rate100}
  • Tags: @AUTOMATED, @TNK-3954, @TNK-9052

    Có thể tạo đơn nháp với nhiều sản phẩm thuộc các merchant: taobao, 1688

    • Given Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "<marketPlace>" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_01product_01skuId_01skusId_01111
      merchant_02product_02skuId_02skusId_02111
    • And Có token của tài khoản "pamiuoi"
    • When Request có header là
      X-Tenantm26
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": ["${skusId_01}", "${skusId_02}"],
        "addressId": "${VN_01}",
        "depositOnDemand": 100,
        "depositRateCode": "${rate100}"
      }
    • Then Trả về status code 200
    • And Response có body thỏa mãn giá trị như sau
      {
          "orderViews": [
              {
                  "marketplace": "<marketPlace>",
                  "status": "DRAFT",
                  "orderItems": [
                      {
                          "itemId": "${product_01}",
                          "skuId": "${skuId_01}",
                          "quantity": 1,
                          "currency": "CNY",
                          "marketplace": "<marketPlace>",
                          "sku": "${skusId_01}"
                      }
                  ],
                  "services": [
                      "standard_shipping"
                  ],
                  "addressId": "${VN_01}",
                  "depositOnDemand": 100
              },
              {
                  "marketplace": "<marketPlace>",
                  "status": "DRAFT",
                  "orderItems": [
                      {
                          "itemId": "${product_02}",
                          "skuId": "${skuId_02}",
                          "quantity": 1,
                          "currency": "CNY",
                          "marketplace": "<marketPlace>",
                          "sku": "${skusId_02}"
                      }
                  ],
                  "services": [
                      "standard_shipping"
                  ],
                  "addressId": "${VN_01}",
                  "depositOnDemand": 100
              }
          ]
      }

    Examples:

    marketPlace
    1688
    taobao
  • Tags: @AUTOMATED, @TNK-3954, @TNK-9052

    Có thể tạo đơn nháp với nhiều sản phẩm thuộc merchant tmall

    • Given Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "tmall" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_01product_01skuId_01skusId_01111
      merchant_02product_02skuId_02skusId_02111
    • And Có token của tài khoản "pamiuoi"
    • When Request có header là
      X-Tenantm26
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": ["${skusId_01}", "${skusId_02}"],
        "addressId": "${VN_01}",
        "depositOnDemand": 100,
        "depositRateCode": "${rate100}"
      }
    • Then Trả về status code 200
    • And Response có body thỏa mãn giá trị như sau
      {
        "orderViews": [
          {
            "status": "DRAFT",
            "orderItems": [
              {
                "itemId": "${product_01}",
                "skuId": "${skuId_01}",
                "quantity": 1,
                "currency": "CNY",
                "marketplace": "tmall",
                "sku": "${skusId_01}"
              }
            ],
            "services": [
              "standard_shipping"
            ],
            "addressId": "${VN_01}"
          },
          {
            "status": "DRAFT",
            "orderItems": [
              {
                "itemId": "${product_02}",
                "skuId": "${skuId_02}",
                "quantity": 1,
                "currency": "CNY",
                "marketplace": "tmall",
                "sku": "${skusId_02}"
              }
            ],
            "services": [
              "standard_shipping"
            ],
            "addressId": "${VN_01}"
          }
        ]
      }
  • Tags: @AUTOMATED, @TNK-3954, @TNK-9052

    Có thể tạo đơn nháp với nhiều sản phẩm thuộc cùng merchant

    • Given Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "1688" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_01product_01skuId_01skusId_01111
      merchant_01product_02skuId_02skusId_02111
    • And Tài khoản "pamiuoi" đã có danh sách địa chỉ nhận hàng
      addressIdcountryprovincecitydistrictwarddefault
      TQ_01中国大陆广东省广州市黄埔区云埔街道true
    • And Có token của tài khoản "pamiuoi"
    • When Request có header là
      X-Tenantm26
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": ["${skusId_01}", "${skusId_02}"],
        "addressId": "${TQ_01}",
        "depositOnDemand": 100,
        "depositRateCode": "${rate100}"
      }
    • Then Trả về status code 200
    • And Response có body thỏa mãn giá trị như sau
      {
        "orderViews": [
          {
            "status": "DRAFT",
            "orderItems": [
              {
                "itemId": "${product_01}",
                "skuId": "${skuId_01}",
                "quantity": 1,
                "currency": "CNY",
                "sku": "${skusId_01}"
              },
              {
                "itemId": "${product_02}",
                "skuId": "${skuId_02}",
                "quantity": 1,
                "currency": "CNY",
                "sku": "${skusId_02}"
              }
            ],
          "services": ["domestic_shipping"],
          "addressId": "${TQ_01}",
          "depositOnDemand": 100
          }
        ]
      }
  • Tags: @AUTOMATED, @TNK-3954, @TNK-9052

    Có thể tạo đơn nháp với nhiều sku của một sản phẩm

    • Given Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "<marketPlace>" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_01product_01skuId_01skusId_01111
      merchant_01product_01skuId_02skusId_02111
    • And Tài khoản "pamiuoi" đã có danh sách địa chỉ nhận hàng
      addressIdcountryprovincecitydistrictwarddefault
      TQ_01中国大陆广东省广州市黄埔区云埔街道true
    • And Có token của tài khoản "pamiuoi"
    • When Request có header là
      X-Tenantm26
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": ["${skusId_01}", "${skusId_02}"],
        "addressId": "${TQ_01}",
        "depositOnDemand": 100,
        "depositRateCode": "${rate100}"
      }
    • Then Trả về status code 200
    • And Response có body thỏa mãn giá trị như sau
      {
      "orderViews": [
      {
      "status": "DRAFT",
      "orderItems": [
      {
      "itemId": "${product_01}",
      "skuId": "${skuId_01}",
      "quantity": 1,
      "currency": "CNY",
      "sku": "${skusId_01}"
      },
      {
      "itemId": "${product_01}",
      "skuId": "${skuId_02}",
      "quantity": 1,
      "currency": "CNY",
      "sku": "${skusId_02}"
      }
      ],
      "services": ["domestic_shipping"],
      "addressId": "${TQ_01}",
      "depositOnDemand": 100
      }
      ]
      }

    Examples:

    marketPlace
    1688
    taobao
    tmall
  • Tags: @manual, @TNK-3954

    Có thể tạo đơn nháp mới với số lượng merchant tối đa là 5 và mỗi merchant tối đa 40 sku

    • Given Thêm sản phẩm vào giỏ hàng của "pamiuoi" với thông tin
      shopskus_quantity
      merchant_0140
      merchant_0240
      merchant_0340
      merchant_0440
      merchant_0540
    • And Có token của tài khoản "pamiuoi"
    • Then Tạo thành công 5 đơn nháp mới cho tất cả sản phẩm trong giỏ, mỗi đơn nháp có 40 sku
  • Tags: @manual, @TNK-3954

    Không thể tạo đơn nháp mới với số lượng merchant vượt quá 5

    • Given Thêm sản phẩm vào giỏ hàng của "pamiuoi" với thông tin
      shopskus_quantity
      merchant_0140
      merchant_0240
      merchant_0340
      merchant_0440
      merchant_0510
      merchant_0610
    • And Có token của tài khoản "pamiuoi"
    • Then Tạo đơn nháp mới không thành công cho tất cả các sản phẩm trong giỏ
  • Tags: @AUTOMATED, @TNK-3954, @TNK-4681, @TNK-9052

    Khi tạo đơn nháp trả ra thông tin phí VCNĐ Việt Nam tạm tính

    nếu địa chỉ đó nằm trong khu vực tính phí giao hàng của hệ thống

    • Given Có token của tài khoản "pamiuoi"
    • And Request có header là
      X-Tenantm26
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "1688" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSizeweight
      merchant_01product_01skuId_01skusId<quantity>1<quantity><weight>
    • When Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": ["${skusId}"],
        "addressId": "<addressId>"
      }
    • Then Trả về status code 200
    • And Response có body thỏa mãn giá trị như sau
        {
            "orderViews": [
                {
                    "addressId": "<addressId>",
                    "vietnamDomesticShippingFee": <vietnamDomesticShippingFee>,
      
                }
            ],
        }

    Examples:

    quantity weight addressId vietnamDomesticShippingFee
    1 0 ${VN_02} null
    1 3 ${VN_02} 3.75
    1 3.01 ${VN_02} 4.65
    1 25.1 ${VN_02} 16.55
    2 0 ${VN_02} null
    2 3 ${VN_02} 6.35
    4 3.01 ${VN_02} 11.3
    1 0 ${VN_03} null
    1 3 ${VN_03} 6.05
    1 3.01 ${VN_03} 8.35
    1 25.1 ${VN_03} 41.7
    2 0 ${VN_03} null
    2 3 ${VN_03} 12
    4 3.01 ${VN_03} 24.5
  • Tags: @AUTOMATED, @TNK-3954, @TNK-4681, @TNK-9052

    Trả về thông tin phí VCNĐ Việt Nam tạm tính bằng null

    nếu địa chỉ tạo đơn nháp không nằm trong danh sách khu vực tính phí giao hàng của hệ thống

    • Given Có token của tài khoản "pamiuoi"
    • And Request có header là
      X-Tenantm26
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "1688" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSizeweight
      merchant_01product_01skuId_01skusId<quantity>1<quantity><weight>
    • When Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": [ "${skusId}"],
        "addressId": "${VN_05}"
      }
    • Then Trả về status code 200
    • And Response có body thỏa mãn giá trị như sau
      {
        "orderViews": [
          {
              "addressId": "${VN_05}",
              "vietnamDomesticShippingFee": null
          }
        ]
      }

    Examples:

    quantity weight
    1 0
    1 3
    1 3.01
    1 25.1
    2 0
    2 3
    4 3.01
  • Tags: @AUTOMATED, @TNK-3954, @TNK-4681, @TNK-9052

    Đơn nháp có nhiều sản phẩm thuộc các merchant khác nhau,

    phí VCNĐ Việt Nam tạm tính cho từng đơn nháp = cân nặng của sản phẩm * đơn giá vận chuyển được cấu hình theo địa chỉ giao hàng

    • Given Có token của tài khoản "pamiuoi"
    • And Request có header là
      X-Tenantm26
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "1688" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSizeweight
      merchant_01product_01skuId_01skusId_01<quantity>1<quantity><weight>
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "taobao" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSizeweight
      merchant_02product_02skuId_02skusId_02<quantity>1<quantity><weight>
    • When Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": ["${skusId_01}", "${skusId_02}"],
        "addressId": "${VN_02}"
      }
    • Then Trả về status code 200
    • And Response có body thỏa mãn giá trị như sau
      {
        "orderViews": [
          {
              "addressId": "${VN_02}",
              "vietnamDomesticShippingFee": <vietnamDomesticShippingFee>
          },
          {
              "addressId": "${VN_02}",
              "vietnamDomesticShippingFee": <vietnamDomesticShippingFee>
          }
        ]
      }

    Examples:

    quantity weight vietnamDomesticShippingFee
    1 0 null
    1 3 3.75
    1 3.01 4.65
    1 25.1 16.55
    2 0 null
    2 3 6.35
    4 3.01 11.3
  • Tags: @AUTOMATED, @TNK-3954, @TNK-4681, @TNK-9052

    Đơn nháp có nhiều sản phẩm thuộc cùng merchant,

    phí VCNĐ Việt Nam tạm tính cho đơn = tổng cân nặng của các sản phẩm thuộc cùng merchant * đơn giá vận chuyển được cấu hình theo địa chỉ giao hàng

    • Given Có token của tài khoản "pamiuoi"
    • And Request có header là
      X-Tenantm26
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "1688" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSizeweight
      merchant_01product_01skuId_01skusId_01<quantity>1<quantity><weight>
      merchant_01product_02skuId_02skusId_02<quantity>1<quantity><weight>
    • When Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": ["${skusId_01}", "${skusId_02}"],
        "addressId": "${VN_03}"
      }
    • Then Trả về status code 200
    • And Response có body thỏa mãn giá trị như sau
      {
        "orderViews": [
          {
              "addressId": "${VN_03}",
              "vietnamDomesticShippingFee": <vietnamDomesticShippingFee>
          }
        ]
      }

    Examples:

    quantity weight vietnamDomesticShippingFee
    1 0 null
    1 3 12
    1 3.01 12
    1 25.1 71.7
    2 0 null
    2 3 24.5
    4 3.01 40.5
  • Tags: @AUTOMATED, @TNK-3954, @TNK-4681, @TNK-9052

    Đơn nháp có nhiều sku của một sản phẩm,

    phí VCNĐ Việt Nam tạm tính cho đơn = tổng cân nặng các sku của một sản phẩm * đơn giá vận chuyển được cấu hình theo địa chỉ giao hàng

    • Given Có token của tài khoản "pamiuoi"
    • And Request có header là
      X-Tenantm26
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "1688" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSizeweight
      merchant_01product_01skuId_01skusId_01<quantity>1<quantity><weight>
      merchant_01product_01skuId_02skusId_02<quantity>1<quantity><weight>
    • When Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": ["${skusId_01}", "${skusId_02}"],
        "addressId": "${VN_04}"
      }
    • Then Trả về status code 200
    • And Response có body thỏa mãn giá trị như sau
      {
        "orderViews": [
          {
              "addressId": "${VN_04}",
              "vietnamDomesticShippingFee": <vietnamDomesticShippingFee>
          }
        ]
      }

    Examples:

    quantity weight vietnamDomesticShippingFee
    1 0 null
    1 3 6.35
    1 3.01 6.35
    1 25.1 25.3
    2 0 null
    2 3 11.3
    4 3.01 16.2
  • Tags: @AUTOMATED, @TNK-3954, @TNK-9052

    Có thể gửi request tạo đơn nháp với sản phẩm của nhiều sàn. Mỗi merchant mỗi marketplace sẽ sinh ra 1 đơn nháp

    • Given Có token của tài khoản "pamiuoi"
    • And Request có header là
      X-Tenantm26
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "<marketPlace>" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_01product_01skuId_01skusId_01111
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "1688" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_02product_02skuId_02skusId_02111
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": ["${skusId_01}", "${skusId_02}"],
        "addressId": "${VN_01}",
        "depositRateCode": "${rate100}"
      }
    • Then Trả về status code 200
    • And Response có body thỏa mãn giá trị như sau
      {
        "orderViews": [
          {
            "status": "DRAFT",
            "marketplace": "<marketPlace>",
            "orderItems": [
              {
                  "itemId": "${product_01}",
                  "skuId": "${skuId_01}",
                  "sku": "${skusId_01}"
              }
            ],
            "depositOnDemand": 100.00
          },
           {
            "status": "DRAFT",
            "marketplace": "1688",
            "orderItems": [
              {
                  "itemId": "${product_02}",
                  "skuId": "${skuId_02}",
                  "sku": "${skusId_02}"
              }
            ],
            "depositOnDemand": 100.00
          }
        ]
      }

    Examples:

    marketPlace
    taobao
    tmall
  • Tags: @manual, @TNK-3954

    Khi tạo đơn nháp của các sản phẩm của cùng một shop trên các sàn khác nhau. Mỗi marketplace tạo ra 1 đơn nháp

    • Given Có token của tài khoản "pamiuoi"
    • And Request có header là
      X-Tenantm26
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "1688" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_01product_02skuId_02skusId_02111
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "<marketPlace>" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSize
      merchant_01product_01skuId_01skusId_01111
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": ["${skusId_01}", "${skusId_02}"],
        "addressId": "${VN_01}",
        "depositRateCode": "${rate100}"
      }
    • Then Trả về status code 200
    • And Response có body thỏa mãn giá trị như sau
      {
        "orderViews": [
          {
            "status": "DRAFT",
            "marketplace": "<marketPlace>",
            "orderItems": [
              {
                  "itemId": "${product_01}",
                  "skuId": "${skuId_01}",
                  "sku": "${skusId_01}"
              }
            ],
            "depositOnDemand": 100.00
          },
           {
            "status": "DRAFT",
            "marketplace": "1688",
            "orderItems": [
              {
                  "itemId": "${product_02}",
                  "skuId": "${skuId_02}",
                  "sku": "${skusId_02}"
              }
            ],
            "depositOnDemand": 100.00
          }
        ]
      }

    Examples:

    marketPlace
    taobao
    tmall
  • Tags: @AUTOMATED, @TNK-6219, @TNK-9052

    Khi lên đơn nháp cho sản phẩm 1688, đơn giá sản phẩm được lấy theo chính sách giá của sản phẩm

    • Given Có token của tài khoản "pamiuoi"
    • And Request có header là
      X-Tenantm26
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "1688" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSizeprice_policy
      merchant_01product_01skuId_01skusId_01<quantity>1<quantity><price_policy>
    • And Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": ["${skusId_01}"],
        "addressId": "${VN_01}",
        "depositRateCode": "${rate100}"
      }
    • Then Trả về status code 200
    • And Response có body thỏa mãn giá trị như sau
      {
        "orderViews": [
          {
            "status": "DRAFT",
            "orderItems": [
              {
                  "itemId": "${product_01}",
                  "skuId": "${skuId_01}",
                  "sku": "${skusId_01}",
                  "quantity": <quantity>,
                  "price": <price>,
                  "totalValue": <totalValue>,
                  "pricePolicies": "<pricePolicyJson>"
              }
            ]
          }
        ]
      }

    Examples:

    quantity price totalValue price_policy pricePolicyJson
    1 30 30 [{"minQuantity":1,"salePrice":30.0},{"minQuantity":5,"salePrice":29.0}] [{\"minQuantity\":1,\"salePrice\":30.0},{\"minQuantity\":5,\"salePrice\":29.0}]
    4 30 120 [{"minQuantity":1,"salePrice":30.0},{"minQuantity":5,"salePrice":29.0}] [{\"minQuantity\":1,\"salePrice\":30.0},{\"minQuantity\":5,\"salePrice\":29.0}]
    5 29 145 [{"minQuantity":1,"salePrice":30.0},{"minQuantity":5,"salePrice":29.0}] [{\"minQuantity\":1,\"salePrice\":30.0},{\"minQuantity\":5,\"salePrice\":29.0}]
    6 29 174 [{"minQuantity":1,"salePrice":30.0},{"minQuantity":5,"salePrice":29.0}] [{\"minQuantity\":1,\"salePrice\":30.0},{\"minQuantity\":5,\"salePrice\":29.0}]
    1 35 35 [{"minQuantity":1,"salePrice":35.0}] [{\"minQuantity\":1,\"salePrice\":35.0}]
    10 35 350 [{"minQuantity":1,"salePrice":35.0}] [{\"minQuantity\":1,\"salePrice\":35.0}]
  • Tags: @AUTOMATED, @TNK-11941, @TNK-6231, @TNK-9052

    Phí vận chuyển quốc tế tạm tính được làm tròn theo quy định

    • Phí VCQT tạm tính lấy từ hệ thống quản lý đơn (đã giảm giá theo chính sách), giá trị được làm tròn và lấy phần thập phân theo quy định của hệ thống quản lý đơn
    • Sabomall dựa vào phí ước tính đã giảm giá lấy được sẽ tính toán ra phí vcqt chưa giảm và số tiền được giảm, giá trị được làm tròn lên theo quy định của Sabomall (làm tròn CELLING) và lấy số chữ số thập phân theo quy định của hệ thống quản lý đơn
    • Given Hệ thống quản lý đơn có các nhóm ngành hàng
      mã nhómtên nhóm
      N4Thể thao và du lịch
    • And Đã mapping category của 1688 với nhóm ngành hàng
      categoryId1688hsCode
      01N4
    • And Dịch vụ quy định số lượng kiện ước tính dựa vào tiền hàng trên đơn
      order_min_valueorder_max_valuepackage_quantity
      03001
    • And Trên hệ thống quản lý đơn, đơn vị tiền tệ "CNH" đang được cấu hình làm tròn "ROUND" đến "<precision>" chữ số thập phân
    • And Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "1688" có thông tin
      merchantIdproductIdskuIdskusIdquantityorder_quantitybatchSizepriceweightcategoryId
      merchant_01product01sku01skusId1114.6<weight>01
    • And Có token của tài khoản "pamiuoi"
    • And Request có header là
      X-Tenantm26
    • When Gửi request "POST" đến "/M26/draft-orders/with-last-mile" với body
      {
        "skus": ["${skusId}"],
        "addressId": "${VN_01}",
        "depositRateCode": "${rate100}"
      }
    • Then Trả về status code 200
    • And Response có body thỏa mãn giá trị như sau
      {
      "orderViews": [
          {
            "internationalShippingFee": <internationalShippingFee>,
            "membershipDiscount": <membershipDiscount>,
            "membershipDiscountPercent": 10
          }
        ]
      }

    Examples:

    precision weight internationalShippingFee membershipDiscount
    4 0.567 4.2130 0.4213
    2 3.5 20.84 2.09
  • Tạo thành công đơn nháp với số lượng sku trong đơn là 50

    • Given Giỏ hàng "thường" của tài khoản "pamiuoi" đang trống
    • And Giỏ hàng của "pamiuoi" đã có 50 sku
    • And Có token của tài khoản "pamiuoi"
    • And Request có header là
      X-Tenantm26
    • Then Tạo thành công 1 đơn nháp mới cho tất cả sản phẩm trong giỏ, đơn nháp có 50 sku
  • Tags: @manual

    Không thể tạo đơn nháp với số lượng sku lớn hơn 50 sku

    • Given Giỏ hàng "thường" của tài khoản "pamiuoi" đang trống
    • And Giỏ hàng của "pamiuoi" đã có 51 sku
    • And Có token của tài khoản "pamiuoi"
    • And Request có header là
      X-Tenantm26
    • And Gửi request tạo đơn nháp cho 51 sku trong giỏ
    • Then Tạo đơn nháp không thành công, hệ thống thông báo lỗi "The size of skus must be less than 51"