1

I'm trying to retrieve the abandoned shopping cart through the Magento Rest API. Here is my request

https://<my_domain>/rest/V1/carts/search?searchCriteria[filter_groups][0][filters][0][field]=is_active&searchCriteria[filter_groups][0][filters][0][value]=1&searchCriteria[filter_groups][0][filters][0][condition_type]=eq&searchCriteria[filter_groups][1][filters][0][field]=store_id&searchCriteria[filter_groups][1][filters][0][value]=1&searchCriteria[filter_groups][1][filters][0][condition_type]=eq&searchCriteria[filter_groups][2][filters][0][field]=items_count&searchCriteria[filter_groups][2][filters][0][value]=0&searchCriteria[filter_groups][2][filters][0][condition_type]=gt

I retrieve 514 items.

When I check the report which is available in Magento back-office, it gives me 189 items. I cannot explain the difference.

What should be the request in order to actually retrieve the abandoned shopping carts ?

Thanks

0

You forget to add the filter on customers:

https://<my_domain>/rest/V1/carts/search?searchCriteria[filter_groups][0][filters][0][field]=is_active&searchCriteria[filter_groups][0][filters][0][value]=1&searchCriteria[filter_groups][0][filters][0][condition_type]=eq&searchCriteria[pageSize]=1&searchCriteria[filter_groups][1][filters][0][field]=store_id&searchCriteria[filter_groups][1][filters][0][value]=0&searchCriteria[filter_groups][1][filters][0][condition_type]=neq&searchCriteria[filter_groups][2][filters][0][field]=items_count&searchCriteria[filter_groups][2][filters][0][value]=0&searchCriteria[filter_groups][2][filters][0][condition_type]=gt&searchCriteria[filter_groups][3][filters][0][field]=customer_id&searchCriteria[filter_groups][3][filters][0][value]=null&searchCriteria[filter_groups][3][filters][0][condition_type]=neq

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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