Sales Order
A sales order is a financial document that confirms an impending sale. It is raised when an initial estimate is approved and the transaction is underway, and details the exact quantity, price and delivery details of the products or services being sold.
Attribute
business_gst
, business_none
, overseas
, consumer
.place of contact
given for the contact will be taken)Supported codes for UAE emirates are : Abu Dhabi -
AB
,Ajman - AJ
,Dubai - DU
,Fujairah - FU
,Ras al-Khaimah - RA
,Sharjah - SH
,Umm al-Quwain - UM
Supported codes for the GCC countries are : United Arab Emirates -
AE
,Saudi Arabia - SA
,Bahrain - BH
,Kuwait - KW
,Oman - OM
,Qatar - QA
.uk
. If the customer is in an EU country & VAT registered, you are resides in Northen Ireland and purchasing Goods then his VAT treatment is eu_vat_registered
and if he resides outside the UK then his VAT treatment is overseas
(For Pre Brexit, this can be split as eu_vat_registered
, eu_vat_not_registered
and non_eu
).vat_registered
,vat_not_registered
,gcc_vat_not_registered
,gcc_vat_registered
,non_gcc
.dz_vat_registered
and dz_vat_not_registered
supported only for UAE.home_country_mexico
,border_region_mexico
,non_mexico
supported only for MX. For Kenya Edition:
vat_registered
,vat_not_registered
,non_kenya
(A business that is located outside Kenya).For SouthAfrica Edition:
vat_registered
, vat_not_registered
, overseas
(A business that is located outside SouthAfrica).entity_level
and item_level
.goods
or services
.For SouthAfrica Edition:
service
, goods
, capital_service
and capital_goods
uae_same_tax_group
, uae_reimbursed_expense
and uae_others
. Supported values for Bahrain are bahrain_same_tax_group
, bahrain_transfer_of_concern
, bahrain_disbursement
, bahrain_head_to_branch_transaction
, bahrain_warranty_repair_services
and bahrain_others
.Supported values for Saudi Arabia are ksa_pvt_health
, ksa_pvt_edu
, ksa_reimbursed_expense
and ksa_house_sales
.[
{
"salesorder_id": "460000000039129",
"documents": [
"document_id",
"file_name"
],
"is_pre_gst": false,
"gst_no": "22AAAAA0000A1Z5",
"gst_treatment": "business_gst",
"place_of_supply": "TN",
"vat_treatment": "string",
"tax_treatment": "vat_registered",
"zcrm_potential_id": "460000000033001",
"zcrm_potential_name": "string",
"salesorder_number": "SO-00001",
"date": "2014-07-28",
"status": "open",
"shipment_date": "string",
"reference_number": "REF-001",
"customer_id": "460000000017138",
"customer_name": "SAF Instruments Inc",
"contact_persons": [
"460000000870911",
"460000000870915"
],
"currency_id": "460000000000097",
"currency_code": "USD",
"currency_symbol": "$",
"exchange_rate": 1.233,
"discount_amount": 0,
"discount": "string",
"discount_applied_on_amount": 0,
"is_discount_before_tax": true,
"discount_type": "entity_level",
"estimate_id": "string",
"delivery_method": "Air",
"delivery_method_id": "string",
"is_inclusive_tax": false,
"line_items": [
{
"item_order": 0,
"item_id": "460000000017088",
"rate": 120,
"name": "Hard Drive",
"description": "500GB, USB 2.0 interface 1400 rpm, protective hard case.",
"quantity": 40,
"product_type": "goods",
"hsn_or_sac": 80540,
"sat_item_key_code": 71121206,
"unitkey_code": "E48",
"warehouse_id": "460000000041001",
"warehouse_name": "Walmart",
"discount": "string",
"tax_id": "460000000017094",
"tds_tax_id": "460000000017098",
"tags": [
{
"is_tag_mandatory": false,
"tag_id": 462000000009070,
"tag_name": "Location",
"tag_option_id": 462000000002670,
"tag_option_name": "USA"
}
],
"unit": "Nos",
"item_custom_fields": [
{
"customfield_id": "460000000639129",
"index": 1,
"value": "Normal",
"label": "Priority"
}
],
"tax_exemption_id": "string",
"tax_exemption_code": "string",
"tax_treatment_code": "uae_others",
"avatax_exempt_no": "string",
"avatax_use_code": "string",
"project_id": 90300000087378
}
],
"shipping_charge": 2,
"adjustment": 0.2,
"adjustment_description": "Adjustment",
"sub_total": 11800,
"tax_total": 600,
"total": 12400,
"taxes": [
{
"tax_id": "460000000017094",
"tax_name": "string",
"tax_amount": 600
}
],
"price_precision": 2,
"is_emailed": false,
"billing_address": {
"address": "B-1104, 11F, \nHorizon International Tower, \nNo. 6, ZhiChun Road, HaiDian District",
"street2": "McMillan Avenue",
"city": "Beijing",
"state": "Beijing",
"zip": "1000881",
"country": "China",
"fax": "+86-10-82637827",
"attention": "string"
},
"shipping_address": {
"address": "B-1104, 11F, \nHorizon International Tower, \nNo. 6, ZhiChun Road, HaiDian District",
"street2": "McMillan Avenue",
"city": "Beijing",
"state": "Beijing",
"zip": "1000881",
"country": "China",
"fax": "+86-10-82637827",
"attention": "string"
},
"notes": "string",
"terms": "string",
"custom_fields": [
{
"customfield_id": "460000000639129",
"index": 1,
"value": "Normal",
"label": "Priority"
}
],
"template_id": "460000000021001",
"template_name": "Standard Template",
"page_width": "8.27in",
"page_height": "11.69in",
"orientation": "portrait",
"template_type": "standard",
"created_time": "2014-07-28T08:29:07+0530",
"last_modified_time": "2014-08-25T11:23:26+0530",
"created_by_id": "460000000053001",
"attachment_name": "string",
"can_send_in_mail": true,
"salesperson_id": "460000000000097",
"salesperson_name": "John Roberts",
"merchant_id": "460000000000597",
"merchant_name": "John Louis"
}
]
Create a sales order
Create a sales order for your customer.
OAuth Scope : ZohoBooks.salesorders.CREATE
Arguments
place of contact
given for the contact will be taken)Supported codes for UAE emirates are : Abu Dhabi -
AB
,Ajman - AJ
,Dubai - DU
,Fujairah - FU
,Ras al-Khaimah - RA
,Sharjah - SH
,Umm al-Quwain - UM
Supported codes for the GCC countries are : United Arab Emirates -
AE
,Saudi Arabia - SA
,Bahrain - BH
,Kuwait - KW
,Oman - OM
,Qatar - QA
. business_gst
, business_none
, overseas
, consumer
.goods
or services
.For SouthAfrica Edition:
service
, goods
, capital_service
and capital_goods
uae_same_tax_group
, uae_reimbursed_expense
and uae_others
. Supported values for Bahrain are bahrain_same_tax_group
, bahrain_transfer_of_concern
, bahrain_disbursement
, bahrain_head_to_branch_transaction
, bahrain_warranty_repair_services
and bahrain_others
.Supported values for Saudi Arabia are ksa_pvt_health
, ksa_pvt_edu
, ksa_reimbursed_expense
and ksa_house_sales
.uk
. If the customer is in an EU country & VAT registered, you are resides in Northen Ireland and purchasing Goods then his VAT treatment is eu_vat_registered
and if he resides outside the UK then his VAT treatment is overseas
(For Pre Brexit, this can be split as eu_vat_registered
, eu_vat_not_registered
and non_eu
).vat_registered
,vat_not_registered
,gcc_vat_not_registered
,gcc_vat_registered
,non_gcc
.dz_vat_registered
and dz_vat_not_registered
supported only for UAE.home_country_mexico
,border_region_mexico
,non_mexico
supported only for MX. For Kenya Edition:
vat_registered
,vat_not_registered
,non_kenya
(A business that is located outside Kenya).For SouthAfrica Edition:
vat_registered
, vat_not_registered
, overseas
(A business that is located outside SouthAfrica).vat_registered
)Used to specify whether the transaction is applicable for Domestic Reverse Charge (DRC) or not.
entity_level
and item_level
.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/salesorders?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/salesorders?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/salesorders?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/salesorders?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/salesorders?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/salesorders?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
{
"customer_id": "460000000017138",
"currency_id": "460000000000097",
"contact_persons": [
"460000000870911",
"460000000870915"
],
"date": "2014-07-28",
"shipment_date": "string",
"custom_fields": [
{
"customfield_id": "460000000639129",
"value": "Normal"
}
],
"place_of_supply": "TN",
"salesperson_id": "460000000000097",
"merchant_id": "460000000000597",
"gst_treatment": "business_gst",
"gst_no": "22AAAAA0000A1Z5",
"is_inclusive_tax": false,
"line_items": [
{
"item_order": 0,
"item_id": "460000000017088",
"rate": 120,
"name": "Hard Drive",
"description": "500GB, USB 2.0 interface 1400 rpm, protective hard case.",
"quantity": 40,
"product_type": "goods",
"hsn_or_sac": 80540,
"sat_item_key_code": 71121206,
"unitkey_code": "E48",
"warehouse_id": "460000000041001",
"warehouse_name": "Walmart",
"discount": "string",
"tax_id": "460000000017094",
"tds_tax_id": "460000000017098",
"tags": [
{
"tag_id": 462000000009070,
"tag_option_id": 462000000002670
}
],
"unit": "Nos",
"item_custom_fields": [
{
"customfield_id": "460000000639129",
"value": "Normal"
}
],
"tax_exemption_id": "string",
"tax_exemption_code": "string",
"tax_treatment_code": "uae_others",
"avatax_exempt_no": "string",
"avatax_use_code": "string",
"project_id": 90300000087378
}
],
"notes": "string",
"terms": "string",
"billing_address_id": 460000000032174,
"shipping_address_id": "string",
"crm_owner_id": "string",
"crm_custom_reference_id": "string",
"vat_treatment": "string",
"tax_treatment": "vat_registered",
"is_reverse_charge_applied": true,
"salesorder_number": "SO-00001",
"reference_number": "REF-001",
"is_update_customer": false,
"discount": "string",
"exchange_rate": 1.233,
"salesperson_name": "John Roberts",
"notes_default": "string",
"terms_default": "string",
"tax_id": "460000000017094",
"tax_authority_id": "string",
"tax_exemption_id": "string",
"tax_authority_name": "string",
"tax_exemption_code": "string",
"avatax_exempt_no": "string",
"avatax_use_code": "string",
"shipping_charge": 2,
"adjustment": 0.2,
"delivery_method": "Air",
"estimate_id": "string",
"is_discount_before_tax": true,
"discount_type": "entity_level",
"adjustment_description": "Adjustment",
"pricebook_id": "string",
"template_id": "460000000021001",
"documents": [
"document_id",
"file_name"
],
"zcrm_potential_id": "460000000033001",
"zcrm_potential_name": "string"
}
{
"code": 0,
"message": "Sales Order Created Successfully.",
"salesorder": [
{
"salesorder_id": "460000000039129",
"documents": [
"document_id",
"file_name"
],
"is_pre_gst": false,
"gst_no": "22AAAAA0000A1Z5",
"gst_treatment": "business_gst",
"place_of_supply": "TN",
"vat_treatment": "string",
"tax_treatment": "vat_registered",
"zcrm_potential_id": "460000000033001",
"zcrm_potential_name": "string",
"salesorder_number": "SO-00001",
"date": "2014-07-28",
"status": "open",
"shipment_date": "string",
"reference_number": "REF-001",
"customer_id": "460000000017138",
"customer_name": "SAF Instruments Inc",
"contact_persons": [
"460000000870911",
"460000000870915"
],
"currency_id": "460000000000097",
"currency_code": "USD",
"currency_symbol": "$",
"exchange_rate": 1.233,
"discount_amount": 0,
"discount": "string",
"discount_applied_on_amount": 0,
"is_discount_before_tax": true,
"discount_type": "entity_level",
"estimate_id": "string",
"delivery_method": "Air",
"delivery_method_id": "string",
"is_inclusive_tax": false,
"line_items": [
{
"item_order": 0,
"item_id": "460000000017088",
"rate": 120,
"name": "Hard Drive",
"description": "500GB, USB 2.0 interface 1400 rpm, protective hard case.",
"quantity": 40,
"product_type": "goods",
"hsn_or_sac": 80540,
"sat_item_key_code": 71121206,
"unitkey_code": "E48",
"warehouse_id": "460000000041001",
"warehouse_name": "Walmart",
"discount": "string",
"tax_id": "460000000017094",
"tds_tax_id": "460000000017098",
"tags": [
{
"is_tag_mandatory": false,
"tag_id": 462000000009070,
"tag_name": "Location",
"tag_option_id": 462000000002670,
"tag_option_name": "USA"
}
],
"unit": "Nos",
"item_custom_fields": [
{
"customfield_id": "460000000639129",
"index": 1,
"value": "Normal",
"label": "Priority"
}
],
"tax_exemption_id": "string",
"tax_exemption_code": "string",
"tax_treatment_code": "uae_others",
"avatax_exempt_no": "string",
"avatax_use_code": "string",
"project_id": 90300000087378
}
],
"shipping_charge": 2,
"adjustment": 0.2,
"adjustment_description": "Adjustment",
"sub_total": 11800,
"tax_total": 600,
"total": 12400,
"taxes": [
{
"tax_id": "460000000017094",
"tax_name": "string",
"tax_amount": 600
}
],
"price_precision": 2,
"is_emailed": false,
"billing_address": {
"address": "B-1104, 11F, \nHorizon International Tower, \nNo. 6, ZhiChun Road, HaiDian District",
"street2": "McMillan Avenue",
"city": "Beijing",
"state": "Beijing",
"zip": "1000881",
"country": "China",
"fax": "+86-10-82637827",
"attention": "string"
},
"shipping_address": {
"address": "B-1104, 11F, \nHorizon International Tower, \nNo. 6, ZhiChun Road, HaiDian District",
"street2": "McMillan Avenue",
"city": "Beijing",
"state": "Beijing",
"zip": "1000881",
"country": "China",
"fax": "+86-10-82637827",
"attention": "string"
},
"notes": "string",
"terms": "string",
"custom_fields": [
{
"customfield_id": "460000000639129",
"index": 1,
"value": "Normal",
"label": "Priority"
}
],
"template_id": "460000000021001",
"template_name": "Standard Template",
"page_width": "8.27in",
"page_height": "11.69in",
"orientation": "portrait",
"template_type": "standard",
"created_time": "2014-07-28T08:29:07+0530",
"last_modified_time": "2014-08-25T11:23:26+0530",
"created_by_id": "460000000053001",
"attachment_name": "string",
"can_send_in_mail": true,
"salesperson_id": "460000000000097",
"salesperson_name": "John Roberts",
"merchant_id": "460000000000597",
"merchant_name": "John Louis"
},
{...},
{...}
]
}
Update a sales order 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 a sales order 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 sales order 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 sales orders, a new sales order will be created if the necessary payload details are available
OAuth Scope : ZohoBooks.salesorders.UPDATE
Arguments
place of contact
given for the contact will be taken)Supported codes for UAE emirates are : Abu Dhabi -
AB
,Ajman - AJ
,Dubai - DU
,Fujairah - FU
,Ras al-Khaimah - RA
,Sharjah - SH
,Umm al-Quwain - UM
Supported codes for the GCC countries are : United Arab Emirates -
AE
,Saudi Arabia - SA
,Bahrain - BH
,Kuwait - KW
,Oman - OM
,Qatar - QA
. business_gst
, business_none
, overseas
, consumer
.uae_same_tax_group
, uae_reimbursed_expense
and uae_others
. Supported values for Bahrain are bahrain_same_tax_group
, bahrain_transfer_of_concern
, bahrain_disbursement
, bahrain_head_to_branch_transaction
, bahrain_warranty_repair_services
and bahrain_others
.Supported values for Saudi Arabia are ksa_pvt_health
, ksa_pvt_edu
, ksa_reimbursed_expense
and ksa_house_sales
.uk
. If the customer is in an EU country & VAT registered, you are resides in Northen Ireland and purchasing Goods then his VAT treatment is eu_vat_registered
and if he resides outside the UK then his VAT treatment is overseas
(For Pre Brexit, this can be split as eu_vat_registered
, eu_vat_not_registered
and non_eu
).vat_registered
,vat_not_registered
,gcc_vat_not_registered
,gcc_vat_registered
,non_gcc
.dz_vat_registered
and dz_vat_not_registered
supported only for UAE.home_country_mexico
,border_region_mexico
,non_mexico
supported only for MX. For Kenya Edition:
vat_registered
,vat_not_registered
,non_kenya
(A business that is located outside Kenya).For SouthAfrica Edition:
vat_registered
, vat_not_registered
, overseas
(A business that is located outside SouthAfrica).vat_registered
)Used to specify whether the transaction is applicable for Domestic Reverse Charge (DRC) or not.
entity_level
and item_level
.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/salesorders?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/salesorders?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/salesorders?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/salesorders?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/salesorders?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/salesorders?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"}'
{
"customer_id": "460000000017138",
"currency_id": "460000000000097",
"contact_persons": [
"460000000870911",
"460000000870915"
],
"date": "2014-07-28",
"shipment_date": "string",
"custom_fields": [
{
"customfield_id": "460000000639129",
"value": "Normal"
}
],
"place_of_supply": "TN",
"salesperson_id": "460000000000097",
"merchant_id": "460000000000597",
"gst_treatment": "business_gst",
"gst_no": "22AAAAA0000A1Z5",
"is_inclusive_tax": false,
"line_items": [
{
"item_order": 0,
"line_item_id": "460000000039131",
"item_id": "460000000017088",
"rate": 120,
"name": "Hard Drive",
"description": "500GB, USB 2.0 interface 1400 rpm, protective hard case.",
"quantity": 40,
"discount": "string",
"tax_id": "460000000017094",
"tds_tax_id": "460000000017098",
"tags": [
{
"tag_id": 462000000009070,
"tag_option_id": 462000000002670
}
],
"unit": "Nos",
"item_custom_fields": [
{
"customfield_id": "460000000639129",
"value": "Normal"
}
],
"tax_exemption_id": "string",
"tax_exemption_code": "string",
"tax_treatment_code": "uae_others",
"avatax_exempt_no": "string",
"avatax_use_code": "string",
"project_id": 90300000087378,
"warehouse_id": "460000000041001"
}
],
"notes": "string",
"terms": "string",
"billing_address_id": 460000000032174,
"shipping_address_id": "string",
"crm_owner_id": "string",
"crm_custom_reference_id": "string",
"vat_treatment": "string",
"tax_treatment": "vat_registered",
"is_reverse_charge_applied": true,
"salesorder_number": "SO-00001",
"reference_number": "REF-001",
"is_update_customer": false,
"discount": "string",
"exchange_rate": 1.233,
"salesperson_name": "John Roberts",
"notes_default": "string",
"terms_default": "string",
"tax_id": "460000000017094",
"tax_authority_id": "string",
"tax_exemption_id": "string",
"tax_authority_name": "string",
"tax_exemption_code": "string",
"avatax_exempt_no": "string",
"avatax_use_code": "string",
"shipping_charge": 2,
"adjustment": 0.2,
"delivery_method": "Air",
"is_discount_before_tax": true,
"discount_type": "entity_level",
"adjustment_description": "Adjustment",
"pricebook_id": "string",
"template_id": "460000000021001",
"documents": [
"document_id",
"file_name"
],
"zcrm_potential_id": "460000000033001",
"zcrm_potential_name": "string"
}
{
"code": 0,
"message": "Sales Order Updated Successfully.",
"salesorder": [
{
"salesorder_id": "460000000039129",
"documents": [
"document_id",
"file_name"
],
"is_pre_gst": false,
"gst_no": "22AAAAA0000A1Z5",
"gst_treatment": "business_gst",
"place_of_supply": "TN",
"vat_treatment": "string",
"tax_treatment": "vat_registered",
"zcrm_potential_id": "460000000033001",
"zcrm_potential_name": "string",
"salesorder_number": "SO-00001",
"date": "2014-07-28",
"status": "open",
"shipment_date": "string",
"reference_number": "REF-001",
"customer_id": "460000000017138",
"customer_name": "SAF Instruments Inc",
"contact_persons": [
"460000000870911",
"460000000870915"
],
"currency_id": "460000000000097",
"currency_code": "USD",
"currency_symbol": "$",
"exchange_rate": 1.233,
"discount_amount": 0,
"discount": "string",
"discount_applied_on_amount": 0,
"is_discount_before_tax": true,
"discount_type": "entity_level",
"estimate_id": "string",
"delivery_method": "Air",
"delivery_method_id": "string",
"is_inclusive_tax": false,
"line_items": [
{
"item_order": 0,
"item_id": "460000000017088",
"rate": 120,
"name": "Hard Drive",
"description": "500GB, USB 2.0 interface 1400 rpm, protective hard case.",
"quantity": 40,
"product_type": "goods",
"hsn_or_sac": 80540,
"sat_item_key_code": 71121206,
"unitkey_code": "E48",
"warehouse_id": "460000000041001",
"warehouse_name": "Walmart",
"discount": "string",
"tax_id": "460000000017094",
"tds_tax_id": "460000000017098",
"tags": [
{
"is_tag_mandatory": false,
"tag_id": 462000000009070,
"tag_name": "Location",
"tag_option_id": 462000000002670,
"tag_option_name": "USA"
}
],
"unit": "Nos",
"item_custom_fields": [
{
"customfield_id": "460000000639129",
"index": 1,
"value": "Normal",
"label": "Priority"
}
],
"tax_exemption_id": "string",
"tax_exemption_code": "string",
"tax_treatment_code": "uae_others",
"avatax_exempt_no": "string",
"avatax_use_code": "string",
"project_id": 90300000087378
}
],
"shipping_charge": 2,
"adjustment": 0.2,
"adjustment_description": "Adjustment",
"sub_total": 11800,
"tax_total": 600,
"total": 12400,
"taxes": [
{
"tax_id": "460000000017094",
"tax_name": "string",
"tax_amount": 600
}
],
"price_precision": 2,
"is_emailed": false,
"billing_address": {
"address": "B-1104, 11F, \nHorizon International Tower, \nNo. 6, ZhiChun Road, HaiDian District",
"street2": "McMillan Avenue",
"city": "Beijing",
"state": "Beijing",
"zip": "1000881",
"country": "China",
"fax": "+86-10-82637827",
"attention": "string"
},
"shipping_address": {
"address": "B-1104, 11F, \nHorizon International Tower, \nNo. 6, ZhiChun Road, HaiDian District",
"street2": "McMillan Avenue",
"city": "Beijing",
"state": "Beijing",
"zip": "1000881",
"country": "China",
"fax": "+86-10-82637827",
"attention": "string"
},
"notes": "string",
"terms": "string",
"custom_fields": [
{
"customfield_id": "460000000639129",
"index": 1,
"value": "Normal",
"label": "Priority"
}
],
"template_id": "460000000021001",
"template_name": "Standard Template",
"page_width": "8.27in",
"page_height": "11.69in",
"orientation": "portrait",
"template_type": "standard",
"created_time": "2014-07-28T08:29:07+0530",
"last_modified_time": "2014-08-25T11:23:26+0530",
"created_by_id": "460000000053001",
"attachment_name": "string",
"can_send_in_mail": true,
"salesperson_id": "460000000000097",
"salesperson_name": "John Roberts",
"merchant_id": "460000000000597",
"merchant_name": "John Louis"
},
{...},
{...}
]
}
List sales orders
List all sales orders.
OAuth Scope : ZohoBooks.salesorders.READ
Query Parameters
customer_name
, salesorder_number
, shipment_date
, last_modified_time
, reference_number
, total
, date
and created_time
.Status.All
, Status.Open
, Status.Draft
, Status.OverDue
, Status.PartiallyInvoiced
, Status.Invoiced
, Status.Void
and Status.Closed
salesorder_number_startswith
, salesorder_number_not_in
, salesorder_number_in
, salesorder_number_contains
. Maximum Length : 100
item_name_startswith
, item_name_not_in
,item_name_in
and item_name_contains
. Maximum Length : 100
item_description_startswith
, item_description_not_in
, item_description_in
and item_description_contains
. Maximum Length: 100
reference_number_startswith
, reference_number_not_in
, reference_number_in
and reference_number_contains
.customer_name_startswith
, customer_name_not_in
, customer_name_in
and customer_name_contains
. Maximum Length : 100
total_start
, total_end
, total_less_than
, total_less_equals
, total_greater_than
and total_greater_equals
.date_start
, date_end
, date_before
and date_after
. Default date format : yyyy-mm-dd
shipment_date_start
, shipment_date_end
, shipment_date_before
and shipment_date_after
. Default date format : yyyy-mm-dd
draft
, open
, invoiced
, partially_invoiced
, void
and overdue
.Maximum Length : 200
json
, csv
, xml
, xls
, xlsx
, pdf
, jhtml
and html
. It will be used when accept = pdf and atleast one value in salesorder_ids
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/salesorders?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/salesorders?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/salesorders?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/salesorders?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/salesorders?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/salesorders?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "success",
"salesorders": [
{
"salesorder_id": "460000000039129",
"zcrm_potential_id": "460000000033001",
"zcrm_potential_name": "string",
"customer_name": "SAF Instruments Inc",
"customer_id": "460000000017138",
"status": "open",
"salesorder_number": "SO-00001",
"reference_number": "REF-001",
"date": "2014-07-28",
"shipment_date": "string",
"shipment_days": 2,
"currency_id": "460000000000097",
"currency_code": "USD",
"total": 12400,
"sub_total": 11800,
"bcy_total": 400,
"created_time": "2014-07-28T08:29:07+0530",
"last_modified_time": "2014-08-25T11:23:26+0530",
"is_emailed": false,
"has_attachment": false,
"custom_fields": [
{
"customfield_id": "460000000639129",
"index": 1,
"value": "Normal",
"label": "Priority"
}
]
},
{...},
{...}
]
}
Update a sales order
Update an existing sales order. To delete a line item just remove it from the line_items list.
OAuth Scope : ZohoBooks.salesorders.UPDATE
Arguments
place of contact
given for the contact will be taken)Supported codes for UAE emirates are : Abu Dhabi -
AB
,Ajman - AJ
,Dubai - DU
,Fujairah - FU
,Ras al-Khaimah - RA
,Sharjah - SH
,Umm al-Quwain - UM
Supported codes for the GCC countries are : United Arab Emirates -
AE
,Saudi Arabia - SA
,Bahrain - BH
,Kuwait - KW
,Oman - OM
,Qatar - QA
. business_gst
, business_none
, overseas
, consumer
.uae_same_tax_group
, uae_reimbursed_expense
and uae_others
. Supported values for Bahrain are bahrain_same_tax_group
, bahrain_transfer_of_concern
, bahrain_disbursement
, bahrain_head_to_branch_transaction
, bahrain_warranty_repair_services
and bahrain_others
.Supported values for Saudi Arabia are ksa_pvt_health
, ksa_pvt_edu
, ksa_reimbursed_expense
and ksa_house_sales
.uk
. If the customer is in an EU country & VAT registered, you are resides in Northen Ireland and purchasing Goods then his VAT treatment is eu_vat_registered
and if he resides outside the UK then his VAT treatment is overseas
(For Pre Brexit, this can be split as eu_vat_registered
, eu_vat_not_registered
and non_eu
).vat_registered
,vat_not_registered
,gcc_vat_not_registered
,gcc_vat_registered
,non_gcc
.dz_vat_registered
and dz_vat_not_registered
supported only for UAE.home_country_mexico
,border_region_mexico
,non_mexico
supported only for MX. For Kenya Edition:
vat_registered
,vat_not_registered
,non_kenya
(A business that is located outside Kenya).For SouthAfrica Edition:
vat_registered
, vat_not_registered
, overseas
(A business that is located outside SouthAfrica).vat_registered
)Used to specify whether the transaction is applicable for Domestic Reverse Charge (DRC) or not.
entity_level
and item_level
.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/salesorders/460000000039129?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/salesorders/460000000039129?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/salesorders/460000000039129?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/salesorders/460000000039129?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/salesorders/460000000039129?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/salesorders/460000000039129?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
{
"customer_id": "460000000017138",
"currency_id": "460000000000097",
"contact_persons": [
"460000000870911",
"460000000870915"
],
"date": "2014-07-28",
"shipment_date": "string",
"custom_fields": [
{
"customfield_id": "460000000639129",
"value": "Normal"
}
],
"place_of_supply": "TN",
"salesperson_id": "460000000000097",
"merchant_id": "460000000000597",
"gst_treatment": "business_gst",
"gst_no": "22AAAAA0000A1Z5",
"is_inclusive_tax": false,
"line_items": [
{
"item_order": 0,
"line_item_id": "460000000039131",
"item_id": "460000000017088",
"rate": 120,
"name": "Hard Drive",
"description": "500GB, USB 2.0 interface 1400 rpm, protective hard case.",
"quantity": 40,
"discount": "string",
"tax_id": "460000000017094",
"tds_tax_id": "460000000017098",
"tags": [
{
"tag_id": 462000000009070,
"tag_option_id": 462000000002670
}
],
"unit": "Nos",
"item_custom_fields": [
{
"customfield_id": "460000000639129",
"value": "Normal"
}
],
"tax_exemption_id": "string",
"tax_exemption_code": "string",
"tax_treatment_code": "uae_others",
"avatax_exempt_no": "string",
"avatax_use_code": "string",
"project_id": 90300000087378,
"warehouse_id": "460000000041001"
}
],
"notes": "string",
"terms": "string",
"billing_address_id": 460000000032174,
"shipping_address_id": "string",
"crm_owner_id": "string",
"crm_custom_reference_id": "string",
"vat_treatment": "string",
"tax_treatment": "vat_registered",
"is_reverse_charge_applied": true,
"salesorder_number": "SO-00001",
"reference_number": "REF-001",
"is_update_customer": false,
"discount": "string",
"exchange_rate": 1.233,
"salesperson_name": "John Roberts",
"notes_default": "string",
"terms_default": "string",
"tax_id": "460000000017094",
"tax_authority_id": "string",
"tax_exemption_id": "string",
"tax_authority_name": "string",
"tax_exemption_code": "string",
"avatax_exempt_no": "string",
"avatax_use_code": "string",
"shipping_charge": 2,
"adjustment": 0.2,
"delivery_method": "Air",
"is_discount_before_tax": true,
"discount_type": "entity_level",
"adjustment_description": "Adjustment",
"pricebook_id": "string",
"template_id": "460000000021001",
"documents": [
"document_id",
"file_name"
],
"zcrm_potential_id": "460000000033001",
"zcrm_potential_name": "string"
}
{
"code": 0,
"message": "Sales Order Updated Successfully.",
"salesorder": [
{
"salesorder_id": "460000000039129",
"documents": [
"document_id",
"file_name"
],
"is_pre_gst": false,
"gst_no": "22AAAAA0000A1Z5",
"gst_treatment": "business_gst",
"place_of_supply": "TN",
"vat_treatment": "string",
"tax_treatment": "vat_registered",
"zcrm_potential_id": "460000000033001",
"zcrm_potential_name": "string",
"salesorder_number": "SO-00001",
"date": "2014-07-28",
"status": "open",
"shipment_date": "string",
"reference_number": "REF-001",
"customer_id": "460000000017138",
"customer_name": "SAF Instruments Inc",
"contact_persons": [
"460000000870911",
"460000000870915"
],
"currency_id": "460000000000097",
"currency_code": "USD",
"currency_symbol": "$",
"exchange_rate": 1.233,
"discount_amount": 0,
"discount": "string",
"discount_applied_on_amount": 0,
"is_discount_before_tax": true,
"discount_type": "entity_level",
"estimate_id": "string",
"delivery_method": "Air",
"delivery_method_id": "string",
"is_inclusive_tax": false,
"line_items": [
{
"item_order": 0,
"item_id": "460000000017088",
"rate": 120,
"name": "Hard Drive",
"description": "500GB, USB 2.0 interface 1400 rpm, protective hard case.",
"quantity": 40,
"product_type": "goods",
"hsn_or_sac": 80540,
"sat_item_key_code": 71121206,
"unitkey_code": "E48",
"warehouse_id": "460000000041001",
"warehouse_name": "Walmart",
"discount": "string",
"tax_id": "460000000017094",
"tds_tax_id": "460000000017098",
"tags": [
{
"is_tag_mandatory": false,
"tag_id": 462000000009070,
"tag_name": "Location",
"tag_option_id": 462000000002670,
"tag_option_name": "USA"
}
],
"unit": "Nos",
"item_custom_fields": [
{
"customfield_id": "460000000639129",
"index": 1,
"value": "Normal",
"label": "Priority"
}
],
"tax_exemption_id": "string",
"tax_exemption_code": "string",
"tax_treatment_code": "uae_others",
"avatax_exempt_no": "string",
"avatax_use_code": "string",
"project_id": 90300000087378
}
],
"shipping_charge": 2,
"adjustment": 0.2,
"adjustment_description": "Adjustment",
"sub_total": 11800,
"tax_total": 600,
"total": 12400,
"taxes": [
{
"tax_id": "460000000017094",
"tax_name": "string",
"tax_amount": 600
}
],
"price_precision": 2,
"is_emailed": false,
"billing_address": {
"address": "B-1104, 11F, \nHorizon International Tower, \nNo. 6, ZhiChun Road, HaiDian District",
"street2": "McMillan Avenue",
"city": "Beijing",
"state": "Beijing",
"zip": "1000881",
"country": "China",
"fax": "+86-10-82637827",
"attention": "string"
},
"shipping_address": {
"address": "B-1104, 11F, \nHorizon International Tower, \nNo. 6, ZhiChun Road, HaiDian District",
"street2": "McMillan Avenue",
"city": "Beijing",
"state": "Beijing",
"zip": "1000881",
"country": "China",
"fax": "+86-10-82637827",
"attention": "string"
},
"notes": "string",
"terms": "string",
"custom_fields": [
{
"customfield_id": "460000000639129",
"index": 1,
"value": "Normal",
"label": "Priority"
}
],
"template_id": "460000000021001",
"template_name": "Standard Template",
"page_width": "8.27in",
"page_height": "11.69in",
"orientation": "portrait",
"template_type": "standard",
"created_time": "2014-07-28T08:29:07+0530",
"last_modified_time": "2014-08-25T11:23:26+0530",
"created_by_id": "460000000053001",
"attachment_name": "string",
"can_send_in_mail": true,
"salesperson_id": "460000000000097",
"salesperson_name": "John Roberts",
"merchant_id": "460000000000597",
"merchant_name": "John Louis"
},
{...},
{...}
]
}
Get a sales order
Get the details of a sales order.
OAuth Scope : ZohoBooks.salesorders.READ
Query Parameters
json
, csv
, xml
, xls
, xlsx
, pdf
, jhtml
and html
.headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/salesorders/460000000039129?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/salesorders/460000000039129?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/salesorders/460000000039129?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/salesorders/460000000039129?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/salesorders/460000000039129?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/salesorders/460000000039129?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "success",
"salesorder": [
{
"customer_id": "460000000017138",
"billing_address_id": 460000000032174,
"shipping_address_id": "string",
"is_pre_gst": false,
"gst_no": "22AAAAA0000A1Z5",
"gst_treatment": "business_gst",
"place_of_supply": "TN",
"crm_owner_id": "string",
"crm_custom_reference_id": "string",
"zcrm_potential_id": "460000000033001",
"vat_treatment": "string",
"tax_treatment": "vat_registered",
"is_reverse_charge_applied": true,
"is_update_customer": false,
"contact_persons": [
{
"contact_person_id": "string"
}
],
"salesorder_number": "SO-00001",
"reference_number": "REF-001",
"template_id": "460000000021001",
"date": "string",
"documents": [
"document_id",
"file_name"
],
"shipment_date": "string",
"exchange_rate": 1.233,
"discount": "string",
"is_discount_before_tax": true,
"discount_type": "entity_level",
"salesperson_id": "460000000000097",
"salesperson_name": "John Roberts",
"merchant_id": "460000000000597",
"merchant_name": "John Louis",
"estimate_id": "string",
"tax_id": "460000000017094",
"tax_authority_id": "string",
"tax_authority_name": "string",
"tax_exemption_id": "string",
"tax_exemption_code": "string",
"avatax_exempt_no": "string",
"avatax_use_code": "string",
"is_inclusive_tax": false,
"sub_statuses": [
{
"status_id": "460000000000097",
"status_code": "cs_openshi",
"parent_status": "open",
"description": "Packed is shipped.",
"display_name": "Open Shipped",
"label_name": "cs_openshi",
"color_code": "208eff"
}
],
"custom_fields": [
{
"customfield_id": "460000000639129",
"index": 1,
"value": "Normal",
"label": "Priority"
}
],
"line_items": [
{
"line_item_id": "460000000039131",
"sku": "string",
"bcy_rate": 120,
"tax_name": "string",
"tax_type": "string",
"tax_percentage": 0.1,
"tax_id": "460000000017094",
"tds_tax_id": "460000000017098",
"tax_treatment_code": "uae_others",
"is_taxable": false,
"product_exemption_id": "string",
"product_exemption_code": "string",
"avatax_use_code_id": "string",
"avatax_use_code_desc": "string",
"avatax_tax_code_id": "string",
"avatax_tax_code_desc": "string",
"item_total_inclusive_of_tax": 48,
"product_type": "goods",
"hsn_or_sac": 80540,
"sat_item_key_code": 71121206,
"unitkey_code": "E48",
"is_invoiced": false,
"stock_on_hand": "string",
"image_id": "string",
"image_name": "string",
"image_type": "string",
"project_id": 90300000087378,
"project_name": "Sample Project",
"warehouse_id": "460000000041001"
}
],
"pricebook_id": "string",
"shipping_charge": 2,
"adjustment": 0.2,
"adjustment_description": "Adjustment",
"delivery_method": "Air",
"notes": "string",
"notes_default": "string",
"terms": "string",
"terms_default": "string"
},
{...},
{...}
]
}
Delete a sales order
Delete an existing sales order. Invoiced sales order cannot be deleted.
OAuth Scope : ZohoBooks.salesorders.DELETE
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/salesorders/460000000039129?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/salesorders/460000000039129?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/salesorders/460000000039129?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/salesorders/460000000039129?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/salesorders/460000000039129?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/salesorders/460000000039129?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "Sales Order Deleted Successfully."
}
Update custom field in existing salesorders
Update the value of the custom field in existing salesorders.
OAuth Scope : ZohoBooks.salesorders.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/salesorder/460000000039129/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/salesorder/460000000039129/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/salesorder/460000000039129/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/salesorder/460000000039129/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/salesorder/460000000039129/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/salesorder/460000000039129/customfields?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
[
{
"customfield_id": "460000000639129",
"index": 1,
"value": "Normal",
"label": "Priority"
}
]
{
"code": 0,
"message": "Custom Fields Updated Successfully"
}
Mark a sales order as open
Mark a draft sales order as open.
OAuth Scope : ZohoBooks.salesorders.CREATE
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/salesorders/460000000039129/status/open?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/salesorders/460000000039129/status/open?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/salesorders/460000000039129/status/open?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/salesorders/460000000039129/status/open?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/salesorders/460000000039129/status/open?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/salesorders/460000000039129/status/open?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "Sales order status has been changed to Open."
}
Mark a sales order as void
Mark a sales order as void.
OAuth Scope : ZohoBooks.salesorders.CREATE
Arguments
Maximum Length: 500
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/salesorders/460000000039129/status/void?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/salesorders/460000000039129/status/void?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/salesorders/460000000039129/status/void?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/salesorders/460000000039129/status/void?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/salesorders/460000000039129/status/void?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/salesorders/460000000039129/status/void?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
{
"reason": " "
}
{
"code": 0,
"message": "Sales order status has been changed to Void."
}
Update a sales order sub status
Update a sales order sub status.
OAuth Scope : ZohoBooks.salesorders.CREATE
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/salesorders/460000000039129/substatus/cs_openshi?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/salesorders/460000000039129/substatus/cs_openshi?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/salesorders/460000000039129/substatus/cs_openshi?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/salesorders/460000000039129/substatus/cs_openshi?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/salesorders/460000000039129/substatus/cs_openshi?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/salesorders/460000000039129/substatus/cs_openshi?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "Sales Order status updated successfully."
}
Email a sales order
Email a sales order to the customer. Input json string is not mandatory. If input json string is empty, mail will be send with default mail content.
OAuth Scope : ZohoBooks.salesorders.CREATE
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/salesorders/460000000039129/email?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/salesorders/460000000039129/email?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/salesorders/460000000039129/email?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/salesorders/460000000039129/email?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/salesorders/460000000039129/email?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/salesorders/460000000039129/email?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
{
"from_address_id": "johnRoberts@safInstrument.com",
"send_from_org_email_id": true,
"to_mail_ids": [
"john@safInstruments.com"
],
"cc_mail_ids": [
"smith@safInstruments.com"
],
"bcc_mail_ids": [
"mark@safInstruments.com"
],
"subject": "Sales Order from Zillium Inc (Sales Order #: SO-00001)",
"documents": "string",
"invoice_id": 460000000028192,
"body": "<br>Dear SAF Instruments Inc, <br><br>Thanks for your interest in our services. Please find our sales order attached with this mail.<br><br> An overview of the sales order is available below for your reference: <br><br> ----------------------------------------------------------------------------------------<br> <h2>Sales Order # : SO-00001</h2><br> ----------------------------------------------------------------------------------------<br> <b> Order Date : 28 Jul 2014</b><br><b> Amount : $12,400.00</b><br>----------------------------------------------------------------------------------------<br><br><span>Assuring you of our best services at all times.</span><br><br><br>Regards,<br><br>John<br>Zillium Inc<br><br><br>"
}
{
"code": 0,
"message": "Your Sales Order has been sent."
}
Get sales order email content
Get the email content of a sales order.
OAuth Scope : ZohoBooks.salesorders.READ
Query Parameters
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/salesorders/460000000039129/email?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/salesorders/460000000039129/email?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/salesorders/460000000039129/email?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/salesorders/460000000039129/email?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/salesorders/460000000039129/email?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/salesorders/460000000039129/email?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "success",
"data": [
{
"bcc_mails": [
"string"
],
"body": "<br>Dear SAF Instruments Inc, <br><br>Thanks for your interest in our services. Please find our sales order attached with this mail.<br><br> An overview of the sales order is available below for your reference: <br><br> ----------------------------------------------------------------------------------------<br> <h2>Sales Order # : SO-00001</h2><br> ----------------------------------------------------------------------------------------<br> <b> Order Date : 28 Jul 2014</b><br><b> Amount : $12,400.00</b><br>----------------------------------------------------------------------------------------<br><br><span>Assuring you of our best services at all times.</span><br><br><br>Regards,<br><br>John<br>Zillium Inc<br><br><br>",
"error_list": [
"string"
],
"bcc_mails_str": "string",
"documents": [
"document_id",
"file_name"
],
"subject": "Sales Order from Zillium Inc (Sales Order #: SO-00001)",
"customer_name": "SAF Instruments Inc",
"entity_id": "460000000058039",
"cc_mails_list": [],
"file_name": "string",
"from_emails": [
{
"organization_contact_id": "460000000053003",
"user_name": "string",
"selected": true,
"email": "string",
"is_org_email_id": true
}
],
"file_name_without_extension": "SO-00001",
"to_mails_str": "string",
"cc_mails_str": "string",
"from_email": "string",
"from_address": "string",
"emailtemplates": [
{
"selected": true,
"name": "Hard Drive",
"email_template_id": 460000000001287
}
],
"to_contacts": [
{
"first_name": "string",
"selected": true,
"phone": "(555) 555-1234",
"email": "string",
"last_name": "string",
"salutation": "Ms.",
"contact_person_id": "string",
"mobile": "string"
}
],
"attachment_name": "string",
"emailtemplate_documents": [
"string"
],
"customer_id": "460000000017138"
},
{...},
{...}
]
}
Submit a sales order for approval
Submit a sales order for approval.
OAuth Scope : ZohoBooks.salesorders.CREATE
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/salesorders/460000000039129/submit?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/salesorders/460000000039129/submit?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/salesorders/460000000039129/submit?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/salesorders/460000000039129/submit?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/salesorders/460000000039129/submit?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/salesorders/460000000039129/submit?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "The Sales Order has been successfully submitted for approval."
}
Approve a sales order.
Approve a sales order.
OAuth Scope : ZohoBooks.salesorders.CREATE
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/salesorders/460000000039129/approve?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/salesorders/460000000039129/approve?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/salesorders/460000000039129/approve?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/salesorders/460000000039129/approve?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/salesorders/460000000039129/approve?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/salesorders/460000000039129/approve?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "You have approved the Sales Order."
}
Bulk export sales orders
Maximum of 25 sales orders can be exported in a single pdf.
OAuth Scope : ZohoBooks.salesorders.READ
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/salesorders/pdf?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/salesorders/pdf?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/salesorders/pdf?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/salesorders/pdf?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/salesorders/pdf?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/salesorders/pdf?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "success"
}
Bulk print sales orders
Export sales orders as pdf and print them. Maximum of 25 sales orders can be printed.
OAuth Scope : ZohoBooks.salesorders.READ
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/salesorders/print?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/salesorders/print?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/salesorders/print?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/salesorders/print?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/salesorders/print?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/salesorders/print?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "success"
}
Update billing address
Updates the billing address for this sales order alone.
OAuth Scope : ZohoBooks.salesorders.UPDATE
Arguments
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/salesorders/460000000039129/address/billing?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/salesorders/460000000039129/address/billing?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/salesorders/460000000039129/address/billing?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/salesorders/460000000039129/address/billing?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/salesorders/460000000039129/address/billing?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/salesorders/460000000039129/address/billing?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
{
"address": "B-1104, 11F, \nHorizon International Tower, \nNo. 6, ZhiChun Road, HaiDian District",
"city": "Beijing",
"state": "Beijing",
"zip": "1000881",
"country": "China",
"phone": "(555) 555-1234",
"fax": "+86-10-82637827",
"attention": "string",
"is_one_off_address": true,
"is_update_customer": false,
"is_verified": true
}
{
"code": 0,
"message": "Billing address updated."
}
Update shipping address
Updates the shipping address for this sales order alone.
OAuth Scope : ZohoBooks.salesorders.UPDATE
Arguments
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/salesorders/460000000039129/address/shipping?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/salesorders/460000000039129/address/shipping?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/salesorders/460000000039129/address/shipping?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/salesorders/460000000039129/address/shipping?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/salesorders/460000000039129/address/shipping?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/salesorders/460000000039129/address/shipping?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
{
"address": "B-1104, 11F, \nHorizon International Tower, \nNo. 6, ZhiChun Road, HaiDian District",
"city": "Beijing",
"state": "Beijing",
"zip": "1000881",
"country": "China",
"fax": "+86-10-82637827",
"attention": "string",
"is_one_off_address": true,
"is_update_customer": false,
"is_verified": true
}
{
"code": 0,
"message": "Shipping address updated."
}
List sales order templates
Get all sales order pdf templates.
OAuth Scope : ZohoBooks.salesorders.READ
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/salesorders/templates?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/salesorders/templates?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/salesorders/templates?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/salesorders/templates?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/salesorders/templates?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/salesorders/templates?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "success",
"templates": [
{
"template_name": "Standard Template",
"template_id": "460000000021001",
"template_type": "standard"
},
{...},
{...}
]
}
Update sales order template
Update the pdf template associated with the sales order.
OAuth Scope : ZohoBooks.salesorders.UPDATE
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/salesorders/460000000039129/templates/460000000021001?organization_id=10234695"
type: PUT
headers: headers_data
connection: <connection_name>
]
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://www.zohoapis.com/books/v3/salesorders/460000000039129/templates/460000000021001?organization_id=10234695")
.put(null)
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'PUT',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://www.zohoapis.com/books/v3/salesorders/460000000039129/templates/460000000021001?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("PUT", "/books/v3/salesorders/460000000039129/templates/460000000021001?organization_id=10234695", headers=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/salesorders/460000000039129/templates/460000000021001?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 PUT \
--url 'https://www.zohoapis.com/books/v3/salesorders/460000000039129/templates/460000000021001?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "Sales Order Updated Successfully."
}
Add attachment to a sales order
Attach a file to a sales order.
OAuth Scope : ZohoBooks.salesorders.CREATE
Query Parameters
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/salesorders/460000000039129/attachment?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/salesorders/460000000039129/attachment?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/salesorders/460000000039129/attachment?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/salesorders/460000000039129/attachment?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/salesorders/460000000039129/attachment?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/salesorders/460000000039129/attachment?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "Your file has been successfully attached to the sales order."
}
Update attachment preference
Set whether you want to send the attached file while emailing the sales order.
OAuth Scope : ZohoBooks.salesorders.UPDATE
Query Parameters
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/salesorders/460000000039129/attachment?organization_id=10234695&can_send_in_mail=true"
type: PUT
headers: headers_data
connection: <connection_name>
]
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://www.zohoapis.com/books/v3/salesorders/460000000039129/attachment?organization_id=10234695&can_send_in_mail=true")
.put(null)
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'PUT',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://www.zohoapis.com/books/v3/salesorders/460000000039129/attachment?organization_id=10234695&can_send_in_mail=true', 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("PUT", "/books/v3/salesorders/460000000039129/attachment?organization_id=10234695&can_send_in_mail=true", headers=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/salesorders/460000000039129/attachment?organization_id=10234695&can_send_in_mail=true",
"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 PUT \
--url 'https://www.zohoapis.com/books/v3/salesorders/460000000039129/attachment?organization_id=10234695&can_send_in_mail=true' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "Sales Oder Updated Successfully."
}
Get a sales order attachment
Returns the file attached to the sales order.
OAuth Scope : ZohoBooks.salesorders.READ
Query Parameters
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/salesorders/460000000039129/attachment?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/salesorders/460000000039129/attachment?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/salesorders/460000000039129/attachment?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/salesorders/460000000039129/attachment?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/salesorders/460000000039129/attachment?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/salesorders/460000000039129/attachment?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "Success"
}
Delete an attachment
Delete the file attached to the sales order.
OAuth Scope : ZohoBooks.salesorders.DELETE
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/salesorders/460000000039129/attachment?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/salesorders/460000000039129/attachment?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/salesorders/460000000039129/attachment?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/salesorders/460000000039129/attachment?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/salesorders/460000000039129/attachment?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/salesorders/460000000039129/attachment?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "Your file is no longer attached to the sales order."
}
Add comment
Add a comment for a sales order.
OAuth Scope : ZohoBooks.salesorders.CREATE
Arguments
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/salesorders/460000000039129/comments?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/salesorders/460000000039129/comments?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/salesorders/460000000039129/comments?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/salesorders/460000000039129/comments?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/salesorders/460000000039129/comments?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/salesorders/460000000039129/comments?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
{
"description": "500GB, USB 2.0 interface 1400 rpm, protective hard case."
}
{
"code": 0,
"message": "Comments added.",
"comment": [
{
"salesorder_id": "460000000039129",
"comment_id": "460000000048023",
"description": "500GB, USB 2.0 interface 1400 rpm, protective hard case.",
"commented_by_id": "460000000017003",
"commented_by": "John",
"comment_type": "system",
"date": "2014-07-28",
"date_description": "6 minutes ago",
"time": "2:12 PM",
"operation_type": "Added",
"transaction_id": "string",
"transaction_type": "salesorder"
},
{...},
{...}
]
}
List sales order comments & history
Get the complete history and comments of sales order.
OAuth Scope : ZohoBooks.salesorders.READ
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/salesorders/460000000039129/comments?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/salesorders/460000000039129/comments?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/salesorders/460000000039129/comments?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/salesorders/460000000039129/comments?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/salesorders/460000000039129/comments?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/salesorders/460000000039129/comments?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "success",
"comments": null
}
Update comment
Update existing comment of a sales order.
OAuth Scope : ZohoBooks.salesorders.UPDATE
Arguments
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/salesorders/460000000039129/comments/460000000048023?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/salesorders/460000000039129/comments/460000000048023?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/salesorders/460000000039129/comments/460000000048023?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/salesorders/460000000039129/comments/460000000048023?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/salesorders/460000000039129/comments/460000000048023?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/salesorders/460000000039129/comments/460000000048023?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
{
"description": "500GB, USB 2.0 interface 1400 rpm, protective hard case."
}
{
"code": 0,
"message": "Comment has been updated.",
"comment": [
{
"salesorder_id": "460000000039129",
"comment_id": "460000000048023",
"description": "500GB, USB 2.0 interface 1400 rpm, protective hard case.",
"commented_by_id": "460000000017003",
"commented_by": "John",
"comment_type": "system",
"date": "2014-07-28",
"date_description": "6 minutes ago",
"time": "2:12 PM",
"operation_type": "Added",
"transaction_id": "string",
"transaction_type": "salesorder"
},
{...},
{...}
]
}
Delete a comment
Delete a sales order comment.
OAuth Scope : ZohoBooks.salesorders.DELETE
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/salesorders/460000000039129/comments/460000000048023?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/salesorders/460000000039129/comments/460000000048023?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/salesorders/460000000039129/comments/460000000048023?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/salesorders/460000000039129/comments/460000000048023?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/salesorders/460000000039129/comments/460000000048023?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/salesorders/460000000039129/comments/460000000048023?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "The comment has been deleted."
}