slince / shopify-api-php

:rocket: Shopify API Client for PHP
MIT License
128 stars 48 forks source link

Search orders by email address #14

Closed krafi closed 5 years ago

krafi commented 5 years ago

Hi, I have been trying to use Order Manager to search orders by email address. But in return i am getting all orders instead of the one's for that email address. Same is happening if i try to find a customer using email.

$customer = $client->getCustomerManager()->findAll(['email' => 'abc@xyz.com']); $orders = $client->getOrderManager()->findAll(['email' => 'abc@xyz.com']);

Not sure if i am passing the wrong parameters to the findAll function.

:(

maximzasorin commented 5 years ago

Hello, to filter orders, as well as to filter customers, you can only use the parameters that Shopify provides.

You can see the list of parameters here: https://help.shopify.com/en/api/reference/orders/order#index https://help.shopify.com/en/api/reference/customers/customer#index

There is no email parameter among them.

slince commented 5 years ago

I have been trying to use Order Manager to search orders by email address

You can not filter orders with email or customer. this is not be supported.

you can refer to the link above.

krafi commented 5 years ago

Well this is not true, We can do this by simple call using following link https://abc.myshopify.com/admin/orders/search.json?query=abc@xyz.com

I was looking for this option is this PHP wrapper.

Thanks

maximzasorin commented 5 years ago

@krafi This is not a part of REST Admin API.