6

I couldn't find some needed API functions in Magento 2 REST API Document . I am very doubted. Is it possible to develop a mobile application with current Magento REST API.?

I couldn't find methods to do following functions.

  1. login customer

  2. Get all products under a category

  3. add shipping address

  4. add products to cart

  5. etc

3 Answers 3

10

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

1) Login customer

2) Get all products under a category

3) Add shipping address

4) Add products to cart

Resources:

Tools for testing purpose:

  • Postman
  • Git Bash on windows with curl command.
  • If we use PHPStorm: Tools > Test RESTful Web Service.
3
  • 1
    @ Khoa TruongDinh the second point Get all products under a category (/V1/categories/{categoryId}/products) only return sku,position,category_id. is there any other way to get all products details. under a category ? Commented Dec 13, 2016 at 6:56
  • We need to use extension_attributes to add more attributes. Need to custom more. Commented Dec 13, 2016 at 7:15
  • Hello @KhoaTruongDinh, Knowledgeable answer +10 for that, do you have any idea about manage multiple rest API calls for one page... Like and example for mobile APP home page. If yes then please reply. so i can ask the question for the same. Commented Jun 21, 2018 at 6:12
3

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.

1
  • 2
    Thank you for the information .i get it .this means I can't develop a mobile application without a Magento developer . :( Commented Dec 13, 2016 at 6:16
1

I have written an article in which I am describing the basics of Magento 2 REST API along with performing some functions. You can look into the below blog post and test it by your own. It is precise and easy to understand. The relevant code is also attached to the blog post for complete understandings. Please have a look:

Getting Started With Magento 2 REST API

If you need any further help, you can further discuss it or comment on the blog post as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.