散装更新Shopify跟踪代码由REST API在Python中
我已经提到创建一个创建一个新的履行 shopify dev文档,但这只会给我<响应[400]>
,然后我尝试了此为一个或多个履行订单创建满足。 发送请求后,我得到了< wenspy [201]>
,但是该顺序显示正在进行的而不是实现。此外,跟踪代码和跟踪公司也不会出现在商店中。
以下是我正在使用的代码。如何更新跟踪代码和公司。
Python Environment
import pandas as pd
import numpy as np
from datetime import datetime, timedelta
import requests
import json
from requests.structures import CaseInsensitiveDict
headers = CaseInsensitiveDict()
API
# add parameter to headers
access_token = f'{token}'
headers["Content-Type"] = "application/json"
headers["X-Shopify-Access-Token"] = f"{access_token}"
身份验证邮政正文,用于跟踪代码/公司/URL信息
data = {}
data['fulfillment'] = {}
data['fulfillment']['tracking_info'] = {}
data['fulfillment']['location_id'] = f'{location_id}' # location id
data['fulfillment']['notify_customer'] = False
data['fulfillment']['status'] = 'success'
data['fulfillment']['tracking_info']['tracking_number'] = f'{trackingCode}'
data['fulfillment']['tracking_info']['company'] = 'DHL Express'
data['fulfillment']['tracking_info']['tracking_urls'] = f'https://www.dhl.com/us-en/home/tracking/tracking-express.html?submit=1&tracking-id={trackingCode}'
发送POST请求
createFulfillment_url = f'{shop_url}/admin/api/2022-04/orders/{orderID}/fulfillments.json'
request.post(createFulfillment_url, headers = headers, json = data)
< wenspys [201]>
,但是跟踪代码和公司不显示
I have referred to Create a new fulfillment Shopify dev documentation, but this will only gave me <Response [400]>
And I tried this one Creats a fulfillment for one or many fulfillment orders.
After sending the request, I got<Response [201]>
, but the order shows in progress instead of fulfilled. Also the tracking code and the tracking company don't appear in the shop.
The following are the codes I was using. How can I update the tracking code and company.
Python Environment
import pandas as pd
import numpy as np
from datetime import datetime, timedelta
import requests
import json
from requests.structures import CaseInsensitiveDict
headers = CaseInsensitiveDict()
API authentication
# add parameter to headers
access_token = f'{token}'
headers["Content-Type"] = "application/json"
headers["X-Shopify-Access-Token"] = f"{access_token}"
post body for tracking code/company/url information
data = {}
data['fulfillment'] = {}
data['fulfillment']['tracking_info'] = {}
data['fulfillment']['location_id'] = f'{location_id}' # location id
data['fulfillment']['notify_customer'] = False
data['fulfillment']['status'] = 'success'
data['fulfillment']['tracking_info']['tracking_number'] = f'{trackingCode}'
data['fulfillment']['tracking_info']['company'] = 'DHL Express'
data['fulfillment']['tracking_info']['tracking_urls'] = f'https://www.dhl.com/us-en/home/tracking/tracking-express.html?submit=1&tracking-id={trackingCode}'
Send the post request
createFulfillment_url = f'{shop_url}/admin/api/2022-04/orders/{orderID}/fulfillments.json'
request.post(createFulfillment_url, headers = headers, json = data)
<Response [201]>
but the tracking code and the company doesn't show
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论