It seems like the official Magento 2 REST API Documentation is not complete.
I found this code in a application of one of our ex colleagues:
protected function addItemToCart($cartId, $cartItem)
{
return $this->client->request('POST', "carts/{$cartId}/items", [
'json' => [
'cartItem' => $cartItem,
],
]);
}
But I can't find any documenation for carts/{$cartId}/items
.
The nearest I can find is: /V1/guest-carts/{cartId}/items
Where can I find the documentation for carts/{$cartId}/items
?
There isn't a POST method available on the carts/{$cartId}/items
route.
So there's probably something else going on, could be one of these:
POST /V1/carts/{quoteId}/items
carts/{$cartId}/items
is a custom endpointConsider using the ReDoc Documentation page.