我正在尝试获得购物商店上的所有订单,这些订单的履行状态为已发货。
当我在web浏览器的url中使用以下内容时,我可以得到想要的结果:
https://<store_name>.myshopify.com/admin/api/2020-01/orders/search.json?query=fulfillment_status:shipped然而,当我尝试使用下面这段python (Python 3.8.2)代码时,返回的json是空的。我遗漏了什么?
>>> payload = {'fulfillment_status':'shipped', 'limit':100}
>>> response = requests.get( "https://%s.myshopify.com/admin/api/2020-01/orders.json" % (SHOP_NAME), auth=(API_KEY,PASSWORD), params=payload)
>>> response
<Response [200]>
>>> response.json()
{'orders': []}发布于 2021-03-14 15:02:49
请使用以下URL进行尝试:
url = "https://{apikey}:{password}@{hostname}/admin/api/{version}/{resource}.json?limit=250&fulfillment_status=shipped"
response = requests.request("GET", url)有一个关于如何从Shopify获得所有订单的教程,你可能会发现它很有用:
https://predictivehacks.com/how-to-get-all-orders-from-shopify-in-python/
https://stackoverflow.com/questions/60983740
复制相似问题