We’re rewarding the question askers & reputations are being recalculated! Read more.

New answers tagged

0

Type mixed is available from version 2.2 onwards. @saravanavelu's answer won't work in versions before that. See docs: docs


1

Api need for third party use. Suppose let take example : You are running any product website successfully.Now you want to make mob app for it so for you want to just pass your all product details there. so using api you can get the product details. likewise customers detail,sales details and many more... when we want POST,delete, in short CRUD operation ...


0

@fmsthird is correct in regards having to create a custom endpoint, however I resorted to creating a new class that depends on \Magento\Sales\Api\OrderRepositoryInterface rather than calling that class directly. From there I've created a new method that the endpoint utilises, and then calls the getList method from there. As that method expects a parameter of ...


1

Method :GET URL: http://yourdomain/index.php/rest/store-code/V1/categories \ -H 'authorization: Bearer token--string--' \ for store grocery call api Method :GET URL: http://yourdomain/index.php/rest/grocery/V1/categories \ -H 'authorization: Bearer token--string--' \ for store fruit call api Method :GET URL: http://yourdomain/index.php/rest/...


0

Use the following search criteria: /rest/all/V1/products?searchCriteria[currentPage]=1&searchCriteria[pageSize]=20 Increase the currentPage until you get to the last page. More details here: Search using REST endpoints


0

Using this documentation : Magento Commerce for B2B v2.2, I was able successfully create API calls for the stockItem. This is a PUT operation, make sure that you get the correct item_id for that product. /V1/products/{productSku}/stockItems/{itemId} item_id from GET Product API: "stock_item": { "item_id": 4721, "qty": 1234, ...


0

public function updateCart($cartId,$itemId,$qty) { if($qty){ $quote = $this->quoteFactory->create()->load($cartId); // \Magento\Quote\Model\QuoteFactory $quoteItem = $quote->getItemById($itemId); $quoteItem->setQty($qty); $quoteItem->getProduct()->setIsSuperMode(true); $quoteItem->save(); ...


1

You can do this by using following api endpoint Method - PUT {URL}/rest/V1/guest-carts/{guest-card-id} Param - { "customerId": 3, "storeId": 1 } Authorization -"Bearer {user-token}" There is also a known issue https://github.com/magento/magento2/issues/24808. It will be fixed in Magento 2.3.4. I created an extension to fix this issue for the ...


1

To bring some light on it, I think the method you mentioned should work after the fix of https://github.com/magento/magento2/issues/24808. I created an extension to fix this issue for the Magento version < 2.3.4. https://github.com/troublediehard/plab-cartsmergefix


0

In order to achieve this you will have to dispatch the event from your API code itself. Use _eventManager to dispatch the event and pass relevant parameters. $this->_eventManager->dispatch( 'checkout_cart_product_add_after', [$this->_eventObject => $this, 'product' => $product] );


0

We can use Token based authentication: https://devdocs.magento.com/guides/v2.3/get-started/authentication/gs-authentication-token.html For example: https://devdocs.magento.com/guides/v2.3/rest/tutorials/orders/order-create-quote.html Magento swagger: https://devdocs.magento.com/swagger/


0

This behavior (an event, di happens for one area and not the other) seems to be related to the area. I'm guessing that you have declared the event to the frontend area etc/frontend/events.xml. You should add that event the "global" area etc/events.xml


Top 50 recent answers are included