Develop a mobile app with Magento 2 REST API.?

Yes, definitely, it is possible. We need to build our own API if there is the complex requirement.

1) Login customer

  • Authentication: http://devdocs.magento.com/guides/v2.0/get-started/authentication/gs-authentication-token.html

2) Get all products under a category

  • /V1/categories/{categoryId}/products : How can I get product list with its detail in rest API I'm on magento2

3) Add shipping address

  • May need to take a look here: https://github.com/magento/magento2/issues/2499

4) Add products to cart

  • We use /rest/V1/carts/mine and /rest/V1/carts/mine/items: https://stackoverflow.com/questions/33701161/how-to-add-an-item-to-a-quote-cart-via-api-on-magento2

Resources:

  • http://devdocs.magento.com/guides/v2.1/rest/list.html
  • http://devdocs.magento.com/swagger/#/

Tools for testing purpose:

  • Postman
  • Git Bash on windows with curl command.
  • If we use PHPStorm: Tools > Test RESTful Web Service.

The Magento 2 API is very extensible, so while these methods may not exist currently, you can write your own module that adds the methods to the API. So, yes, it is very possible to develop an app like the one you are describing, but it may require extending the Magento API.

Tags:

Rest

Api

Magento2