Update the tracking number for a fulfillment, "fulfillment":"Required parameter missing or invalid"

Highlighted
New Member
3 0 0
#get order detail by id
def getOrderDetail(order_id):
        order_detail = session.get(const.shopify_url_prefix + f'orders/{order_id}.json', auth=const.shopify_auth)
        return json.loads(order_detail.text).get("order")

def update_fulfillment_tracknumber(order_id, track_number):
order_detail = getOrderDetail(order_id)
fulfillment_id = order_detail.get('fulfillments')[0].get("id")
print(fulfillment_id)
update_params = {
"fulfillment": {
"tracking_number":track_number,
"id":str(fulfillment_id)
}
}
update_result = session.put(const.shopify_url_prefix + f'orders/{order_id}/fulfillments/{fulfillment_id}.json', json.dumps(update_params), auth=const.shopify_auth)
print(update_result.text)
 
shopify.update_fulfillment_tracknumber(1851776270447, 'LO429281728CN')
 
response info:{"errors":{"fulfillment":"Required parameter missing or invalid"}}
0 Likes
Shopify Staff
Shopify Staff
349 48 55

Hey @pengdai,

 

I'm not sure you mean to be sending an id. Here's an example.

 

If you're still stuck please provide a request id (from the response headers).

0 Likes