From 115b31542d1f8011506e008cf65362e3ae0359c2 Mon Sep 17 00:00:00 2001 From: iCodeTechnologies Date: Sat, 4 Feb 2023 21:26:28 +1100 Subject: [PATCH] [FIX] Fix URL generation for Fulfillment Fix Fulfillment.py to generate the correct URL for API 2023-01. If no order_id supplied, URL should be /admin/api//fulfillments.py See issue #634 --- shopify/resources/fulfillment.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/shopify/resources/fulfillment.py b/shopify/resources/fulfillment.py index fcf74863..527fd56c 100644 --- a/shopify/resources/fulfillment.py +++ b/shopify/resources/fulfillment.py @@ -5,6 +5,14 @@ class Fulfillment(ShopifyResource): _prefix_source = "/orders/$order_id/" + @classmethod + def _prefix(cls, options={}): + order_id = options.get("order_id") + if order_id: + return "%s/orders/%s" % (cls.site, order_id) + else: + return cls.site + def cancel(self): self._load_attributes_from_response(self.post("cancel"))