We can insert or update Zoho CRM product in shopify by creating a custom function in zoho. Below is the custom function which can create a product in shopify. We can invoke it when we create or update a product in Zoho:
void getProductData (int Product_id ) { response_from_shopify=map(); requestHeader=map(); response = zoho.crm.getRecordById("Products",product_id); product_title=response.get("Product Name"); baseEncoded = zoho.encryption.base64Encode(username:pass); //We need to convert username and password in base64 format for authentication in shopify. json={ "product": { "title": product_title, "body_html": "My first product in shopify<\/strong>", "vendor": "Vender_name", "product_type": "product_type", "published": false }} requestHeader.put("Content-Type","application/json"); requestHeader.put("Authorization","Basic " + baseEncoded); response_from_shopify=postUrl(("https://Your_shop_name.myshopify.com/admin/products.json"), json,requestHeader,false); }
Leave A Comment