API Docs
/
No Results Found
Purchase Order

Purchase Order

A purchase order is an official document that a buyer issues to a seller, indicating relevant information about what they want to buy, the quantity, the price agreed for that particular product or service.

End Points
Create a purchase order
Update a purchase order using a custom field's unique value
List purchase orders
Update a purchase order
Get a purchase order
Delete purchase order
Update custom field in existing purchaseorders
Mark a purchase order as open
Mark as billed
Cancel a purchase order
Submit a purchase order for approval
Approve a purchase order
Email a purchase order
Get purchase order email content
Update billing address
List purchase order templates
Update purchase order template
Add attachment to a purchase order
Update attachment preference
Get a purchase order attachment
Delete an attachment
Add comment
List purchase order comments & history
Update comment
Delete a comment

Attribute

purchaseorder_id
string
documents
array
Show Sub-Attributes arrow
document_id
long
ID of the Document
file_name
string
Name of the file
vat_treatment
string
🇬🇧 United Kingdom
only
(Optional) VAT treatment for the purchase order. VAT treatment denotes the location of the vendor, if the vendor resides in UK then the VAT treatment is uk. If the vendor 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).
gst_no
string
🇮🇳 India
only
15 digit GST identification number of the vendor.
gst_treatment
string
🇮🇳 India
only
Choose whether the contact is GST registered/unregistered/consumer/overseas. Allowed values are business_gst , business_none , overseas , consumer .
tax_treatment
GCC , 🇲🇽 Mexico
only
VAT treatment for the purchase order. Choose whether the vendor falls under: vat_registered,vat_not_registered,gcc_vat_not_registered,gcc_vat_registered,non_gcc.
dz_vat_registered and dz_vat_not_registered are supported only for UAE.
home_country_mexico,border_region_mexico,non_mexico supported only for MX.
is_pre_gst
boolean
🇮🇳 India
only
Applicable for transactions that fall before july 1, 2017
source_of_supply
string
🇮🇳 India
only
Place from where the goods/services are supplied. (If not given, place of contact given for the contact will be taken)
destination_of_supply
string
🇮🇳 India
only
Place where the goods/services are supplied to. (If not given, organisation's home state will be taken)
place_of_supply
string
GCC only
The place of supply is where a transaction is considered to have occurred for VAT purposes. For the supply of goods, the place of supply is the location of the goods when the supply occurs. For the supply of services, the place of supply should be where the supplier is established. (If not given, 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.
pricebook_id
string
Enter pricebook ID
pricebook_name
string
Enter pricebook name
is_reverse_charge_applied
boolean
🇮🇳 India
only
Applicable for transactions where you pay reverse charge
purchaseorder_number
string
Mandatory if auto number generation is disabled.
date
string
The date the purchase order is created.
expected_delivery_date
string
Date the goods is expected to arrive.
discount
string
Discount to be applied on Purchase Order.
discount_account_id
string
Account ID for the discount amount.
is_discount_before_tax
boolean
Discount applied before or after applying tax.
reference_number
string
Reference number of purchase order.
status
string
Status of the Purchase Order
vendor_id
string
ID of the vendor the purchase order has to be created.
vendor_name
string
Name of the Vendor in Purchase Order
crm_owner_id
string
ID of the CRM Owner
contact_persons
array
Array of contact person(s) for whom purchase order has to be sent.
currency_id
string
ID of the Currency
currency_code
string
Code of the Currency
currency_symbol
string
Symbol of the Currency
exchange_rate
double
Exchange rate of the currency.
delivery_date
string
Date of delivery of the purchase order
is_emailed
boolean
Check if the purchase order is emailed
is_inclusive_tax
boolean
Not applicable 🇺🇸 United States
Used to specify whether the line item rates are inclusive or exclusive of tax.
line_items
array
Line items of purchase order.
Show Sub-Attributes arrow
item_id
string
ID of the item.
line_item_id
string
ID of the line item. Mandatory if the existing line item has to be updated. If empty, a new line item will be created.
sku
string
SKU of the Item
warehouse_id
string
Enter warehouse ID
warehouse_name
string
Enter warehouse name
product_type
string
🇬🇧 United Kingdom
only
This denotes whether the Purchase Order line item is to be treated as a goods or service purchase. This only need to be specified in case purchase order is not enabled. Allowed Values: goods, digital_service and service.
reverse_charge_tax_id
string
Enter reverse charge tax ID
reverse_charge_tax_name
string
🇮🇳 India
only
Enter reverse charge tax name
reverse_charge_tax_percentage
double
🇮🇳 India
only
Enter reverse charge tax percentage
reverse_charge_tax_amount
double
🇮🇳 India
only
Tax amount for the reverse charge.
account_id
string
ID of the account, the line item is associated with.
account_name
string
Name of the Account
name
string
Name of the line item.
description
string
item_order
integer
Order of the items in Purhcase Order
bcy_rate
integer
Rate in Base Currency
unit
string
Unit of the line item e.g. kgs, Nos.
rate
double
Rate of the line item.
quantity
string
Quantity of the line item.
item_total
integer
Total of the Item
item_total_inclusive_of_tax
integer
Total of the Item inclusive tax
tax_exemption_id
string
🇮🇳 India
, 🇦🇺 Australia
, 🇨🇦 Canada
only
ID of the Tax Exemption
tax_exemption_code
string
🇮🇳 India
, 🇦🇺 Australia
, 🇨🇦 Canada
, 🇲🇽 Mexico
only
Code of the Tax Exemption
tax_id
string
tax_treatment_code
string
GCC only
Specify reason for using out of scope.
Supported values for UAE are 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 KSA are ksa_reimbursed_expense.
tax_name
string
Name of the Tax
tax_type
string
Type of the Tax
tax_percentage
integer
Percentage of the Tax
hsn_or_sac
string
🇮🇳 India
only
HSN or SAC Code for the Item
acquisition_vat_id
string
🇬🇧 United Kingdom
, Europe only
ID of the VAT Acquistion
acquisition_vat_name
string
🇬🇧 United Kingdom
, Europe only
Name of the VAT Acquistion
acquisition_vat_percentage
string
🇬🇧 United Kingdom
, Europe only
Percentage of the VAT Acquistion
acquisition_vat_amount
string
🇬🇧 United Kingdom
, Europe only
Amount of the VAT Acquistion
reverse_charge_vat_id
string
🇬🇧 United Kingdom
, Europe only
ID of the Reverse Charge
reverse_charge_vat_name
string
🇬🇧 United Kingdom
, Europe only
Name of the Reverse Charge
reverse_charge_vat_percentage
string
🇬🇧 United Kingdom
, Europe only
Percentage of the Reverse Charge
reverse_charge_vat_amount
string
🇬🇧 United Kingdom
, Europe only
Percentage of the Reverse Charge
tags
array
Show Sub-Attributes arrow
tag_id
long
ID of the Tag
tag_option_id
long
Id of the Tag Option
item_custom_fields
array
Show Sub-Attributes arrow
customfield_id
long
value
string
Value of the Custom Field
project_id
string
ID of the project
project_name
string
Name of the project.
sub_total
double
Sub Total of the Purchase Order
tax_total
double
Total of the Tax
total
double
Total of the Purchase Order
taxes
array
acquisition_vat_summary
array
🇬🇧 United Kingdom
, Europe only
Summary of the VAT Acquistion
Show Sub-Attributes arrow
tax_name
string
Name of the Tax
tax_amount
double
Amount of Tax
acquisition_vat_total
double
🇬🇧 United Kingdom
, Europe only
Total of the VAT Acquistion
reverse_charge_vat_summary
array
🇬🇧 United Kingdom
, Europe only
Summary of the Reverse Charge
Show Sub-Attributes arrow
tax_name
string
Name of the Tax
tax_amount
double
Amount of Tax
reverse_charge_vat_total
double
🇬🇧 United Kingdom
, Europe only
Total of the Reverse Charge
billing_address
object
Show Sub-Attributes arrow
address
string
Address associated with the Purchase Order
street2
string
city
string
City involved in the Address
state
string
State Involved in the Address
zip
string
ZIP Code of the Address
country
string
Country involved in the Address
fax
string
Fax Number
attention
string
Delivery contact person.
notes
string
Delivery note for vendor.
terms
string
Terms for the purchase order
ship_via
string
Shipment Preference
ship_via_id
string
ID of the Shipment Preference
attention
string
Delivery contact person.
delivery_org_address_id
string
ID of the Delivery Address
delivery_customer_id
string
ID of the Customer associated with the Purchase Order
delivery_address
object
Show Sub-Attributes arrow
zip
string
ZIP Code of the Address
is_verifiable
boolean
state
string
State Involved in the Address
address1
string
address2
string
is_valid
string
city
string
City involved in the Address
country
string
Country involved in the Address
address
string
Address associated with the Purchase Order
email
string
Email ID of the Vendor
is_primary
string
organization_address_id
string
ID of organization address.
phone
string
Phone Number of the Associated Contact
is_verified
boolean
price_precision
integer
Price Precision for the Values
custom_fields
array
Custom fields for purchase order.
Show Sub-Attributes arrow
customfield_id
long
value
string
Value of the Custom Field
attachment_name
string
Name of the Attachment
can_send_in_mail
boolean
Boolean to send the attachment with the purchase order when emailed.
template_id
string
ID of the pdf template associated with the purchase order.
template_name
string
Name of the template
page_width
string
Width of the Page
page_height
string
Height of the Page
orientation
string
Orientation of the Page
template_type
string
Type of the Template
created_time
string
Created Time of the Purchase Order
created_by_id
string
ID of the User who created the Purchase Order
last_modified_time
string
Last Modified Time of the Purchase Order
can_mark_as_bill
boolean
can_mark_as_unbill
boolean

Example

{ "purchaseorder_id": "460000000062001", "documents": [ { "document_id": 0, "file_name": "string" } ], "vat_treatment": "string", "gst_no": "22AAAAA0000A1Z5", "gst_treatment": "business_gst", "tax_treatment": "vat_registered", "is_pre_gst": false, "source_of_supply": "AP", "destination_of_supply": "TN", "place_of_supply": "DU", "pricebook_id": 460000000026089, "pricebook_name": "", "is_reverse_charge_applied": false, "purchaseorder_number": "PO-00001", "date": "2014-02-10", "expected_delivery_date": "string", "discount": "10", "discount_account_id": "460000000011105", "is_discount_before_tax": true, "reference_number": "ER/0034", "status": "draft", "vendor_id": "460000000026049", "vendor_name": "string", "crm_owner_id": "string", "contact_persons": [ "460000000026051" ], "currency_id": "460000000000099", "currency_code": "INR", "currency_symbol": "string", "exchange_rate": 1, "delivery_date": "2014-02-10", "is_emailed": false, "is_inclusive_tax": false, "line_items": [ { "item_id": "460000000027009", "line_item_id": "460000000074009", "sku": "string", "warehouse_id": 460000000026051, "warehouse_name": "string", "product_type": "string", "reverse_charge_tax_id": 460000000026068, "reverse_charge_tax_name": "inter", "reverse_charge_tax_percentage": 10, "reverse_charge_tax_amount": 100, "account_id": "460000000074003", "account_name": "Other Expenses", "name": "Hard Drive", "description": "string", "item_order": 0, "bcy_rate": 40, "unit": "Nos", "rate": 112, "quantity": 1, "item_total": 40, "item_total_inclusive_of_tax": 40, "tax_exemption_id": "string", "tax_exemption_code": "string", "tax_id": "string", "tax_treatment_code": "uae_others", "tax_name": "string", "tax_type": "tax", "tax_percentage": 0, "hsn_or_sac": "string", "acquisition_vat_id": "string", "acquisition_vat_name": "string", "acquisition_vat_percentage": "string", "acquisition_vat_amount": "string", "reverse_charge_vat_id": "string", "reverse_charge_vat_name": "string", "reverse_charge_vat_percentage": "string", "reverse_charge_vat_amount": "string", "tags": [ { "tag_id": 0, "tag_option_id": 0 } ], "item_custom_fields": [ { "customfield_id": "46000000012845", "value": "Normal" } ], "project_id": 90300000087378, "project_name": "Sample Project" } ], "sub_total": 40, "tax_total": 0, "total": 40, "taxes": [ "string" ], "acquisition_vat_summary": [ { "tax_name": "string", "tax_amount": 0.1 } ], "acquisition_vat_total": 0.1, "reverse_charge_vat_summary": [ { "tax_name": "string", "tax_amount": 0.1 } ], "reverse_charge_vat_total": 0.1, "billing_address": { "address": "string", "street2": "McMillan Avenue", "city": "string", "state": "string", "zip": "string", "country": "string", "fax": "string", "attention": "string" }, "notes": "Please deliver as soon as possible.", "terms": "Thanks for your business.", "ship_via": "string", "ship_via_id": "string", "attention": "string", "delivery_org_address_id": "string", "delivery_customer_id": "string", "delivery_address": { "zip": "string", "is_verifiable": true, "state": "string", "address1": "string", "address2": "string", "is_valid": "string", "city": "string", "country": "string", "address": "string", "email": "peterparker@bowmanfurniture.com", "is_primary": "string", "organization_address_id": "string", "phone": "+1-925-929-7211", "is_verified": false }, "price_precision": 2, "custom_fields": [ { "customfield_id": "46000000012845", "value": "Normal" } ], "attachment_name": "7.png", "can_send_in_mail": false, "template_id": "460000000011003", "template_name": "Standard Template", "page_width": "8.27in", "page_height": "11.69in", "orientation": "portrait", "template_type": "standard", "created_time": "2014-02-10T15:26:26+0530", "created_by_id": "460000000053001", "last_modified_time": "2014-02-10T15:26:26+0530", "can_mark_as_bill": false, "can_mark_as_unbill": false }

Create a purchase order

Create a purchase order for your vendor.
OAuth Scope : ZohoBooks.purchaseorders.CREATE

Arguments

vendor_id
string
(Required)
ID of the vendor the purchase order has to be created.
currency_id
string
ID of the Currency
contact_persons
array
Array of contact person(s) for whom purchase order has to be sent.
purchaseorder_number
string
Mandatory if auto number generation is disabled.
gst_treatment
string
🇮🇳 India
only
Choose whether the contact is GST registered/unregistered/consumer/overseas. Allowed values are business_gst , business_none , overseas , consumer .
tax_treatment
GCC , 🇲🇽 Mexico
only
VAT treatment for the purchase order. Choose whether the vendor falls under: vat_registered,vat_not_registered,gcc_vat_not_registered,gcc_vat_registered,non_gcc.
dz_vat_registered and dz_vat_not_registered are supported only for UAE.
home_country_mexico,border_region_mexico,non_mexico supported only for MX.
gst_no
string
🇮🇳 India
only
15 digit GST identification number of the vendor.
source_of_supply
string
🇮🇳 India
only
Place from where the goods/services are supplied. (If not given, place of contact given for the contact will be taken)
destination_of_supply
string
🇮🇳 India
only
Place where the goods/services are supplied to. (If not given, organisation's home state will be taken)
place_of_supply
string
GCC only
The place of supply is where a transaction is considered to have occurred for VAT purposes. For the supply of goods, the place of supply is the location of the goods when the supply occurs. For the supply of services, the place of supply should be where the supplier is established. (If not given, 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.
pricebook_id
string
Enter pricebook ID
reference_number
string
Reference number of purchase order.
billing_address_id
long
ID of the Billing Address
crm_owner_id
string
ID of the CRM Owner
crm_custom_reference_id
long
ID of CRM Custom Reference
template_id
string
ID of the pdf template associated with the purchase order.
date
string
The date the purchase order is created.
delivery_date
string
Date of delivery of the purchase order
due_date
string
Delivery date of purchase order.
exchange_rate
double
Exchange rate of the currency.
discount
string
Discount to be applied on Purchase Order.
discount_account_id
string
Account ID for the discount amount.
is_discount_before_tax
boolean
Discount applied before or after applying tax.
is_inclusive_tax
boolean
Not applicable 🇺🇸 United States
Used to specify whether the line item rates are inclusive or exclusive of tax.
notes
string
Delivery note for vendor.
notes_default
string
Default notes for purchase order
terms
string
Terms for the purchase order
terms_default
string
Default terms for Purchase Orders
ship_via
string
Shipment Preference
delivery_org_address_id
string
ID of the Delivery Address
delivery_customer_id
string
ID of the Customer associated with the Purchase Order
attention
string
Delivery contact person.
vat_treatment
string
🇬🇧 United Kingdom
only
(Optional) VAT treatment for the purchase order. VAT treatment denotes the location of the vendor, if the vendor resides in UK then the VAT treatment is uk. If the vendor 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).
is_update_customer
string
Check if customer should be updated
salesorder_id
long
ID of the Sales Order
line_items
array
(Required)
Line items of purchase order.
Show Sub-Attributes arrow
item_id
string
ID of the item.
account_id
string
ID of the account, the line item is associated with.
name
string
Name of the line item.
description
string
unit
string
Unit of the line item e.g. kgs, Nos.
warehouse_id
string
Enter warehouse ID
hsn_or_sac
string
🇮🇳 India
only
HSN or SAC Code for the Item
reverse_charge_tax_id
string
Enter reverse charge tax ID
rate
double
Rate of the line item.
quantity
string
Quantity of the line item.
item_order
integer
Order of the items in Purhcase Order
tax_id
string
tds_tax_id
string
🇲🇽 Mexico
only
tax_treatment_code
string
GCC only
Specify reason for using out of scope.
Supported values for UAE are 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 KSA are ksa_reimbursed_expense.
tax_exemption_code
string
🇮🇳 India
, 🇦🇺 Australia
, 🇨🇦 Canada
, 🇲🇽 Mexico
only
Code of the Tax Exemption
tax_exemption_id
string
🇮🇳 India
, 🇦🇺 Australia
, 🇨🇦 Canada
only
ID of the Tax Exemption
acquisition_vat_id
string
🇬🇧 United Kingdom
, Europe only
ID of the VAT Acquistion
reverse_charge_vat_id
string
🇬🇧 United Kingdom
, Europe only
ID of the Reverse Charge
item_custom_fields
array
Show Sub-Attributes arrow
index
integer
Index of the Custom Field
value
string
Value of the Custom Field
tags
array
Show Sub-Attributes arrow
tag_id
long
ID of the Tag
tag_option_id
long
Id of the Tag Option
project_id
string
ID of the project
custom_fields
array
Custom fields for purchase order.
Show Sub-Attributes arrow
customfield_id
long
value
string
Value of the Custom Field
documents
array
Show Sub-Attributes arrow
document_id
long
ID of the Document
file_name
string
Name of the file

Query Parameters

attachment
Allowed Extensions: gif, png, jpeg, jpg, bmp, pdf, xls, xlsx, doc and docx.
ignore_auto_number_generation
Ignore auto purchase order number generation for this purchase order. This mandates the purchase order number.

Request Example

Click to copy
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/purchaseorders?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/purchaseorders?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/purchaseorders?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/purchaseorders?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/purchaseorders?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/purchaseorders?organization_id=10234695' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "vendor_id": "460000000026049", "currency_id": "460000000000099", "contact_persons": [ "460000000026051" ], "purchaseorder_number": "PO-00001", "gst_treatment": "business_gst", "tax_treatment": "vat_registered", "gst_no": "22AAAAA0000A1Z5", "source_of_supply": "AP", "destination_of_supply": "TN", "place_of_supply": "DU", "pricebook_id": 460000000026089, "reference_number": "ER/0034", "billing_address_id": "460000000017491", "crm_owner_id": "string", "crm_custom_reference_id": 0, "template_id": "460000000011003", "date": "2014-02-10", "delivery_date": "2014-02-10", "due_date": "string", "exchange_rate": 1, "discount": "10", "discount_account_id": "460000000011105", "is_discount_before_tax": true, "is_inclusive_tax": false, "notes": "Please deliver as soon as possible.", "notes_default": "string", "terms": "Thanks for your business.", "terms_default": "string", "ship_via": "string", "delivery_org_address_id": "string", "delivery_customer_id": "string", "attention": "string", "vat_treatment": "string", "is_update_customer": "string", "salesorder_id": "460000124728314", "line_items": [ { "item_id": "460000000027009", "account_id": "460000000074003", "name": "Hard Drive", "description": "string", "unit": "Nos", "warehouse_id": 460000000026051, "hsn_or_sac": "string", "reverse_charge_tax_id": 460000000026068, "rate": 112, "quantity": 1, "item_order": 0, "tax_id": "string", "tds_tax_id": 90300000087370, "tax_treatment_code": "uae_others", "tax_exemption_code": "string", "tax_exemption_id": "string", "acquisition_vat_id": "string", "reverse_charge_vat_id": "string", "item_custom_fields": [ { "index": 1, "value": "Normal" } ], "tags": [ { "tag_id": 0, "tag_option_id": 0 } ], "project_id": 90300000087378 } ], "custom_fields": [ { "customfield_id": "46000000012845", "value": "Normal" } ], "documents": [ { "document_id": 0, "file_name": "string" } ] }

Response Example

{ "code": 0, "message": "Purchase Order has been added.", "purchaseorder": { "purchaseorder_id": "460000000062001", "documents": [ { "document_id": 0, "file_name": "string" } ], "vat_treatment": "string", "gst_no": "22AAAAA0000A1Z5", "gst_treatment": "business_gst", "tax_treatment": "vat_registered", "is_pre_gst": false, "source_of_supply": "AP", "destination_of_supply": "TN", "place_of_supply": "DU", "pricebook_id": 460000000026089, "pricebook_name": "", "is_reverse_charge_applied": false, "purchaseorder_number": "PO-00001", "date": "2014-02-10", "expected_delivery_date": "string", "discount": "10", "discount_account_id": "460000000011105", "is_discount_before_tax": true, "reference_number": "ER/0034", "status": "draft", "vendor_id": "460000000026049", "vendor_name": "string", "crm_owner_id": "string", "contact_persons": [ "460000000026051" ], "currency_id": "460000000000099", "currency_code": "INR", "currency_symbol": "string", "exchange_rate": 1, "delivery_date": "2014-02-10", "is_emailed": false, "is_inclusive_tax": false, "line_items": [ { "item_id": "460000000027009", "line_item_id": "460000000074009", "sku": "string", "warehouse_id": 460000000026051, "warehouse_name": "string", "product_type": "string", "reverse_charge_tax_id": 460000000026068, "reverse_charge_tax_name": "inter", "reverse_charge_tax_percentage": 10, "reverse_charge_tax_amount": 100, "account_id": "460000000074003", "account_name": "Other Expenses", "name": "Hard Drive", "description": "string", "item_order": 0, "bcy_rate": 40, "unit": "Nos", "rate": 112, "quantity": 1, "item_total": 40, "item_total_inclusive_of_tax": 40, "tax_exemption_id": "string", "tax_exemption_code": "string", "tax_id": "string", "tax_treatment_code": "uae_others", "tax_name": "string", "tax_type": "tax", "tax_percentage": 0, "hsn_or_sac": "string", "acquisition_vat_id": "string", "acquisition_vat_name": "string", "acquisition_vat_percentage": "string", "acquisition_vat_amount": "string", "reverse_charge_vat_id": "string", "reverse_charge_vat_name": "string", "reverse_charge_vat_percentage": "string", "reverse_charge_vat_amount": "string", "tags": [ { "tag_id": 0, "tag_option_id": 0 } ], "item_custom_fields": [ { "customfield_id": "46000000012845", "value": "Normal" } ], "project_id": 90300000087378, "project_name": "Sample Project" } ], "sub_total": 40, "tax_total": 0, "total": 40, "taxes": [ "string" ], "acquisition_vat_summary": [ { "tax_name": "string", "tax_amount": 0.1 } ], "acquisition_vat_total": 0.1, "reverse_charge_vat_summary": [ { "tax_name": "string", "tax_amount": 0.1 } ], "reverse_charge_vat_total": 0.1, "billing_address": { "address": "string", "street2": "McMillan Avenue", "city": "string", "state": "string", "zip": "string", "country": "string", "fax": "string", "attention": "string" }, "notes": "Please deliver as soon as possible.", "terms": "Thanks for your business.", "ship_via": "string", "ship_via_id": "string", "attention": "string", "delivery_org_address_id": "string", "delivery_customer_id": "string", "delivery_address": { "zip": "string", "is_verifiable": true, "state": "string", "address1": "string", "address2": "string", "is_valid": "string", "city": "string", "country": "string", "address": "string", "email": "peterparker@bowmanfurniture.com", "is_primary": "string", "organization_address_id": "string", "phone": "+1-925-929-7211", "is_verified": false }, "price_precision": 2, "custom_fields": [ { "customfield_id": "46000000012845", "value": "Normal" } ], "attachment_name": "7.png", "can_send_in_mail": false, "template_id": "460000000011003", "template_name": "Standard Template", "page_width": "8.27in", "page_height": "11.69in", "orientation": "portrait", "template_type": "standard", "created_time": "2014-02-10T15:26:26+0530", "created_by_id": "460000000053001", "last_modified_time": "2014-02-10T15:26:26+0530", "can_mark_as_bill": false, "can_mark_as_unbill": false } }

Update a purchase 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 purchase 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 purchase 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 purchase orders, a new purchase order will be created if the necessary payload details are available
OAuth Scope : ZohoBooks.purchaseorders.UPDATE

Arguments

vendor_id
string
(Required)
ID of the vendor the purchase order has to be created.
currency_id
string
ID of the Currency
contact_persons
array
Array of contact person(s) for whom purchase order has to be sent.
purchaseorder_number
string
Mandatory if auto number generation is disabled.
gst_treatment
string
🇮🇳 India
only
Choose whether the contact is GST registered/unregistered/consumer/overseas. Allowed values are business_gst , business_none , overseas , consumer .
tax_treatment
GCC , 🇲🇽 Mexico
only
VAT treatment for the purchase order. Choose whether the vendor falls under: vat_registered,vat_not_registered,gcc_vat_not_registered,gcc_vat_registered,non_gcc.
dz_vat_registered and dz_vat_not_registered are supported only for UAE.
home_country_mexico,border_region_mexico,non_mexico supported only for MX.
gst_no
string
🇮🇳 India
only
15 digit GST identification number of the vendor.
source_of_supply
string
🇮🇳 India
only
Place from where the goods/services are supplied. (If not given, place of contact given for the contact will be taken)
destination_of_supply
string
🇮🇳 India
only
Place where the goods/services are supplied to. (If not given, organisation's home state will be taken)
place_of_supply
string
GCC only
The place of supply is where a transaction is considered to have occurred for VAT purposes. For the supply of goods, the place of supply is the location of the goods when the supply occurs. For the supply of services, the place of supply should be where the supplier is established. (If not given, 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.
pricebook_id
string
Enter pricebook ID
reference_number
string
Reference number of purchase order.
discount
string
Discount to be applied on Purchase Order.
discount_account_id
string
Account ID for the discount amount.
is_discount_before_tax
boolean
Discount applied before or after applying tax.
billing_address_id
long
ID of the Billing Address
crm_owner_id
string
ID of the CRM Owner
crm_custom_reference_id
long
ID of CRM Custom Reference
template_id
string
ID of the pdf template associated with the purchase order.
date
string
The date the purchase order is created.
delivery_date
string
Date of delivery of the purchase order
due_date
string
Delivery date of purchase order.
exchange_rate
double
Exchange rate of the currency.
is_inclusive_tax
boolean
Not applicable 🇺🇸 United States
Used to specify whether the line item rates are inclusive or exclusive of tax.
notes
string
Delivery note for vendor.
notes_default
string
Default notes for purchase order
terms
string
Terms for the purchase order
terms_default
string
Default terms for Purchase Orders
ship_via
string
Shipment Preference
delivery_org_address_id
string
ID of the Delivery Address
delivery_customer_id
string
ID of the Customer associated with the Purchase Order
attention
string
Delivery contact person.
vat_treatment
string
🇬🇧 United Kingdom
only
(Optional) VAT treatment for the purchase order. VAT treatment denotes the location of the vendor, if the vendor resides in UK then the VAT treatment is uk. If the vendor 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).
is_update_customer
string
Check if customer should be updated
salesorder_id
long
ID of the Sales Order
line_items
array
(Required)
Line items of purchase order.
Show Sub-Attributes arrow
line_item_id
string
ID of the line item. Mandatory if the existing line item has to be updated. If empty, a new line item will be created.
item_id
string
ID of the item.
account_id
string
ID of the account, the line item is associated with.
name
string
Name of the line item.
description
string
unit
string
Unit of the line item e.g. kgs, Nos.
warehouse_id
string
Enter warehouse ID
hsn_or_sac
string
🇮🇳 India
only
HSN or SAC Code for the Item
reverse_charge_tax_id
string
Enter reverse charge tax ID
rate
double
Rate of the line item.
quantity
string
Quantity of the line item.
item_order
integer
Order of the items in Purhcase Order
tax_id
string
tds_tax_id
string
🇲🇽 Mexico
only
tax_treatment_code
string
GCC only
Specify reason for using out of scope.
Supported values for UAE are 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 KSA are ksa_reimbursed_expense.
tax_exemption_code
string
🇮🇳 India
, 🇦🇺 Australia
, 🇨🇦 Canada
, 🇲🇽 Mexico
only
Code of the Tax Exemption
tax_exemption_id
string
🇮🇳 India
, 🇦🇺 Australia
, 🇨🇦 Canada
only
ID of the Tax Exemption
acquisition_vat_id
string
🇬🇧 United Kingdom
, Europe only
ID of the VAT Acquistion
reverse_charge_vat_id
string
🇬🇧 United Kingdom
, Europe only
ID of the Reverse Charge
item_custom_fields
array
Show Sub-Attributes arrow
index
integer
Index of the Custom Field
value
string
Value of the Custom Field
tags
array
Show Sub-Attributes arrow
tag_id
long
ID of the Tag
tag_option_id
long
Id of the Tag Option
project_id
string
ID of the project
custom_fields
array
Custom fields for purchase order.
Show Sub-Attributes arrow
customfield_id
long
value
string
Value of the Custom Field
documents
array
Show Sub-Attributes arrow
document_id
long
ID of the Document
file_name
string
Name of the file

Request Example

Click to copy
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/purchaseorders?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/purchaseorders?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/purchaseorders?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/purchaseorders?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/purchaseorders?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/purchaseorders?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"}'

Body Parameters

Click to copy
{ "vendor_id": "460000000026049", "currency_id": "460000000000099", "contact_persons": [ "460000000026051" ], "purchaseorder_number": "PO-00001", "gst_treatment": "business_gst", "tax_treatment": "vat_registered", "gst_no": "22AAAAA0000A1Z5", "source_of_supply": "AP", "destination_of_supply": "TN", "place_of_supply": "DU", "pricebook_id": 460000000026089, "reference_number": "ER/0034", "discount": "10", "discount_account_id": "460000000011105", "is_discount_before_tax": true, "billing_address_id": "460000000017491", "crm_owner_id": "string", "crm_custom_reference_id": 0, "template_id": "460000000011003", "date": "2014-02-10", "delivery_date": "2014-02-10", "due_date": "string", "exchange_rate": 1, "is_inclusive_tax": false, "notes": "Please deliver as soon as possible.", "notes_default": "string", "terms": "Thanks for your business.", "terms_default": "string", "ship_via": "string", "delivery_org_address_id": "string", "delivery_customer_id": "string", "attention": "string", "vat_treatment": "string", "is_update_customer": "string", "salesorder_id": "460000124728314", "line_items": [ { "line_item_id": "460000000074009", "item_id": "460000000027009", "account_id": "460000000074003", "name": "Hard Drive", "description": "string", "unit": "Nos", "warehouse_id": 460000000026051, "hsn_or_sac": "string", "reverse_charge_tax_id": 460000000026068, "rate": 112, "quantity": 1, "item_order": 0, "tax_id": "string", "tds_tax_id": 90300000087370, "tax_treatment_code": "uae_others", "tax_exemption_code": "string", "tax_exemption_id": "string", "acquisition_vat_id": "string", "reverse_charge_vat_id": "string", "item_custom_fields": [ { "index": 1, "value": "Normal" } ], "tags": [ { "tag_id": 0, "tag_option_id": 0 } ], "project_id": 90300000087378 } ], "custom_fields": [ { "customfield_id": "46000000012845", "value": "Normal" } ], "documents": [ { "document_id": 0, "file_name": "string" } ] }

Response Example

{ "code": 0, "message": "Purchase Order has been updated.", "purchaseorder": { "purchaseorder_id": "460000000062001", "documents": [ { "document_id": 0, "file_name": "string" } ], "vat_treatment": "string", "gst_no": "22AAAAA0000A1Z5", "gst_treatment": "business_gst", "tax_treatment": "vat_registered", "is_pre_gst": false, "source_of_supply": "AP", "destination_of_supply": "TN", "place_of_supply": "DU", "pricebook_id": 460000000026089, "pricebook_name": "", "is_reverse_charge_applied": false, "purchaseorder_number": "PO-00001", "date": "2014-02-10", "expected_delivery_date": "string", "discount": "10", "discount_account_id": "460000000011105", "is_discount_before_tax": true, "reference_number": "ER/0034", "status": "draft", "vendor_id": "460000000026049", "vendor_name": "string", "crm_owner_id": "string", "contact_persons": [ "460000000026051" ], "currency_id": "460000000000099", "currency_code": "INR", "currency_symbol": "string", "exchange_rate": 1, "delivery_date": "2014-02-10", "is_emailed": false, "is_inclusive_tax": false, "line_items": [ { "item_id": "460000000027009", "line_item_id": "460000000074009", "sku": "string", "warehouse_id": 460000000026051, "warehouse_name": "string", "product_type": "string", "reverse_charge_tax_id": 460000000026068, "reverse_charge_tax_name": "inter", "reverse_charge_tax_percentage": 10, "reverse_charge_tax_amount": 100, "account_id": "460000000074003", "account_name": "Other Expenses", "name": "Hard Drive", "description": "string", "item_order": 0, "bcy_rate": 40, "unit": "Nos", "rate": 112, "quantity": 1, "item_total": 40, "item_total_inclusive_of_tax": 40, "tax_exemption_id": "string", "tax_exemption_code": "string", "tax_id": "string", "tax_treatment_code": "uae_others", "tax_name": "string", "tax_type": "tax", "tax_percentage": 0, "hsn_or_sac": "string", "acquisition_vat_id": "string", "acquisition_vat_name": "string", "acquisition_vat_percentage": "string", "acquisition_vat_amount": "string", "reverse_charge_vat_id": "string", "reverse_charge_vat_name": "string", "reverse_charge_vat_percentage": "string", "reverse_charge_vat_amount": "string", "tags": [ { "tag_id": 0, "tag_option_id": 0 } ], "item_custom_fields": [ { "customfield_id": "46000000012845", "value": "Normal" } ], "project_id": 90300000087378, "project_name": "Sample Project" } ], "sub_total": 40, "tax_total": 0, "total": 40, "taxes": [ "string" ], "acquisition_vat_summary": [ { "tax_name": "string", "tax_amount": 0.1 } ], "acquisition_vat_total": 0.1, "reverse_charge_vat_summary": [ { "tax_name": "string", "tax_amount": 0.1 } ], "reverse_charge_vat_total": 0.1, "billing_address": { "address": "string", "street2": "McMillan Avenue", "city": "string", "state": "string", "zip": "string", "country": "string", "fax": "string", "attention": "string" }, "notes": "Please deliver as soon as possible.", "terms": "Thanks for your business.", "ship_via": "string", "ship_via_id": "string", "attention": "string", "delivery_org_address_id": "string", "delivery_customer_id": "string", "delivery_address": { "zip": "string", "is_verifiable": true, "state": "string", "address1": "string", "address2": "string", "is_valid": "string", "city": "string", "country": "string", "address": "string", "email": "peterparker@bowmanfurniture.com", "is_primary": "string", "organization_address_id": "string", "phone": "+1-925-929-7211", "is_verified": false }, "price_precision": 2, "custom_fields": [ { "customfield_id": "46000000012845", "value": "Normal" } ], "attachment_name": "7.png", "can_send_in_mail": false, "template_id": "460000000011003", "template_name": "Standard Template", "page_width": "8.27in", "page_height": "11.69in", "orientation": "portrait", "template_type": "standard", "created_time": "2014-02-10T15:26:26+0530", "created_by_id": "460000000053001", "last_modified_time": "2014-02-10T15:26:26+0530", "can_mark_as_bill": false, "can_mark_as_unbill": false } }

List purchase orders

List all purchase orders.
OAuth Scope : ZohoBooks.purchaseorders.READ

Query Parameters

purchaseorder_number
Search purchase order by purchase order number. Variants: purchaseorder_number.startswith and purchaseorder_number.contains
reference_number
Search purchase order by reference number.Variants: reference_number.startswith and reference_number.contains
date
The date the purchase order is created.
status
Search purchase order by purchase order status. Allowed Values: draft, open, billed and cancelled
item_description
Search purchase order by purchase order item description. Variants: item_description.startswith and item_description.contains
vendor_name
Search purchase order by vendor name. Variants: vendor_name.startswith and vendor_name.contains
total
Search purchase order by purchase order total. Variants: total.start, total.end, total.less_than, total.less_equals, total.greater_than and total.greater_equals
vendor_id
Search purchase order by vendor id.
last_modified_time
Search purchase order by last modified time.
item_id
Search purchase order by item id.
filter_by
Filter purchase order by any status. Allowed Values: Status.All, Status.Draft, Status.Open, Status.Billed and Status.Cancelled.
search_text
Search purchase order by purchase order number or reference number or vendor name.
sort_column
Sort purchase orders. Allowed Values: vendor_name, purchaseorder_number, date, delivery_date, total and created_time.
custom_field
Search purchase order by purchase order’s custom field. Variants: custom_field_startswith, custom_field_contains

Request Example

Click to copy
headers_data = Map(); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/books/v3/purchaseorders?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/purchaseorders?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/purchaseorders?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/purchaseorders?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/purchaseorders?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/purchaseorders?organization_id=10234695' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

{ "code": 0, "message": "success", "purchaseorders": [ { "purchaseorder_id": "460000000062001", "vendor_id": "460000000026049", "vendor_name": "string", "status": "draft", "purchaseorder_number": "PO-00001", "reference_number": "ER/0034", "date": "2014-02-10", "delivery_date": "2014-02-10", "currency_id": "460000000000099", "currency_code": "INR", "price_precision": 2, "total": 40, "has_attachment": false, "created_time": "2014-02-10T15:26:26+0530", "last_modified_time": "2014-02-10T15:26:26+0530", "custom_fields": [ { "customfield_id": "46000000012845", "value": "Normal" } ] }, {...}, {...} ] }

Update a purchase order

Update an existing purchase order.
OAuth Scope : ZohoBooks.purchaseorders.UPDATE

Arguments

vendor_id
string
(Required)
ID of the vendor the purchase order has to be created.
currency_id
string
ID of the Currency
contact_persons
array
Array of contact person(s) for whom purchase order has to be sent.
purchaseorder_number
string
Mandatory if auto number generation is disabled.
gst_treatment
string
🇮🇳 India
only
Choose whether the contact is GST registered/unregistered/consumer/overseas. Allowed values are business_gst , business_none , overseas , consumer .
tax_treatment
GCC , 🇲🇽 Mexico
only
VAT treatment for the purchase order. Choose whether the vendor falls under: vat_registered,vat_not_registered,gcc_vat_not_registered,gcc_vat_registered,non_gcc.
dz_vat_registered and dz_vat_not_registered are supported only for UAE.
home_country_mexico,border_region_mexico,non_mexico supported only for MX.
gst_no
string
🇮🇳 India
only
15 digit GST identification number of the vendor.
source_of_supply
string
🇮🇳 India
only
Place from where the goods/services are supplied. (If not given, place of contact given for the contact will be taken)
destination_of_supply
string
🇮🇳 India
only
Place where the goods/services are supplied to. (If not given, organisation's home state will be taken)
place_of_supply
string
GCC only
The place of supply is where a transaction is considered to have occurred for VAT purposes. For the supply of goods, the place of supply is the location of the goods when the supply occurs. For the supply of services, the place of supply should be where the supplier is established. (If not given, 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.
pricebook_id
string
Enter pricebook ID
reference_number
string
Reference number of purchase order.
discount
string
Discount to be applied on Purchase Order.
discount_account_id
string
Account ID for the discount amount.
is_discount_before_tax
boolean
Discount applied before or after applying tax.
billing_address_id
long
ID of the Billing Address
crm_owner_id
string
ID of the CRM Owner
crm_custom_reference_id
long
ID of CRM Custom Reference
template_id
string
ID of the pdf template associated with the purchase order.
date
string
The date the purchase order is created.
delivery_date
string
Date of delivery of the purchase order
due_date
string
Delivery date of purchase order.
exchange_rate
double
Exchange rate of the currency.
is_inclusive_tax
boolean
Not applicable 🇺🇸 United States
Used to specify whether the line item rates are inclusive or exclusive of tax.
notes
string
Delivery note for vendor.
notes_default
string
Default notes for purchase order
terms
string
Terms for the purchase order
terms_default
string
Default terms for Purchase Orders
ship_via
string
Shipment Preference
delivery_org_address_id
string
ID of the Delivery Address
delivery_customer_id
string
ID of the Customer associated with the Purchase Order
attention
string
Delivery contact person.
vat_treatment
string
🇬🇧 United Kingdom
only
(Optional) VAT treatment for the purchase order. VAT treatment denotes the location of the vendor, if the vendor resides in UK then the VAT treatment is uk. If the vendor 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).
is_update_customer
string
Check if customer should be updated
salesorder_id
long
ID of the Sales Order
line_items
array
(Required)
Line items of purchase order.
Show Sub-Attributes arrow
line_item_id
string
ID of the line item. Mandatory if the existing line item has to be updated. If empty, a new line item will be created.
item_id
string
ID of the item.
account_id
string
ID of the account, the line item is associated with.
name
string
Name of the line item.
description
string
unit
string
Unit of the line item e.g. kgs, Nos.
warehouse_id
string
Enter warehouse ID
hsn_or_sac
string
🇮🇳 India
only
HSN or SAC Code for the Item
reverse_charge_tax_id
string
Enter reverse charge tax ID
rate
double
Rate of the line item.
quantity
string
Quantity of the line item.
item_order
integer
Order of the items in Purhcase Order
tax_id
string
tds_tax_id
string
🇲🇽 Mexico
only
tax_treatment_code
string
GCC only
Specify reason for using out of scope.
Supported values for UAE are 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 KSA are ksa_reimbursed_expense.
tax_exemption_code
string
🇮🇳 India
, 🇦🇺 Australia
, 🇨🇦 Canada
, 🇲🇽 Mexico
only
Code of the Tax Exemption
tax_exemption_id
string
🇮🇳 India
, 🇦🇺 Australia
, 🇨🇦 Canada
only
ID of the Tax Exemption
acquisition_vat_id
string
🇬🇧 United Kingdom
, Europe only
ID of the VAT Acquistion
reverse_charge_vat_id
string
🇬🇧 United Kingdom
, Europe only
ID of the Reverse Charge
item_custom_fields
array
Show Sub-Attributes arrow
index
integer
Index of the Custom Field
value
string
Value of the Custom Field
tags
array
Show Sub-Attributes arrow
tag_id
long
ID of the Tag
tag_option_id
long
Id of the Tag Option
project_id
string
ID of the project
custom_fields
array
Custom fields for purchase order.
Show Sub-Attributes arrow
customfield_id
long
value
string
Value of the Custom Field
documents
array
Show Sub-Attributes arrow
document_id
long
ID of the Document
file_name
string
Name of the file

Query Parameters

attachment
Allowed Extensions: gif, png, jpeg, jpg, bmp, pdf, xls, xlsx, doc and docx.
ignore_auto_number_generation
Ignore auto purchase order number generation for this purchase order. This mandates the purchase order number.

Request Example

Click to copy
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/purchaseorders/?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/purchaseorders/?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/purchaseorders/?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/purchaseorders/?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/purchaseorders/?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/purchaseorders/?organization_id=10234695' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "vendor_id": "460000000026049", "currency_id": "460000000000099", "contact_persons": [ "460000000026051" ], "purchaseorder_number": "PO-00001", "gst_treatment": "business_gst", "tax_treatment": "vat_registered", "gst_no": "22AAAAA0000A1Z5", "source_of_supply": "AP", "destination_of_supply": "TN", "place_of_supply": "DU", "pricebook_id": 460000000026089, "reference_number": "ER/0034", "discount": "10", "discount_account_id": "460000000011105", "is_discount_before_tax": true, "billing_address_id": "460000000017491", "crm_owner_id": "string", "crm_custom_reference_id": 0, "template_id": "460000000011003", "date": "2014-02-10", "delivery_date": "2014-02-10", "due_date": "string", "exchange_rate": 1, "is_inclusive_tax": false, "notes": "Please deliver as soon as possible.", "notes_default": "string", "terms": "Thanks for your business.", "terms_default": "string", "ship_via": "string", "delivery_org_address_id": "string", "delivery_customer_id": "string", "attention": "string", "vat_treatment": "string", "is_update_customer": "string", "salesorder_id": "460000124728314", "line_items": [ { "line_item_id": "460000000074009", "item_id": "460000000027009", "account_id": "460000000074003", "name": "Hard Drive", "description": "string", "unit": "Nos", "warehouse_id": 460000000026051, "hsn_or_sac": "string", "reverse_charge_tax_id": 460000000026068, "rate": 112, "quantity": 1, "item_order": 0, "tax_id": "string", "tds_tax_id": 90300000087370, "tax_treatment_code": "uae_others", "tax_exemption_code": "string", "tax_exemption_id": "string", "acquisition_vat_id": "string", "reverse_charge_vat_id": "string", "item_custom_fields": [ { "index": 1, "value": "Normal" } ], "tags": [ { "tag_id": 0, "tag_option_id": 0 } ], "project_id": 90300000087378 } ], "custom_fields": [ { "customfield_id": "46000000012845", "value": "Normal" } ], "documents": [ { "document_id": 0, "file_name": "string" } ] }

Response Example

{ "code": 0, "message": "Purchase Order has been updated.", "purchaseorder": { "purchaseorder_id": "460000000062001", "documents": [ { "document_id": 0, "file_name": "string" } ], "vat_treatment": "string", "gst_no": "22AAAAA0000A1Z5", "gst_treatment": "business_gst", "tax_treatment": "vat_registered", "is_pre_gst": false, "source_of_supply": "AP", "destination_of_supply": "TN", "place_of_supply": "DU", "pricebook_id": 460000000026089, "pricebook_name": "", "is_reverse_charge_applied": false, "purchaseorder_number": "PO-00001", "date": "2014-02-10", "expected_delivery_date": "string", "discount": "10", "discount_account_id": "460000000011105", "is_discount_before_tax": true, "reference_number": "ER/0034", "status": "draft", "vendor_id": "460000000026049", "vendor_name": "string", "crm_owner_id": "string", "contact_persons": [ "460000000026051" ], "currency_id": "460000000000099", "currency_code": "INR", "currency_symbol": "string", "exchange_rate": 1, "delivery_date": "2014-02-10", "is_emailed": false, "is_inclusive_tax": false, "line_items": [ { "item_id": "460000000027009", "line_item_id": "460000000074009", "sku": "string", "warehouse_id": 460000000026051, "warehouse_name": "string", "product_type": "string", "reverse_charge_tax_id": 460000000026068, "reverse_charge_tax_name": "inter", "reverse_charge_tax_percentage": 10, "reverse_charge_tax_amount": 100, "account_id": "460000000074003", "account_name": "Other Expenses", "name": "Hard Drive", "description": "string", "item_order": 0, "bcy_rate": 40, "unit": "Nos", "rate": 112, "quantity": 1, "item_total": 40, "item_total_inclusive_of_tax": 40, "tax_exemption_id": "string", "tax_exemption_code": "string", "tax_id": "string", "tax_treatment_code": "uae_others", "tax_name": "string", "tax_type": "tax", "tax_percentage": 0, "hsn_or_sac": "string", "acquisition_vat_id": "string", "acquisition_vat_name": "string", "acquisition_vat_percentage": "string", "acquisition_vat_amount": "string", "reverse_charge_vat_id": "string", "reverse_charge_vat_name": "string", "reverse_charge_vat_percentage": "string", "reverse_charge_vat_amount": "string", "tags": [ { "tag_id": 0, "tag_option_id": 0 } ], "item_custom_fields": [ { "customfield_id": "46000000012845", "value": "Normal" } ], "project_id": 90300000087378, "project_name": "Sample Project" } ], "sub_total": 40, "tax_total": 0, "total": 40, "taxes": [ "string" ], "acquisition_vat_summary": [ { "tax_name": "string", "tax_amount": 0.1 } ], "acquisition_vat_total": 0.1, "reverse_charge_vat_summary": [ { "tax_name": "string", "tax_amount": 0.1 } ], "reverse_charge_vat_total": 0.1, "billing_address": { "address": "string", "street2": "McMillan Avenue", "city": "string", "state": "string", "zip": "string", "country": "string", "fax": "string", "attention": "string" }, "notes": "Please deliver as soon as possible.", "terms": "Thanks for your business.", "ship_via": "string", "ship_via_id": "string", "attention": "string", "delivery_org_address_id": "string", "delivery_customer_id": "string", "delivery_address": { "zip": "string", "is_verifiable": true, "state": "string", "address1": "string", "address2": "string", "is_valid": "string", "city": "string", "country": "string", "address": "string", "email": "peterparker@bowmanfurniture.com", "is_primary": "string", "organization_address_id": "string", "phone": "+1-925-929-7211", "is_verified": false }, "price_precision": 2, "custom_fields": [ { "customfield_id": "46000000012845", "value": "Normal" } ], "attachment_name": "7.png", "can_send_in_mail": false, "template_id": "460000000011003", "template_name": "Standard Template", "page_width": "8.27in", "page_height": "11.69in", "orientation": "portrait", "template_type": "standard", "created_time": "2014-02-10T15:26:26+0530", "created_by_id": "460000000053001", "last_modified_time": "2014-02-10T15:26:26+0530", "can_mark_as_bill": false, "can_mark_as_unbill": false } }

Get a purchase order

Get the details of a purchase order.
OAuth Scope : ZohoBooks.purchaseorders.READ

Query Parameters

print
Print the exported pdf.
accept
Get the details of a particular purchase order in formats such as json/ pdf/ html. Default format is json. Allowed Values: json, pdf and html.

Request Example

Click to copy
headers_data = Map(); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/books/v3/purchaseorders/?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/purchaseorders/?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/purchaseorders/?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/purchaseorders/?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/purchaseorders/?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/purchaseorders/?organization_id=10234695' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

{ "code": 0, "message": "success", "purchaseorder": { "purchaseorder_id": "460000000062001", "documents": [ { "document_id": 0, "file_name": "string" } ], "vat_treatment": "string", "gst_no": "22AAAAA0000A1Z5", "gst_treatment": "business_gst", "tax_treatment": "vat_registered", "is_pre_gst": false, "source_of_supply": "AP", "destination_of_supply": "TN", "place_of_supply": "DU", "pricebook_id": 460000000026089, "pricebook_name": "", "is_reverse_charge_applied": false, "purchaseorder_number": "PO-00001", "date": "2014-02-10", "expected_delivery_date": "string", "discount": "10", "discount_account_id": "460000000011105", "is_discount_before_tax": true, "reference_number": "ER/0034", "status": "draft", "vendor_id": "460000000026049", "vendor_name": "string", "crm_owner_id": "string", "contact_persons": [ "460000000026051" ], "currency_id": "460000000000099", "currency_code": "INR", "currency_symbol": "string", "exchange_rate": 1, "delivery_date": "2014-02-10", "is_emailed": false, "is_inclusive_tax": false, "line_items": [ { "item_id": "460000000027009", "line_item_id": "460000000074009", "sku": "string", "warehouse_id": 460000000026051, "warehouse_name": "string", "product_type": "string", "reverse_charge_tax_id": 460000000026068, "reverse_charge_tax_name": "inter", "reverse_charge_tax_percentage": 10, "reverse_charge_tax_amount": 100, "account_id": "460000000074003", "account_name": "Other Expenses", "name": "Hard Drive", "description": "string", "item_order": 0, "bcy_rate": 40, "unit": "Nos", "rate": 112, "quantity": 1, "item_total": 40, "item_total_inclusive_of_tax": 40, "tax_exemption_id": "string", "tax_exemption_code": "string", "tax_id": "string", "tax_treatment_code": "uae_others", "tax_name": "string", "tax_type": "tax", "tax_percentage": 0, "hsn_or_sac": "string", "acquisition_vat_id": "string", "acquisition_vat_name": "string", "acquisition_vat_percentage": "string", "acquisition_vat_amount": "string", "reverse_charge_vat_id": "string", "reverse_charge_vat_name": "string", "reverse_charge_vat_percentage": "string", "reverse_charge_vat_amount": "string", "tags": [ { "tag_id": 0, "tag_option_id": 0 } ], "item_custom_fields": [ { "customfield_id": "46000000012845", "value": "Normal" } ], "project_id": 90300000087378, "project_name": "Sample Project" } ], "sub_total": 40, "tax_total": 0, "total": 40, "taxes": [ "string" ], "acquisition_vat_summary": [ { "tax_name": "string", "tax_amount": 0.1 } ], "acquisition_vat_total": 0.1, "reverse_charge_vat_summary": [ { "tax_name": "string", "tax_amount": 0.1 } ], "reverse_charge_vat_total": 0.1, "billing_address": { "address": "string", "street2": "McMillan Avenue", "city": "string", "state": "string", "zip": "string", "country": "string", "fax": "string", "attention": "string" }, "notes": "Please deliver as soon as possible.", "terms": "Thanks for your business.", "ship_via": "string", "ship_via_id": "string", "attention": "string", "delivery_org_address_id": "string", "delivery_customer_id": "string", "delivery_address": { "zip": "string", "is_verifiable": true, "state": "string", "address1": "string", "address2": "string", "is_valid": "string", "city": "string", "country": "string", "address": "string", "email": "peterparker@bowmanfurniture.com", "is_primary": "string", "organization_address_id": "string", "phone": "+1-925-929-7211", "is_verified": false }, "price_precision": 2, "custom_fields": [ { "customfield_id": "46000000012845", "value": "Normal" } ], "attachment_name": "7.png", "can_send_in_mail": false, "template_id": "460000000011003", "template_name": "Standard Template", "page_width": "8.27in", "page_height": "11.69in", "orientation": "portrait", "template_type": "standard", "created_time": "2014-02-10T15:26:26+0530", "created_by_id": "460000000053001", "last_modified_time": "2014-02-10T15:26:26+0530", "can_mark_as_bill": false, "can_mark_as_unbill": false } }

Delete purchase order

Delete an existing purchase order.
OAuth Scope : ZohoBooks.purchaseorders.DELETE

Request Example

Click to copy
headers_data = Map(); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/books/v3/purchaseorders/?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/purchaseorders/?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/purchaseorders/?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/purchaseorders/?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/purchaseorders/?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/purchaseorders/?organization_id=10234695' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

{ "code": 0, "message": "The purchase order has been deleted." }

Update custom field in existing purchaseorders

Update the value of the custom field in existing purchaseorders.
OAuth Scope : ZohoBooks.purchaseorders.UPDATE

Arguments

customfield_id
long
value
string
Value of the Custom Field

Query Parameters

organization_id
(Required)
ID of the organization

Request Example

Click to copy
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/purchaseorder/460000000062001/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/purchaseorder/460000000062001/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/purchaseorder/460000000062001/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/purchaseorder/460000000062001/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/purchaseorder/460000000062001/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/purchaseorder/460000000062001/customfields?organization_id=10234695' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
[ { "customfield_id": "46000000012845", "value": "Normal" } ]

Response Example

{ "code": 0, "message": "Custom Fields Updated Successfully" }

Mark a purchase order as open

Mark a draft purchase order as open.
OAuth Scope : ZohoBooks.purchaseorders.CREATE

Request Example

Click to copy
headers_data = Map(); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/books/v3/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/status/open?organization_id=10234695' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

{ "code": 0, "message": "The purchase order has been marked as open." }

Mark as billed

Mark a purchase order as billed.
OAuth Scope : ZohoBooks.purchaseorders.CREATE

Request Example

Click to copy
headers_data = Map(); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/books/v3/purchaseorders/460000000062001/status/billed?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/purchaseorders/460000000062001/status/billed?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/purchaseorders/460000000062001/status/billed?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/purchaseorders/460000000062001/status/billed?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/purchaseorders/460000000062001/status/billed?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/purchaseorders/460000000062001/status/billed?organization_id=10234695' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

{ "code": 0, "message": "The purchase order has been marked as billed." }

Cancel a purchase order

Mark a purchase order as cancelled.
OAuth Scope : ZohoBooks.purchaseorders.CREATE

Request Example

Click to copy
headers_data = Map(); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/books/v3/purchaseorders/460000000062001/status/cancelled?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/purchaseorders/460000000062001/status/cancelled?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/purchaseorders/460000000062001/status/cancelled?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/purchaseorders/460000000062001/status/cancelled?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/purchaseorders/460000000062001/status/cancelled?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/purchaseorders/460000000062001/status/cancelled?organization_id=10234695' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

{ "code": 0, "message": "The purchase order has been cancelled." }

Submit a purchase order for approval

Submit a purchase order for approval.
OAuth Scope : ZohoBooks.purchaseorders.CREATE

Request Example

Click to copy
headers_data = Map(); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/books/v3/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/submit?organization_id=10234695' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

{ "code": 0, "message": "The purchase order has been successfully submitted for approval." }

Approve a purchase order

Approve a purchase order.
OAuth Scope : ZohoBooks.purchaseorders.CREATE

Request Example

Click to copy
headers_data = Map(); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/books/v3/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/approve?organization_id=10234695' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

{ "code": 0, "message": "You have approved the Purchase Order." }

Email a purchase order

Email a purchase order to the vendor. Input json string is not mandatory. If input json string is empty, mail will be send with default mail content.
OAuth Scope : ZohoBooks.purchaseorders.CREATE

Arguments

send_from_org_email_id
boolean
Boolean to trigger the email from the organization's email address.
from_address_id
long
ID of From Address of the Email Address
to_mail_ids
array
(Required)
Array of email address of the recipients.
cc_mail_ids
array
Array of email address of the recipients to be cced.
bcc_mail_ids
array
Array of email address of the recipients to be BCC ed.
subject
string
Subject of the mail.
body
string
(Required)
Body of the mail
mail_documents
array
Show Sub-Attributes arrow
document_id
long
ID of the Document
file_name
string
Name of the file

Query Parameters

attachments
The files to be attached with the email.
send_attachment
Send the purchase order attachment a with the email.
file_name
Name of the file

Request Example

Click to copy
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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/email?organization_id=10234695' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "send_from_org_email_id": true, "from_address_id": "460000008392548", "to_mail_ids": [ "willsmith@bowmanfurniture.com" ], "cc_mail_ids": [ "peterparker@bowmanfurniture.com" ], "bcc_mail_ids": [ "mark@safInstruments.com" ], "subject": "Purchase Order from Zillium Inc (PO #: PO-00001)", "body": "Dear Bowman and Co, <br><br>The purchase order (PO-00001) is attached with this email. <br><br>An overview of the purchase order is available below: <br>Purchase Order # : PO-00001 <br>Date : 10 Feb 2014 <br>Amount : $112.00(in USD) <br><br>Please go through it and confirm the order. We look forward to working with you again<br><br><br><br>Regards<br><br>Zillium Inc<br><br>", "mail_documents": [ { "document_id": 0, "file_name": "string" } ] }

Response Example

{ "code": 0, "message": "Your purchase order has been sent." }

Get purchase order email content

Get the email content of a purchase order.
OAuth Scope : ZohoBooks.purchaseorders.READ

Query Parameters

email_template_id
Get the email content based on a specific email template. If this param is not inputted, then the content will be based on the email template associated with the customer. If no template is associated with the customer, then default template will be used.

Request Example

Click to copy
headers_data = Map(); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/books/v3/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/email?organization_id=10234695' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

{ "code": 0, "message": "success" }

Update billing address

Updates the billing address for this purchase order alone.
OAuth Scope : ZohoBooks.purchaseorders.UPDATE

Arguments

address
string
Address associated with the Purchase Order
city
string
City involved in the Address
state
string
State Involved in the Address
zip
string
ZIP Code of the Address
country
string
Country involved in the Address
fax
string
Fax Number
attention
string
Delivery contact person.
is_update_customer
string
Check if customer should be updated

Request Example

Click to copy
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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/address/billing?organization_id=10234695' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "address": "string", "city": "string", "state": "string", "zip": "string", "country": "string", "fax": "string", "attention": "string", "is_update_customer": "string" }

Response Example

{ "code": 0, "message": "Billing address updated." }

List purchase order templates

Get all purchase order pdf templates.
OAuth Scope : ZohoBooks.purchaseorders.READ

Request Example

Click to copy
headers_data = Map(); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/books/v3/purchaseorders/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/purchaseorders/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/purchaseorders/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/purchaseorders/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/purchaseorders/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/purchaseorders/templates?organization_id=10234695' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

{ "code": 0, "message": "success", "templates": [ { "template_name": "Standard Template", "template_id": "460000000011003", "template_type": "standard" }, {...}, {...} ] }

Update purchase order template

Update the pdf template associated with the purchase order.
OAuth Scope : ZohoBooks.purchaseorders.UPDATE

Request Example

Click to copy
headers_data = Map(); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/books/v3/purchaseorders/460000000062001/templates/460000000011003?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/purchaseorders/460000000062001/templates/460000000011003?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/purchaseorders/460000000062001/templates/460000000011003?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/purchaseorders/460000000062001/templates/460000000011003?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/purchaseorders/460000000062001/templates/460000000011003?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/purchaseorders/460000000062001/templates/460000000011003?organization_id=10234695' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

{ "code": 0, "message": "Purchase Order has been updated." }

Add attachment to a purchase order

Attach a file to a purchase order.
OAuth Scope : ZohoBooks.purchaseorders.CREATE

Query Parameters

attachment
Allowed Extensions: gif, png, jpeg, jpg, bmp, pdf, xls, xlsx, doc and docx.

Request Example

Click to copy
headers_data = Map(); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/books/v3/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/attachment?organization_id=10234695' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

{ "code": 0, "message": "The document has been attached." }

Update attachment preference

Set whether you want to send the attached file while emailing the purchase order.
OAuth Scope : ZohoBooks.purchaseorders.UPDATE

Query Parameters

can_send_in_mail
(Required)
Boolean to send the attachment with the purchase order when emailed.

Request Example

Click to copy
headers_data = Map(); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/books/v3/purchaseorders/460000000062001/attachment?organization_id=10234695&can_send_in_mail=false" 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/purchaseorders/460000000062001/attachment?organization_id=10234695&can_send_in_mail=false") .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/purchaseorders/460000000062001/attachment?organization_id=10234695&can_send_in_mail=false', 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/purchaseorders/460000000062001/attachment?organization_id=10234695&can_send_in_mail=false", 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/purchaseorders/460000000062001/attachment?organization_id=10234695&can_send_in_mail=false", "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/purchaseorders/460000000062001/attachment?organization_id=10234695&can_send_in_mail=false' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

{ "code": 0, "message": "Purchase Order has been updated." }

Get a purchase order attachment

Returns the file attached to the purchase order.
OAuth Scope : ZohoBooks.purchaseorders.READ

Query Parameters

preview
Get the thumbnail of the attachment.

Request Example

Click to copy
headers_data = Map(); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/books/v3/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/attachment?organization_id=10234695' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

{ "code": 0, "message": "success" }

Delete an attachment

Delete the file attached to the purchase order.
OAuth Scope : ZohoBooks.purchaseorders.DELETE

Request Example

Click to copy
headers_data = Map(); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/books/v3/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/attachment?organization_id=10234695' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

{ "code": 0, "message": "The attachment has been deleted." }

Add comment

Add a comment for a purchase order.
OAuth Scope : ZohoBooks.purchaseorders.CREATE

Arguments

description
string
(Required)
expected_delivery_date
string
(Required)
Date the goods is expected to arrive.

Request Example

Click to copy
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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/comments?organization_id=10234695' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "description": "string", "expected_delivery_date": "string" }

Response Example

{ "code": 0, "message": "Comments added.", "comment": { "comment_id": "460000000012345", "purchaseorder_id": "460000000062001", "description": "string", "commented_by_id": "string", "commented_by": "string", "comment_type": "system", "date": "2014-02-10", "date_description": "22 hours ago.", "time": "3.26PM" } }

List purchase order comments & history

Get the complete history and comments of purchase order.
OAuth Scope : ZohoBooks.purchaseorders.READ

Request Example

Click to copy
headers_data = Map(); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/books/v3/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/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/purchaseorders/460000000062001/comments?organization_id=10234695' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

{ "code": 0, "message": "success", "comments": [ { "comment_id": "460000000012345", "description": "string", "commented_by_id": "string", "commented_by": "string", "comment_type": "system", "date": "2014-02-10", "date_description": "22 hours ago.", "time": "3.26PM", "operation_type": "Updated", "transaction_id": "string", "transaction_type": "purchaseorder" }, {...}, {...} ] }

Update comment

Update an existing comment of a purchase order.
OAuth Scope : ZohoBooks.purchaseorders.UPDATE

Arguments

description
string
expected_delivery_date
string
Date the goods is expected to arrive.

Request Example

Click to copy
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/purchaseorders/460000000062001/comments/460000000012345?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/purchaseorders/460000000062001/comments/460000000012345?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/purchaseorders/460000000062001/comments/460000000012345?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/purchaseorders/460000000062001/comments/460000000012345?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/purchaseorders/460000000062001/comments/460000000012345?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/purchaseorders/460000000062001/comments/460000000012345?organization_id=10234695' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "description": "string", "expected_delivery_date": "string" }

Response Example

{ "code": 0, "message": "Comment has been updated." }

Delete a comment

Delete a purchase order comment.
OAuth Scope : ZohoBooks.purchaseorders.DELETE

Request Example

Click to copy
headers_data = Map(); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/books/v3/purchaseorders/460000000062001/comments/460000000012345?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/purchaseorders/460000000062001/comments/460000000012345?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/purchaseorders/460000000062001/comments/460000000012345?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/purchaseorders/460000000062001/comments/460000000012345?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/purchaseorders/460000000062001/comments/460000000012345?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/purchaseorders/460000000062001/comments/460000000012345?organization_id=10234695' \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'

Response Example

{ "code": 0, "message": "The comment has been deleted." }