Items
Items are the products or services that you sell to your customers.
Attribute
active
or inactive
goods
or service
or digital_service
. For SouthAfrica Edition:
service
, goods
, capital_service
and capital_goods
active
or inactive
{
"item_id": 45667789900,
"name": "Hard Drive",
"status": "active",
"description": "500GB",
"rate": 120,
"unit": "100GB",
"tax_id": 982000000037049,
"purchase_tax_rule_id": 127919000000106780,
"sales_tax_rule_id": 127919000000106780,
"tax_name": "Sales Tax",
"hsn_or_sac": "string",
"sat_item_key_code": "string",
"unitkey_code": "string",
"tax_percentage": "70%",
"tax_type": "tax",
"sku": "s12345",
"product_type": "goods",
"item_tax_preferences": [
{
"tax_id": 982000000037049,
"tax_specification": "intra"
}
],
"custom_fields": [
{
"customfield_id": "46000000012845",
"value": "Normal"
}
],
"warehouses": [
{
"warehouse_id": "",
"warehouse_name": "",
"status": "active",
"is_primary": false,
"warehouse_stock_on_hand": "",
"warehouse_available_stock": "",
"warehouse_actual_available_stock": ""
}
]
}
Create an Item
Create a new item.
OAuth Scope : ZohoBooks.settings.CREATE
Arguments
goods
or service
or digital_service
. For SouthAfrica Edition:
service
, goods
, capital_service
and capital_goods
is_taxable
is false.is_taxable
is false.sales
,purchases
,sales_and_purchases
and inventory
. Default value will be sales
.parameters_data='{"field1":"value1","field2":"value2"}';
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/items?organization_id=10234695"
type: POST
headers: headers_data
content-type: application/json
parameters: parameters_data
connection: <connection_name>
]
info response;
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}");
Request request = new Request.Builder()
.url("https://www.zohoapis.com/books/v3/items?organization_id=10234695")
.post(body)
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'POST',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
'content-type': 'application/json'
},
body: '{"field1":"value1","field2":"value2"}'
};
fetch('https://www.zohoapis.com/books/v3/items?organization_id=10234695', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}"
headers = {
'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
'content-type': "application/json"
}
conn.request("POST", "/books/v3/items?organization_id=10234695", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "POST",
"hostname": "www.zohoapis.com",
"port": null,
"path": "/books/v3/items?organization_id=10234695",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
"content-type": "application/json"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({field1: 'value1', field2: 'value2'}));
req.end();
curl --request POST \
--url 'https://www.zohoapis.com/books/v3/items?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
{
"name": "Hard Drive",
"rate": 120,
"description": "500GB",
"tax_id": 982000000037049,
"purchase_tax_rule_id": 127919000000106780,
"sales_tax_rule_id": 127919000000106780,
"tax_percentage": "70%",
"sku": "s12345",
"product_type": "goods",
"hsn_or_sac": "string",
"sat_item_key_code": "string",
"unitkey_code": "string",
"is_taxable": true,
"tax_exemption_id": "string",
"purchase_tax_exemption_id": "string",
"account_id": " ",
"avatax_tax_code": 982000000037049,
"avatax_use_code": 982000000037049,
"item_type": " ",
"purchase_description": " ",
"purchase_rate": " ",
"purchase_account_id": " ",
"inventory_account_id": " ",
"vendor_id": " ",
"reorder_level": " ",
"initial_stock": " ",
"initial_stock_rate": " ",
"item_tax_preferences": [
{
"tax_id": 982000000037049,
"tax_specification": "intra"
}
],
"custom_fields": [
{
"customfield_id": "46000000012845",
"value": "Normal"
}
]
}
{
"code": 0,
"message": "The item has been added.",
"item": {
"item_id": 45667789900,
"name": "Hard Drive",
"status": "active",
"description": "500GB",
"rate": 120,
"unit": "100GB",
"tax_id": 982000000037049,
"purchase_tax_rule_id": 127919000000106780,
"sales_tax_rule_id": 127919000000106780,
"tax_name": "Sales Tax",
"hsn_or_sac": "string",
"sat_item_key_code": "string",
"unitkey_code": "string",
"tax_percentage": "70%",
"tax_type": "tax",
"sku": "s12345",
"product_type": "goods",
"item_tax_preferences": [
{
"tax_id": 982000000037049,
"tax_specification": "intra"
}
],
"custom_fields": [
{
"customfield_id": "46000000012845",
"value": "Normal"
}
],
"warehouses": [
{
"warehouse_id": "",
"warehouse_name": "",
"status": "active",
"is_primary": false,
"warehouse_stock_on_hand": "",
"warehouse_available_stock": "",
"warehouse_actual_available_stock": ""
}
]
}
}
Update an item using a custom field's unique value
A custom field will have unique values if it's configured to not accept duplicate values. Now, you can use that custom field's value to update an item by providing its API name in the X-Unique-Identifier-Key header and its value in the X-Unique-Identifier-Value header. Based on this value, the corresponding item will be retrieved and updated. Additionally, there is an optional X-Upsert header. If the X-Upsert header is true and the custom field's unique value is not found in any of the existing items, a new item will be created if the necessary payload details are available
OAuth Scope : ZohoBooks.settings.UPDATE
Arguments
goods
or service
or digital_service
. For SouthAfrica Edition:
service
, goods
, capital_service
and capital_goods
is_taxable
is false.is_taxable
is false.sales
,purchases
,sales_and_purchases
and inventory
. Default value will be sales
.parameters_data='{"field1":"value1","field2":"value2"}';
headers_data = Map();
headers_data.put("X-Unique-Identifier-Key", "cf_unique_cf");
headers_data.put("X-Unique-Identifier-Value", "unique Value");
headers_data.put("X-Upsert", "true");
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/items?organization_id=10234695"
type: PUT
headers: headers_data
content-type: application/json
parameters: parameters_data
connection: <connection_name>
]
info response;
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}");
Request request = new Request.Builder()
.url("https://www.zohoapis.com/books/v3/items?organization_id=10234695")
.put(body)
.addHeader("X-Unique-Identifier-Key", "cf_unique_cf")
.addHeader("X-Unique-Identifier-Value", "unique Value")
.addHeader("X-Upsert", "true")
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'PUT',
headers: {
'X-Unique-Identifier-Key': 'cf_unique_cf',
'X-Unique-Identifier-Value': 'unique Value',
'X-Upsert': 'true',
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
'content-type': 'application/json'
},
body: '{"field1":"value1","field2":"value2"}'
};
fetch('https://www.zohoapis.com/books/v3/items?organization_id=10234695', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}"
headers = {
'X-Unique-Identifier-Key': "cf_unique_cf",
'X-Unique-Identifier-Value': "unique Value",
'X-Upsert': "true",
'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
'content-type': "application/json"
}
conn.request("PUT", "/books/v3/items?organization_id=10234695", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "PUT",
"hostname": "www.zohoapis.com",
"port": null,
"path": "/books/v3/items?organization_id=10234695",
"headers": {
"X-Unique-Identifier-Key": "cf_unique_cf",
"X-Unique-Identifier-Value": "unique Value",
"X-Upsert": "true",
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
"content-type": "application/json"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({field1: 'value1', field2: 'value2'}));
req.end();
curl --request PUT \
--url 'https://www.zohoapis.com/books/v3/items?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'X-Unique-Identifier-Key: cf_unique_cf' \
--header 'X-Unique-Identifier-Value: unique Value' \
--header 'X-Upsert: true' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
{
"name": "Hard Drive",
"rate": 120,
"description": "500GB",
"tax_id": 982000000037049,
"purchase_tax_rule_id": 127919000000106780,
"sales_tax_rule_id": 127919000000106780,
"tax_percentage": "70%",
"hsn_or_sac": "string",
"sat_item_key_code": "string",
"unitkey_code": "string",
"sku": "s12345",
"product_type": "goods",
"is_taxable": true,
"tax_exemption_id": "string",
"purchase_tax_exemption_id": "string",
"account_id": " ",
"avatax_tax_code": 982000000037049,
"avatax_use_code": 982000000037049,
"item_type": " ",
"purchase_description": " ",
"purchase_rate": " ",
"purchase_account_id": " ",
"inventory_account_id": " ",
"vendor_id": " ",
"reorder_level": " ",
"initial_stock": " ",
"initial_stock_rate": " ",
"item_tax_preferences": [
{
"tax_id": 982000000037049,
"tax_specification": "intra"
}
],
"custom_fields": [
{
"customfield_id": "46000000012845",
"value": "Normal"
}
]
}
{
"code": 0,
"message": "Item details have been saved.",
"item": {
"item_id": 45667789900,
"name": "Hard Drive",
"status": "active",
"description": "500GB",
"rate": 120,
"unit": "100GB",
"hsn_or_sac": "string",
"sat_item_key_code": "string",
"unitkey_code": "string",
"tax_id": 982000000037049,
"purchase_tax_rule_id": 127919000000106780,
"sales_tax_rule_id": 127919000000106780,
"tax_name": "Sales Tax",
"tax_percentage": "70%",
"tax_type": "tax",
"sku": "s12345",
"product_type": "goods",
"item_tax_preferences": [
{
"tax_id": 982000000037049,
"tax_specification": "intra"
}
],
"warehouses": [
{
"warehouse_id": "",
"warehouse_name": "",
"status": "active",
"is_primary": false,
"warehouse_stock_on_hand": "",
"warehouse_available_stock": "",
"warehouse_actual_available_stock": ""
}
]
}
}
List items
Get the list of all active items with pagination.
OAuth Scope : ZohoBooks.settings.READ
Query Parameters
name_startswith
and name_contains
description_startswith
and description_contains
rate_less_than
, rate_less_equals
, rate_greater_than
and rate_greater_equals
is_taxable
is false.Status.All
, Status.Active
and Status.Inactive
name
, rate
and tax_name
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/items?organization_id=10234695"
type: GET
headers: headers_data
connection: <connection_name>
]
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://www.zohoapis.com/books/v3/items?organization_id=10234695")
.get()
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'GET',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://www.zohoapis.com/books/v3/items?organization_id=10234695', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }
conn.request("GET", "/books/v3/items?organization_id=10234695", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "GET",
"hostname": "www.zohoapis.com",
"port": null,
"path": "/books/v3/items?organization_id=10234695",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
curl --request GET \
--url 'https://www.zohoapis.com/books/v3/items?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "success",
"items": [
{
"item_id": 45667789900,
"name": "Hard Drive",
"status": "active",
"description": "500GB",
"rate": 120,
"unit": "100GB",
"tax_id": 982000000037049,
"purchase_tax_rule_id": 127919000000106780,
"sales_tax_rule_id": 127919000000106780,
"tax_name": "Sales Tax",
"tax_percentage": "70%",
"tax_type": "tax",
"sku": "s12345",
"product_type": "goods",
"sat_item_key_code": "string",
"unitkey_code": "string",
"custom_fields": [
{
"customfield_id": "46000000012845",
"value": "Normal"
}
]
},
{...},
{...}
],
"page_context": {
"page": 1,
"per_page": 200,
"has_more_page": false,
"report_name": "Items",
"sort_column": "string",
"sort_order": "A"
}
}
Update an item
Update the details of an item.
OAuth Scope : ZohoBooks.settings.UPDATE
Arguments
goods
or service
or digital_service
. For SouthAfrica Edition:
service
, goods
, capital_service
and capital_goods
is_taxable
is false.is_taxable
is false.sales
,purchases
,sales_and_purchases
and inventory
. Default value will be sales
.parameters_data='{"field1":"value1","field2":"value2"}';
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/items/45667789900?organization_id=10234695"
type: PUT
headers: headers_data
content-type: application/json
parameters: parameters_data
connection: <connection_name>
]
info response;
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}");
Request request = new Request.Builder()
.url("https://www.zohoapis.com/books/v3/items/45667789900?organization_id=10234695")
.put(body)
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'PUT',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
'content-type': 'application/json'
},
body: '{"field1":"value1","field2":"value2"}'
};
fetch('https://www.zohoapis.com/books/v3/items/45667789900?organization_id=10234695', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}"
headers = {
'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
'content-type': "application/json"
}
conn.request("PUT", "/books/v3/items/45667789900?organization_id=10234695", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "PUT",
"hostname": "www.zohoapis.com",
"port": null,
"path": "/books/v3/items/45667789900?organization_id=10234695",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
"content-type": "application/json"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({field1: 'value1', field2: 'value2'}));
req.end();
curl --request PUT \
--url 'https://www.zohoapis.com/books/v3/items/45667789900?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
{
"name": "Hard Drive",
"rate": 120,
"description": "500GB",
"tax_id": 982000000037049,
"purchase_tax_rule_id": 127919000000106780,
"sales_tax_rule_id": 127919000000106780,
"tax_percentage": "70%",
"hsn_or_sac": "string",
"sat_item_key_code": "string",
"unitkey_code": "string",
"sku": "s12345",
"product_type": "goods",
"is_taxable": true,
"tax_exemption_id": "string",
"purchase_tax_exemption_id": "string",
"account_id": " ",
"avatax_tax_code": 982000000037049,
"avatax_use_code": 982000000037049,
"item_type": " ",
"purchase_description": " ",
"purchase_rate": " ",
"purchase_account_id": " ",
"inventory_account_id": " ",
"vendor_id": " ",
"reorder_level": " ",
"initial_stock": " ",
"initial_stock_rate": " ",
"item_tax_preferences": [
{
"tax_id": 982000000037049,
"tax_specification": "intra"
}
],
"custom_fields": [
{
"customfield_id": "46000000012845",
"value": "Normal"
}
]
}
{
"code": 0,
"message": "Item details have been saved.",
"item": {
"item_id": 45667789900,
"name": "Hard Drive",
"status": "active",
"description": "500GB",
"rate": 120,
"unit": "100GB",
"hsn_or_sac": "string",
"sat_item_key_code": "string",
"unitkey_code": "string",
"tax_id": 982000000037049,
"purchase_tax_rule_id": 127919000000106780,
"sales_tax_rule_id": 127919000000106780,
"tax_name": "Sales Tax",
"tax_percentage": "70%",
"tax_type": "tax",
"sku": "s12345",
"product_type": "goods",
"item_tax_preferences": [
{
"tax_id": 982000000037049,
"tax_specification": "intra"
}
],
"warehouses": [
{
"warehouse_id": "",
"warehouse_name": "",
"status": "active",
"is_primary": false,
"warehouse_stock_on_hand": "",
"warehouse_available_stock": "",
"warehouse_actual_available_stock": ""
}
]
}
}
Get an item
Details of an existing item.
OAuth Scope : ZohoBooks.settings.READ
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/items/45667789900?organization_id=10234695"
type: GET
headers: headers_data
connection: <connection_name>
]
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://www.zohoapis.com/books/v3/items/45667789900?organization_id=10234695")
.get()
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'GET',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://www.zohoapis.com/books/v3/items/45667789900?organization_id=10234695', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }
conn.request("GET", "/books/v3/items/45667789900?organization_id=10234695", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "GET",
"hostname": "www.zohoapis.com",
"port": null,
"path": "/books/v3/items/45667789900?organization_id=10234695",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
curl --request GET \
--url 'https://www.zohoapis.com/books/v3/items/45667789900?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "success",
"item": {
"item_id": 45667789900,
"name": "Hard Drive",
"status": "active",
"description": "500GB",
"rate": 120,
"unit": "100GB",
"hsn_or_sac": "string",
"sat_item_key_code": "string",
"unitkey_code": "string",
"tax_id": 982000000037049,
"purchase_tax_rule_id": 127919000000106780,
"sales_tax_rule_id": 127919000000106780,
"tax_name": "Sales Tax",
"tax_percentage": "70%",
"tax_type": "tax",
"sku": "s12345",
"product_type": "goods",
"item_tax_preferences": [
{
"tax_id": 982000000037049,
"tax_specification": "intra"
}
],
"warehouses": [
{
"warehouse_id": "",
"warehouse_name": "",
"status": "active",
"is_primary": false,
"warehouse_stock_on_hand": "",
"warehouse_available_stock": "",
"warehouse_actual_available_stock": ""
}
]
}
}
Delete an item
Delete the item created.items that are part of transaction cannot be deleted.
OAuth Scope : ZohoBooks.settings.DELETE
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/items/45667789900?organization_id=10234695"
type: DELETE
headers: headers_data
connection: <connection_name>
]
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://www.zohoapis.com/books/v3/items/45667789900?organization_id=10234695")
.delete(null)
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'DELETE',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://www.zohoapis.com/books/v3/items/45667789900?organization_id=10234695', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }
conn.request("DELETE", "/books/v3/items/45667789900?organization_id=10234695", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "DELETE",
"hostname": "www.zohoapis.com",
"port": null,
"path": "/books/v3/items/45667789900?organization_id=10234695",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
curl --request DELETE \
--url 'https://www.zohoapis.com/books/v3/items/45667789900?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "The item has been deleted."
}
Update custom field in existing items
Update the value of the custom field in existing items.
OAuth Scope : ZohoBooks.settings.UPDATE
Arguments
Query Parameters
parameters_data='{"field1":"value1","field2":"value2"}';
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/item/45667789900/customfields?organization_id=10234695"
type: PUT
headers: headers_data
content-type: application/json
parameters: parameters_data
connection: <connection_name>
]
info response;
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}");
Request request = new Request.Builder()
.url("https://www.zohoapis.com/books/v3/item/45667789900/customfields?organization_id=10234695")
.put(body)
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'PUT',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
'content-type': 'application/json'
},
body: '{"field1":"value1","field2":"value2"}'
};
fetch('https://www.zohoapis.com/books/v3/item/45667789900/customfields?organization_id=10234695', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}"
headers = {
'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
'content-type': "application/json"
}
conn.request("PUT", "/books/v3/item/45667789900/customfields?organization_id=10234695", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "PUT",
"hostname": "www.zohoapis.com",
"port": null,
"path": "/books/v3/item/45667789900/customfields?organization_id=10234695",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
"content-type": "application/json"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({field1: 'value1', field2: 'value2'}));
req.end();
curl --request PUT \
--url 'https://www.zohoapis.com/books/v3/item/45667789900/customfields?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
[
{
"customfield_id": "46000000012845",
"value": "Normal"
}
]
{
"code": 0,
"message": "Custom Fields Updated Successfully"
}
Mark as active
Mark an inactive item as active.
OAuth Scope : ZohoBooks.settings.CREATE
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/items/45667789900/active?organization_id=10234695"
type: POST
headers: headers_data
connection: <connection_name>
]
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://www.zohoapis.com/books/v3/items/45667789900/active?organization_id=10234695")
.post(null)
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'POST',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://www.zohoapis.com/books/v3/items/45667789900/active?organization_id=10234695', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }
conn.request("POST", "/books/v3/items/45667789900/active?organization_id=10234695", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "POST",
"hostname": "www.zohoapis.com",
"port": null,
"path": "/books/v3/items/45667789900/active?organization_id=10234695",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
curl --request POST \
--url 'https://www.zohoapis.com/books/v3/items/45667789900/active?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "The item has been marked as active."
}
Mark as inactive
Mark an active item as inactive.
OAuth Scope : ZohoBooks.settings.CREATE
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/items/45667789900/inactive?organization_id=10234695"
type: POST
headers: headers_data
connection: <connection_name>
]
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://www.zohoapis.com/books/v3/items/45667789900/inactive?organization_id=10234695")
.post(null)
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'POST',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://www.zohoapis.com/books/v3/items/45667789900/inactive?organization_id=10234695', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }
conn.request("POST", "/books/v3/items/45667789900/inactive?organization_id=10234695", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "POST",
"hostname": "www.zohoapis.com",
"port": null,
"path": "/books/v3/items/45667789900/inactive?organization_id=10234695",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
curl --request POST \
--url 'https://www.zohoapis.com/books/v3/items/45667789900/inactive?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "The item has been marked as inactive."
}