«

PATCH /M26/cart/skus - Cập nhật thông tin sản phẩm trong giỏ

  • Header: X-Teant: "m26"
  • Request Body: { "skuId": "string", "quantity": 0, "marketplace": "string", "productSellingType": "string" }
  • Tags: @AUTOMATED, @TNK-10432

    Trả về status code 400 khi gửi request không gửi lên header

    • 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 "<marketPlace>" có thông tin
      merchantIdproductIdskuIdskusIdquantity
      merchant_01product01sku01skusId011
    • When Gửi request "PATCH" đến "/M26/cart/skus" với body
        {
          "skuId": "${sku01}",
          "marketplace": "<marketPlace>",
          "quantity": 2
        }
    • Then Trả về status code 400
    • And Response có body thỏa mãn giá trị như sau
      {
        "title": "Bad Request"
      }

    Examples:

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

    Trả về status code 400 khi gửi request với x-tenant không hợp lệ

    • 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 "<marketPlace>" có thông tin
      merchantIdproductIdskuIdskusIdquantity
      merchant_01product01sku01skusId011
    • When Request có header là
      X-Tenant<tenant>
    • And Gửi request "PATCH" đến "/M26/cart/skus" với body
        {
          "skuId": "${sku01}",
          "marketplace": "<marketPlace>",
          "quantity": 2
        }
    • Then Trả về status code 400
    • And Response có body thỏa mãn giá trị như sau
      {
        "title": "sku_not_found"
      }

    Examples:

    marketPlace tenant
    tmall
    taobao tenantBatKy
    1688
  • Tags: @AUTOMATED, @TNK-10432

    Trả về status code 401 khi gửi lên request cập nhật thông tin sản phẩm trong giỏ mà không có token

    • Given Giỏ hàng của tài khoản "pamiuoi" đã có sản phẩm thuộc marketplace "<marketPlace>" có thông tin
      merchantIdproductIdskuIdskusIdquantity
      merchant_01product01sku01skusId011
    • When Request có header là
      X-Tenantm26
    • And Gửi request "PATCH" đến "/M26/cart/skus" với body
        {
          "skuId": "${sku01}",
          "marketplace": "<marketPlace>",
          "quantity": 2
        }
    • Then Trả về status code 401

    Examples:

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

    Trả về status 400 khi gửi lên request với sản phẩm không tồn tại trong giỏ

    • Given Có token của tài khoản "pamiuoi"
    • When Request có header là
      X-Tenantm26
    • And Gửi request "PATCH" đến "/M26/cart/skus" với body
        {
          "skuId": "sanphambatky",
          "marketplace": "<marketPlace>",
          "quantity": 2
        }
    • Then Trả về status code 400
    • And Response có body thỏa mãn giá trị như sau
      {
        "title": "sku_not_found"
      }

    Examples:

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

    Trả về status code khác 200 khi gửi lên request với thông tin không hợp lệ

    • 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 "<marketPlace>" có thông tin
      merchantIdproductIdskuIdskusIdquantity
      merchant_01product01sku01skusId011
    • When Request có header là
      X-Tenantm26
    • And Gửi request "PATCH" đến "/M26/cart/skus" với body
        {
          <requestBody>
        }
    • Then Trả về status code <status>
    • And Response có body thỏa mãn giá trị như sau
      {
        <response>
      }

    Examples:

    marketPlace requestBody status response
    tmall "skuId": "${sku01}", "marketplace": "taobao", "quantity": 2 400 "title": "sku_not_found"
    taobao "skuId": "${sku01}", "marketplace": "", "quantity": 2 400 "title": "sku_not_found"
    1688 "skuId": "${sku01}", "marketplace": "marketPlaceLinhTinh", "quantity": 2 400 "title": "sku_not_found"
    tmall "skuId": "${sku01}", "marketplace": "tmall", "quantity": null 400 "title": "Bad Request"
    1688 "skuId": "${sku01}", "marketplace": "1688", "quantity": "" 400 "title": "Bad Request"
    taobao "marketplace": "taobao", "quantity": 2 400 "title": "sku_not_found"
    tmall "skuId": "${sku01}", "quantity": 2 400 "title": "sku_not_found"
    1688 "skuId": "${sku01}", "marketplace": "1688" 500 "error": "Internal Server Error"
  • Tags: @AUTOMATED, @TNK-10432

    Trả về status code 200 khi gửi lên request với thông tin hợp lệ

    • 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 "<marketPlace>" có thông tin
      merchantIdproductIdskuIdskusIdquantity
      merchant_01product01sku01skusId011
    • When Request có header là
      X-Tenantm26
    • And Gửi request "PATCH" đến "/M26/cart/skus" với body
        {
          "skuId": "${sku01}",
          "marketplace": "<marketPlace>",
          <productSellingType>
          "quantity": 2
        }
    • Then Trả về status code 200
    • And Response có body thỏa mãn giá trị như sau
        {
              "itemId": "${product01}",
              "skuId": "${sku01}",
              "quantity": 2,
              "marketplace": "<marketPlace>",
              "productSellingType": null
        }

    Examples:

    marketPlace productSellingType
    tmall "productSellingType": null,
    taobao
    1688 "productSellingType": null,