Magento 2 API – Get All Orders of Customer Using Customer’s Token

cartmagento2rest api

I want all orders of customer using customer's Token in Magento API.

Which gives the list of all previous orders of the customer.

This API provides me the cart products of specific customer using customer's Token.

http://<magento-host>/rest/V1/carts/mine

Authorization :: Bearer <Customer Token>

Thanks in advance!

Best Answer

You should be able to filter out the orders of a single customer using the search query parameters like this:

https://<mage host>/rest/V1/orders/?searchCriteria[filterGroups][0][filters]
[0][field]=customer_id&searchCriteria[filterGroups][0][filters][0][value]=<customer_id>

This returns a list of orders on which you can loop and find out other information.