Fdk Client UpdateCart Api

Hi, in cart.updateCart api, it is not clear what is the item_id field in body whether it is item_code or something else, also during calling the api, it throws error with reason that identifiers are required, but no such field is given in the docs.
On Called addItems api, it returns internal server error
attaching doc link

addItems request:

{
            body : {
                "items": [
                    {
                        "quantity": 2,
                        "item_id" : "590298196",
                    }
                ]
            }
        }

addItems result:

app.0b56d67aaf4b35d6247f.js:48 Uncaught (in promise) FDKServerResponseError: oops! something went wrong.
    at app.0b56d67aaf4b35d6247f.js:48:304436
    at async e.exports.addItems (app.0b56d67aaf4b35d6247f.js:83:24192)

Hi @aakash140799_1 Please refer to this doc
https://github.com/gofynd/fdk-client-javascript/blob/master/documentation/platform/CART.md#updatecart

In this doc you can see item_id is not str type it is a Number type and also Item_id is not item_code.
Item_id is fetched from “/platform/content/v1/products/” which is referring to product_uid which you can basically find in the auto-generated-slug or item_id in item details.

in this doc “https://github.com/gofynd/fdk-client-javascript/blob/master/documentation/platform/CART.md#AddProductCart” is there for correct mapping for additem request.

2 Likes

Hi @Devendra_Kumari_Dhay , After changing the request body according to api doc, the api call is working, thanks