Sales Receipt
A sales receipt is a document sent to customers when you sell them goods or services and record payment for it simultaneously. In a retail environment, this means that you only need to create one single transaction to record sales and collect payment. Sales receipts are commonly used in places where cash and sale is recorded instantly such as e-commerce websites and POS.
Create a sales receipt
Create a sales receipt for immediate payment transactions.
OAuth Scope : ZohoBooks.invoices.CREATE
Arguments
Query Parameters
parameters_data='{"field1":"value1","field2":"value2"}';
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/salesreceipts?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/salesreceipts?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/salesreceipts?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/salesreceipts?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/salesreceipts?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/salesreceipts?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
{
"customer_id": "460000000017138",
"receipt_number": "SR-00001",
"date": "2014-07-28",
"payment_mode": "cash",
"line_items": [
{
"item_id": "460000000017088",
"rate": 120,
"quantity": 2,
"tax_id": "460000000017094"
}
],
"notes": "Thank you for your business",
"terms": "Payment received in full"
}
{
"code": 0,
"message": "Sales Receipt Created Successfully.",
"salesreceipt": {
"sales_receipt_id": "460000000039129",
"receipt_number": "SR-00001",
"date": "2014-07-28",
"status": "sent",
"payment_mode": "cash",
"customer_id": "460000000017138",
"customer_name": "Instruments Inc",
"currency_id": "460000000000097",
"currency_code": "USD",
"currency_symbol": "$",
"exchange_rate": 1,
"line_items": [
{
"item_id": "460000000017088",
"name": "Hard Drive",
"description": "500GB, USB 2.0 interface",
"rate": 120,
"quantity": 2,
"unit": "Nos",
"item_total": 240,
"tax_id": "460000000017094",
"tax_name": "Sales Tax",
"tax_percentage": 10
}
],
"sub_total": 240,
"tax_total": 24,
"total": 264,
"notes": "Thank you for your business",
"terms": "Payment received in full",
"created_time": "2014-07-28T08:29:07+0530",
"last_modified_time": "2014-08-25T11:23:26+0530"
}
}
List sales receipts
List all sales receipts.
OAuth Scope : ZohoBooks.invoices.READ
Query Parameters
receipt_number_startswith
and receipt_number_contains
variants. Maximum length is 100 characters. Useful for finding specific receipts or receipts with similar numbering patterns.item_name_startswith
and item_name_contains
variants. Maximum length is 100 characters.customer_name
, receipt_number
, date
, total
, and created_time
.ThisWeek
, ThisMonth
, ThisQuarter
, ThisYear
,PreviousDay
, PreviousWeek
, PreviousMonth
, PreviousQuarter
, PreviousYear
, Status.All
, Status.Draft
, Status.Sent
date_start
, date_end
, date_before
, and date_after
. Default date format: yyyy-mm-dd
.total_start
, total_end
, total_less_than
, total_greater_than
.headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/salesreceipts?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/salesreceipts?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/salesreceipts?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/salesreceipts?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/salesreceipts?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/salesreceipts?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "success",
"salesreceipts": [
{
"sales_receipt_id": "460000000039129",
"receipt_number": "SR-00001",
"date": "2014-07-28",
"status": "sent",
"payment_mode": "cash",
"customer_id": "460000000017138",
"customer_name": "Instruments Inc",
"currency_id": "460000000000097",
"currency_code": "USD",
"currency_symbol": "$",
"exchange_rate": 1,
"line_items": [
{
"item_id": "460000000017088",
"name": "Hard Drive",
"description": "500GB, USB 2.0 interface",
"rate": 120,
"quantity": 2,
"unit": "Nos",
"item_total": 240,
"tax_id": "460000000017094",
"tax_name": "Sales Tax",
"tax_percentage": 10
}
],
"sub_total": 240,
"tax_total": 24,
"total": 264,
"notes": "Thank you for your business",
"terms": "Payment received in full",
"created_time": "2014-07-28T08:29:07+0530",
"last_modified_time": "2014-08-25T11:23:26+0530"
},
{...},
{...}
]
}
Update a sales receipt
Update an existing sales receipt.
OAuth Scope : ZohoBooks.invoices.UPDATE
Arguments
Path Parameters
Query Parameters
parameters_data='{"field1":"value1","field2":"value2"}';
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/salesreceipts/460000000039129?organization_id=10234695"
type: PUT
headers: headers_data
content-type: application/json
parameters: parameters_data
connection: <connection_name>
];
info response;
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}");
Request request = new Request.Builder()
.url("https://www.zohoapis.com/books/v3/salesreceipts/460000000039129?organization_id=10234695")
.put(body)
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'PUT',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
'content-type': 'application/json'
},
body: '{"field1":"value1","field2":"value2"}'
};
fetch('https://www.zohoapis.com/books/v3/salesreceipts/460000000039129?organization_id=10234695', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}"
headers = {
'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
'content-type': "application/json"
}
conn.request("PUT", "/books/v3/salesreceipts/460000000039129?organization_id=10234695", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "PUT",
"hostname": "www.zohoapis.com",
"port": null,
"path": "/books/v3/salesreceipts/460000000039129?organization_id=10234695",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
"content-type": "application/json"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({field1: 'value1', field2: 'value2'}));
req.end();
curl --request PUT \
--url 'https://www.zohoapis.com/books/v3/salesreceipts/460000000039129?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
{
"customer_id": "460000000017138",
"receipt_number": "SR-00001",
"date": "2014-07-28",
"payment_mode": "cash",
"line_items": [
{
"item_id": "460000000017088",
"rate": 120,
"quantity": 2
}
],
"notes": "Thank you for your business"
}
{
"code": 0,
"message": "Sales Receipt Updated Successfully.",
"salesreceipt": {
"sales_receipt_id": "460000000039129",
"receipt_number": "SR-00001",
"date": "2014-07-28",
"status": "sent",
"payment_mode": "cash",
"customer_id": "460000000017138",
"customer_name": "Instruments Inc",
"currency_id": "460000000000097",
"currency_code": "USD",
"currency_symbol": "$",
"exchange_rate": 1,
"line_items": [
{
"item_id": "460000000017088",
"name": "Hard Drive",
"description": "500GB, USB 2.0 interface",
"rate": 120,
"quantity": 2,
"unit": "Nos",
"item_total": 240,
"tax_id": "460000000017094",
"tax_name": "Sales Tax",
"tax_percentage": 10
}
],
"sub_total": 240,
"tax_total": 24,
"total": 264,
"notes": "Thank you for your business",
"terms": "Payment received in full",
"created_time": "2014-07-28T08:29:07+0530",
"last_modified_time": "2014-08-25T11:23:26+0530"
}
}
Get a sales receipt
Get the details of a sales receipt.
OAuth Scope : ZohoBooks.invoices.READ
Path Parameters
Query Parameters
json
, pdf
, html
.headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/salesreceipts/460000000039129?organization_id=10234695"
type: GET
headers: headers_data
connection: <connection_name>
];
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://www.zohoapis.com/books/v3/salesreceipts/460000000039129?organization_id=10234695")
.get()
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'GET',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://www.zohoapis.com/books/v3/salesreceipts/460000000039129?organization_id=10234695', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }
conn.request("GET", "/books/v3/salesreceipts/460000000039129?organization_id=10234695", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "GET",
"hostname": "www.zohoapis.com",
"port": null,
"path": "/books/v3/salesreceipts/460000000039129?organization_id=10234695",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
curl --request GET \
--url 'https://www.zohoapis.com/books/v3/salesreceipts/460000000039129?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "success",
"salesreceipt": {
"sales_receipt_id": "460000000039129",
"receipt_number": "SR-00001",
"date": "2014-07-28",
"status": "sent",
"payment_mode": "cash",
"customer_id": "460000000017138",
"customer_name": "Instruments Inc",
"currency_id": "460000000000097",
"currency_code": "USD",
"currency_symbol": "$",
"exchange_rate": 1,
"line_items": [
{
"item_id": "460000000017088",
"name": "Hard Drive",
"description": "500GB, USB 2.0 interface",
"rate": 120,
"quantity": 2,
"unit": "Nos",
"item_total": 240,
"tax_id": "460000000017094",
"tax_name": "Sales Tax",
"tax_percentage": 10
}
],
"sub_total": 240,
"tax_total": 24,
"total": 264,
"notes": "Thank you for your business",
"terms": "Payment received in full",
"created_time": "2014-07-28T08:29:07+0530",
"last_modified_time": "2014-08-25T11:23:26+0530"
}
}
Delete a sales receipt
Delete an existing sales receipt.
OAuth Scope : ZohoBooks.invoices.DELETE
Path Parameters
Query Parameters
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/salesreceipts/460000000039129?organization_id=10234695"
type: DELETE
headers: headers_data
connection: <connection_name>
];
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://www.zohoapis.com/books/v3/salesreceipts/460000000039129?organization_id=10234695")
.delete(null)
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'DELETE',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://www.zohoapis.com/books/v3/salesreceipts/460000000039129?organization_id=10234695', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }
conn.request("DELETE", "/books/v3/salesreceipts/460000000039129?organization_id=10234695", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "DELETE",
"hostname": "www.zohoapis.com",
"port": null,
"path": "/books/v3/salesreceipts/460000000039129?organization_id=10234695",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
curl --request DELETE \
--url 'https://www.zohoapis.com/books/v3/salesreceipts/460000000039129?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "Sales Receipt Deleted Successfully."
}
Email a sales receipt
Email a sales receipt to the customer.
OAuth Scope : ZohoBooks.invoices.CREATE
Arguments
Query Parameters
parameters_data='{"field1":"value1","field2":"value2"}';
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/books/v3/salesreceipts/%7Bsales_receipt_id%7D/email"
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/salesreceipts/%7Bsales_receipt_id%7D/email")
.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/salesreceipts/%7Bsales_receipt_id%7D/email', 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/salesreceipts/%7Bsales_receipt_id%7D/email", 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/salesreceipts/%7Bsales_receipt_id%7D/email",
"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/salesreceipts/%7Bsales_receipt_id%7D/email \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
{
"to_mail_ids": [
"john@safinstruments.com"
],
"subject": "Sales Receipt from Zillium Inc",
"body": "Please find the sales receipt attached."
}
{
"code": 0,
"message": "Your Sales Receipt has been sent."
}