From 0419f8285a2909bcd07bdf6e7267a00b0070514a Mon Sep 17 00:00:00 2001 From: consultoria-as Date: Thu, 11 Jun 2026 18:39:47 +0000 Subject: [PATCH] fix(ml): add family_name field required for User Products model - ML's new User Products model requires family_name in item body - Use product name as family_name (generic product description) - Keep title for backward compatibility with legacy sellers --- pos/services/marketplace_external_service.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pos/services/marketplace_external_service.py b/pos/services/marketplace_external_service.py index c4f43da..fd79db2 100644 --- a/pos/services/marketplace_external_service.py +++ b/pos/services/marketplace_external_service.py @@ -173,8 +173,13 @@ def build_item_payload( shipping_payload["free_shipping"] = False shipping_payload["methods"] = [] shipping_payload["costs"] = [{"description": "Envio", "cost": str(shipping_cost)}] + # family_name is required for ML's User Products model (enabled sellers). + # It's a generic product description shared across variations. + family_name = inventory_row.get("name") or title + payload = { "title": title, + "family_name": family_name, "category_id": meli_category_id, "price": round(float(price), 2), "currency_id": "MXN", @@ -185,6 +190,7 @@ def build_item_payload( "pictures": [{"source": url} for url in _resolve_image_urls(images, base_url) if url], "shipping": shipping_payload, "attributes": [], + "seller_custom_field": inventory_row.get("part_number") or str(inventory_row.get("id")), } # Collect extra attribute IDs to avoid duplicates