Zoho creator integration with zoho books

972 Views Asked by At

So i recently started working with the Zoho platform so im quite new to it, ive been assigned the following task:

Build a Customer form on zoho creator with various different fields (name, company name, billing address and some extra custom fields. Integrate the data from the form to the zoho books platform.

Basically, a user submit the form and on submission a new record on zoho books its created.

enter image description here

enter image description here

My issue, when the form is submitted theres no new customer on zoho books.

Can someone help me please

Thank You

2

There are 2 best solutions below

1
On

There might need to be an authentication token for 'books' included in the headers. Check the books.zoho API documentation to see if there is information regarding creating and using an API token.

Also by adding detailed:true to the invokeurl call you can get some visibility into any information or error-messages in the response from invokeurl. Here is some example code:

response = invokeurl
[
    url : "https://books.zoho.eu/api/v3/contacts?orgainization_id=20077348839
    type :POST
    parameters:datamap
    connection:"books_contact_auth"
    detailed:true
];

// To see all headers and content
info response;
0
On
cpList = List();
firstName = input.Contact_Name.first_name;
lastName = input.Contact_Name.last_name;
contactName = firstName + " " + lastName;
contactMap = Map();
contactMap.put("contact_name",contactName);
contactMap.put("company_name",input.Company_Name);
contactMap.put("website",input.Website);
billingMap = Map();
billingMap.put("zip",input.Billing_Address.postal_Code);
billingMap.put("country",input.Billing_Address.country);
billingMap.put("address",input.Billing_Address.address_line_1);
billingMap.put("street2",input.Billing_Address.address_line_2);
billingMap.put("city",input.Billing_Address.district_city);
billingMap.put("state",input.Billing_Address.state_province);
contactP = Map();
contactP.put("first_name",firstName);
contactP.put("last_name",lastName);
contactP.put("designation",input.Designation);
contactP.put("department",input.Department);
contactP.put("contact_salutation","Mr/Mrs");
contactP.put("mobile",input.Mobile_Phone);
contactP.put("phone",input.Phone_Number);
contactP.put("email",input.Email);
contactP.put("is_primary_contact",true);
contactMap.put("billing_address",billingMap);
cpList.add(contactP);
contactMap.put("contact_persons",cpList);
params = Map();
params.put("JSONString",contactMap);
createContact = invokeurl
[
    url :"https://books.zoho.eu/api/v3/contacts?organization_id="
    type :POST
    parameters:params
    connection:"books"
];

This was the way i was able to make it work.