- Introduction
- OAuth
- HTTP Methods
- Response
- Errors
- Pagination
- Organizations
- Contacts
- Contact Persons
- Item Groups
- Items
- Composite Items
- Item Adjustments
- Transfer Orders
- Sales Orders
- Packages
- Shipment Orders
- Invoices
- Overview
- Create an invoice
- List invoices
- Update an invoice
- Get an invoice
- Delete an invoice
- Mark an invoice as sent
- Void an invoice
- Mark as draft
- Email an invoice
- Get invoice email content
- Email invoices
- Get payment reminder mail content
- Bulk export Invoices
- Bulk print invoices
- Disable payment reminder
- Enable payment reminder
- Write off invoice
- Cancel write off
- Update billing address
- Update shipping address
- List invoice templates
- Update invoice template
- List invoice payments
- List credits applied
- Apply credits
- Delete a payment
- Delete applied credit
- Add attachment to an invoice
- Update attachment preference
- Get an invoice attachment
- Delete an attachment
- Add comment
- List invoice comments & history
- Update comment
- Delete a comment
- Retainer Invoices
- Overview
- Create a retainer invoice
- List a retainer invoices
- update a retainer invoice
- Get a retainer invoice
- Delete a retainer invoice
- Mark a retainer invoice as sent
- Update retainer invoice template
- Void a retainer invoice
- Mark as draft
- Submit a retainer invoice for approval
- Approve a retainer invoice.
- Email a retainer invoice
- Get retainer invoice email content
- Update billing address
- List retainer invoice templates
- Add attachment to a retainer invoice
- Get a retainer invoice attachment
- Delete an attachment
- Add comment
- List retainer invoice comments & history
- Update comment
- Delete a comment
- Customer Payments
- Sales Returns
- Credit Notes
- Overview
- Create a credit note
- List all Credit Notes
- Update a credit note
- Get a credit note
- Delete a credit note
- Email a credit note
- Get email content
- Void a Credit Note
- Convert Credit Note to Draft
- Convert credit note to Open
- Submit a credit note for approval
- Approve a credit note
- Email history
- Update billing address
- Update Shipping address
- List the credit note templates
- Update a credit note template
- Apply credits to invoices
- List invoices credited
- Delete credits applied to an invoice
- Add a comment
- List credit note comments & history
- Delete a Comment
- List credit note refunds
- Refund credit note
- List refunds of a credit note
- Update credit note refund
- Get credit note refund
- Delete credit note refund
- Purchase Orders
- Purchase Receives
- Bills
- Vendor Credits
- Overview
- Create a vendor credit
- List vendor credits
- Update vendor credit
- Get vendor credit
- Delete vendor credit
- Convert to open
- Void vendor credit
- Submit a Vendor credit for approval
- Approve a Vendor credit
- Apply credits to a bill
- List bills credited
- Delete bills credited
- Refund a vendor credit
- List refunds of a vendor credit
- Update vendor credit refund
- Get vendor credit refund
- Delete vendor credit refund
- List vendor credit refunds
- Add a comment
- List vendor credit comments & history
- Delete a comment
- Warehouse Settings
- Price Lists
- Taxes
Purchase Orders
A purchase order is an official document that you issue to your vendors, indicating relevant information about what you want to buy, the quantity, the price agreed for that particular product or service.
Attribute
- purchaseorder_idlong
Unique ID generated by the server for the Purchase Order.
- documentsarray
Purchase order can have files attached to them. Each attachment has the following attributes can_send_in_mail, file_name, file_type, file_size_formatted, attachment_order, document_id, file_size.
Show Sub-Attributes
- can_send_in_mailboolean
Checks whether it can be sent in a mail or not.
- file_namestring
This indicates the name of the file.
- file_typestring
This indicates the type of the file.
- file_size_formattedstring
This indicates the size of the formatted file.
- attachment_orderinteger
This indicates the chronological number of the attachment.
- document_idlong
Unique ID generated by the server for the document. This is used as an identifier.
- file_sizelong
this indicates the size of the attached file.
- purchaseorder_numberstring
Purchase Order number.
- datestring
Date of Purchase Order
- expected_delivery_datestring
Expected date of delivery for the items ordered.
- date_formattedstring
Indicates the date format.
- expected_delivery_date_formattedstring
Indicates the date format.
- delivery_date_formattedstring
Indicates the delivery date format.
- status_formattedstring
Indicates the Format of the status.
- billed_statusinteger
Indiacates the Status of the bill.
- is_emailedboolean
Checks whether the purchase order has been emailed or not.
- is_inclusive_taxboolean
This indicates whether the tax is inclusive or not.
- reference_numberstring
Reference number of purchase order.
- statusstring
Status of Purchase Order.
- vendor_idlong
Unique ID generated by the server for the vendor.
- vendor_namestring
Name of the vendor.
- contact_personsarray
Array of contact person IDs.
- is_inclusive_taxboolean
This indicates whether the tax is inclusive or not.
Show Sub-Attributes
- comment_idlong
Unique ID generated by the server for the comment(history). This is used as an identifier.
- purchaseorder_idlong
Unique ID generated by the server for the Purchase Order.
- commented_bystring
Indicates the User who performed the action on the purchase oder
{
"purchaseorder_id": 4815000000044972,
"documents": [
{
"can_send_in_mail": true,
"file_name": "sample.pdf",
"file_type": "pdf",
"file_size_formatted": "116.8 KB",
"attachment_order": 1,
"document_id": 16115000000096068,
"file_size": 11957
}
],
"purchaseorder_number": "PO-00002",
"date": "2015-05-28",
"expected_delivery_date": "2015-05-28",
"date_formatted": "2015/05/28",
"expected_delivery_date_formatted": "2015/05/28",
"delivery_date_formatted": "2015/05/28",
"status_formatted": "Draft",
"billed_status": 1,
"is_emailed": true,
"is_inclusive_tax": false,
"is_backorder": false,
"reference_number": "REF-P-00002",
"status": "Partially_Received",
"vendor_id": 4815000000044080,
"vendor_name": "Molly",
"contact_persons": 4815000000044080,
"comments": [
{
"comment_id": 16115000000097016,
"purchaseorder_id": 4815000000044972,
"commented_by": "John",
"comment_type": "string",
"date_description": "few seconds ago",
"time": "2:18 PM",
"operation_type": "Updated",
"transaction_id": 1232423434,
"transaction_type": "purchaseorder"
}
],
"currency_id": 4815000000000097,
"currency_code": "USD",
"currency_symbol": "$",
"exchange_rate": 1,
"delivery_date": "2015-06-01",
"salesorder_id": 4815000000044936,
"is_drop_shipment": true,
"line_items": [
{
"item_id": 4815000000044100,
"line_item_id": 4815000000044897,
"account_id": 4815000000035003,
"name": "Laptop-white/15inch/dell",
"description": "Just a sample description.",
"item_order": 0,
"bcy_rate": 122,
"purchase_rate": 122,
"quantity": 2,
"quantity_received": 2,
"unit": "qty",
"item_total": 244,
"tax_id": 4815000000044043,
"tax_name": "Sales Tax",
"tax_type": "tax",
"tax_percentage": 12,
"image_id": 2077500000000002000,
"image_name": "dell.jpg",
"image_type": "jpg",
"reverse_charge_tax_id": 460000000026068,
"reverse_charge_tax_name": "inter",
"reverse_charge_tax_percentage": 10,
"reverse_charge_tax_amount": 100,
"hsn_or_sac": "string",
"tax_exemption_code": "string",
"warehouse_id": 130426000000664020,
"tax_exemption_id": "string",
"salesorder_item_id": 4815000000044892
}
],
"sub_total": 244,
"sub_total_formatted": "string",
"tax_total": 29,
"total": 350,
"taxes": [
{
"tax_name": "Sales Tax",
"tax_amount": 29
}
],
"price_precision": 2,
"pricebook_id": 4815000000044054,
"billing_address": [
{
"address": "No:234,90 Church Street",
"city": "New York City",
"state": "New York",
"zip": 10048,
"country": "U.S.A",
"fax": "324-524242"
}
],
"notes": "Sample Note",
"terms": "Terms and Conditions",
"ship_via": "FedEx",
"ship_via_id": 4815000000044822,
"attention": "Tony",
"delivery_org_address_id": 4815000000044077,
"delivery_customer_id": 4815000000044066,
"delivery_customer_name": "Tony",
"delivery_address": [
{
"address": "No:234,90 Church Street",
"city": "New York City",
"state": "New York",
"zip": 10048,
"country": "U.S.A",
"fax": "324-524242"
}
],
"attachment_name": "sample.pdf",
"can_send_in_mail": true,
"template_id": 4815000000017003,
"template_name": "Standard",
"template_type": "standard",
"created_time": "2015-05-28T00:00:00.000Z",
"last_modified_time": "2015-05-28T00:00:00.000Z",
"purchasereceives": [
{
"receive_id": 4815000000045035,
"receive_number": "PR-00002",
"date": "2015-05-28",
"notes": "Sample Note",
"line_items": [
{
"item_id": 4815000000044100,
"line_item_id": 4815000000044897,
"account_id": 4815000000035003,
"name": "Laptop-white/15inch/dell",
"description": "Just a sample description.",
"item_order": 0,
"bcy_rate": 122,
"purchase_rate": 122,
"quantity": 2,
"quantity_received": 2,
"unit": "qty",
"item_total": 244,
"tax_id": 4815000000044043,
"tax_name": "Sales Tax",
"tax_type": "tax",
"tax_percentage": 12,
"image_id": 2077500000000002000,
"image_name": "dell.jpg",
"image_type": "jpg",
"reverse_charge_tax_id": 460000000026068,
"reverse_charge_tax_name": "inter",
"reverse_charge_tax_percentage": 10,
"reverse_charge_tax_amount": 100,
"hsn_or_sac": "string",
"tax_exemption_code": "string",
"warehouse_id": 130426000000664020,
"tax_exemption_id": "string",
"salesorder_item_id": 4815000000044892
}
]
}
],
"bills": [
{
"bill_id": 4815000000045067,
"bill_number": "BL-00002",
"status": "Partially_Received",
"date": "2015-05-28",
"due_date": "2015-06-28",
"total": 350,
"balance": 100
}
],
"gst_treatment": "business_gst",
"gst_no": "22AAAAA0000A1Z5",
"source_of_supply": "AP",
"destination_of_supply": "TN",
"is_pre_gst": false,
"is_reverse_charge_applied": false
}
Create a Purchase Order
Creates a new Sales Order in Zakya. Description about extra parameter ignore_auto_number_generation - Ignore auto sales order number generation for this Purchase order. This mandates the Purchase Order number to be entered. Allowed Values true and false.
curl --request POST \
--url 'https://api.zakya.com/v1/purchaseorders?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
parameters_data='{"field1":"value1","field2":"value2"}';
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/v1/purchaseorders?organization_id=10234695"
type: POST
headers: headers_data
content-type: application/json
parameters: parameters_data
connection:
]
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://api.zakya.com/v1/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 http = require("https");
const options = {
"method": "POST",
"hostname": "api.zakya.com",
"port": null,
"path": "/v1/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();
const options = {
method: 'POST',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
'content-type': 'application/json'
},
body: '{"field1":"value1","field2":"value2"}'
};
fetch('https://api.zakya.com/v1/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("api.zakya.com")
payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}"
headers = {
'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
'content-type': "application/json"
}
conn.request("POST", "/v1/purchaseorders?organization_id=10234695", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
{
"purchaseorder_number": "PO-00002",
"date": "2015-05-28",
"delivery_date": "2015-06-01",
"reference_number": "REF-P-00002",
"ship_via": "FedEx",
"vendor_id": 4815000000044080,
"salesorder_id": 4815000000044936,
"is_drop_shipment": true,
"is_inclusive_tax": false,
"is_backorder": false,
"template_id": 4815000000017003,
"contact_persons": 4815000000044080,
"attention": "Tony",
"delivery_org_address_id": 4815000000044077,
"delivery_customer_id": 4815000000044066,
"notes": "Sample Note",
"terms": "Terms and Conditions",
"exchange_rate": 1,
"line_items": [
{
"item_id": 4815000000044100,
"account_id": 4815000000035003,
"name": "Laptop-white/15inch/dell",
"description": "Just a sample description.",
"item_order": 0,
"bcy_rate": 122,
"purchase_rate": 122,
"quantity": 2,
"quantity_received": 2,
"unit": "qty",
"item_total": 244,
"tax_id": 4815000000044043,
"tax_name": "Sales Tax",
"tax_type": "tax",
"tax_percentage": 12,
"image_id": 2077500000000002000,
"image_name": "dell.jpg",
"image_type": "jpg",
"reverse_charge_tax_id": 460000000026068,
"hsn_or_sac": "string",
"tax_exemption_code": "string",
"warehouse_id": 130426000000664020,
"tax_exemption_id": "string",
"salesorder_item_id": 4815000000044892
}
],
"documents": [
{
"can_send_in_mail": true,
"file_name": "sample.pdf",
"file_type": "pdf",
"file_size_formatted": "116.8 KB",
"attachment_order": 1,
"document_id": 16115000000096068,
"file_size": 11957
}
],
"gst_treatment": "business_gst",
"gst_no": "22AAAAA0000A1Z5",
"source_of_supply": "AP",
"destination_of_supply": "TN"
}
{
"code": 0,
"message": "success",
"purchase_order": {
"purchaseorder_id": 4815000000044972,
"documents": [
{
"can_send_in_mail": true,
"file_name": "sample.pdf",
"file_type": "pdf",
"file_size_formatted": "116.8 KB",
"attachment_order": 1,
"document_id": 16115000000096068,
"file_size": 11957
}
],
"purchaseorder_number": "PO-00002",
"date": "2015-05-28",
"expected_delivery_date": "2015-05-28",
"date_formatted": "2015/05/28",
"expected_delivery_date_formatted": "2015/05/28",
"delivery_date_formatted": "2015/05/28",
"status_formatted": "Draft",
"billed_status": 1,
"is_emailed": true,
"is_inclusive_tax": false,
"is_backorder": false,
"reference_number": "REF-P-00002",
"status": "Partially_Received",
"vendor_id": 4815000000044080,
"vendor_name": "Molly",
"contact_persons": 4815000000044080,
"comments": [
{
"comment_id": 16115000000097016,
"purchaseorder_id": 4815000000044972,
"commented_by": "John",
"comment_type": "string",
"date_description": "few seconds ago",
"time": "2:18 PM",
"operation_type": "Updated",
"transaction_id": 1232423434,
"transaction_type": "purchaseorder"
}
],
"currency_id": 4815000000000097,
"currency_code": "USD",
"currency_symbol": "$",
"exchange_rate": 1,
"delivery_date": "2015-06-01",
"salesorder_id": 4815000000044936,
"is_drop_shipment": true,
"line_items": [
{
"item_id": 4815000000044100,
"line_item_id": 4815000000044897,
"account_id": 4815000000035003,
"name": "Laptop-white/15inch/dell",
"description": "Just a sample description.",
"item_order": 0,
"bcy_rate": 122,
"purchase_rate": 122,
"quantity": 2,
"quantity_received": 2,
"unit": "qty",
"item_total": 244,
"tax_id": 4815000000044043,
"tax_name": "Sales Tax",
"tax_type": "tax",
"tax_percentage": 12,
"image_id": 2077500000000002000,
"image_name": "dell.jpg",
"image_type": "jpg",
"reverse_charge_tax_id": 460000000026068,
"reverse_charge_tax_name": "inter",
"reverse_charge_tax_percentage": 10,
"reverse_charge_tax_amount": 100,
"hsn_or_sac": "string",
"tax_exemption_code": "string",
"warehouse_id": 130426000000664020,
"tax_exemption_id": "string",
"salesorder_item_id": 4815000000044892
}
],
"sub_total": 244,
"sub_total_formatted": "string",
"tax_total": 29,
"total": 350,
"taxes": [
{
"tax_name": "Sales Tax",
"tax_amount": 29
}
],
"price_precision": 2,
"pricebook_id": 4815000000044054,
"billing_address": [
{
"address": "No:234,90 Church Street",
"city": "New York City",
"state": "New York",
"zip": 10048,
"country": "U.S.A",
"fax": "324-524242"
}
],
"notes": "Sample Note",
"terms": "Terms and Conditions",
"ship_via": "FedEx",
"ship_via_id": 4815000000044822,
"attention": "Tony",
"delivery_org_address_id": 4815000000044077,
"delivery_customer_id": 4815000000044066,
"delivery_customer_name": "Tony",
"delivery_address": [
{
"address": "No:234,90 Church Street",
"city": "New York City",
"state": "New York",
"zip": 10048,
"country": "U.S.A",
"fax": "324-524242"
}
],
"attachment_name": "sample.pdf",
"can_send_in_mail": true,
"template_id": 4815000000017003,
"template_name": "Standard",
"template_type": "standard",
"created_time": "2015-05-28T00:00:00.000Z",
"last_modified_time": "2015-05-28T00:00:00.000Z",
"purchasereceives": [
{
"receive_id": 4815000000045035,
"receive_number": "PR-00002",
"date": "2015-05-28",
"notes": "Sample Note",
"line_items": [
{
"item_id": 4815000000044100,
"line_item_id": 4815000000044897,
"account_id": 4815000000035003,
"name": "Laptop-white/15inch/dell",
"description": "Just a sample description.",
"item_order": 0,
"bcy_rate": 122,
"purchase_rate": 122,
"quantity": 2,
"quantity_received": 2,
"unit": "qty",
"item_total": 244,
"tax_id": 4815000000044043,
"tax_name": "Sales Tax",
"tax_type": "tax",
"tax_percentage": 12,
"image_id": 2077500000000002000,
"image_name": "dell.jpg",
"image_type": "jpg",
"reverse_charge_tax_id": 460000000026068,
"reverse_charge_tax_name": "inter",
"reverse_charge_tax_percentage": 10,
"reverse_charge_tax_amount": 100,
"hsn_or_sac": "string",
"tax_exemption_code": "string",
"warehouse_id": 130426000000664020,
"tax_exemption_id": "string",
"salesorder_item_id": 4815000000044892
}
]
}
],
"bills": [
{
"bill_id": 4815000000045067,
"bill_number": "BL-00002",
"status": "Partially_Received",
"date": "2015-05-28",
"due_date": "2015-06-28",
"total": 350,
"balance": 100
}
],
"gst_treatment": "business_gst",
"gst_no": "22AAAAA0000A1Z5",
"source_of_supply": "AP",
"destination_of_supply": "TN",
"is_pre_gst": false,
"is_reverse_charge_applied": false
}
}
List all Purchase Orders
Lists all the Purchase Orders present in Zakya.
OAuth Scope : ZakyaAPI.purchaseorders.READ
curl --request GET \
--url 'https://api.zakya.com/v1/purchaseorders?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/v1/purchaseorders?organization_id=10234695"
type: GET
headers: headers_data
connection:
]
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.zakya.com/v1/purchaseorders?organization_id=10234695")
.get()
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
const http = require("https");
const options = {
"method": "GET",
"hostname": "api.zakya.com",
"port": null,
"path": "/v1/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();
const options = {
method: 'GET',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://api.zakya.com/v1/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("api.zakya.com")
headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }
conn.request("GET", "/v1/purchaseorders?organization_id=10234695", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
{
"code": 0,
"message": "success",
"purchaseorders": [
{
"purchaseorder_id": 4815000000044972,
"vendor_id": 4815000000044080,
"vendor_name": "Molly",
"status": "Partially_Received",
"purchaseorder_number": "PO-00002",
"reference_number": "REF-P-00002",
"date": "2015-05-28",
"delivery_date": "2015-06-01",
"currency_id": 4815000000000097,
"currency_code": "USD",
"price_precision": 2,
"total": 350,
"created_time": "2015-05-28T00:00:00.000Z",
"last_modified_time": "2015-05-28T00:00:00.000Z",
"is_drop_shipment": true,
"is_backorder": false,
"receives": [
{
"receive_id": 4815000000045035,
"receive_number": "PR-00002"
}
]
},
{...},
{...}
]
}
Update a Purchase Order
Updates a new Sales Order in Zakya. Description about extra parameter ignore_auto_number_generation - Ignore auto Purchase order number generation for this Purchase Order. This mandates the Purchase Order number to be entered. Allowed Values true and false.
OAuth Scope : ZakyaAPI.purchaseorders.UPDATE
curl --request PUT \
--url 'https://api.zakya.com/v1/purchaseorders/4815000000044972?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
parameters_data='{"field1":"value1","field2":"value2"}';
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/v1/purchaseorders/4815000000044972?organization_id=10234695"
type: PUT
headers: headers_data
content-type: application/json
parameters: parameters_data
connection:
]
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://api.zakya.com/v1/purchaseorders/4815000000044972?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 http = require("https");
const options = {
"method": "PUT",
"hostname": "api.zakya.com",
"port": null,
"path": "/v1/purchaseorders/4815000000044972?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();
const options = {
method: 'PUT',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
'content-type': 'application/json'
},
body: '{"field1":"value1","field2":"value2"}'
};
fetch('https://api.zakya.com/v1/purchaseorders/4815000000044972?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("api.zakya.com")
payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}"
headers = {
'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
'content-type': "application/json"
}
conn.request("PUT", "/v1/purchaseorders/4815000000044972?organization_id=10234695", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
{
"purchaseorder_number": "PO-00002",
"date": "2015-05-28",
"expected_delivery_date": "2015-05-28",
"reference_number": "REF-P-00002",
"ship_via": "FedEx",
"vendor_id": 4815000000044080,
"salesorder_id": 4815000000044936,
"is_drop_shipment": true,
"contact_persons": 4815000000044080,
"attention": "Tony",
"delivery_org_address_id": 4815000000044077,
"delivery_customer_id": 4815000000044066,
"notes": "Sample Note",
"terms": "Terms and Conditions",
"exchange_rate": 1,
"line_items": [
{
"item_id": 4815000000044100,
"line_item_id": 4815000000044897,
"account_id": 4815000000035003,
"name": "Laptop-white/15inch/dell",
"description": "Just a sample description.",
"item_order": 0,
"bcy_rate": 122,
"purchase_rate": 122,
"quantity": 2,
"quantity_received": 2,
"unit": "qty",
"item_total": 244,
"tax_id": 4815000000044043,
"tax_name": "Sales Tax",
"tax_type": "tax",
"tax_percentage": 12,
"image_id": 2077500000000002000,
"image_name": "dell.jpg",
"image_type": "jpg",
"reverse_charge_tax_id": 460000000026068,
"hsn_or_sac": "string",
"tax_exemption_code": "string",
"warehouse_id": 130426000000664020,
"tax_exemption_id": "string",
"salesorder_item_id": 4815000000044892
}
],
"gst_treatment": "business_gst",
"gst_no": "22AAAAA0000A1Z5",
"source_of_supply": "AP",
"destination_of_supply": "TN"
}
{
"code": 0,
"message": "success",
"purchase_order": {
"purchaseorder_id": 4815000000044972,
"purchaseorder_number": "PO-00002",
"date": "2015-05-28",
"expected_delivery_date": "2015-05-28",
"reference_number": "REF-P-00002",
"status": "Partially_Received",
"vendor_id": 4815000000044080,
"vendor_name": "Molly",
"contact_persons": 4815000000044080,
"currency_id": 4815000000000097,
"currency_code": "USD",
"currency_symbol": "$",
"exchange_rate": 1,
"delivery_date": "2015-06-01",
"salesorder_id": 4815000000044936,
"is_drop_shipment": true,
"line_items": [
{
"item_id": 4815000000044100,
"line_item_id": 4815000000044897,
"account_id": 4815000000035003,
"name": "Laptop-white/15inch/dell",
"description": "Just a sample description.",
"item_order": 0,
"bcy_rate": 122,
"purchase_rate": 122,
"quantity": 2,
"quantity_received": 2,
"unit": "qty",
"item_total": 244,
"tax_id": 4815000000044043,
"tax_name": "Sales Tax",
"tax_type": "tax",
"tax_percentage": 12,
"image_id": 2077500000000002000,
"image_name": "dell.jpg",
"image_type": "jpg",
"reverse_charge_tax_id": 460000000026068,
"reverse_charge_tax_name": "inter",
"reverse_charge_tax_percentage": 10,
"reverse_charge_tax_amount": 100,
"hsn_or_sac": "string",
"tax_exemption_code": "string",
"warehouse_id": 130426000000664020,
"tax_exemption_id": "string",
"salesorder_item_id": 4815000000044892
}
],
"sub_total": 244,
"tax_total": 29,
"total": 350,
"taxes": [
{
"tax_name": "Sales Tax",
"tax_amount": 29
}
],
"price_precision": 2,
"pricebook_id": 4815000000044054,
"billing_address": [
{
"address": "No:234,90 Church Street",
"city": "New York City",
"state": "New York",
"zip": 10048,
"country": "U.S.A",
"fax": "324-524242"
}
],
"notes": "Sample Note",
"terms": "Terms and Conditions",
"ship_via": "FedEx",
"ship_via_id": 4815000000044822,
"attention": "Tony",
"delivery_org_address_id": 4815000000044077,
"delivery_customer_id": 4815000000044066,
"delivery_customer_name": "Tony",
"delivery_address": [
{
"address": "No:234,90 Church Street",
"city": "New York City",
"state": "New York",
"zip": 10048,
"country": "U.S.A",
"fax": "324-524242"
}
],
"attachment_name": "sample.pdf",
"can_send_in_mail": true,
"template_id": 4815000000017003,
"template_name": "Standard",
"template_type": "standard",
"created_time": "2015-05-28T00:00:00.000Z",
"last_modified_time": "2015-05-28T00:00:00.000Z",
"purchasereceives": [
{
"receive_id": 4815000000045035,
"receive_number": "PR-00002",
"date": "2015-05-28",
"notes": "Sample Note",
"line_items": [
{
"item_id": 4815000000044100,
"line_item_id": 4815000000044897,
"account_id": 4815000000035003,
"name": "Laptop-white/15inch/dell",
"description": "Just a sample description.",
"item_order": 0,
"bcy_rate": 122,
"purchase_rate": 122,
"quantity": 2,
"quantity_received": 2,
"unit": "qty",
"item_total": 244,
"tax_id": 4815000000044043,
"tax_name": "Sales Tax",
"tax_type": "tax",
"tax_percentage": 12,
"image_id": 2077500000000002000,
"image_name": "dell.jpg",
"image_type": "jpg",
"reverse_charge_tax_id": 460000000026068,
"reverse_charge_tax_name": "inter",
"reverse_charge_tax_percentage": 10,
"reverse_charge_tax_amount": 100,
"hsn_or_sac": "string",
"tax_exemption_code": "string",
"warehouse_id": 130426000000664020,
"tax_exemption_id": "string",
"salesorder_item_id": 4815000000044892
}
]
}
],
"bills": [
{
"bill_id": 4815000000045067,
"bill_number": "BL-00002",
"status": "Partially_Received",
"date": "2015-05-28",
"due_date": "2015-06-28",
"total": 350,
"balance": 100
}
],
"gst_treatment": "business_gst",
"gst_no": "22AAAAA0000A1Z5",
"source_of_supply": "AP",
"destination_of_supply": "TN",
"is_pre_gst": false,
"is_reverse_charge_applied": false
}
}
Retrieve a Purchase Order
Retrieves the details for an existing Purchase Order.
OAuth Scope : ZakyaAPI.purchaseorders.READ
curl --request GET \
--url 'https://api.zakya.com/v1/purchaseorders/4815000000044972?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/v1/purchaseorders/4815000000044972?organization_id=10234695"
type: GET
headers: headers_data
connection:
]
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.zakya.com/v1/purchaseorders/4815000000044972?organization_id=10234695")
.get()
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
const http = require("https");
const options = {
"method": "GET",
"hostname": "api.zakya.com",
"port": null,
"path": "/v1/purchaseorders/4815000000044972?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();
const options = {
method: 'GET',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://api.zakya.com/v1/purchaseorders/4815000000044972?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("api.zakya.com")
headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }
conn.request("GET", "/v1/purchaseorders/4815000000044972?organization_id=10234695", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
{
"code": 0,
"message": "success",
"purchase_order": {
"purchaseorder_id": 4815000000044972,
"purchaseorder_number": "PO-00002",
"date": "2015-05-28",
"expected_delivery_date": "2015-05-28",
"reference_number": "REF-P-00002",
"status": "Partially_Received",
"vendor_id": 4815000000044080,
"vendor_name": "Molly",
"contact_persons": 4815000000044080,
"currency_id": 4815000000000097,
"currency_code": "USD",
"currency_symbol": "$",
"exchange_rate": 1,
"delivery_date": "2015-06-01",
"salesorder_id": 4815000000044936,
"is_drop_shipment": true,
"is_backorder": false,
"line_items": [
{
"item_id": 4815000000044100,
"line_item_id": 4815000000044897,
"account_id": 4815000000035003,
"name": "Laptop-white/15inch/dell",
"description": "Just a sample description.",
"item_order": 0,
"bcy_rate": 122,
"purchase_rate": 122,
"quantity": 2,
"quantity_received": 2,
"unit": "qty",
"item_total": 244,
"tax_id": 4815000000044043,
"tax_name": "Sales Tax",
"tax_type": "tax",
"tax_percentage": 12,
"image_id": 2077500000000002000,
"image_name": "dell.jpg",
"image_type": "jpg",
"reverse_charge_tax_id": 460000000026068,
"reverse_charge_tax_name": "inter",
"reverse_charge_tax_percentage": 10,
"reverse_charge_tax_amount": 100,
"hsn_or_sac": "string",
"tax_exemption_code": "string",
"warehouse_id": 130426000000664020,
"tax_exemption_id": "string",
"salesorder_item_id": 4815000000044892
}
],
"sub_total": 244,
"tax_total": 29,
"total": 350,
"taxes": [
{
"tax_name": "Sales Tax",
"tax_amount": 29
}
],
"price_precision": 2,
"pricebook_id": 4815000000044054,
"billing_address": [
{
"address": "No:234,90 Church Street",
"city": "New York City",
"state": "New York",
"zip": 10048,
"country": "U.S.A",
"fax": "324-524242"
}
],
"notes": "Sample Note",
"terms": "Terms and Conditions",
"ship_via": "FedEx",
"ship_via_id": 4815000000044822,
"attention": "Tony",
"delivery_org_address_id": 4815000000044077,
"delivery_customer_id": 4815000000044066,
"delivery_customer_name": "Tony",
"delivery_address": [
{
"address": "No:234,90 Church Street",
"city": "New York City",
"state": "New York",
"zip": 10048,
"country": "U.S.A",
"fax": "324-524242"
}
],
"attachment_name": "sample.pdf",
"can_send_in_mail": true,
"template_id": 4815000000017003,
"template_name": "Standard",
"template_type": "standard",
"created_time": "2015-05-28T00:00:00.000Z",
"last_modified_time": "2015-05-28T00:00:00.000Z",
"purchasereceives": [
{
"receive_id": 4815000000045035,
"receive_number": "PR-00002",
"date": "2015-05-28",
"notes": "Sample Note",
"line_items": [
{
"item_id": 4815000000044100,
"line_item_id": 4815000000044897,
"account_id": 4815000000035003,
"name": "Laptop-white/15inch/dell",
"description": "Just a sample description.",
"item_order": 0,
"bcy_rate": 122,
"purchase_rate": 122,
"quantity": 2,
"quantity_received": 2,
"unit": "qty",
"item_total": 244,
"tax_id": 4815000000044043,
"tax_name": "Sales Tax",
"tax_type": "tax",
"tax_percentage": 12,
"image_id": 2077500000000002000,
"image_name": "dell.jpg",
"image_type": "jpg",
"reverse_charge_tax_id": 460000000026068,
"reverse_charge_tax_name": "inter",
"reverse_charge_tax_percentage": 10,
"reverse_charge_tax_amount": 100,
"hsn_or_sac": "string",
"tax_exemption_code": "string",
"warehouse_id": 130426000000664020,
"tax_exemption_id": "string",
"salesorder_item_id": 4815000000044892
}
]
}
],
"bills": [
{
"bill_id": 4815000000045067,
"bill_number": "BL-00002",
"status": "Partially_Received",
"date": "2015-05-28",
"due_date": "2015-06-28",
"total": 350,
"balance": 100
}
],
"gst_treatment": "business_gst",
"gst_no": "22AAAAA0000A1Z5",
"source_of_supply": "AP",
"destination_of_supply": "TN",
"is_pre_gst": false,
"is_reverse_charge_applied": false
}
}
Delete a Purchase Order
Deletes a Purchase Order from Zakya.
OAuth Scope : ZakyaAPI.purchaseorders.DELETE
curl --request DELETE \
--url 'https://api.zakya.com/v1/purchaseorders/4815000000044972?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/v1/purchaseorders/4815000000044972?organization_id=10234695"
type: DELETE
headers: headers_data
connection:
]
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.zakya.com/v1/purchaseorders/4815000000044972?organization_id=10234695")
.delete(null)
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
const http = require("https");
const options = {
"method": "DELETE",
"hostname": "api.zakya.com",
"port": null,
"path": "/v1/purchaseorders/4815000000044972?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();
const options = {
method: 'DELETE',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://api.zakya.com/v1/purchaseorders/4815000000044972?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("api.zakya.com")
headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }
conn.request("DELETE", "/v1/purchaseorders/4815000000044972?organization_id=10234695", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
{
"code": 0,
"message": "The Purchase Order has been deleted."
}
Mark as Issued
Marks a Purchase Order as Issued.
OAuth Scope : ZakyaAPI.purchaseorders.CREATE
curl --request POST \
--url 'https://api.zakya.com/v1/purchaseorders/4815000000044972/status/issued?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/v1/purchaseorders/4815000000044972/status/issued?organization_id=10234695"
type: POST
headers: headers_data
connection:
]
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.zakya.com/v1/purchaseorders/4815000000044972/status/issued?organization_id=10234695")
.post(null)
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
const http = require("https");
const options = {
"method": "POST",
"hostname": "api.zakya.com",
"port": null,
"path": "/v1/purchaseorders/4815000000044972/status/issued?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();
const options = {
method: 'POST',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://api.zakya.com/v1/purchaseorders/4815000000044972/status/issued?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("api.zakya.com")
headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }
conn.request("POST", "/v1/purchaseorders/4815000000044972/status/issued?organization_id=10234695", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
{
"code": 0,
"message": "The purchase order has been marked as issued."
}
Mark as Cancelled
Marks a Purchase Order as Cancelled.
OAuth Scope : ZakyaAPI.purchaseorders.CREATE
curl --request POST \
--url 'https://api.zakya.com/v1/purchaseorders/4815000000044972/status/cancelled?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/v1/purchaseorders/4815000000044972/status/cancelled?organization_id=10234695"
type: POST
headers: headers_data
connection:
]
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.zakya.com/v1/purchaseorders/4815000000044972/status/cancelled?organization_id=10234695")
.post(null)
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
const http = require("https");
const options = {
"method": "POST",
"hostname": "api.zakya.com",
"port": null,
"path": "/v1/purchaseorders/4815000000044972/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();
const options = {
method: 'POST',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://api.zakya.com/v1/purchaseorders/4815000000044972/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("api.zakya.com")
headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }
conn.request("POST", "/v1/purchaseorders/4815000000044972/status/cancelled?organization_id=10234695", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
{
"code": 0,
"message": "The purchase order has been marked as cancelled."
}