I would like to create a python script that returns the orders of a customer knowing only his billing email.
I tried doing this but returns all recent orders:
<code>from woocommerce import API
wcapi = API(
url="https://siteexample.com",
consumer_key="ck_xxx",
consumer_secret="cs_xxx",
version="wc/v3"
)
response = wcapi.get("orders", params={"billing": {"email": "[email protected]"}}).json()
print(response)
</code>
<code>from woocommerce import API
wcapi = API(
url="https://siteexample.com",
consumer_key="ck_xxx",
consumer_secret="cs_xxx",
version="wc/v3"
)
response = wcapi.get("orders", params={"billing": {"email": "[email protected]"}}).json()
print(response)
</code>
from woocommerce import API
wcapi = API(
url="https://siteexample.com",
consumer_key="ck_xxx",
consumer_secret="cs_xxx",
version="wc/v3"
)
response = wcapi.get("orders", params={"billing": {"email": "[email protected]"}}).json()
print(response)
I also saw from the official woocommerce documentation that you can retrieve orders directly from the customer id.
Then how can I get customer id knowing his billing email?
Thanks in advance for the reply!