Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    update cart through api.

    General Discussion
    3
    8
    784
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      karkiswapnil last edited by

      Hi can someone explain me how to update cart quantity through the api? I would like to know about the put request and the parameter we need to provide.
      It would be nice if you can give me an example using axios.

      1 Reply Last reply Reply Quote 0
      • R
        rahul last edited by

        Hi,

        Call update route of cart to update cart quantity thorough API. You need to pass data like given below.

        {"qty":{"productId":"Quantity"}} 
        

        It is a JSON format.

        You can see attach screenshot for more reference.

        Thacart-update.png nks

        1 Reply Last reply Reply Quote 0
        • K
          karkiswapnil last edited by

          Thank you.

          1 Reply Last reply Reply Quote 0
          • K
            karkiswapnil last edited by

            Hello,
            Can you also help me with api for add to cart.
            http://localhost/bagisto-master/public/api/checkout/cart/add/203

            1 Reply Last reply Reply Quote 0
            • K
              karkiswapnil last edited by

              Capture.PNG

              1 Reply Last reply Reply Quote 0
              • K
                karkiswapnil last edited by

                i also tried passing data {"product_id" : "203"}, is there something more to the payload?

                1 Reply Last reply Reply Quote 0
                • K
                  karkiswapnil last edited by

                  it took me while to figure it out what the payload needed to be
                  i passed data as {"product" : "203", "quantity": "1", "is_configurable" : "false"} and it worked.
                  It would have been nice if this was mentioned in the devdocs.

                  1 Reply Last reply Reply Quote 0
                  • K
                    klapakistan last edited by

                    Thanks for sharing this

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post