Rakesh
Rakesh

Reputation: 77

Magento API Support

I wonder if Magento provide API for following.

  1. Product Search.
  2. Add to Wishlist.
  3. View wishlist.
  4. Add to cart.

If it does provides API for above, Can any one share useful resource for it.

Thanks

Upvotes: 2

Views: 326

Answers (3)

Garvin
Garvin

Reputation: 65

Product Search. Add to Wishlist. View wishlist. Add to cart.

  • Product Search -> YES. Provided By magento2.
  • Add to Wishlist ->Not sure.
  • View wishlist -> Not sure
  • Add to cart -> YES. Provided By magento2.

Product search Api in Magento 2:

http://localhost/magento/rest/V1/products?searchCriteria[filter_groups][0][filters][1][field]=name&searchCriteria[filter_groups][0][filters][1][value]=%25<Name_Of_Product>%25&searchCriteria[filter_groups][0][filters][1][condition_type]=like

Add To Cart Api In Magento 2:

http://localhost/magento/rest/V1/carts/mine/items/

Note : Add Items to a cart of a registered customer. Two things we have to send in request, first token & second is cartItems detail. e.g. Body to be load in POST request

{"cartItem": {"sku": "WS1M-Orange-Flav","qty": 1,"quote_id": "4"}}

Upvotes: 2

Bery
Bery

Reputation: 1104

Yes, Magento API is extendable using custom API models in your extension. We are frequently using Magento API extends for both inbound/outbound calls. Magento supports multiple API backends - Rest, SOAP, XML-RPC (v1), v2 only REST and SOAP if I remember correctly.

Magento 1

http://devdocs.magento.com/guides/m1x/api/rest/introduction.html http://devdocs.magento.com/guides/m1x/api/rest/Resources/resources.html

Magento 2 http://devdocs.magento.com/guides/v2.0/get-started/bk-get-started-api.html

Upvotes: 0

Marius
Marius

Reputation: 15216

Product Search - NO.
Add to Wishlist - NO.
View wishlist - NO.
Add to cart - YES. see shoppingCartProductAdd for V2 and shopping_cart_product.add for V1

Upvotes: 1

Related Questions