Updating Fulfillments Using the Fulfillment API Throws A 422 If No Original Address Is Found

Hey Everyone,

I’ve been running some tests with the Fulfillment API on both version 2021-10 and 2022-01 and noticed the Fulfillment API throws an error if a Fulfillment does not have an Origin Address.

I’m looking to upgrade the API version on one of our apps, which currently uses API version 2021-07. I upgraded the API version and ran some tests and whenever I try and update an existing Fulfillment created before 2021-10 or a fulfillment that does not specify an origin_address, the Shopify API throws a 422 error. The error message returned from the 422 error is “Origin address country code Country is unknown and Origin address country code may not be empty”

Since the origin_address was added on the 2021-10 API (any fulfillment created before this API version, or if it’s created with API version 2021-10 or older and doesn’t specify the field) the API returns an error when updating the fulfillment. According to the documentation, this field is not required and any fulfillments created without this field will break future fulfillment updates, which means fulfillments created before the field was available will break if a user tries to update the fulfillment with a current API version.

Since this field isn’t required on creation, it seems like throwing a 422 error shouldn’t happen. This error seems incorrect since a fulfillment can be created without this field and older fulfillments (ones created before the 2021-10 API version) may not have the field as it wasn’t available.

Please let me know if you have any advice on how to handle this and if this is indeed a bug, since this field isn’t marked as required.

Thanks for all your help!

I’ve run some more tests this morning and noticed this behavior when trying to add tracking numbers to orders that are fulfilled in the Shopify admin. If I create an order, then create a fulfillment using the Shopify admin and try to update that fulfillment using the Shopify API (say update the tracking numbers) I get a 422 Error below:

“Origin address country code Country is unknown and Origin address country code may not be empty”

It looks like the Fulfillment API is preventing any updates to a fulfillment without an origin_address, which it looks like the Shopify Admin doesn’t add when creating fulfillments either.