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
place of contact
given for the contact will be taken) business_gst
, business_none
, overseas
, consumer
.home_country_mexico
,border_region_mexico
,non_mexico
supported only for MX.acquisition_of_merchandise
, return_discount_bonus
, general_expense
, buildings
, furniture_office_equipment
, transport_equipment
, computer_equipmentdye_molds_tools
, telephone_communication
, satellite_communication
, other_machinery_equipment
, hospital_expense
, medical_expense_disability
, funeral_expense
, donation
, interest_mortage_loans
, contribution_sar
, medical_expense_insurance_pormium
, school_transportation_expense
, deposit_saving_account
, payment_educational_service
, no_tax_effect
, payment
, payroll
.uk
. If the customer is in an EU country & VAT registered, you are resides in Northen Ireland and selling Goods then his VAT treatment is eu_vat_registered
, if he resides outside of the UK then his VAT treatment is overseas
(For Pre Brexit, this can be split as eu_vat_registered
, eu_vat_not_registered
and non_eu
).paid
, sent
, overdue
, partially_paid
or void
.Maximum length [100]
Maximum length [100]
overdue
. If the invoice is only partially paid, its status will be partially_paid
.Maximum length [100]
entity_level
and item_level
.Maximum length [100]
Maximum length [100]
Maximum length [100]
standard
and adaptive
paypal
, authorize_net
, payflow_pro
, stripe
, 2checkout
and braintree
street
, city
, state
,zip
and country
.street
, city
, state
,zip
and country
.{
"invoice_id": "903000000079426",
"ach_payment_initiated": true,
"invoice_number": "INV-384",
"is_pre_gst": true,
"place_of_supply": "TN",
"gst_no": "22AAAAA0000A1Z5",
"gst_treatment": "business_gst",
"tax_treatment": "vat_registered",
"cfdi_usage": "acquisition_of_merchandise",
"vat_treatment": "string",
"vat_reg_no": "string",
"date": "2016-06-05",
"status": "paid",
"payment_terms": 15,
"payment_terms_label": "Net 15",
"due_date": "2016-06-05",
"payment_expected_date": "10-05-2013",
"last_payment_date": " ",
"reference_number": "INV-384",
"customer_id": "903000000000099",
"customer_name": "Bowman Furniture",
"contact_persons": [
{
"contactperson_id": 982000000567003
}
],
"currency_id": 982000000000190,
"currency_code": "USD",
"exchange_rate": 1,
"discount": 0,
"is_discount_before_tax": true,
"discount_type": "item_level",
"is_inclusive_tax": false,
"is_viewed_by_client": false,
"has_attachment": true,
"client_viewed_time": "",
"invoice_items": [
{
"item_id": 982000000567021,
"product_id": "7000000079434",
"project_id": 90300000087378,
"project_name": "Sample Project",
"time_entry_ids": [],
"item_type": "goods",
"product_type": "goods",
"expense_id": " ",
"name": "Basic",
"description": "Payment has been made for the invoice INV-384",
"item_order": 1,
"bcy_rate": 120,
"price": 50,
"quantity": 1,
"unit": " ",
"discount_amount": 80,
"discount": 0,
"tax_id": "903002205046032",
"tds_tax_id": "982000000557012",
"tax_name": "VAT",
"tax_type": "tax",
"tax_percentage": 12.5,
"item_total": 400,
"sat_item_key_code": 71121206,
"unitkey_code": "E48"
}
],
"shipping_charge": 0,
"adjustment": 0,
"adjustment_description": " ",
"sub_total": 153,
"tax_total": 22.6,
"total": 370,
"taxes": [
{
"tax_name": "VAT",
"tax_amount": 19.13
}
],
"payment_reminder_enabled": true,
"payment_made": 370,
"credits_applied": 0,
"tax_amount_withheld": 0,
"balance": 0,
"write_off_amount": 0,
"allow_partial_payments": true,
"price_precision": 2,
"payment_options": {
"payment_gateways": [
{
"configured": true,
"additional_field1": "standard",
"gateway_name": "paypal"
}
]
},
"is_emailed": false,
"reminders_sent": 1,
"last_reminder_sent_date": " ",
"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
},
"notes": "Looking forward for your business.",
"terms": "Terms & Conditions apply",
"custom_fields": [
"string"
],
"template_id": 982000000000143,
"template_name": "Service - Classic",
"created_time": "2016-06-05T02:15:15-0700",
"last_modified_time": "2013-12-18T02:02:51-0800",
"attachment_name": " ",
"can_send_in_mail": true,
"salesperson_id": "90300023000043",
"salesperson_name": "Bowman",
"invoice_url": ""
}
Create an invoice
Create an invoice for your customer.
OAuth Scope : ZohoSubscriptions.invoices.CREATE
Arguments
place of contact
given for the contact will be taken)uk
. If the customer is in an EU country & VAT registered, you are resides in Northen Ireland and selling Goods then his VAT treatment is eu_vat_registered
, if he resides outside of the UK then his VAT treatment is overseas
(For Pre Brexit, this can be split as eu_vat_registered
, eu_vat_not_registered
and non_eu
). business_gst
, business_none
, overseas
, consumer
.home_country_mexico
,border_region_mexico
,non_mexico
supported only for MX.acquisition_of_merchandise
, return_discount_bonus
, general_expense
, buildings
, furniture_office_equipment
, transport_equipment
, computer_equipmentdye_molds_tools
, telephone_communication
, satellite_communication
, other_machinery_equipment
, hospital_expense
, medical_expense_disability
, funeral_expense
, donation
, interest_mortage_loans
, contribution_sar
, medical_expense_insurance_pormium
, school_transportation_expense
, deposit_saving_account
, payment_educational_service
, no_tax_effect
, payment
, payroll
.Maximum length [100]
Maximum length [100]
overdue
. If the invoice is only partially paid, its status will be partially_paid
.Maximum length [100]
entity_level
and item_level
.Maximum length [100]
Maximum length [100]
Maximum length [25]
Maximum length [25]
standard
and adaptive
paypal
, authorize_net
, payflow_pro
, stripe
, 2checkout
and braintree
Maximum length [100]
Maximum length [25]
Maximum length [25]
Maximum length [25]
Query Parameters
true
and false
.true
and false
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"
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")
.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', 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", 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",
"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 \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'X-com-zoho-subscriptions-organizationid: 10234695' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
{
"customer_id": "903000000000099",
"contact_persons": [
{
"contactperson_id": 982000000567003
}
],
"invoice_number": "INV-384",
"reference_number": "INV-384",
"place_of_supply": "TN",
"vat_treatment": "string",
"gst_treatment": "business_gst",
"tax_treatment": "vat_registered",
"cfdi_usage": "acquisition_of_merchandise",
"gst_no": "22AAAAA0000A1Z5",
"template_id": 982000000000143,
"date": "2016-06-05",
"payment_terms": 15,
"payment_terms_label": "Net 15",
"due_date": "2016-06-05",
"discount": 0,
"is_discount_before_tax": true,
"discount_type": "item_level",
"is_inclusive_tax": false,
"exchange_rate": 1,
"invoiced_estimate_id": " ",
"salesperson_name": "Bowman",
"custom_fields": [
{
"label": "string",
"value": "string"
}
],
"project_id": 90300000087378,
"invoice_items": [
{
"product_id": "7000000079434",
"project_id": 90300000087378,
"time_entry_ids": [],
"expense_id": " ",
"name": "Basic",
"product_type": "goods",
"hsn_or_sac": "74191010",
"sat_item_key_code": 71121206,
"unitkey_code": "E48",
"description": "Payment has been made for the invoice INV-384",
"item_order": 1,
"price": 50,
"quantity": 1,
"unit": " ",
"discount": 0,
"tax_id": "903002205046032",
"tds_tax_id": "982000000557012",
"tax_exemption_id": "903002205042099",
"avatax_use_code": "string",
"avatax_exempt_no": "string",
"tax_name": "VAT",
"tax_type": "tax",
"tax_percentage": 12.5,
"item_total": 400
}
],
"payment_options": {
"payment_gateways": [
{
"configured": true,
"additional_field1": "standard",
"gateway_name": "paypal"
}
]
},
"allow_partial_payments": true,
"custom_body": " ",
"custom_subject": " ",
"notes": "Looking forward for your business.",
"terms": "Terms & Conditions apply",
"shipping_charge": 0,
"adjustment": 0,
"adjustment_description": " ",
"reason": " ",
"tax_authority_id": 11149000000061052,
"tax_exemption_id": "903002205042099",
"avatax_use_code": "string",
"avatax_tax_code": "string",
"avatax_exempt_no": "string"
}
{
"code": 0,
"message": "The invoice has been created.",
"invoice": {
"invoice_id": "903000000079426",
"ach_payment_initiated": true,
"invoice_number": "INV-384",
"is_pre_gst": true,
"place_of_supply": "TN",
"gst_no": "22AAAAA0000A1Z5",
"gst_treatment": "business_gst",
"tax_treatment": "vat_registered",
"cfdi_usage": "acquisition_of_merchandise",
"vat_treatment": "string",
"vat_reg_no": "string",
"date": "2016-06-05",
"status": "paid",
"payment_terms": 15,
"payment_terms_label": "Net 15",
"due_date": "2016-06-05",
"payment_expected_date": "10-05-2013",
"last_payment_date": " ",
"reference_number": "INV-384",
"customer_id": "903000000000099",
"customer_name": "Bowman Furniture",
"contact_persons": [
{
"contactperson_id": 982000000567003
}
],
"currency_id": 982000000000190,
"currency_code": "USD",
"exchange_rate": 1,
"discount": 0,
"is_discount_before_tax": true,
"discount_type": "item_level",
"is_inclusive_tax": false,
"is_viewed_by_client": false,
"has_attachment": true,
"client_viewed_time": "",
"invoice_items": [
{
"item_id": 982000000567021,
"product_id": "7000000079434",
"project_id": 90300000087378,
"project_name": "Sample Project",
"time_entry_ids": [],
"item_type": "goods",
"product_type": "goods",
"expense_id": " ",
"name": "Basic",
"description": "Payment has been made for the invoice INV-384",
"item_order": 1,
"bcy_rate": 120,
"price": 50,
"quantity": 1,
"unit": " ",
"discount_amount": 80,
"discount": 0,
"tax_id": "903002205046032",
"tds_tax_id": "982000000557012",
"tax_name": "VAT",
"tax_type": "tax",
"tax_percentage": 12.5,
"item_total": 400,
"sat_item_key_code": 71121206,
"unitkey_code": "E48"
}
],
"shipping_charge": 0,
"adjustment": 0,
"adjustment_description": " ",
"sub_total": 153,
"tax_total": 22.6,
"total": 370,
"taxes": [
{
"tax_name": "VAT",
"tax_amount": 19.13
}
],
"payment_reminder_enabled": true,
"payment_made": 370,
"credits_applied": 0,
"tax_amount_withheld": 0,
"balance": 0,
"write_off_amount": 0,
"allow_partial_payments": true,
"price_precision": 2,
"payment_options": {
"payment_gateways": [
{
"configured": true,
"additional_field1": "standard",
"gateway_name": "paypal"
}
]
},
"is_emailed": false,
"reminders_sent": 1,
"last_reminder_sent_date": " ",
"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
},
"notes": "Looking forward for your business.",
"terms": "Terms & Conditions apply",
"custom_fields": [
"string"
],
"template_id": 982000000000143,
"template_name": "Service - Classic",
"created_time": "2016-06-05T02:15:15-0700",
"last_modified_time": "2013-12-18T02:02:51-0800",
"attachment_name": " ",
"can_send_in_mail": true,
"salesperson_id": "90300023000043",
"salesperson_name": "Bowman",
"invoice_url": ""
}
}
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
. Allowed values are Status.(All
, Sent
, Draft
, OverDue
, Paid
, PartiallyPaid
, Void
, Unpaid
).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'
{
"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"
},
{...},
{...}
]
}
Update an invoice
Update an existing invoice. To delete a line item just remove it from the invoice_items list.
OAuth Scope : ZohoSubscriptions.invoices.UPDATE
Arguments
place of contact
given for the contact will be taken)uk
. If the customer is in an EU country & VAT registered, you are resides in Northen Ireland and selling Goods then his VAT treatment is eu_vat_registered
, if he resides outside of the UK then his VAT treatment is overseas
(For Pre Brexit, this can be split as eu_vat_registered
, eu_vat_not_registered
and non_eu
). business_gst
, business_none
, overseas
, consumer
.home_country_mexico
,border_region_mexico
,non_mexico
supported only for MX.acquisition_of_merchandise
, return_discount_bonus
, general_expense
, buildings
, furniture_office_equipment
, transport_equipment
, computer_equipmentdye_molds_tools
, telephone_communication
, satellite_communication
, other_machinery_equipment
, hospital_expense
, medical_expense_disability
, funeral_expense
, donation
, interest_mortage_loans
, contribution_sar
, medical_expense_insurance_pormium
, school_transportation_expense
, deposit_saving_account
, payment_educational_service
, no_tax_effect
, payment
, payroll
.Maximum length [100]
Maximum length [100]
overdue
. If the invoice is only partially paid, its status will be partially_paid
.Maximum length [100]
entity_level
and item_level
.Maximum length [100]
Maximum length [100]
Maximum length [25]
Maximum length [25]
standard
and adaptive
paypal
, authorize_net
, payflow_pro
, stripe
, 2checkout
and braintree
Maximum length [100]
Maximum length [25]
Maximum length [25]
Maximum length [25]
Query Parameters
true
and false
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"
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")
.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', 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", 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",
"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 \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'X-com-zoho-subscriptions-organizationid: 10234695' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
{
"customer_id": "903000000000099",
"contact_persons": [
{
"contactperson_id": 982000000567003
}
],
"invoice_number": "INV-384",
"reference_number": "INV-384",
"place_of_supply": "TN",
"vat_treatment": "string",
"gst_treatment": "business_gst",
"tax_treatment": "vat_registered",
"cfdi_usage": "acquisition_of_merchandise",
"gst_no": "22AAAAA0000A1Z5",
"template_id": 982000000000143,
"date": "2016-06-05",
"payment_terms": 15,
"payment_terms_label": "Net 15",
"due_date": "2016-06-05",
"discount": 0,
"is_discount_before_tax": true,
"discount_type": "item_level",
"is_inclusive_tax": false,
"exchange_rate": 1,
"invoiced_estimate_id": " ",
"salesperson_name": "Bowman",
"custom_fields": [
{
"label": "string",
"value": "string"
}
],
"project_id": 90300000087378,
"invoice_items": [
{
"product_id": "7000000079434",
"project_id": 90300000087378,
"time_entry_ids": [],
"expense_id": " ",
"name": "Basic",
"product_type": "goods",
"hsn_or_sac": "74191010",
"sat_item_key_code": 71121206,
"unitkey_code": "E48",
"description": "Payment has been made for the invoice INV-384",
"item_order": 1,
"price": 50,
"quantity": 1,
"unit": " ",
"discount": 0,
"tax_id": "903002205046032",
"tds_tax_id": "982000000557012",
"tax_exemption_id": "903002205042099",
"avatax_use_code": "string",
"avatax_exempt_no": "string",
"tax_name": "VAT",
"tax_type": "tax",
"tax_percentage": 12.5,
"item_total": 400
}
],
"payment_options": {
"payment_gateways": [
{
"configured": true,
"additional_field1": "standard",
"gateway_name": "paypal"
}
]
},
"allow_partial_payments": true,
"custom_body": " ",
"custom_subject": " ",
"notes": "Looking forward for your business.",
"terms": "Terms & Conditions apply",
"shipping_charge": 0,
"adjustment": 0,
"adjustment_description": " ",
"reason": " ",
"tax_authority_id": 11149000000061052,
"tax_exemption_id": "903002205042099",
"avatax_use_code": "string",
"avatax_tax_code": "string",
"avatax_exempt_no": "string"
}
{
"code": 0,
"message": "Invoice information has been updated.",
"invoice": {
"invoice_id": "903000000079426",
"ach_payment_initiated": true,
"invoice_number": "INV-384",
"date": "2016-06-05",
"status": "paid",
"is_pre_gst": true,
"place_of_supply": "TN",
"gst_no": "22AAAAA0000A1Z5",
"gst_treatment": "business_gst",
"tax_treatment": "vat_registered",
"cfdi_usage": "acquisition_of_merchandise",
"vat_treatment": "string",
"vat_reg_no": "string",
"payment_terms": 15,
"payment_terms_label": "Net 15",
"due_date": "2016-06-05",
"payment_expected_date": "10-05-2013",
"last_payment_date": " ",
"reference_number": "INV-384",
"customer_id": "903000000000099",
"customer_name": "Bowman Furniture",
"contact_persons": [
{
"contactperson_id": 982000000567003
}
],
"currency_id": 982000000000190,
"currency_code": "USD",
"exchange_rate": 1,
"discount": 0,
"is_discount_before_tax": true,
"discount_type": "item_level",
"is_inclusive_tax": false,
"is_viewed_by_client": false,
"has_attachment": true,
"client_viewed_time": "",
"invoice_items": [
{
"item_id": 982000000567021,
"product_id": "7000000079434",
"project_id": 90300000087378,
"project_name": "Sample Project",
"item_type": "goods",
"product_type": "goods",
"time_entry_ids": [],
"expense_id": " ",
"expense_receipt_name": "string",
"name": "Basic",
"description": "Payment has been made for the invoice INV-384",
"item_order": 1,
"bcy_rate": 120,
"price": 50,
"quantity": 1,
"unit": " ",
"discount_amount": 80,
"discount": 0,
"tax_id": "903002205046032",
"tds_tax_id": "982000000557012",
"tax_name": "VAT",
"tax_type": "tax",
"tax_percentage": 12.5,
"item_total": 400,
"sat_item_key_code": 71121206,
"unitkey_code": "E48"
}
],
"shipping_charge": 0,
"adjustment": 0,
"adjustment_description": " ",
"sub_total": 153,
"tax_total": 22.6,
"total": 370,
"taxes": [
{
"tax_name": "VAT",
"tax_amount": 19.13
}
],
"payment_reminder_enabled": true,
"payment_made": 370,
"credits_applied": 0,
"tax_amount_withheld": 0,
"balance": 0,
"write_off_amount": 0,
"allow_partial_payments": true,
"price_precision": 2,
"payment_options": {
"payment_gateways": [
{
"configured": true,
"additional_field1": "standard",
"gateway_name": "paypal"
}
]
},
"is_emailed": false,
"reminders_sent": 1,
"last_reminder_sent_date": " ",
"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
},
"notes": "Looking forward for your business.",
"terms": "Terms & Conditions apply",
"custom_fields": [
"string"
],
"template_id": 982000000000143,
"template_name": "Service - Classic",
"created_time": "2016-06-05T02:15:15-0700",
"last_modified_time": "2013-12-18T02:02:51-0800",
"attachment_name": " ",
"can_send_in_mail": true,
"salesperson_id": "90300023000043",
"salesperson_name": "Bowman",
"invoice_url": ""
}
}
Retrieve an invoice
Details of an existing invoice.
OAuth Scope : ZohoSubscriptions.invoices.READ
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'
{
"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",
"product_id": "7000000079973",
"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
}
]
}
}
Delete an invoice
Delete an existing invoice. Invoices which have payment or credits note applied cannot be deleted.
OAuth Scope : ZohoSubscriptions.invoices.DELETE
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: 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")
.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', 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", 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",
"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 \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'X-com-zoho-subscriptions-organizationid: 10234695'
{
"code": 0,
"message": "The invoice has been deleted."
}
Update custom field in existing invoices
Update the value of the custom field in existing invoices.
OAuth Scope : ZohoSubscriptions.invoices.UPDATE
Arguments
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/invoice/982000000567114/customfields"
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/invoice/982000000567114/customfields")
.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/invoice/982000000567114/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("PUT", "/billing/v1/invoice/982000000567114/customfields", 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/invoice/982000000567114/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 PUT \
--url https://www.zohoapis.com/billing/v1/invoice/982000000567114/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"}'
[
{
"customfield_id": "46000000012845",
"value": "string"
}
]
{
"code": 0,
"message": "Custom Fields Updated Successfully"
}
Convert to open
Change the status of the invoice to open.
OAuth Scope : ZohoSubscriptions.invoices.CREATE
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'
{
"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
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/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/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/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/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/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/void \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'X-com-zoho-subscriptions-organizationid: 10234695'
{
"code": 0,
"message": "Invoice status has been changed to Void."
}
Email an invoice
Email an invoice.
OAuth Scope : ZohoSubscriptions.invoices.CREATE
Arguments
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"}'
{
"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."
}
{
"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
card_id
(Card ID of the card associated with the transaction)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"}'
{
"account_id": "9030000000000361"
}
{
"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
Arguments
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/writeoff"
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/writeoff")
.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/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")
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/writeoff", 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/writeoff",
"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/writeoff \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'X-com-zoho-subscriptions-organizationid: 10234695' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
{
"reason": true
}
{
"code": 0,
"message": "Invoice has been written off.."
}
Update address
Update shipping and billing address of an invoice.
OAuth Scope : ZohoSubscriptions.invoices.UPDATE
Arguments
street
, city
, state
,zip
and country
.street
, city
, state
,zip
and country
.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"}'
{
"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
}
}
{
"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
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"}'
{
"custom_fields": [
{
"label": "string",
"value": "string"
}
]
}
{
"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
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"}'
{
"apply_creditnotes": [
{
"creditnote_id": "9030000079876",
"amount_applied": 450
}
]
}
{
"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
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)"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"}'
{
"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"
}
]
}
{
"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
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'
{
"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
gif
, png
, jpeg
, jpg
, bmp
and pdf
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"}'
{
"can_send_in_mail": true,
"attachment": "string"
}
{
"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
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/cancelwriteoff"
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/cancelwriteoff")
.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/cancelwriteoff', 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/cancelwriteoff", 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/cancelwriteoff",
"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/cancelwriteoff \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'X-com-zoho-subscriptions-organizationid: 10234695'
{
"code": 0,
"message": "The write off done for this invoice has been cancelled."
}