0

I'm new to Magento (Version 2) and am a bit confused by the variables for the calls in the API-Documentation (https://magento.redoc.ly/). As you might know there's not much explanation about what they stand for or possible values besides the datatype. Until now I could construct most calls with the help of this and other forums, but am now stuck on the call to get orders based on certain criteria, e.g. "new" orders, orders from the last n days (What does searchCriteria[filterGroups][0][filters][0][field] mean? What could be possible values???). Since this probably won't be the last call causing me such headaches I was wondering if there might be a document I didn't find yet, where there are further explanations.

Thank you very much for your help!

asked Apr 20, 2021 at 12:06

1 Answer 1

1

I think this article will help you a lot as it contains both the theory and the relevant examples (includin some on orders): https://devdocs.magento.com/guides/v2.4/rest/performing-searches.html

By checking this article, you will understand why searching for new orders can be a simple request as this one:

GET <host>/rest/V1/orders?searchCriteria[filter_groups][0][filters][0][field]=status&&searchCriteria[filter_groups][0][filters][0][value]=pending&&searchCriteria[filter_groups][0][filters][0][condition_type]=eq

Note - in my example, 'pending' is the status of the new orders, feel free to change it according to your needs.

answered Apr 20, 2021 at 12:31
2
  • 1
    Hi Diana, thanks for your quick answer. This looks promising and actually fun to work with, haha. I guess I'll add asking questions here to my strategy of problem solving. Commented Apr 20, 2021 at 14:35
  • no problem, you are most welcome! if you need more help please open new questions and i am sure we will gladly help :) cheers! Commented Apr 20, 2021 at 15:52

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.