Deluge Help

Create a record in QuickBooks

Table of Contentsup

 Overview

The intuit.quickbooks.create() task is used to add a record in any of the supported modules of your QuickBooks account, directly from your Zoho Creator Application. For example, you can add a new customer, create a new invoice for a specific customer or add a new vendor in quickbooks. To connect Zoho Creator with QuickBooks, create a new connection from the Setup - Connections page.

 Supported Modules

  • Customer
  • Vendor
  • Item
  • Invoice
  • Account
  • Employee
  • Department

 Syntax

<quickbooksResponse> = intuit.quickbooks.create(<quickbooksConnectionName>,<quickbooksModuleName>,<quickbooks CompanyId> , <params>);

where,
<quickbooksResponse> is the map variable returned as response. It contains the details of the newly created record.
<quickbooksConnectionName> refers to the connection name used to connect Zoho Creator with Quickbooks. Create a new connection from the Setup - Connections page.
<quickbooksModuleName> refers to the module name in Quick Books where the record is created.
<quickbooksCompanyId> refers to the unique ID generated by Quickbooks for each account. You can find this under Your Company -> Account and Settings -> Billing & Subscription -> Company Id in your Quickbooks account.
<params> is the map variable that holds the key,value pairs. The map key is the label name in the format as specified in QuickBooks API. The map value is the field value as submitted from a Zoho Creator application. Refer the Quickboks API Guide for the attributes to be specified for each module.

 Example - To create a record

A sample script to add a customer to the Quickbooks customer module is given below. You can execute this script from a Zoho Creator form by adding it to the required workflow section. For example, to add a record to the customer module, based on the values submitted from a Zoho Creator form,

//Declare Map Variable to hold the customer details
Customer_Details = map();

//Add the customer details to the map variable

Customer_Details.put("FamilyName", "George Stepenson");
Customer_Details.put("FullyQualifiedName", "Stepenson ");
Customer_Details.put("DisplayName", "George");

//declare map variable to hold the shipping address
Shipping_Address = map();

//add shipping address to the map variable
Shipping_Address.put("Line1", "312, 10th Avenue");
Shipping_Address.put("Line2", "Rick cross street");
Shipping_Address.put("Line3", "5th Block");
Shipping_Address.put("Country", "USA");

//declare map variable to hold the billing address
Billing_Address = map();

//add billing address to the map variable
Billing_Address.put("Line1", "312, 10th Avenue");
Billing_Address.put("Line2", "Rick cross street");
Billing_Address.put("Line3", "5th Block");
Billing_Address.put("Country", "USA");

//adding the shipping address to customer details
Customer_Details.put("ShipAddr", Shipping_Address);

//adding the billing address to customer details
Customer_Details.put("BillAddr", Billing_Address);

//creating the customer in the Quickbooks Customer module with connecton name "Zoho" and account id "1241802285"
createResponse = intuit.quickbooks.create("Zoho", "Customer", "1241802285", Customer_Details);

 Example - To get the ID of the created record

createResponse = createResponse.get("Customer");
id = createResponse.get("Id");

info id ;

Note

  • In the above example, we have specified the param values directly within quotes. To fetch the param values from a Zoho Creator form, specify the field name used in the form. For example, if Family_Name is the Field Deluge name, the key value pair should be specified in the following format: ("FamilyName", Family_Name)

 Response Format

The response returned by Quickbooks will be in the format given below.

{
"Customer":"{" ShipAddr":"{" Line3":"5th Block",
"Long":"-121.8773403",
"Line2":"Rick cross street",
"Line1":"312, 10th Avenue",
"Lat":"37.3357731",
"Id":"13",
"Country":"USA"
}","PreferredDeliveryMethod":"Email",
"BalanceWithJobs":0,
"DisplayName":"George",
"FullyQualifiedName":"George",
"BillWithParent":false,
"Job":false,
"Active":true,
"MetaData":"{"CreateTime":"2014-08-06T03:19:41-07:00",
"LastUpdatedTime":"2014-08-06T03:19:41-07:00"
}","Taxable":false,
"BillAddr":"{"Line3":"5th Block",
"Long":"-121.8773403",
"Line2":"Rick cross street",
"Line1":"312, 10th Avenue",
"Lat":"37.3357731",
"Id":"12",
"Country":"USA"
}","domain":"QBO",
"SyncToken":"0",
"PrintOnCheckName":"George Stepenson",
"CurrencyRef":"{"name":"Indian Rupee",
"value":"INR"
}","Id":"8",
"FamilyName":"George Stepenson",
"Balance":0,
"sparse":false
}","time":"2014-08-06T03:19:41.084-07:00"
}

If for some reason, the execution fails, the response will be in the following format.

ERROR RESPONSE - For Invalid Parameter Name

{
"Error":"[{
"Detail":"Property Name:Can not instanti specified is unsupported or invalid",
"Message":"Request has invalid or unsupported property",
"code":"2010"
}]"
} module selected.

Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: support@zohocreator.com