When I try to add to card any item via REST API I get this error:
"{"message":""%fieldName" is required. Enter and try again.","parameters":{"fieldName":"quoteId"}}"
First time I get the cart id calling this
“rest/V1/carts/mine”
than I call
“rest/V1/carts/mine/items”
with this data:
{
"cartItem": {
"sku": "24-WG080",
"qty": 1,
"quote_id": cartID
}
}
Tried with cart-item, quoteId, quote_id and more…
I’m stuck, I have no ideea what is wrong, the documentation is wrong? https://devdocs.magento.com/guides/v2.4/rest/tutorials/orders/order-add-items.html
Enabed developer mode, and now I got this error in response:
"#0 [internal function]: MagentoQuoteModelQuoteItemRepository->save(Object(MagentoQuoteModelQuoteItem))
#1 /home2/xxx/vendor/magento/module-webapi/Controller/Rest/SynchronousRequestProcessor.php(95): call_user_func_array(Array, Array)
#2 /home2/xxx/vendor/magento/module-webapi/Controller/Rest.php(188): MagentoWebapiControllerRestSynchronousRequestProcessor->process(Object(MagentoFrameworkWebapiRestRequestProxy))
#3 /home2/xxx/vendor/magento/framework/Interception/Interceptor.php(58): MagentoWebapiControllerRest->dispatch(Object(MagentoFrameworkAppRequestHttp))
#4 /home2/xxx/vendor/magento/framework/Interception/Interceptor.php(138): MagentoWebapiControllerRestInterceptor->___callParent('dispatch', Array)
#5 /home2/xxx/vendor/magento/framework/Interception/Interceptor.php(153): MagentoWebapiControllerRestInterceptor->MagentoFrameworkInterception{closure}(Object(MagentoFrameworkAppRequestHttp))
#6 /home2/xxx/generated/code/Magento/Webapi/Controller/Rest/Interceptor.php(23): MagentoWebapiControllerRestInterceptor->___callPlugins('dispatch', Array, Array)
#7 /home2/xxx/vendor/magento/framework/App/Http.php(116): MagentoWebapiControllerRestInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp))
#8 /home2/xxx/generated/code/Magento/Framework/App/Http/Interceptor.php(23): MagentoFrameworkAppHttp->launch()
#9 /home2/xxx/vendor/magento/framework/App/Bootstrap.php(264): MagentoFrameworkAppHttpInterceptor->launch()
#10 /home2/xxx/pub/index.php(29): MagentoFrameworkAppBootstrap->run(Object(MagentoFrameworkAppHttpInterceptor))
#11 {main}"