Purchase Receives
A new purchase receive can a be created.To create Purchase receive, URL parameter purchaseorder_id is needed.
End Points
Create a purchase receive
Retrieve a Purchase Receive
Delete a Purchase Receive
Attribute
purchaseorder_id
long
Unique ID generated by the server for the Purchase Order.
purchaseorder_number
string
Purchase Order number.
receive_id
long
Unique ID generated by the server for the Purchase Receive. This is used as identifier.
receive_number
string
Number of the Purchase Receive.
date
string
Date of Purchase Order
vendor_id
long
Unique ID generated by the server for the vendor.
vendor_name
string
Name of the vendor.
contact_persons
array
Array of contact person IDs.
notes
string
Purchase Receive notes.
line_items
array
Number of line items for purchase receive. Each line item contains
line_item_id
, item_id
, name
, description
, item_order
, quantity
and unit
. line_item_id
long
Unique ID generated by the server for each line item. This is used as an identifier.
item_id
long
Unique ID generated by the server for the item. This is used as an identifier.
name
string
Name of the line item.
description
string
Description of the line item.
item_order
integer
The order of the line items, starts from
0
by default. quantity
double
Quantity of the line item.
unit
string
Unit of line item.
billing_address
array
Customer's billing address. It contains -
address
, city
, state
, zip
, country
and fax
. address
string
Name of the street of the customer’s billing address.
city
string
Name of the city of the customer’s billing address.
state
string
Name of the state of the customer's billing address.
zip
string
Zip code of the customer’s billing address.
country
string
Name of the country of the customer’s billing address.
fax
string
Fax number of the customer’s billing address.
shipping_address
array
Customer's shipping address. It contains -
address
, city
, state
, zip
, country
and fax
. address
string
Name of the street of the customer’s billing address.
city
string
Name of the city of the customer’s billing address.
state
string
Name of the state of the customer's billing address.
zip
string
Zip code of the customer’s billing address.
country
string
Name of the country of the customer’s billing address.
fax
string
Fax number of the customer’s billing address.
created_time
string
Time at which the Purchase Receive was created.
last_modified_time
string
Time at which the Purchase Order details were last modified.
{
"purchaseorder_id": 4815000000044972,
"purchaseorder_number": "PO-00002",
"receive_id": 4815000000045035,
"receive_number": "PR-00002",
"date": "2015-05-28",
"vendor_id": 4815000000044080,
"vendor_name": "Molly",
"contact_persons": 4815000000044080,
"notes": "Sample Note.",
"line_items": [
{
"line_item_id": 4815000000044897,
"item_id": 4815000000044100,
"name": "Laptop-white/15inch/dell",
"description": "Just a sample description.",
"item_order": 0,
"quantity": 2,
"unit": "qty"
}
],
"billing_address": [
{
"address": "No:234,90 Church Street",
"city": "New York City",
"state": "New York",
"zip": 10048,
"country": "U.S.A",
"fax": "324-524242"
}
],
"shipping_address": [
{
"address": "No:234,90 Church Street",
"city": "New York City",
"state": "New York",
"zip": 10048,
"country": "U.S.A",
"fax": "324-524242"
}
],
"created_time": "2015-05-28T00:00:00.000Z",
"last_modified_time": "2015-05-28T00:00:00.000Z"
}
Create a purchase receive
A new purchase receive can a be created.To create Purchase receive, URL parameter purchaseorder_id
is needed. oauthscope : ZohoInventory.purchasereceives.CREATE
Arguments
receive_number
string
(Required)
Number of the Purchase Receive.
date
string
Date of Purchase Order
notes
string
Purchase Receive notes.
line_items
array
(Required)
Number of line items for purchase receive. Each line item contains
line_item_id
, item_id
, name
, description
, item_order
, quantity
and unit
. line_item_id
long
Unique ID generated by the server for each line item. This is used as an identifier.
item_id
long
Unique ID generated by the server for the item. This is used as an identifier.
name
string
Name of the line item.
description
string
Description of the line item.
item_order
integer
The order of the line items, starts from
0
by default. quantity
double
Quantity of the line item.
unit
string
Unit of line item.
parameters_data='{"field1":"value1","field2":"value2"}';
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9f2cfbd1b7a8f9e314b7aff7bc2d1.8fcc9810810a216793f385b9dd6e125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/inventory/v1/purchasereceives?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/inventory/v1/purchasereceives?organization_id=10234695")
.post(body)
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9f2cfbd1b7a8f9e314b7aff7bc2d1.8fcc9810810a216793f385b9dd6e125f")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'POST',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9f2cfbd1b7a8f9e314b7aff7bc2d1.8fcc9810810a216793f385b9dd6e125f',
'content-type': 'application/json'
},
body: '{"field1":"value1","field2":"value2"}'
};
fetch('https://www.zohoapis.com/inventory/v1/purchasereceives?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.41d9f2cfbd1b7a8f9e314b7aff7bc2d1.8fcc9810810a216793f385b9dd6e125f",
'content-type': "application/json"
}
conn.request("POST", "/inventory/v1/purchasereceives?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": "/inventory/v1/purchasereceives?organization_id=10234695",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9f2cfbd1b7a8f9e314b7aff7bc2d1.8fcc9810810a216793f385b9dd6e125f",
"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/inventory/v1/purchasereceives?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9f2cfbd1b7a8f9e314b7aff7bc2d1.8fcc9810810a216793f385b9dd6e125f' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
{
"receive_number": "PR-00002",
"date": "2015-05-28",
"notes": "Sample Note.",
"line_items": [
{
"line_item_id": 4815000000044897,
"item_id": 4815000000044100,
"name": "Laptop-white/15inch/dell",
"description": "Just a sample description.",
"item_order": 0,
"quantity": 2,
"unit": "qty"
}
]
}
{
"code": 0,
"message": "success",
"purchase_receive": {
"purchaseorder_id": 4815000000044972,
"purchaseorder_number": "PO-00002",
"receive_id": 4815000000045035,
"receive_number": "PR-00002",
"date": "2015-05-28",
"vendor_id": 4815000000044080,
"vendor_name": "Molly",
"contact_persons": 4815000000044080,
"notes": "Sample Note.",
"line_items": [
{
"line_item_id": 4815000000044897,
"item_id": 4815000000044100,
"name": "Laptop-white/15inch/dell",
"description": "Just a sample description.",
"item_order": 0,
"quantity": 2,
"unit": "qty"
}
],
"billing_address": [
{
"address": "No:234,90 Church Street",
"city": "New York City",
"state": "New York",
"zip": 10048,
"country": "U.S.A",
"fax": "324-524242"
}
],
"shipping_address": [
{
"address": "No:234,90 Church Street",
"city": "New York City",
"state": "New York",
"zip": 10048,
"country": "U.S.A",
"fax": "324-524242"
}
],
"created_time": "2015-05-28T00:00:00.000Z",
"last_modified_time": "2015-05-28T00:00:00.000Z"
}
}
Retrieve a Purchase Receive
Fetches a Purchase Receive from Zoho Inventory. oauthscope : ZohoInventory.purchasereceives.READ
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9f2cfbd1b7a8f9e314b7aff7bc2d1.8fcc9810810a216793f385b9dd6e125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/inventory/v1/purchasereceives/987000000654321?organization_id=10234695"
type: GET
headers: headers_data
content-type: application/octet-stream
connection: <connection_name>
]
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://www.zohoapis.com/inventory/v1/purchasereceives/987000000654321?organization_id=10234695")
.get()
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9f2cfbd1b7a8f9e314b7aff7bc2d1.8fcc9810810a216793f385b9dd6e125f")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'GET',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9f2cfbd1b7a8f9e314b7aff7bc2d1.8fcc9810810a216793f385b9dd6e125f'
}
};
fetch('https://www.zohoapis.com/inventory/v1/purchasereceives/987000000654321?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.41d9f2cfbd1b7a8f9e314b7aff7bc2d1.8fcc9810810a216793f385b9dd6e125f" }
conn.request("GET", "/inventory/v1/purchasereceives/987000000654321?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": "/inventory/v1/purchasereceives/987000000654321?organization_id=10234695",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9f2cfbd1b7a8f9e314b7aff7bc2d1.8fcc9810810a216793f385b9dd6e125f"
}
};
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/inventory/v1/purchasereceives/987000000654321?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9f2cfbd1b7a8f9e314b7aff7bc2d1.8fcc9810810a216793f385b9dd6e125f'
{
"code": 0,
"message": "success",
"purchase_receive": {
"purchaseorder_id": 4815000000044972,
"purchaseorder_number": "PO-00002",
"receive_id": 4815000000045035,
"receive_number": "PR-00002",
"date": "2015-05-28",
"vendor_id": 4815000000044080,
"vendor_name": "Molly",
"contact_persons": 4815000000044080,
"notes": "Sample Note.",
"line_items": [
{
"line_item_id": 4815000000044897,
"item_id": 4815000000044100,
"name": "Laptop-white/15inch/dell",
"description": "Just a sample description.",
"item_order": 0,
"quantity": 2,
"unit": "qty"
}
],
"billing_address": [
{
"address": "No:234,90 Church Street",
"city": "New York City",
"state": "New York",
"zip": 10048,
"country": "U.S.A",
"fax": "324-524242"
}
],
"shipping_address": [
{
"address": "No:234,90 Church Street",
"city": "New York City",
"state": "New York",
"zip": 10048,
"country": "U.S.A",
"fax": "324-524242"
}
],
"created_time": "2015-05-28T00:00:00.000Z",
"last_modified_time": "2015-05-28T00:00:00.000Z"
}
}
Delete a Purchase Receive
Deletes a Purchase Receive from Zoho Inventory. oauthscope : ZohoInventory.purchasereceives.DELETE
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9f2cfbd1b7a8f9e314b7aff7bc2d1.8fcc9810810a216793f385b9dd6e125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/inventory/v1/purchasereceives/987000000654321?organization_id=10234695"
type: DELETE
headers: headers_data
content-type: application/octet-stream
connection: <connection_name>
]
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://www.zohoapis.com/inventory/v1/purchasereceives/987000000654321?organization_id=10234695")
.delete(null)
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9f2cfbd1b7a8f9e314b7aff7bc2d1.8fcc9810810a216793f385b9dd6e125f")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'DELETE',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9f2cfbd1b7a8f9e314b7aff7bc2d1.8fcc9810810a216793f385b9dd6e125f'
}
};
fetch('https://www.zohoapis.com/inventory/v1/purchasereceives/987000000654321?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.41d9f2cfbd1b7a8f9e314b7aff7bc2d1.8fcc9810810a216793f385b9dd6e125f" }
conn.request("DELETE", "/inventory/v1/purchasereceives/987000000654321?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": "/inventory/v1/purchasereceives/987000000654321?organization_id=10234695",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9f2cfbd1b7a8f9e314b7aff7bc2d1.8fcc9810810a216793f385b9dd6e125f"
}
};
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/inventory/v1/purchasereceives/987000000654321?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9f2cfbd1b7a8f9e314b7aff7bc2d1.8fcc9810810a216793f385b9dd6e125f'
{
"code": 0,
"message": "The Purchase Receive has been deleted."
}