This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Working with Items in Zoho Books
Overview
The following operations allow you to work with items. Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with items, see Sample configuration.
Operation | Description |
---|---|
Creates a new item. | |
getItem | Retrieves the details of an item. |
listItems | Retrieves the list of all items with pagination. |
Operation details
This section provides further details on the operations related to items.
Creating a new item
The createItem
operation creates a new item.
<zohobooks.createItem> <itemName>{$ctx:itemName}</itemName> <description>{$ctx:description}</description> <accountId>{$ctx:accountId}</accountId> <taxId>{$ctx:taxId}</taxId> <isTaxable>{$ctx:isTaxable}</isTaxable> <taxExemptionId>{$ctx:taxExemptionId}</taxExemptionId> <avataxTaxCode>{$ctx:avataxTaxCode}</avataxTaxCode> <avataxUseCode>{$ctx:avataxUseCode}</avataxUseCode> <productType>{$ctx:productType}</productType> <itemType>{$ctx:itemType}</itemType> <purchaseRate>{$ctx:purchaseRate}</purchaseRate> <purchaseAccountId>{$ctx:purchaseAccountId}</purchaseAccountId> <inventoryAccountId>{$ctx:inventoryAccountId}</inventoryAccountId> <vendorId>{$ctx:vendorId}</vendorId> <reorderLevel>{$ctx:reorderLevel}</reorderLevel> <initialStock>{$ctx:initialStock}</initialStock> <initialStockRate>{$ctx:initialStockRate}</initialStockRate> <purchaseDescription>{$ctx:purchaseDescription}</purchaseDescription> <rate>{$ctx:rate}</rate> <unit>{$ctx:unit}</unit> <taxPercentage>{$ctx:taxPercentage}</taxPercentage> <purchaseAccountName>{$ctx:purchaseAccountName}</purchaseAccountName> </zohobooks.createItem>
Properties
The name of the item.itemName:
The description of the item.description:
The ID of the account with which the item has to be associated.accountId:
The ID of the tax to be associated with the item (not applicable for US Edition).taxId:
The Boolean value to track the taxability of the item (US Edition only).isTaxable:
The ID of the tax exemption. Mandatory, if "is_taxable" is "false" (US Edition only).taxExemptionId:
A unique label used to group Items (products, services, or charges) together (Avalara integration only).avataxTaxCode:
Groups similar customers for exemption purposes. It is a custom value that links customers to a tax rule (Avalara integration only).avataxUseCode:
The product type of an item. Items with the type "digital_service" are treated as a service except for the cases where non-UK VAT is applied to the "digital_service" items (UK Edition only).productType:
The type of the item. Allowed values: "sales", "purchase", "sales_and_purchase" and "inventory". Default value: "sales".itemType:
The purchase price of the item (Mandatory, if "item_type" is "purchase", "sales and purchase", or "inventory").purchaseRate:
The ID of the COGS account with which the item has to be associated (Mandatory, if "item_type" is "purchase", "sales and purchase" or "inventory").purchaseAccountId:
The ID of the stock account with which the item has to be associated (Mandatory, if "item_type" is "inventory").inventoryAccountId:
The preferred vendor ID.vendorId:
The reorder level of the item.reorderLevel:
The opening stock of the item.initialStock:
The unit price of the opening stock.initialStockRate:
The purchase description of the Item.purchaseDescription:
The price of the item.rate:
The unit to measure the quantity of the item.unit:
The percentage of tax to be added to the item.taxPercentage:
The name of the purchase account.purchaseAccountName:
Sample request
Following is a sample REST/JSON request that can be handled by the createItem operation.
{ "apiUrl": "https://books.zoho.com", "authToken": "594cb85213f98ce15dfa9fe92330658a", "organizationId": "46892166", "itemName": "iPhone 1.7", "description": "Description for iPhone 1.7", "rate": 17.00, "purchaseAccountId": "ereer", "inventoryAccountId": "ererer", "reorderLevel": "erere", "accountId": "rerere", "purchaseDescription": "eer", "isTaxable": true, "purchaseRate": "erer", "itemType": "erer", "initialStockRate": "ererer", "initialStock": "ereer", "vendorId": "erere", "productType": "erere", "avataxTaxCode": "errer", "taxId": "ereer", "taxExemptionId": "ererer", "avataxUseCode": "erre", "unit": "ereer", "taxPercentage": "ererer", "purchaseAccountName": "erre" }
Related Zoho Books documentation
https://www.zoho.com/books/api/v3/settings/items/#create-an-item
Retrieving the details of an item
The getItem operation retrieves the details of an item.
<zohobooks.getItem> <itemId>{$ctx:itemId}</itemId> </zohobooks.getItem>
Properties
The ID of the item to be retrieved.itemId:
Sample request
Following is a sample REST/JSON request that can be handled by the getItem operation.
{ "authToken": "594cb85213f98ce15dfa9fe92330658a", "apiUrl": "https://books.zoho.com", "organizationId": "46892166", "itemId": "" }
Related Zoho Books documentation
https://www.zoho.com/books/api/v3/settings/items/#get-an-item
Retrieving the list of items with pagination
The
operation retrieves the list of all active items with pagination.listItems
<zohobooks.listItems> <page>{$ctx:page}</page> <perPage>{$ctx:perPage}</perPage> <appliedFilter>{$ctx:appliedFilter}</appliedFilter> <sortOrder>{$ctx:sortOrder}</sortOrder> <sortColumn>{$ctx:sortColumn}</sortColumn> <searchText>{$ctx:searchText}</searchText> <filterBy>{$ctx:filterBy}</filterBy> <taxName>{$ctx:taxName}</taxName> <taxId>{$ctx:taxId}</taxId> <name>{$ctx:name}</name> <nameStartsWith>{$ctx:nameStartsWith}</nameStartsWith> <nameContains>{$ctx:nameContains}</nameContains> <rate>{$ctx:rate}</rate> <rateLessThan>{$ctx:rateLessThan}</rateLessThan> <rateLessEquals>{$ctx:rateLessEquals}</rateLessEquals> <rateGreaterEquals>{$ctx:rateGreaterEquals}</rateGreaterEquals> <accountId>{$ctx:accountId}</accountId> <taxExemptionId>{$ctx:taxExemptionId}</taxExemptionId> <isTaxable>{$ctx:isTaxable}</isTaxable> <description>{$ctx:description}</description> <descriptionStartsWith>{$ctx:descriptionStartsWith}</descriptionStartsWith> <descriptionContains>{$ctx:descriptionContains}</descriptionContains> <rateGreaterThan>{$ctx:rateGreaterThan}</rateGreaterThan> </zohobooks.listItems>
Properties
The number of the page to be returned - pagination value.page:
Specifies how many entries should be returned in the response.perPage:
Filters to be applied while querying.appliedFilter:
The order of sorting - "ascending" or "descending".sortOrder:
Sort contacts. Allowed values: "contact_name", "first_name", "last_name", "email", "outstanding_receivable_amount", "outstanding_payable_amount", "created_time" and "last_modified_time".sortColumn:
Searches contacts by contact name or notes.searchText:
Filters contacts by status. Allowed values: "Status.All", "Status.Active", "Status.Inactive", "Status.Duplicate", "Status.Customers", "Status.Vendors" and "Status".filterBy:
The name of the tax to be associated.taxName:
The ID of the tax or tax group that can be collected from the contact. The tax can be given only if "is_taxable" is "true" (US Edition only).taxId:
Searches items by name.name:
Searches items by name starting with this value.nameStartsWith:
Searches items by name containing this value.nameContains:
Searches items by rate.rate:
Searches items by rate less than this value.rateLessThan:
Searches items by rate less than or equal to this value.rateLessEquals:
Searches items by rate greater than or equal to this value.rateGreaterEquals:
Searches items by account ID.accountId:
The ID of the tax exemption (US Edition only).taxExemptionId:
The Boolean value to track the taxability of the customer (US Edition only).isTaxable:
Searches items by description.description:
Searches items by description starting with this value.descriptionStartsWith:
Searches items by description containing this value.descriptionContains:
Searches items by rate greater than this value.rateGreaterThan:
Sample request
Following is a sample REST/JSON request that can be handled by the
operation.listTrainings
{ "apiUrl": "https://api.citrixonline.com", "accessToken": "zR14S7cGFWC0UXuujbYP5DGKbeOR", "organizerKey": "3596608450020387846", "grantType": "password", "userId": "wso2connector@gmail.com", "password": "1qaz2wsx@", "clientId": "2UVpqLxGDrkcQvs0JGvUMDyO1Mha9FT0" }
Related Zoho Books documentation
https://www.zoho.com/books/api/v3/settings/items/#list-items
Sample configuration
Following is a sample proxy service that illustrates how to connect to Zoho Books with the init
operation and use the createItem
operation. The sample request for this proxy can be found in the createItem sample request. You can use this sample as a template for using other operations in this category.
<?xml version="1.0" encoding="UTF-8"?> <proxy name="zohobooks_createItem" startOnLoad="true" statistics="disable" trace="disable" transports="https,http" xmlns="http://ws.apache.org/ns/synapse"> <target> <inSequence> <property name="apiUrl" expression="json-eval($.apiUrl)"/> <property name="authToken" expression="json-eval($.authToken)"/> <property name="organizationId" expression="json-eval($.organizationId)"/> <property name="itemName" expression="json-eval($.itemName)"/> <property name="description" expression="json-eval($.description)"/> <property name="accountId" expression="json-eval($.accountId)"/> <property name="taxId" expression="json-eval($.taxId)"/> <property name="isTaxable" expression="json-eval($.isTaxable)"/> <property name="taxExemptionId" expression="json-eval($.taxExemptionId)"/> <property name="avataxTaxCode" expression="json-eval($.avataxTaxCode)"/> <property name="avataxUseCode" expression="json-eval($.avataxUseCode)"/> <property name="productType" expression="json-eval($.productType)"/> <property name="itemType" expression="json-eval($.itemType)"/> <property name="purchaseRate" expression="json-eval($.purchaseRate)"/> <property name="purchaseAccountId" expression="json-eval($.purchaseAccountId)"/> <property name="inventoryAccountId" expression="json-eval($.inventoryAccountId)"/> <property name="vendorId" expression="json-eval($.vendorId)"/> <property name="reorderLevel" expression="json-eval($.reorderLevel)"/> <property name="initialStock" expression="json-eval($.initialStock)"/> <property name="initialStockRate" expression="json-eval($.initialStockRate)"/> <property name="purchaseDescription" expression="json-eval($.purchaseDescription)"/> <property name="rate" expression="json-eval($.rate)"/> <property name="unit" expression="json-eval($.unit)"/> <property name="taxPercentage" expression="json-eval($.taxPercentage)"/> <property name="purchaseAccountName" expression="json-eval($.purchaseAccountName)"/> <zohobooks.init> <apiUrl>{$ctx:apiUrl}</apiUrl> <authToken>{$ctx:authToken}</authToken> <organizationId>{$ctx:organizationId}</organizationId> </zohobooks.init> <zohobooks.createItem> <itemName>{$ctx:itemName}</itemName> <description>{$ctx:description}</description> <accountId>{$ctx:accountId}</accountId> <taxId>{$ctx:taxId}</taxId> <isTaxable>{$ctx:isTaxable}</isTaxable> <taxExemptionId>{$ctx:taxExemptionId}</taxExemptionId> <avataxTaxCode>{$ctx:avataxTaxCode}</avataxTaxCode> <avataxUseCode>{$ctx:avataxUseCode}</avataxUseCode> <productType>{$ctx:productType}</productType> <itemType>{$ctx:itemType}</itemType> <purchaseRate>{$ctx:purchaseRate}</purchaseRate> <purchaseAccountId>{$ctx:purchaseAccountId}</purchaseAccountId> <inventoryAccountId>{$ctx:inventoryAccountId}</inventoryAccountId> <vendorId>{$ctx:vendorId}</vendorId> <reorderLevel>{$ctx:reorderLevel}</reorderLevel> <initialStock>{$ctx:initialStock}</initialStock> <initialStockRate>{$ctx:initialStockRate}</initialStockRate> <purchaseDescription>{$ctx:purchaseDescription}</purchaseDescription> <rate>{$ctx:rate}</rate> <unit>{$ctx:unit}</unit> <taxPercentage>{$ctx:taxPercentage}</taxPercentage> <purchaseAccountName>{$ctx:purchaseAccountName}</purchaseAccountName> </zohobooks.createItem> <respond/> </inSequence> <outSequence> <send/> </outSequence> </target> <description/> </proxy>