In Zoho inventory Converting sales return to cerdit note from using Api from Creator Error details: {"code":-1,"message":"Invalid Sales Return ID."}

In Zoho inventory Converting sales return to cerdit note from using Api from Creator Error details: {"code":-1,"message":"Invalid Sales Return ID."}

In Zoho inventory  Converting sales return to cerdit note from using Api from Creator

Error details: {"code":-1,"message":"Invalid Sales Return ID."}

this is  button Function used in the Creator

map Inventory.Create_Credit_note(int CRE_ID)
{
return_value = Map();
Cre_details = Credit_Note[ID == CRE_ID];
// Fetch customer from Zoho Books
customerResp = invokeurl
[
type :GET
connection:"z_books"
];
contacts = customerResp.get("contacts");
if(contacts.size() > 0)
{
customerID = contacts.get(0).get("contact_id");
}
else
{
return_value.put("message","Customer not found in Zoho Books");
return return_value;
}
info customerID;
cnDate = Cre_details.Credit_Note_Date;
cnNo = Cre_details.Credit_Note;
Cn_salesreturnid = Cre_details.Sales_Return_Books_ID;
info Cn_salesreturnid;
Cn_salesorderid = Cre_details.Sales_Order_Books_ID;
info Cn_salesorderid;
// Fetch Sales Order data from Zoho Inventory
Get_Data = invokeurl
[
url :"https://www.zohoapis.com/inventory/v1/salesorders/" + Cn_salesorderid + "?organization_id=3333"
type :GET
connection:"zoh_inv_v3"
];
SO_data = Get_Data.getJSON("salesorder");
invoice_id = ifnull(SO_data.getJSON("invoices").getJSON("invoice_id"),"");
info invoice_id;
invoice_num = ifnull(SO_data.getJSON("invoices").getJSON("invoice_number"),"");
info invoice_num;
Place_Of_Supply = SO_data.getJSON("place_of_supply");
info Place_Of_Supply;
tax_treatment = SO_data.getJSON("tax_treatment");
info tax_treatment;
// Build line items list
itemsList = List();
for each  row in Cre_details.Item_Details
{
if(row.Quantity > 0)
{
itemMap = Map();
itemMap.put("item_id",row.Product.Product_Inventory_ID);
itemMap.put("quantity",row.Quantity);
itemMap.put("rate",row.Rate);
itemMap.put("account_id","2976380000000000388");
    itemMap.put("location_id","2976380000006616056");
itemMap.put("invoice_id",invoice_id);
itemMap.put("invoice_item_id","2976380000029841014");
itemMap.put("salesreturn_item_id","2976380000029833112");
itemMap.put("is_item_shipped",true);
itemMap.put("is_returned_to_stock",true);
// <-- Fixed typo here!
itemsList.add(itemMap);
}
}
// Build credit note data map
cnData = Map();
cnData.put("location_id","2976380000006616056");
cnData.put("customer_id",customerID);
cnData.put("creditnote_number",cnNo);
cnData.put("date",cnDate.toString("yyyy-MM-dd"));
// cnData.put("invoice_number", invoice_num);
// cnData.put("invoice_id", invoice_id);
//cnData.put("salesreturn_id", Cn_salesreturnid);
// cnData.put("salesorder_id", Cn_salesorderid);
cnData.put("place_of_supply",ifnull(Place_Of_Supply,""));
cnData.put("tax_treatment",ifnull(tax_treatment,""));
cnData.put("line_items",itemsList);
info cnData;
cnDataString = cnData.toString();
response = invokeurl
[
type :POST
parameters:cnDataString
connection:"zoh_inv_v3"
];
info response;
if(response.getJSON("code") == 0)
{
Cre_details.Books_Credit_Note=response.get("creditnote").get("creditnote_id");
sales_ret = Sales_Returns[SalesReturn_Inventory_id == Cn_salesreturnid];
if(sales_ret != null)
{
sales_ret.Create_Credit_Note="Created";
sales_ret.Return_Status="CLOSED";
sales_ret.Refund_Status="pending";
sales_ret.Amount_Refunded=Cre_details.Total;
sales_ret.Credit_Note_Books_Id=response.get("creditnote").get("creditnote_id");
}
return_value.put("message",response.get("message"));
sendmail
[
from :zoho.loginuserid
subject :"Credit Note Created: " + Cre_details.Credit_Note
message :"Credit Note Created Successfully: " + response.toString()
]
}
else
{
return_value.put("message",response.get("message"));
sendmail
[
from :zoho.loginuserid
subject :"Error in Credit Note Creation: " + Cre_details.Credit_Note
message :"Error details: " + response.toString()
]
}
return return_value;
}

/// itemMap.put("salesreturn_item_id","2976380000029833112"); 
if i use this line iam getting the error 
iam passing line item id of the sales return  in the sreturn_item_id 
during that time i get the error

    • Recent Topics

    • Team Module Issues?

      We are testing Team Licenses for use by our Customer Service staff. I created a Teamspace called CSR and only assigned two users to this space: Administrator (me) and “Team License Test.” Team License Test is assigned to the Team User profile, with a
    • Announcing new features in Trident for Windows (v.1.41.5.0)

      Hello Community! Trident for Windows just received an exciting update with new ways to collaborate and stay organized without leaving your workspace. Let’s take a look at what’s new! Integrate Zoho Meeting with Trident. You can now schedule, start, and
    • Zoho ERP | Product updates | June 2026

      Hello users, We launched Zoho ERP on January 23, and since then, our goal has been to help businesses streamline and manage their operations with greater efficiency, flexibility, and control. Since the launch, we've continued to enhance the platform every
    • Zia Agent activation in Zoho Desk forces new Organization creation instead of deploying to existing one

      While attempting to complete the deployment and activation sequence of a new Zia Agent within our existing Zoho Desk environment, the activation process failed on the user interface, throwing a generic error (see print). However, despite the activation
    • Allow native Webhooks to authenticate via Connections

      Allow native Webhooks to authenticate via Connections (Basic Auth) instead of plaintext custom headers Summary Please allow native Webhooks (Workflow Rules > Instant Actions > Webhooks) to authenticate against the destination endpoint using the existing
    • How do page versions work these days?

      I thought that Zoho Wiki had the capability to display previous versions of a page, and optionally reinstate them. But I can't find a current doc on this subject -- is there one? From what I remember, that capability was accessed via the Version number
    • Warehouse -> Locations Transition Causing Errors

      After saying "okay" to the transition from 'warehouses' to 'locations', I've now got shipped Sales Orders that I cannot invoice. How does one proceed?
    • Problem with the blueprint flow.

      Scenario: 3 departments in a single environment: A-B-C agents from department 1 D-E-F agents from department 2 G-H agents from department 3 Since we've been using Zohodesk (2023), agents can assign tickets to the correct department using the blueprint
    • Introducing the new Zoho Announcements Hub

      Hello, Enterprise Support Community! We are excited to announce a new way to keep up to date with recent product releases and announcements for the Zoho apps you use on a regular basis. Introducing our new centralized location to bring together all Zoho
    • Ability to run report over 180 days

      Is there a reason Zoho limits the ability to run reports for records older than 180 days? In my view, the only reason I can think of is that it forces us to pay for Advanced Analytics (which I do).
    • Cloning a View

      When I clone a View, it doesn't make a copy; it only creates a new copy with the same default fields as if I were creating a new view. What is the purpose of cloning if it doesn't bring in the same fields? Thanks Rudy
    • New tickets with empty image contents

      Dear Support. From the end of last week onwards customers send messages for new tickets through microsoft graph (by email to support at procert.ch using the procert portal). We have an issue with the emails because well packed images are no longer visible.
    • Images not showing up in Desk tickets

      Customers are trying to send us screenshots to diagnose their issues. But Desk seems to be stopping the images/breaking the link when the ticket comes in. (We can see them in an email box getting cc'd on all tickets...so it's not our mail system). Help!
    • Introducing Databridge for Zoho Creator

      Hello, Enterprise Support Community! We'd like to highlight a recent utility that was released for Zoho Creator, that will allow you to connect external, private datasources with your Creator apps, Databridge. Databridge is an application that will need
    • Zoho HTML editor is removing MSO (Outlook) specific code.

      The ability to add in custom HTML is great. We are using MJML to generate our wonderfully cross platform and responsive email code that works on Act-On, Salesforce, Hubspot, Active Campaign, and lead liaison. The way it supports MSO (Outlook) is it included
    • Retail Payment Receipt

      Hi, So "payment receipts" have a "Retail" template for thermal printers, but the template is configured at A4 paper size!!! How is this retail guys? On the other hand, Invoices have 3 Retail templates which have 3 and 4 inch paper size, perfectly fitting
    • Custom Portal URL causing SAMEORIGIN error with embedded Page snippet

      In my app, I have a page that embeds another page. The URL that I have for the embedded page starts with https://creatorapp.zoho.com but the custom domain I have set up is https://kors.kerndell.com. Because the user logged into the app at https://kors.kerndell.com,
    • Pasting images is a mess

      I’m trying to paste images into my tickets, in the comments field. But when I paste images, they end up in the wrong order or behind the text.
    • Sort by Project Name?

      How the heck do you sort by project name in the task list views??? Seems like this should be a no-brainer?
    • Zoho Contracts Just Got Better! CRM 2.0, Regional Settings & 6 New Reports

      Zoho Contracts is evolving to bring you a more efficient and customizable contract management experience. In this update, we are introducing powerful enhancements to our Zoho CRM integration, regional settings, and reports. Let us explore what’s new:
    • Zoho Finance Limitations 2.0 #5: Can't select "Account Id" if creating Custom Links in Related Panel (but it's available for Custom Buttons)

      When creating a custom link within the Zoho Finance module there is no option to select the "Account Id". If creating a Custom Button, it's available. Any plans to make this available within a reasonable timeframe? ======== Perspective: using Zoho finance
    • Zoho Cliq not working on airplanes

      Hi, My team and I have been having this constant issue of cliq not working when connected to an airplane's wifi. Is there a reason for this? We have tried on different Airlines and it doesn't work on any of them. We need assistance here since we are constantly
    • Can Zoho CRM Emails be used in Zoho Analytics in any capacity?

      We're wanting to display details about Lead Activity in regular reports through Zoho Analytics but we're having difficulty integrating Emails at all. We'd like to be able to note when an email is received and when it is sent somewhere other than just
    • CRM Portal Lookup Linkage and Related Fields

      hi, if someone can give me the right path, would be greatly appreciated. we want to do a customer portal for our partners who we issue work orders for our customers, the linkage via lookup fields Partner -> Work Order -> Customer in our portal, the primary
    • [Free Webinar] New portal page customization in Zoho Creator - Creator Tech Connect

      Hello everyone, We’re excited to invite you to another edition of the Creator Tech Connect webinar. About Creator Tech Connect The Creator Tech Connect series is a free monthly webinar featuring in-depth technical sessions designed for developers, administrators,
    • #11 Stop Absorbing Cost That Client Should Pay

      One of the easiest ways of losing profit in a business isn't losing a customer. It's forgetting to include the expenses that are incurred for half of your customers. A taxi ride to a client location A software subscription purchased for a project. Domain
    • Related products & AI product recommendations through commerce API.

      Hello Zoho team I’m looking to add related products and AI product recommendations to my Zoho Commerce webshop with custom storefront. Is this supported through the API? And if not, is this on your roadmap? Thanks in advance David
    • Can you sell Subscriptions using Zoho Commerce?

      In addition to physical products and the apparently coming soon 'Digital Products', it is possible to sell Subscriptions using Zoho Commerce?
    • Zoho Commerce B2B

      Hello, I have signed up for a Zoho Commerce B2B product demo but it's not clear to me how the B2B experience would look for my customers, in a couple of ways. 1) Some of my customers are on terms and some pay upfront with credit card. How do I hide/show
    • A method for renaming tab titles in Creator to display more relevant information

      Hi Zoho Devs, Updates: Rules Export File attached; you can now import this into Tab Modifier instead of manually entering the rules yourself) 2022-06-08: Updated rules so that crm.zoho.com tabs are not affected; uploaded new .json import file 2022-06-09:
    • Bulk upload images and specifications to products

      Hi, Many users have asked this over the years and I am also asking the same. Is there any way in which we can bulk upload product (variant) images and product specifications. The current way to upload/select image for every variant is too cumbersome.
    • Problem with CRM Connection not Refreshing Token

      I've setup a connection with Zoom in the CRM. I'm using this connection to automate some registrations, so my team doesn't have to manually create them in both the CRM and Zoom. Connection works great in my function until the token expires. It does not refresh and I have to manually revoke the connection and connect it again. I've chatted with Zoho about this and after emailing me that it couldn't be done I asked for specifics on why and they responded. "The connection is CRM is not a feature to
    • Conditional Drop Downs

      Am I the only one that has a problem when setting up the same project for multiple customers - resulting in a HUGE number of projects (e.g. Project A - customer 1, Project A - customer 2, Project A - customer 3 etc.). OR, am I doing it wrong? What results
    • Getting Project Template List using the REST API

      I am trying to confirm that I can use the REST API to create a project using a project template. The API documentation indicates this is possible by providing the Template ID, but it is not clear at all how to get a list of available Project Templates
    • Can't delete shared mailbox emails from mobile app

      I have the mobile app on iOS and cannot seem to find a way to delete an email from a shared mailbox. Is there something I'm missing here? Michael
    • From Zoho CRM to Paper : Design & Print Data Directly using Canvas Print View

      Hello Everyone, We are excited to announce a new addition to your Canvas in Zoho CRM - Print View. Canvas print view helps you transform your custom CRM layouts into print-ready documents, so you can bring your digital data to the physical world with
    • OAuth integration issues

      I'm experiencing persistent OAuth errors when trying to connect Make with Zoho API. I've tried multiple approaches but keep encountering the following issues: First error: 'Invalid Redirect Uri - Redirect URI passed does not match with the one configured'
    • Zoho Books Placeholder: Inventory Counts

      I was hoping to figure out how to find the placeholders for inventory counts by item. We use Location based inventory tracking, so I dont know if that affects things. I want my PDF and Printed PICK LISTS to show the Quantity Available to Pick. I have
    • Blueprint Not Triggering When Lead Status Is Updated by Workflow (IndiaMART Integration)

      I have set up a blueprint that triggers when a lead’s status is “New Lead.” Our CRM is integrated with IndiaMART, and when leads are created from IndiaMART, their Lead Status is initially set to None. To handle this, I created a workflow that automatically
    • Le cauchemar de PEPPOL avec Zoho Books

      Après de longues hésitations — car je défends toujours les produits Zoho malgré leurs imperfections —, je me suis décidé à poster cet avis sur ce forum. En effet, depuis plus de 5 mois, les nombreux soucis relatifs à la facturation par PEPPOL semblent
    • Next Page