[英]How to get all the orders in shopify with fulfillment status as shipped using REST API in python?
我正在尝试获取 Shopify 商店中的所有订单,这些订单的履行状态为已发货。
当我在 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': []}
尝试使用以下 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/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.