Hello, I am using the ShopifyAPI python library in its version 12.3.0 (the latest at this time).
My code has been working perfectly for two weeks (with daily execution). But since last week, the same code without any changes become unable to fulfill orders. This is the function I use:
def fulfillOrder(self, order, tracking_number) -> bool:
fulfillment = shopify.Fulfillment({
'order_id': order.id,
'line_items': [line_item for line_item in order.line_items if line_item.fulfillment_status != 'fulfilled'],
'location_id': self.location
})
fulfillment.tracking_number = tracking_number
fulfillment.notify_customer = True
response = fulfillment.save()
return response
The error I am getting is in the fulfillment.save() line, and the error is:
Exception has occurred: ResourceNotFound
Not Found: https://MY_STORE.myshopify.com/admin/orders/ORDER_ID/fulfillments.json
urllib.error.HTTPError: HTTP Error 404: Not Found
During handling of the above exception, another exception occurred:
File "C:\path\of\my\project\ShopifyConnector.py", line 104, in fulfillOrder
response = fulfillment.save()
^^^^^^^^^^^^^^^^^^
File "C:\path\of\my\project\TrackingBot.py", line 75, in
*(I have redacted MY_STORE and ORDER_ID, but the are both valid)*
However, if I enter in that URL that is suposedly returning a 404 in a web browser, I get a valid JSON response:
```javascript
{"fulfillments":[]}
Also, other jobs of my code are working properly, like getting all the unfulfilled orders from the last N days. So it is not an athentication issue. Moreover, the right permissions are granted, so it is not an authorization issue.
This is happening not with one specific order, but with all of them.
Does anyone have any idea on how to address this issue?
Thanks in advance