Can someone help me find out what am I missing in this Python code. It works fine with 2022-04 API version. Here is the error message: urllib.error.HTTPError: HTTP Error 404: Not Found
import shopify
API_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
API_SECRET = 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
TOKEN = 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'
shopify.Session.setup(api_key=API_KEY, secret=API_SECRET)
shop_url = "mysite.myshopify.com"
api_version = '2023-01'
session = shopify.Session(shop_url, api_version, TOKEN)
shopify.ShopifyResource.activate_session(session)
#unfulfilled orders
new_orders = shopify.Order.find()
for order in new_orders:
fo = shopify.FulfillmentOrders.find(order_id=order.id)[0]
location = fo.assigned_location_id
fulfillable_quantity = fo.line_items[0].fulfillable_quantity
fulfillment = shopify.Fulfillment({
'order_id':fo.order_id,
})
fulfillment.location_id = location
fulfillment.notify_customer = False
fulfillment.message = 'The package has been shipped this morning'
fulfillment.tracking_info = {
"number": "11111111",
"url": "https://mysite.myshopify.com",
"company": "mycompany"
};
fulfillment.line_items_by_fulfillment_order = [
{
"fulfillment_order_id": fo.id,
"fulfillment_order_line_items": [
{
"id": fo.line_items[0].id,
"quantity": fulfillable_quantity
}
]
}
]
fulfillment.save()
shopify.ShopifyResource.clear_session()