From 4fdb1a00bf46375d26de5cb92a9cbfdb3e75f4d3 Mon Sep 17 00:00:00 2001 From: kinshukshah Date: Thu, 9 Jul 2026 17:11:00 +0530 Subject: [PATCH 1/3] Backport updateRealtimeInventory changes (parity with fdk-private-client feature/1.4.4.1) Replicates the updateRealtimeInventory schema changes onto GitHub v1.4.4: - client.py: switch response validation to InventoryUpdateResponseSchema - models.py: add InventoryUpdateResponseSchema and InventoryTransaction models - models.py: add fields to InventoryPayload (price_cost, mode, damaged_quantity, not_available_quantity, meta, transaction_type, transaction) - models.py: add transaction_type and transaction to InventoryRequestSchemaV2 All updateRealtimeInventory-related schemas match prod 3.28.0 / the Azure fdk-private-client feature/1.4.4.1 branch exactly. --- fdk_client/platform/catalog/client.py | 4 +- fdk_client/platform/catalog/models.py | 54 +++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/fdk_client/platform/catalog/client.py b/fdk_client/platform/catalog/client.py index acd0acb0f..d6d6fb0b0 100644 --- a/fdk_client/platform/catalog/client.py +++ b/fdk_client/platform/catalog/client.py @@ -3468,8 +3468,8 @@ async def updateRealtimeInventory(self, item_id=None, seller_identifier=None, bo response = await AiohttpHelper().aiohttp_request("POST", url_with_params, headers=get_headers_with_signature(self._conf.domain, "post", await create_url_without_domain(f"/service/platform/catalog/v2.0/company/{self._conf.companyId}/products/{item_id}/inventory/{seller_identifier}", item_id=item_id, seller_identifier=seller_identifier), query_string, headers, body, exclude_headers=exclude_headers), data=body, debug=(self._conf.logLevel=="DEBUG")) if 200 <= int(response['status_code']) < 300: - from .models import InventoryUpdateResponse - schema = InventoryUpdateResponse() + from .models import InventoryUpdateResponseSchema + schema = InventoryUpdateResponseSchema() try: schema.load(response["json"]) except Exception as e: diff --git a/fdk_client/platform/catalog/models.py b/fdk_client/platform/catalog/models.py index 9de020e58..dc18c2a79 100644 --- a/fdk_client/platform/catalog/models.py +++ b/fdk_client/platform/catalog/models.py @@ -858,6 +858,14 @@ class InventoryUpdateResponse(BaseSchema): pass +class InventoryUpdateResponseSchema(BaseSchema): + pass + + +class InventoryTransaction(BaseSchema): + pass + + class InventoryValidationResponse(BaseSchema): pass @@ -4919,16 +4927,30 @@ class InventoryPayload(BaseSchema): price_marked = fields.Float(required=False) + price_cost = fields.Float(required=False) + seller_identifier = fields.Str(required=False) store_id = fields.Int(required=False) tags = fields.List(fields.Str(required=False), required=False) + mode = fields.Str(required=False) + total_quantity = fields.Int(required=False, allow_none=True) + damaged_quantity = fields.Int(required=False, allow_none=True) + + not_available_quantity = fields.Int(required=False, allow_none=True) + trace_id = fields.Str(required=False) + meta = fields.Dict(required=False) + + transaction_type = fields.Str(required=False, allow_none=True) + + transaction = fields.Nested(InventoryTransaction, required=False) + class InventoryRequest(BaseSchema): @@ -4953,6 +4975,10 @@ class InventoryRequestSchemaV2(BaseSchema): payload = fields.List(fields.Nested(InventoryPayload, required=False), required=False) + transaction_type = fields.Str(required=False, allow_none=True) + + transaction = fields.Nested(InventoryTransaction, required=False) + class InventoryResponse(BaseSchema): @@ -5127,6 +5153,34 @@ class InventoryUpdateResponse(BaseSchema): +class InventoryUpdateResponseSchema(BaseSchema): + # Catalog swagger.json + + + items = fields.List(fields.Nested(InventoryResponseItem, required=False), required=False) + + message = fields.Str(required=False) + + success = fields.Boolean(required=False) + + + +class InventoryTransaction(BaseSchema): + # Catalog swagger.json + + + type = fields.Str(required=False) + + reference_id = fields.Str(required=False) + + reason = fields.Str(required=False) + + source = fields.Str(required=False) + + user_ref = fields.Str(required=False) + + + class InventoryValidationResponse(BaseSchema): # Catalog swagger.json From 3119ddcd3ff98bdef42f6f5c1506bd7ac25cae32 Mon Sep 17 00:00:00 2001 From: kinshukshah Date: Thu, 9 Jul 2026 17:25:27 +0530 Subject: [PATCH 2/3] Align updateRealtimeInventory query string with 3.28.0 Use empty create_query_string() with conditional append, matching GitHub 3.28.0 exactly (item_id/seller_identifier are path params). Function code now identical to 3.28.0 (docstring aside). --- fdk_client/platform/catalog/client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fdk_client/platform/catalog/client.py b/fdk_client/platform/catalog/client.py index d6d6fb0b0..0325ec7b2 100644 --- a/fdk_client/platform/catalog/client.py +++ b/fdk_client/platform/catalog/client.py @@ -3451,7 +3451,10 @@ async def updateRealtimeInventory(self, item_id=None, seller_identifier=None, bo schema.dump(schema.load(body)) url_with_params = await create_url_with_params(self._conf.domain, f"/service/platform/catalog/v2.0/company/{self._conf.companyId}/products/{item_id}/inventory/{seller_identifier}", """{"required":[{"description":"Id of the company associated to product that is to be viewed.","in":"path","name":"company_id","required":true,"schema":{"type":"integer"}},{"description":"Item code of the product of which size is to be get.","in":"path","name":"item_id","required":true,"schema":{"type":"integer"}},{"description":"Size Identifier (Seller Identifier or Primary Identifier) of which inventory is to get.","in":"path","name":"seller_identifier","required":true,"schema":{"type":"string"}}],"optional":[],"query":[],"headers":[],"path":[{"description":"Id of the company associated to product that is to be viewed.","in":"path","name":"company_id","required":true,"schema":{"type":"integer"}},{"description":"Item code of the product of which size is to be get.","in":"path","name":"item_id","required":true,"schema":{"type":"integer"}},{"description":"Size Identifier (Seller Identifier or Primary Identifier) of which inventory is to get.","in":"path","name":"seller_identifier","required":true,"schema":{"type":"string"}}]}""", serverType="platform", item_id=item_id, seller_identifier=seller_identifier) - query_string = await create_query_string(item_id=item_id, seller_identifier=seller_identifier) + query_string = await create_query_string() + if query_string: + url_with_params += "?" + query_string + headers = {} headers["Authorization"] = f"Bearer {await self._conf.getAccessToken()}" From 75a5da66efd51bbecbe1056b8af7b311ee1c8db6 Mon Sep 17 00:00:00 2001 From: kinshukshah Date: Thu, 9 Jul 2026 19:35:52 +0530 Subject: [PATCH 3/3] Send item_id & seller_identifier in updateRealtimeInventory query string Restore query params (item_id, seller_identifier) in the signed query string so FP's audit/ledger pipeline is populated for SDK-originated inventory calls. --- fdk_client/platform/catalog/client.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fdk_client/platform/catalog/client.py b/fdk_client/platform/catalog/client.py index 0325ec7b2..d6d6fb0b0 100644 --- a/fdk_client/platform/catalog/client.py +++ b/fdk_client/platform/catalog/client.py @@ -3451,10 +3451,7 @@ async def updateRealtimeInventory(self, item_id=None, seller_identifier=None, bo schema.dump(schema.load(body)) url_with_params = await create_url_with_params(self._conf.domain, f"/service/platform/catalog/v2.0/company/{self._conf.companyId}/products/{item_id}/inventory/{seller_identifier}", """{"required":[{"description":"Id of the company associated to product that is to be viewed.","in":"path","name":"company_id","required":true,"schema":{"type":"integer"}},{"description":"Item code of the product of which size is to be get.","in":"path","name":"item_id","required":true,"schema":{"type":"integer"}},{"description":"Size Identifier (Seller Identifier or Primary Identifier) of which inventory is to get.","in":"path","name":"seller_identifier","required":true,"schema":{"type":"string"}}],"optional":[],"query":[],"headers":[],"path":[{"description":"Id of the company associated to product that is to be viewed.","in":"path","name":"company_id","required":true,"schema":{"type":"integer"}},{"description":"Item code of the product of which size is to be get.","in":"path","name":"item_id","required":true,"schema":{"type":"integer"}},{"description":"Size Identifier (Seller Identifier or Primary Identifier) of which inventory is to get.","in":"path","name":"seller_identifier","required":true,"schema":{"type":"string"}}]}""", serverType="platform", item_id=item_id, seller_identifier=seller_identifier) - query_string = await create_query_string() - if query_string: - url_with_params += "?" + query_string - + query_string = await create_query_string(item_id=item_id, seller_identifier=seller_identifier) headers = {} headers["Authorization"] = f"Bearer {await self._conf.getAccessToken()}"