How to create zoho books contact from zoho crm custom function
Hi.
I am trying to create a zoho books customer from a zoho crm custom function.
I got it working, but it doesn't add in the contact information section (screenshot attached), just the billing or shipping address sections.
I think i need to add a contact persons in the request to make that happen. But when I try to do that I get this error:
- {"code":1038,"message":"JSON is not well formed"}
that error is from this code:
- contactperson = Map();
- contactperson.put("first_name",fName);
- contactperson.put("last_name",lName);
- contactperson.put("email",email);
- contactperson.put("phone",phone);
- billingAddress = Map();
- billingAddress.put("attention",fName + " " + lName);
- billingAddress.put("address",street);
- billingAddress.put("city",city);
- billingAddress.put("state",state);
- billingAddress.put("zip",zip);
- booksContactInfo = Map();
- booksContactInfo.put("contact_name",fName + " " + lName);
- booksContactInfo.put("contact_persons",contactperson);
- booksContactInfo.put("currency_id",3474557000000000097);
- booksContactInfo.put("billing_address",billingAddress);
- booksContactInfo.put("tax_authority_id",3474557000000360005);
- booksContactInfo.put("tax_id",3474557000000360007);
- booksContactInfo.put("is_taxable",true);
- response = zoho.books.createRecord("Contacts","788939832",booksContactInfo,"zoho_books_create_update");
- info response;
- booksID = response.get("contact").get("contact_id");
- info booksID;
If I comment out the contact persons stuff it created the contact but without the primary contact information section. I attached a screenshot
This seems similar to a lot of things I have done in the past that have worked.
I would appreciate any insight. Thanks so much in advance!
Access your files securely from anywhere
Zoho Developer Community
Deliver unforgettable customer experiences
Deliver unforgettable customer experiences
New to Zoho Marketing Plus?
Everything you need to run your marketing
New to Zoho Marketing Plus?
Everything you need to run your marketing
Zoho Desk Resources
-
Desk Community Learning Series
-
-
-
-
-
-
-
-
-
Sticky Posts
Free Webinar - Digital signatures for digital contract management with Zoho CRM
Hi, Did you know you can seamlessly send and collect signatures on important business documents like business proposals, vendor agreements, sales contracts, invoices, and other inventory documents with Zoho Sign’s extension for Zoho CRM? Join our upcoming
New User Interface for your Email integration in Zoho CRM
Hello folks, As most of you may already know, Zoho Mail recently got a new user interface that's a lot better and easier to use. As a result, this change will affect your email integration with your Zoho CRM account**. If you have your email integration in Zoho CRM set up through POP, your Emails UI in CRM will be moved to the new Zoho Mail UI. We hope that you like the new and improved Emails interface inside Zoho CRM. Feel free to share your feedback by commenting below. **Please note that,
Fetching leads from Zoho CRM into Zoho Creator, automatically
I'd like to pull new leads from the CRM system, into Creator, on a daily basis. Is this possible? Yes, it is possible. Zoho Creator and Zoho CRM are integrated with each other, enabling you to synchronize data between them. This is done by fetching records from CRM into a Zoho Creator form. In order to achieve this, you'll have to configure a workflow alert in Zoho CRM. For instance, you can maintain the lead details in CRM on a separate form in Zoho Creator by fetching the details automatically
Zoho TeamInbox Resources
Zoho DataPrep Resources
Zoho CRM Plus Resources
Zoho Books Resources
Zoho Subscriptions Resources
Zoho Projects Resources
Zoho Sprints Resources
Qntrl Resources
Zoho Creator Resources
Zoho Campaigns Resources
Zoho CRM Resources
Zoho Show Resources
Writer Get Started. Write Away!
Writer is a powerful online word processor, designed for collaborative work.