Push Product Data
The catalog_push_data method in the Groclake library is used to upload or update product information in the catalog lake. It accepts a structured product object containing detailed metadata, inventory information, pricing details, and product attributes.
Python
try:
catalog_push_data = catalog.push(product_object)
print("catalog_push_data----", catalog_push_data)
except Exception as e:
print(f"Error while pushing product data: {e}")
Example of Product Object:
{
"items": [
{
"client_item_id": "99999900003",
"groc_category": "DRESS",
"groc_category_id": "1",
"product_type": "simple",
"name": "blue dress",
"description": "new patter dress",
"short_description": "new patter dress",
"category": "Dress",
"variant_group_id": "11111",
"variant": "Size",
"location_id": [],
"inventory_info": {
"qty": "1",
"min_qty": "10",
"max_qty": "1",
"is_in_stock": "1"
},
"pricing_info": {
"mrp": "599.00",
"sale_price": "299.00",
"discount_start_date": "",
"discount_end_date": "",
"discounted_price": ""
},
"images": [
"https://cdnaz.plotch.io/image/upload/w_551/C/V/PLOsKP4Wlc1724847153_38aacdfdc7af7e11c26263295e196d6fdb0e2b1773fe981eff83ad08a248014a.jpg"
],
"attributes": {
"pattern": "plane",
"material": "Cotten",
"occasion": "casual",
"season": "winter",
"trend": "leates",
"features": "Statable",
"material_finish": "fabric",
"size_chart": "m",
"fulfillment_mode": "test",
"available_on_cod": false,
"cancellable": false,
"rateable": false,
"return_pickup": false,
"return_window": "P7D",
"returnable": true,
"time_to_ship": "P2D",
"common_or_generic_name_of_commodity": "qa",
"imported_product_country_of_origin": "ind",
"manufacturer_address": "KK",
"manufacturer_name": "platiga",
"measure_of_commodity_in_pkg": "bag",
"month_year_of_manufacture_packing_import": "2024",
"nutritional_info": "No",
"additives_info": "Gakas",
"brand_owner_fssai_license_no": "141264",
"other_fssai_license_no": "141264",
"importer_fssai_license_no": "141264",
"is_veg": "False",
"ondc_domain": "store1.samhita.org",
"gender": "Female",
"colour": "blue",
"size": "m",
"brand": "test-12",
"fabric": "cotten",
"strap_material": "string",
"water_resistant": "string",
"display": "string",
"glass_material": "string",
"colour_name": "string",
"sport_type": "string",
"base_metal": "string",
"plating": "string",
"care_instructions": "string",
"wash_type": "string",
"fit": "string",
"collar": "string",
"neck": "string",
"hemline": "string",
"sleeve_length": "string",
"battery_life": "string",
"bluetooth": "string",
"model": "string",
"model_year": "string",
"os_type": "string",
"weight": "string",
"length": "string",
"breadth": "string",
"height": "string",
"refurbished": "string",
"skin_type": "string",
"ingredient": "string",
"formulation": "string",
"veg_nonveg_flag": "string",
"upc_code": "string",
"ram": "string",
"ram_unit": "string",
"storage": "string",
"storage_unit": "string",
"storage_type": "string",
"screen_size": "string",
"cpu": "string",
"os_version": "string",
"form_factor": "string",
"expiry_date": "string",
"best_before": "string",
"marketed_by": "string",
"net_weight": "string",
"number_of_items": "string",
"item_quantity": "string",
"flavour": "string",
"country_of_origin": "string",
"number_of_pieces": "string",
"allergen_information": "string",
"package_information": "string",
"package_weight": "string",
"item_form": "string",
"sodium_mg": "string",
"total_fat_gm": "string",
"total_fat_saturated_gm": "string",
"total_fat_trans_gm": "string",
"energy_kcal": "string",
"protein_gm": "string",
"carbohydrates_gm": "string",
"scent": "string",
"consumer_care_phone": "string",
"consumer_care_email": "string",
"manufacturing_date": "string",
"batch_number": "string",
"product_description": "string",
"product_benefits": "string",
"product_highlights": "string",
"item_volume": "string",
"net_volume": "string",
"product_disclaimer": "string",
"product_instructions": "string",
"more_image_links": "string",
"scan_type": "string",
"GTIN": "string",
"CSIN": "string",
"fssai_number": "string",
"marketing_fssai_number": "string",
"manufacturer_fssai_number": "string"
}
}
]
}
Example App Code
product_object = {
"items": [
{
"client_item_id": "99999900003",
"groc_category": "DRESS",
"groc_category_id": "1",
"product_type": "simple",
"name": "blue dress",
"description": "new patter dress",
"short_description": "new patter dress",
"category": "Dress",
"variant_group_id": "11111",
"variant": "Size",
"location_id": [],
"inventory_info": {
"qty": "1",
"min_qty": "10",
"max_qty": "1",
"is_in_stock": "1"
},
"pricing_info": {
"mrp": "599.00",
"sale_price": "299.00",
"discount_start_date": "",
"discount_end_date": "",
"discounted_price": ""
},
"images": [
"https://cdnaz.plotch.io/image/upload/w_551/C/V/PLOsKP4Wlc1724847153_38aacdfdc7af7e11c26263295e196d6fdb0e2b1773fe981eff83ad08a248014a.jpg"
],
"attributes": {
"pattern": "plane",
"material": "Cotten",
"occasion": "casual",
"season": "winter",
"trend": "leates",
"features": "Statable",
"material_finish": "fabric",
"size_chart": "m",
"fulfillment_mode": "test",
"available_on_cod": False,
"cancellable": False,
"rateable": False,
"return_pickup": False,
"return_window": "P7D",
"returnable": True,
"time_to_ship": "P2D",
"common_or_generic_name_of_commodity": "qa",
"imported_product_country_of_origin": "ind",
"manufacturer_address": "KK",
"manufacturer_name": "platiga",
"measure_of_commodity_in_pkg": "bag",
"month_year_of_manufacture_packing_import": "2024",
"nutritional_info": "No",
"additives_info": "Gakas",
"brand_owner_fssai_license_no": "141264",
"other_fssai_license_no": "141264",
"importer_fssai_license_no": "141264",
"is_veg": "False",
"ondc_domain": "store1.samhita.org",
"gender": "Female",
"colour": "blue",
"size": "m",
"brand": "test-12",
"fabric": "cotten",
"strap_material": "string",
"water_resistant": "string",
"display": "string",
"glass_material": "string",
"colour_name": "string",
"sport_type": "string",
"base_metal": "string",
"plating": "string",
"care_instructions": "string",
"wash_type": "string",
"fit": "string",
"collar": "string",
"neck": "string",
"hemline": "string",
"sleeve_length": "string",
"battery_life": "string",
"bluetooth": "string",
"model": "string",
"model_year": "string",
"os_type": "string",
"weight": "string",
"length": "string",
"breadth": "string",
"height": "string",
"refurbished": "string",
"skin_type": "string",
"ingredient": "string",
"formulation": "string",
"veg_nonveg_flag": "string",
"upc_code": "string",
"ram": "string",
"ram_unit": "string",
"storage": "string",
"storage_unit": "string",
"storage_type": "string",
"screen_size": "string",
"cpu": "string",
"os_version": "string",
"form_factor": "string",
"expiry_date": "string",
"best_before": "string",
"marketed_by": "string",
"net_weight": "string",
"number_of_items": "string",
"item_quantity": "string",
"flavour": "string",
"country_of_origin": "string",
"number_of_pieces": "string",
"allergen_information": "string",
"package_information": "string",
"package_weight": "string",
"item_form": "string",
"sodium_mg": "string",
"total_fat_gm": "string",
"total_fat_saturated_gm": "string",
"total_fat_trans_gm": "string",
"energy_kcal": "string",
"protein_gm": "string",
"carbohydrates_gm": "string",
"scent": "string",
"consumer_care_phone": "string",
"consumer_care_email": "string",
"manufacturing_date": "string",
"batch_number": "string",
"product_description": "string",
"product_benefits": "string",
"product_highlights": "string",
"item_volume": "string",
"net_volume": "string",
"product_disclaimer": "string",
"product_instructions": "string",
"more_image_links": "string",
"scan_type": "string",
"GTIN": "string",
"CSIN": "string",
"fssai_number": "string",
"marketing_fssai_number": "string",
"manufacturer_fssai_number": "string"
}
}
]
}
catalog_push_data = catalog.push(product_object)
print("catalog_push_data----", catalog_push_data)
#RESPONSE FROM CATALOG PUSH
# {'catalog_push_request_id': 'e5e385f2-4dee-48c5-89fb-ed46392c692a', 'catalog_push_received_product_count': '1', 'catalog_push_success_product_count': '1', 'catalog_push_failed_product_count': '0', 'items': [{'99999900003': '1214468138'}]}
Last updated