Question

I am using this

http://domain.com/index.php/rest/V1/orders/7??fields=billing_address,customer_firstname,customer_lastname

it return the billing_address,customer_firstname,customer_lastname of order id 7, I want to get these details of all orders so i try

http://domain.com/index.php/rest/V1/orders?searchCriteria=all

it work return all orders But i want to get specific feilds for example billing_address,customer_firstname,customer_lastname.

How can I get specifics columns of all orders?

Était-ce utile?

La solution

try this one, the response will have only these fields.

entity_id, billing_address,customer_firstname, and customer_lastname only

http://www.domain.com/rest/V1/orders?
searchCriteria[filter_groups][0][filters][0][field]=entity_id&
searchCriteria[filter_groups][0][filters][0][value]=1&
searchCriteria[filter_groups][0][filters][0][condition_type]=gteq&
searchCriteria[sortOrders][0][field]=increment_id&
fields=items[entity_id,billing_address,customer_firstname,customer_lastname]

check link for a detailed guide

Licencié sous: CC-BY-SA avec attribution
Non affilié à magento.stackexchange
scroll top