Hello, I'm trying to integrate Magento into an IOS app through the use of the Magento REST Web API. Currently in my program, the user logs in then a customer session token is stored in the application (/rest/V1/integration/customer/token). What I've been trying to figure out is how one would then obtain all Platform Orders/Orders for this specific customer. Reading through the documentation has led me to believe that the only way that this would be possible is to create a custom endpoint. Is there any other way that achieving this would be possible without having to create a custom endpoint or is this the only option. Thanks for the help!
By default, You have to use SearchCriteria interface for Get Customer Specific Order Data in magento 2.
http://<host>/rest/V1/orders?searchCriteria[filterGroups][][filters][][field]=customer_email&searchCriteria[filterGroups][0][filters][0][value]=someone@test.com
In above query replace customer_email with your customer email and someone@test.com with your email id.
Already one user have asked question like you,
But you can check other sales and customer API in Magento swagger,
https://devdocs.magento.com/swagger/
Thanks.
Hi @gabriel_kb
Yes , you can get specific customer orders using rest api !! you need to pass that in searchcriteria api !
Magento 2 have one mechanism to get filtered data using SearchCriteria property in REST API.
Below is the end point - if you wanted to get specific customer order data.
https://domain.com/index.php/rest/V1/orders?searchCriteria[filter_groups][0][filters][0][field]=customer_email&searchCriteria[filter_groups][0][filters][0][value]=aaa@gmail.com
Where you need to pass - your customer 's email id instead of aaa@gmail.com
same way like others api you are calling - you need to pass its access token for the same.
Hope it helps to you !!