API Docs
/
No Results Found
Invoices

Invoices

Invoices describe how much a customer owes for his subscription. Invoices are created for recurring charges, one time charges including any prorated adjustments.

Attribute

invoice_id
string
Unique ID generated for an invoice.
number
string
Unique invoice number (starts with INV) generated for an invoice which will be used to display in interface and invoices.
status
string
Status of the invoice. It can be paid, sent, overdue, partially_paid or void.
invoice_date
string
The date on which the invoice is raised.
due_date
string
Date on which the invoice is due. If the invoice is not fully paid on or before this date, the status of the invoice will be changed to overdue. If the invoice is only partially paid, its status will be partially_paid.
customer_id
string
Customer ID of the customer to whom the invoice is raised.
customer_name
string
Name of the customer to whom the invoice is raised.
email
string
Email address of the customer.
balance
double
The unpaid amount of an invoice.
total
double
Total amount to be paid for the invoice. This would be the sum of individual costs of all items involved in the invoice. Total is determined only after customer credits (if any) are applied.
currency_code
string
The customer's currency code.
currency_symbol
string
The customer's currency symbol.
has_attachment
Denotes whether a customer has any attachments associated with it.
created_time
string
Time when the invoice was created.
updated_time
string
Time when the invoice details were last updated.

Example

[ { "invoice_id": "903000000079426", "number": "INV-384", "status": "paid", "invoice_date": "2016-06-05", "due_date": "2016-06-05", "customer_id": "903000000000099", "customer_name": "Bowman Furniture", "email": "benjamin.george@bowmanfurniture.com", "balance": 0, "total": 370, "currency_code": "USD", "currency_symbol": "$", "has_attachment": true, "created_time": "2016-06-05T02:15:15-0700", "updated_time": "2016-06-05T02:15:15-0700" } ]

List all invoices

List of all invoices.

To list invoices for a particular subscription or customer append a param as subscription_id={subscription_id} or customer_id={customer_id}.
OAuth Scope : ZohoSubscriptions.invoices.READ

Query Parameters

filter_by
Invoices of particular status can be filtered by passing a param filter_by. Allowed values are Status.(All, Sent, Draft, OverDue, Paid, PartiallyPaid, Void, Unpaid).

Request Example

Click to copy
headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/invoices" type: GET headers: headers_data connection: <connection_name> ] info response;
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/billing/v1/invoices") .get() .addHeader("X-com-zoho-subscriptions-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute();
const options = { method: 'GET', headers: { 'X-com-zoho-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/billing/v1/invoices', 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 = { 'X-com-zoho-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("GET", "/billing/v1/invoices", 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": "/billing/v1/invoices", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "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/billing/v1/invoices \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695'

Response Example

{ "code": 0, "message": "success", "invoices": [ { "invoice_id": "903000000079426", "number": "INV-384", "status": "paid", "invoice_date": "2016-06-05", "due_date": "2016-06-05", "customer_id": "903000000000099", "customer_name": "Bowman Furniture", "email": "benjamin.george@bowmanfurniture.com", "balance": 0, "total": 370, "currency_code": "USD", "currency_symbol": "$", "has_attachment": true, "created_time": "2016-06-05T02:15:15-0700", "updated_time": "2016-06-05T02:15:15-0700" }, {...}, {...} ] }

Retrieve an invoice

Details of an existing invoice.
OAuth Scope : ZohoSubscriptions.invoices.READ

Request Example

Click to copy
headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/invoices/903000000079426" type: GET headers: headers_data connection: <connection_name> ] info response;
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/billing/v1/invoices/903000000079426") .get() .addHeader("X-com-zoho-subscriptions-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute();
const options = { method: 'GET', headers: { 'X-com-zoho-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/billing/v1/invoices/903000000079426', 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 = { 'X-com-zoho-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("GET", "/billing/v1/invoices/903000000079426", 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": "/billing/v1/invoices/903000000079426", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "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/billing/v1/invoices/903000000079426 \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695'

Response Example

{ "code": 0, "message": "success", "invoice": { "invoice_id": "903000000079426", "number": "INV-384", "status": "paid", "invoice_date": "2016-06-05", "due_date": "2016-06-05", "payment_expected_date": "10-05-2013", "ach_payment_initiated": true, "transaction_type": "renewal", "customer_id": "903000000000099", "customer_name": "Bowman Furniture", "email": "benjamin.george@bowmanfurniture.com", "invoice_items": [ { "item_id": "7000000079434", "name": "Basic", "description": "Charges for this duration (from 16-April-2016 to 8-June-2016)", "code": "basic-monthly", "tags": [ { "tag_id": 0, "tag_option_id": 0 } ], "item_custom_fields": [ { "label": "string", "value": "string" } ], "price": 50, "quantity": 1, "discount_amount": 80, "item_total": 400, "tax_id": "903002205046032", "tax_exemption_id": "903002205042099", "tax_exemption_code": "NGO" } ], "coupons": [ { "coupon_code": "THANKSGIVING20", "coupon_name": "Flat 10", "discount_amount": 80 } ], "credits": [ { "creditnote_id": "9030000079876", "creditnotes_number": "CN-26", "credited_date": "2016-06-15", "credited_amount": 15 } ], "total": 370, "payment_made": 370, "balance": 0, "credits_applied": 0, "write_off_amount": 0, "payments": [ { "payment_id": "90300000079467", "payment_mode": "autotransaction", "invoice_payment_id": "90300000079469", "amount_refunded": 50, "gateway_transaction_id": "B10E6E0F31BD", "description": "Payment has been made for the invoice INV-384", "date": "2016-06-05", "reference_number": "INV-384", "amount": 370, "bank_charges": 10, "exchange_rate": 1, "autotransaction": { "autotransaction_id": "9030000079465", "payment_gateway": "payflow_pro", "gateway_transaction_id": "B10E6E0F31BD", "gateway_error_message": "Gateway error message for a failed transaction.", "account_id": "9030000000000361" } } ], "currency_code": "USD", "currency_symbol": "$", "created_time": "2016-06-05T02:15:15-0700", "updated_time": "2016-06-05T02:15:15-0700", "salesperson_id": "90300023000043", "salesperson_name": "Bowman", "invoice_url": "", "billing_address": { "city": "Salt Lake City", "state": "CA", "zip": 92612, "country": "U.S.A", "fax": 4527389 }, "shipping_address": { "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "zip": 92612, "country": "U.S.A", "fax": 4527389 }, "comments": [ { "comment_id": "9030000003133", "description": "Invoice has been marked as void", "commented_by_id": "90300000002099", "commented_by": "Zoho Billinh", "comment_type": "system", "date": null, "time": "2:50 AM", "operation_type": "Added", "transaction_id": "903000001223", "transaction_type": "invoice" } ], "custom_fields": [ { "index": 1, "label": "string", "value": "string", "data_type": "text" } ], "can_send_in_mail": true, "documents": [ { "file_name": "Rental Agreement.pdf", "file_type": "pdf", "file_size": 5447, "file_size_formatted": "5.3 KB", "document_id": "903000005689", "attachment_order": 1 } ] } }

Convert to open

Change the status of the invoice to open.
OAuth Scope : ZohoSubscriptions.invoices.CREATE

Request Example

Click to copy
headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/invoices/903000000079426/converttoopen" type: POST headers: headers_data connection: <connection_name> ] info response;
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/billing/v1/invoices/903000000079426/converttoopen") .post(null) .addHeader("X-com-zoho-subscriptions-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute();
const options = { method: 'POST', headers: { 'X-com-zoho-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/billing/v1/invoices/903000000079426/converttoopen', 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 = { 'X-com-zoho-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("POST", "/billing/v1/invoices/903000000079426/converttoopen", 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": "/billing/v1/invoices/903000000079426/converttoopen", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "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/billing/v1/invoices/903000000079426/converttoopen \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695'

Response Example

{ "code": 0, "message": "Status of the invoice has been changed to open." }

Void an invoice

Mark an invoice status as void. Upon voiding, the payments and credits associated with the invoices will be unassociated and will be under customer credits.
OAuth Scope : ZohoSubscriptions.invoices.CREATE

Request Example

Click to copy
headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/invoices/982000000567114/status/void" type: POST headers: headers_data connection: <connection_name> ] info response;
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/billing/v1/invoices/982000000567114/status/void") .post(null) .addHeader("X-com-zoho-subscriptions-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute();
const options = { method: 'POST', headers: { 'X-com-zoho-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/billing/v1/invoices/982000000567114/status/void', 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 = { 'X-com-zoho-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("POST", "/billing/v1/invoices/982000000567114/status/void", 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": "/billing/v1/invoices/982000000567114/status/void", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "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/billing/v1/invoices/982000000567114/status/void \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695'

Response Example

{ "code": 0, "message": "Invoice status has been changed to Void." }

Email an invoice

Email an invoice.
OAuth Scope : ZohoSubscriptions.invoices.CREATE

Arguments

to_mail_ids
array
(Required)
The email IDs to which the invoice is to be mailed.
cc_mail_ids
array
The email IDs that have to be copied when the credit note is to be mailed.
subject
string
(Required)
The subject of the email.
body
string
(Required)
The body of the email.

Request Example

Click to copy
parameters_data='{"field1":"value1","field2":"value2"}'; headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/invoices/903000000079426/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/billing/v1/invoices/903000000079426/email") .post(body) .addHeader("X-com-zoho-subscriptions-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
const options = { method: 'POST', headers: { 'X-com-zoho-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f', 'content-type': 'application/json' }, body: '{"field1":"value1","field2":"value2"}' }; fetch('https://www.zohoapis.com/billing/v1/invoices/903000000079426/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 = { 'X-com-zoho-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", 'content-type': "application/json" } conn.request("POST", "/billing/v1/invoices/903000000079426/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": "/billing/v1/invoices/903000000079426/email", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "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/billing/v1/invoices/903000000079426/email \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "to_mail_ids": [ "benjamin.george@bowmanfurniture.com", "paul@bowmanfurniture.com" ], "cc_mail_ids": [ "accounts@bowmanfurniture.com" ], "subject": "Invoice for the subscription.", "body": "Please find attached invoice for your subscription." }

Response Example

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

Collect charge via bank account / credit card

Charge a customer for an invoice using existing bank account.
OAuth Scope : ZohoSubscriptions.invoices.CREATE

Arguments

account_id
string
(Required)
Unique ID of the bank account. If you are collecting charge via credit card, use card_id (Card ID of the card associated with the transaction)

Request Example

Click to copy
parameters_data='{"field1":"value1","field2":"value2"}'; headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/invoices/903000000079426/collect" 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/billing/v1/invoices/903000000079426/collect") .post(body) .addHeader("X-com-zoho-subscriptions-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
const options = { method: 'POST', headers: { 'X-com-zoho-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f', 'content-type': 'application/json' }, body: '{"field1":"value1","field2":"value2"}' }; fetch('https://www.zohoapis.com/billing/v1/invoices/903000000079426/collect', 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-com-zoho-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", 'content-type': "application/json" } conn.request("POST", "/billing/v1/invoices/903000000079426/collect", 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": "/billing/v1/invoices/903000000079426/collect", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "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/billing/v1/invoices/903000000079426/collect \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "account_id": "9030000000000361" }

Response Example

{ "code": 0, "message": "The customer payment has been recorded.", "payment": { "payment_id": "90300000079467", "payment_mode": "autotransaction", "amount": 370, "amount_refunded": 50, "bank_charges": 10, "date": "2016-06-05", "status": "paid", "reference_number": "INV-384", "due_date": "2016-06-05", "amount_due": 10, "description": "Payment has been made for the invoice INV-384", "customer_id": "903000000000099", "customer_name": "Bowman Furniture", "email": "benjamin.george@bowmanfurniture.com", "autotransaction": { "autotransaction_id": "9030000079465", "payment_gateway": "payflow_pro", "gateway_transaction_id": "B10E6E0F31BD", "gateway_error_message": "Gateway error message for a failed transaction.", "account_id": "9030000000000361" }, "invoices": [ { "invoice_id": "903000000079426", "invoice_number": "INV-384", "date": "2016-06-05", "invoice_amount": 450, "amount_applied": 450, "balance_amount": 0 } ], "currency_code": "USD", "currency_symbol": "$", "custom_fields": [ { "index": 1, "value": "string", "label": "string", "data_type": "text" } ], "created_time": "2016-06-05T02:15:15-0700", "updated_time": "2016-06-05T02:15:15-0700" } }

Write off

Write off a invoice.
OAuth Scope : ZohoSubscriptions.invoices.CREATE

Request Example

Click to copy
headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/invoices/903000000079426/writeoff" type: POST headers: headers_data connection: <connection_name> ] info response;
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/billing/v1/invoices/903000000079426/writeoff") .post(null) .addHeader("X-com-zoho-subscriptions-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute();
const options = { method: 'POST', headers: { 'X-com-zoho-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/billing/v1/invoices/903000000079426/writeoff', 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 = { 'X-com-zoho-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("POST", "/billing/v1/invoices/903000000079426/writeoff", 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": "/billing/v1/invoices/903000000079426/writeoff", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "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/billing/v1/invoices/903000000079426/writeoff \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695'

Response Example

{ "code": 0, "message": "Invoice has been written off.." }

Update address

Update shipping and billing address of an invoice.
OAuth Scope : ZohoSubscriptions.invoices.UPDATE

Arguments

billing_address
object
Customer's billing address object. It contains street, city, state,zip and country.
Show Sub-Attributes arrow
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
Customer's fax number.
shipping_address
object
Customer's shipping address object. It contains street, city, state,zip and country.
Show Sub-Attributes arrow
street
string
Name of the street of the customer’s shipping address.
city
string
Name of the city of the customer’s shipping address.
state
string
Name of the state of the customer’s shipping address.
zip
string
Zip code of the customer’s shipping address.
country
string
Country code of the customer’s shipping address.
fax
string
Zip code of the customer’s shipping address.

Request Example

Click to copy
parameters_data='{"field1":"value1","field2":"value2"}'; headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/invoices/903000000079426/address" 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/billing/v1/invoices/903000000079426/address") .put(body) .addHeader("X-com-zoho-subscriptions-organizationid", "10234695") .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-com-zoho-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f', 'content-type': 'application/json' }, body: '{"field1":"value1","field2":"value2"}' }; fetch('https://www.zohoapis.com/billing/v1/invoices/903000000079426/address', 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-com-zoho-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", 'content-type': "application/json" } conn.request("PUT", "/billing/v1/invoices/903000000079426/address", 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": "/billing/v1/invoices/903000000079426/address", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "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/billing/v1/invoices/903000000079426/address \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "billing_address": { "city": "Salt Lake City", "state": "CA", "zip": 92612, "country": "U.S.A", "fax": 4527389 }, "shipping_address": { "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "zip": 92612, "country": "U.S.A", "fax": 4527389 } }

Response Example

{ "code": 0, "message": "Invoice address updated", "invoice_address": { "billing_address": { "city": "Salt Lake City", "state": "CA", "zip": 92612, "country": "U.S.A", "fax": 4527389 }, "shipping_address": { "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "zip": 92612, "country": "U.S.A", "fax": 4527389 } } }

Update Custom Fields

Update the custom fields of an invoice.
OAuth Scope : ZohoSubscriptions.invoices.CREATE

Arguments

custom_fields
array
(Required)
Additional fields for the invoices.
Show Sub-Attributes arrow
label
string
(Required)
Label of the Custom Field
value
string
(Required)
Value of the Custom Field

Request Example

Click to copy
parameters_data='{"field1":"value1","field2":"value2"}'; headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/invoices/903000000079426/customfields" 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/billing/v1/invoices/903000000079426/customfields") .post(body) .addHeader("X-com-zoho-subscriptions-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
const options = { method: 'POST', headers: { 'X-com-zoho-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f', 'content-type': 'application/json' }, body: '{"field1":"value1","field2":"value2"}' }; fetch('https://www.zohoapis.com/billing/v1/invoices/903000000079426/customfields', 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-com-zoho-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", 'content-type': "application/json" } conn.request("POST", "/billing/v1/invoices/903000000079426/customfields", 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": "/billing/v1/invoices/903000000079426/customfields", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "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/billing/v1/invoices/903000000079426/customfields \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "custom_fields": [ { "label": "string", "value": "string" } ] }

Response Example

{ "code": 0, "message": "Custom Fields Updated Successfully", "custom_fields": [ { "customfield_id": 2000000029001, "show_in_store": false, "is_active": true, "index": 1, "show_in_hp": false, "is_mandatory": true, "label": "Test_field", "is_custom_field": true, "is_mandatory_in_sales_item": false, "is_mandatory_in_hp": false, "edit_on_store": false, "show_in_all_pdf": true, "search_entity": "invoice", "data_type": "string", "pii_type": "non_pii", "placeholder": "cf_test_field", "is_inherited_value": false, "value": "Test_value", "is_dependent_field": false, "max_length": 255, "help_text": "" }, {...}, {...} ] }

Apply Multiple Credits to Invoice

To associate multiple creditnotes to a particular invoice.
OAuth Scope : ZohoSubscriptions.invoices.CREATE

Arguments

apply_creditnotes
array
(Required)
List of creditnotes applied to the object.
Show Sub-Attributes arrow
creditnote_id
string
(Required)
Unique ID denoting the credit note.
amount_applied
(Required)
Credit amount to be applied to the invoice.

Request Example

Click to copy
parameters_data='{"field1":"value1","field2":"value2"}'; headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/invoices/903000000079426/credits" 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/billing/v1/invoices/903000000079426/credits") .post(body) .addHeader("X-com-zoho-subscriptions-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
const options = { method: 'POST', headers: { 'X-com-zoho-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f', 'content-type': 'application/json' }, body: '{"field1":"value1","field2":"value2"}' }; fetch('https://www.zohoapis.com/billing/v1/invoices/903000000079426/credits', 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-com-zoho-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", 'content-type': "application/json" } conn.request("POST", "/billing/v1/invoices/903000000079426/credits", 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": "/billing/v1/invoices/903000000079426/credits", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "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/billing/v1/invoices/903000000079426/credits \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "apply_creditnotes": [ { "creditnote_id": "9030000079876", "amount_applied": 450 } ] }

Response Example

{ "code": 0, "message": "Credits have been applied to the invoice(s).", "apply_creditnotes": [ { "creditnotes_invoice_id": "903000000054901", "creditnote_id": "9030000079876", "invoice_id": "903000000079426", "amount_applied": 450, "date": "2016-06-05", "date_formatted": "05 Jun 2016" }, {...}, {...} ] }

Add items to a pending invoice

Editing a pending invoice to add usage charges.
OAuth Scope : ZohoSubscriptions.invoices.CREATE

Arguments

invoice_items
array
The list of items which are all included in the invoice. Each item object will have item_id, name, code, price, quantity and item_total. description: Small description about the Invoice item. example: "Charges for this duration (from 16-April-2016 to 8-June-2016)"
Show Sub-Attributes arrow
code
Addon code of the addon.
product_id
Product ID of the product to which the addon is associated with.
name
Name for the item.
description
Description for the item.
price
double
Price of the item.
quantity
integer
Required quantity of the chosen item.
tax_id
Unique ID of Tax or Tax Group that must be associated with the item.
tax_exemption_id
Unique Tax Exemption ID if you dont want to associate a tax to the plan.

Request Example

Click to copy
parameters_data='{"field1":"value1","field2":"value2"}'; headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/invoices/903000000079426/lineitems" 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/billing/v1/invoices/903000000079426/lineitems") .post(body) .addHeader("X-com-zoho-subscriptions-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
const options = { method: 'POST', headers: { 'X-com-zoho-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f', 'content-type': 'application/json' }, body: '{"field1":"value1","field2":"value2"}' }; fetch('https://www.zohoapis.com/billing/v1/invoices/903000000079426/lineitems', 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-com-zoho-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", 'content-type': "application/json" } conn.request("POST", "/billing/v1/invoices/903000000079426/lineitems", 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": "/billing/v1/invoices/903000000079426/lineitems", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "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/billing/v1/invoices/903000000079426/lineitems \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "invoice_items": [ { "code": "UsageAddon", "product_id": "90300000079226", "name": "usage charge", "description": "Usage charges for last month", "price": 10, "quantity": 1, "tax_id": "90300000079226", "tax_exemption_id": "90300000079226" } ] }

Response Example

{ "code": 0, "message": "Invoice information has been updated.", "invoice": { "invoice_id": "903000000079426", "number": "INV-384", "status": "paid", "invoice_date": "2016-06-05", "due_date": "2016-06-05", "payment_expected_date": "10-05-2013", "ach_payment_initiated": true, "transaction_type": "renewal", "customer_id": "903000000000099", "customer_name": "Bowman Furniture", "email": "benjamin.george@bowmanfurniture.com", "invoice_items": [ { "item_id": "7000000079434", "name": "Basic", "description": "Charges for this duration (from 16-April-2016 to 8-June-2016)", "tags": [ { "tag_id": 0, "tag_option_id": 0 } ], "item_custom_fields": [ { "label": "string", "value": "string" } ], "code": "basic-monthly", "price": 50, "quantity": 1, "discount_amount": 80, "item_total": 400, "tax_id": "903002205046032", "product_type": "goods", "hsn_or_sac": "74191010", "tax_exemption_id": "903002205042099", "tax_exemption_code": "NGO" } ], "coupons": [ { "coupon_code": "THANKSGIVING20", "coupon_name": "Flat 10", "discount_amount": 80 } ], "credits": [ { "creditnote_id": "9030000079876", "creditnotes_number": "CN-26", "credited_date": "2016-06-15", "credited_amount": 15 } ], "total": 370, "payment_made": 370, "balance": 0, "credits_applied": 0, "write_off_amount": 0, "payments": [ { "payment_id": "90300000079467", "payment_mode": "autotransaction", "invoice_payment_id": "90300000079469", "gateway_transaction_id": "B10E6E0F31BD", "description": "Payment has been made for the invoice INV-384", "date": "2016-06-05", "reference_number": "INV-384", "amount": 370, "bank_charges": 10, "exchange_rate": 1 } ], "currency_code": "USD", "currency_symbol": "$", "created_time": "2016-06-05T02:15:15-0700", "updated_time": "2016-06-05T02:15:15-0700", "salesperson_id": "90300023000043", "salesperson_name": "Bowman", "invoice_url": "", "billing_address": { "city": "Salt Lake City", "state": "CA", "zip": 92612, "country": "U.S.A", "fax": 4527389 }, "shipping_address": { "street": "Harrington Bay Street", "city": "Salt Lake City", "state": "CA", "zip": 92612, "country": "U.S.A", "fax": 4527389 }, "comments": [ { "comment_id": "9030000003133", "description": "Invoice has been marked as void", "commented_by_id": "90300000002099", "commented_by": "Zoho Billinh", "comment_type": "system", "date": null, "time": "2:50 AM", "operation_type": "Added", "transaction_id": "903000001223", "transaction_type": "invoice" } ], "custom_fields": [ { "index": 1, "label": "string", "value": "string", "data_type": "text" } ] } }

Delete items from a pending invoice

Deleting an item from pending invoice.
OAuth Scope : ZohoSubscriptions.invoices.DELETE

Request Example

Click to copy
headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/invoices/903000000079426/lineitems/7000000079434" type: DELETE headers: headers_data connection: <connection_name> ] info response;
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/billing/v1/invoices/903000000079426/lineitems/7000000079434") .delete(null) .addHeader("X-com-zoho-subscriptions-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute();
const options = { method: 'DELETE', headers: { 'X-com-zoho-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/billing/v1/invoices/903000000079426/lineitems/7000000079434', 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 = { 'X-com-zoho-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("DELETE", "/billing/v1/invoices/903000000079426/lineitems/7000000079434", 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": "/billing/v1/invoices/903000000079426/lineitems/7000000079434", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "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/billing/v1/invoices/903000000079426/lineitems/7000000079434 \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695'

Response Example

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

Add attachment to an invoice

Attach a file to an invoice.
OAuth Scope : ZohoSubscriptions.invoices.CREATE

Arguments

can_send_in_mail
boolean
True to send the attachment with the invoice when emailed.
attachment
binary
The file to be attached.Allowed Extensions: gif, png, jpeg, jpg, bmp and pdf

Request Example

Click to copy
parameters_data='{"field1":"value1","field2":"value2"}'; headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/invoices/903000000079426/attachment" 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/billing/v1/invoices/903000000079426/attachment") .post(body) .addHeader("X-com-zoho-subscriptions-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
const options = { method: 'POST', headers: { 'X-com-zoho-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f', 'content-type': 'application/json' }, body: '{"field1":"value1","field2":"value2"}' }; fetch('https://www.zohoapis.com/billing/v1/invoices/903000000079426/attachment', 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-com-zoho-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", 'content-type': "application/json" } conn.request("POST", "/billing/v1/invoices/903000000079426/attachment", 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": "/billing/v1/invoices/903000000079426/attachment", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "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/billing/v1/invoices/903000000079426/attachment \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "can_send_in_mail": true, "attachment": "string" }

Response Example

{ "code": 0, "message": "Your file has been successfully attached to the invoice." }

Cancel write off

Cancel the write off amount of an invoice.
OAuth Scope : ZohoSubscriptions.invoices.CREATE

Request Example

Click to copy
headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/invoices/982000000567114/writeoff/cancel" type: POST headers: headers_data connection: <connection_name> ] info response;
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/billing/v1/invoices/982000000567114/writeoff/cancel") .post(null) .addHeader("X-com-zoho-subscriptions-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute();
const options = { method: 'POST', headers: { 'X-com-zoho-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/billing/v1/invoices/982000000567114/writeoff/cancel', 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 = { 'X-com-zoho-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("POST", "/billing/v1/invoices/982000000567114/writeoff/cancel", 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": "/billing/v1/invoices/982000000567114/writeoff/cancel", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "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/billing/v1/invoices/982000000567114/writeoff/cancel \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695'

Response Example

{ "code": 0, "message": "The write off done for this invoice has been cancelled." }