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.
ach_payment_initiated
boolean
Set to true if ACH payment is initiated.
invoice_number
string
Unique ID (starts with INV) of an invoice.
is_pre_gst
boolean
🇮🇳 India
only
Applicable for transactions that fall before july 1, 2017
place_of_supply
string
🇮🇳 India
only
Place where the goods/services are supplied to. (If not given, place of contact given for the contact will be taken)
gst_no
string
🇮🇳 India
only
15 digit GST identification number of the customer.
gst_treatment
string
🇮🇳 India
only
Choose whether the contact is GST registered/unregistered/consumer/overseas. Allowed values are business_gst , business_none , overseas , consumer .
tax_treatment
string
🇲🇽 Mexico
only
VAT treatment for the Estimate.Allowed Values:
home_country_mexico,border_region_mexico,non_mexico supported only for MX.
cfdi_usage
string
🇲🇽 Mexico
only
Choose CFDI Usage. Allowed values:
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.
vat_treatment
string
🇬🇧 United Kingdom
only
(Optional) VAT treatment for the invoices. VAT treatment denotes the location of the customer, if the customer resides in UK then the VAT treatment is 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).
vat_reg_no
string
Enter VAT registration number.
date
string
Date on which the invoice is paid.
status
string
Status of the invoice. It can be paid, sent, overdue, partially_paid or void.
payment_terms
integer
Payment terms in days e.g. 15, 30, 60. Invoice due date will be calculated based on this. Maximum length [100]
payment_terms_label
string
Used to override the default payment terms label. Default value for 15 days is "Net 15 Days". Maximum length [100]
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.
payment_expected_date
string
A date to specify the expected payment date.
last_payment_date
string
The last payment date of the invoice
reference_number
string
Reference number of the invoice for which payment is made.
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.
contact_persons
array
The IDs of the contact person associated with the contact.
currency_id
string
The currenct id of the currency
currency_code
string
The customer's currency code.
exchange_rate
double
Exchange-Rate for the currency.
discount
float
Discount applied to the invoice. It can be either in % or in amount. e.g. 12.5% or 190. Maximum length [100]
is_discount_before_tax
boolean
Check if discount is exclusive of tax
discount_type
string
Type of discount. Allowed values: entity_level and item_level.
is_inclusive_tax
boolean
To check if discount is inclusive of tax
is_viewed_by_client
boolean
Check if invoice is viewed by client
has_attachment
Denotes whether a customer has any attachments associated with it.
client_viewed_time
string
Time when client viewed the statement
invoice_items
array
Items listed in invoice
Show Sub-Attributes arrow
item_id
string
The line item ID
product_id
string
The ID of the item included in the invoice.
project_id
string
Unique ID of the projet associated to an invoice
project_name
string
Name of the project.
time_entry_ids
array
Unique ID's of all the time entries associated to the linked project
item_type
string
Enter goods/services
product_type
string
VAT , India GST only
Product type for UK Edition.
expense_id
string
Unique ID of the expenses associated
name
string
Name of the item included in the invoice.
description
string
Small description of the payment made for the invoice.
item_order
integer
The order of the line item_order
bcy_rate
double
base currency rate
price
string
Price of the item included in the invoice.
quantity
integer
Quantity of the item included in the invoice.
unit
string
Unit of the line item e.g. kgs, Nos. Maximum length [100]
discount_amount
double
The discount amount included in an invoice on applying a coupon.
discount
float
Discount applied to the invoice. It can be either in % or in amount. e.g. 12.5% or 190. Maximum length [100]
tax_id
string
Tax ID to which you would like to associate with this plan.
tds_tax_id
string
🇲🇽 Mexico
only
ID of the TDS tax.
tax_name
string
The name of the tax
tax_type
string
The type of the tax
tax_percentage
float
The percentage of tax levied
item_total
integer
Cost of an item included in the invoice. This would be the product of quantity of the item included and the price of that item.
sat_item_key_code
string
🇲🇽 Mexico
only
Add SAT Item Key Code for your goods/services. Download the CFDI Catalogs.
unitkey_code
string
🇲🇽 Mexico
only
Add SAT Unit Key Code for your goods/services. Download the CFDI Catalogs.
shipping_charge
string
Shipping charges applied to the invoice. Maximum length [100]
adjustment
double
Adjustments made to the invoice.
adjustment_description
string
Customize the adjustment description. E.g. Rounding off.
sub_total
float
The sub total of the all items
tax_total
double
The total amount of the tax levied
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.
taxes
array
List of the taxes levied
Show Sub-Attributes arrow
tax_name
string
The name of the tax
tax_amount
float
The amount of the tax levied
payment_reminder_enabled
boolean
Boolean to check if reminders have been enabled
payment_made
double
Payments can be made in multiple instalments. payment_made refers to the amount paid for the invoice in the respective instalment.
credits_applied
double
Credits applied for the invoice.
tax_amount_withheld
float
The tax amount which has been withheld
balance
double
The unpaid amount of an invoice.
write_off_amount
double
The unpaid amount of an invoice that is written off.
allow_partial_payments
boolean
Boolean to check if partial payments are allowed for the contact
price_precision
integer
The precision value on the price
payment_options
object
Payment options available for payment
Show Sub-Attributes arrow
payment_gateways
array
Payment gateways integrated and supported
Show Sub-Attributes arrow
configured
boolean
Boolean check to see if a payment gateway has been configured
additional_field1
string
Paypal payment method. Allowed Values: standard and adaptive
gateway_name
string
Name of the payment gateway associated with the invoice. E.g. paypal, stripe.Allowed Values: paypal, authorize_net, payflow_pro, stripe, 2checkout and braintree
is_emailed
boolean
Boolean check to see if the mail has been sent
reminders_sent
integer
The number of reminders sent
last_reminder_sent_date
string
The date the last email was sent
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.
notes
string
The notes added below expressing gratitude or for conveying some information.
terms
string
The terms added below expressing gratitude or for conveying some information.
custom_fields
array
Additional fields for the invoices.
template_id
string
ID of the pdf template associated with the invoice.
template_name
string
Name of the invoice template used
created_time
string
Time when the invoice was created.
last_modified_time
string
Date of last modification of the invoice
attachment_name
string
Name of the file attached
can_send_in_mail
Set to true if all the attachments of this invoice can be attached in Invoice Emails.
salesperson_id
string
Unique Id to denote the sales person.
salesperson_name
string
Name of the sales person associated with the invoice for offline payments.
invoice_url
string
Url which corresponds to the invoice.

Example

{ "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": [ "982000000870911", "982000000870915" ], "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

customer_id
string
(Required)
Customer ID of the customer to whom the invoice is raised.
contact_persons
array
The IDs of the contact person associated with the contact.
invoice_number
string
Unique ID (starts with INV) of an invoice.
reference_number
string
Reference number of the invoice for which payment is made.
place_of_supply
string
🇮🇳 India
only
Place where the goods/services are supplied to. (If not given, place of contact given for the contact will be taken)
vat_treatment
string
🇬🇧 United Kingdom
only
(Optional) VAT treatment for the invoices. VAT treatment denotes the location of the customer, if the customer resides in UK then the VAT treatment is 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).
gst_treatment
string
🇮🇳 India
only
Choose whether the contact is GST registered/unregistered/consumer/overseas. Allowed values are business_gst , business_none , overseas , consumer .
tax_treatment
string
🇲🇽 Mexico
only
VAT treatment for the Estimate.Allowed Values:
home_country_mexico,border_region_mexico,non_mexico supported only for MX.
cfdi_usage
string
🇲🇽 Mexico
only
Choose CFDI Usage. Allowed values:
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.
gst_no
string
🇮🇳 India
only
15 digit GST identification number of the customer.
template_id
string
ID of the pdf template associated with the invoice.
date
string
(Required)
Date on which the invoice is paid.
payment_terms
integer
Payment terms in days e.g. 15, 30, 60. Invoice due date will be calculated based on this. Maximum length [100]
payment_terms_label
string
Used to override the default payment terms label. Default value for 15 days is "Net 15 Days". Maximum length [100]
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.
discount
float
Discount applied to the invoice. It can be either in % or in amount. e.g. 12.5% or 190. Maximum length [100]
is_discount_before_tax
boolean
Check if discount is exclusive of tax
discount_type
string
Type of discount. Allowed values: entity_level and item_level.
is_inclusive_tax
boolean
To check if discount is inclusive of tax
exchange_rate
double
Exchange-Rate for the currency.
invoiced_estimate_id
string
ID of the invoice from which the invoice is created.
salesperson_name
string
Name of the sales person associated with the invoice for offline payments.
custom_fields
array
Custom fields for an invoice.
Show Sub-Attributes arrow
label
string
Label of the Custom Field
value
string
Value of the Custom Field
project_id
string
Unique ID of the projet associated to an invoice
invoice_items
array
(Required)
Line items of an invoice.
Show Sub-Attributes arrow
product_id
string
(Required)
The ID of the item included in the invoice.
project_id
string
Unique ID of the projet associated to an invoice
time_entry_ids
array
Unique ID's of all the time entries associated to the linked project
expense_id
string
Unique ID of the expenses associated
name
string
Name of the item included in the invoice.
product_type
string
VAT , India GST only
Product type for UK Edition.
hsn_or_sac
string
India GST only
HSN or SAC code for Goods/Services
sat_item_key_code
string
🇲🇽 Mexico
only
Add SAT Item Key Code for your goods/services. Download the CFDI Catalogs.
unitkey_code
string
🇲🇽 Mexico
only
Add SAT Unit Key Code for your goods/services. Download the CFDI Catalogs.
description
string
Small description of the payment made for the invoice.
item_order
integer
The order of the line item_order
price
string
Price of the item included in the invoice.
quantity
integer
(Required)
Quantity of the item included in the invoice.
unit
string
Unit of the line item e.g. kgs, Nos. Maximum length [100]
discount
float
Discount applied to the invoice. It can be either in % or in amount. e.g. 12.5% or 190. Maximum length [100]
tax_id
string
Tax ID to which you would like to associate with this plan.
tds_tax_id
string
🇲🇽 Mexico
only
ID of the TDS tax.
tax_exemption_id
string
Unique Tax Exemption ID if you dont want to associate a tax to the plan.
avatax_use_code
string
Avalara Integration only
Used to group like customers for exemption purposes. It is a custom value that links customers to a tax rule. Select from Avalara [standard codes][1] or enter a custom code. Maximum length [25]
avatax_exempt_no
string
Avalara Integration only
Exemption certificate number of the customer. Maximum length [25]
tax_name
string
The name of the tax
tax_type
string
The type of the tax
tax_percentage
float
The percentage of tax levied
item_total
integer
Cost of an item included in the invoice. This would be the product of quantity of the item included and the price of that item.
payment_options
object
Payment options available for payment
Show Sub-Attributes arrow
payment_gateways
array
Payment gateways integrated and supported
Show Sub-Attributes arrow
configured
boolean
Boolean check to see if a payment gateway has been configured
additional_field1
string
Paypal payment method. Allowed Values: standard and adaptive
gateway_name
string
Name of the payment gateway associated with the invoice. E.g. paypal, stripe.Allowed Values: paypal, authorize_net, payflow_pro, stripe, 2checkout and braintree
allow_partial_payments
boolean
Boolean to check if partial payments are allowed for the contact
custom_body
string
Customized email content
custom_subject
string
Customized Subject line
notes
string
The notes added below expressing gratitude or for conveying some information.
terms
string
The terms added below expressing gratitude or for conveying some information.
shipping_charge
string
Shipping charges applied to the invoice. Maximum length [100]
adjustment
double
Adjustments made to the invoice.
adjustment_description
string
Customize the adjustment description. E.g. Rounding off.
reason
string
Description of the attachment
tax_authority_id
string
🇺🇸 United States
, 🇨🇦 Canada
only
ID of the tax authority. Tax authority depends on the location of the customer. For example, if the customer is located in NY, then the tax authority is NY tax authority.
tax_exemption_id
string
Unique Tax Exemption ID if you dont want to associate a tax to the plan.
avatax_use_code
string
Avalara Integration only
Used to group like customers for exemption purposes. It is a custom value that links customers to a tax rule. Select from Avalara [standard codes][1] or enter a custom code. Maximum length [25]
avatax_tax_code
string
Avalara Integration only
A tax code is a unique label used to group Items (products, services, or charges) together. Maximum length [25]
avatax_exempt_no
string
Avalara Integration only
Exemption certificate number of the customer. Maximum length [25]

Query Parameters

send
Send the invoice to the contact person(s) associated with the invoice. Allowed values true and false.
ignore_auto_number_generation
Ignore auto invoice number generation for this invoice. This mandates the invoice number. Allowed values true and false

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" 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"}'

Body Parameters

Click to copy
{ "customer_id": "903000000000099", "contact_persons": [ "982000000870911", "982000000870915" ], "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" }

Response Example

{ "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": [ "982000000870911", "982000000870915" ], "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
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" }, {...}, {...} ] }

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

customer_id
string
(Required)
Customer ID of the customer to whom the invoice is raised.
contact_persons
array
The IDs of the contact person associated with the contact.
invoice_number
string
Unique ID (starts with INV) of an invoice.
reference_number
string
Reference number of the invoice for which payment is made.
place_of_supply
string
🇮🇳 India
only
Place where the goods/services are supplied to. (If not given, place of contact given for the contact will be taken)
vat_treatment
string
🇬🇧 United Kingdom
only
(Optional) VAT treatment for the invoices. VAT treatment denotes the location of the customer, if the customer resides in UK then the VAT treatment is 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).
gst_treatment
string
🇮🇳 India
only
Choose whether the contact is GST registered/unregistered/consumer/overseas. Allowed values are business_gst , business_none , overseas , consumer .
tax_treatment
string
🇲🇽 Mexico
only
VAT treatment for the Estimate.Allowed Values:
home_country_mexico,border_region_mexico,non_mexico supported only for MX.
cfdi_usage
string
🇲🇽 Mexico
only
Choose CFDI Usage. Allowed values:
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.
gst_no
string
🇮🇳 India
only
15 digit GST identification number of the customer.
template_id
string
ID of the pdf template associated with the invoice.
date
string
Date on which the invoice is paid.
payment_terms
integer
Payment terms in days e.g. 15, 30, 60. Invoice due date will be calculated based on this. Maximum length [100]
payment_terms_label
string
Used to override the default payment terms label. Default value for 15 days is "Net 15 Days". Maximum length [100]
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.
discount
float
Discount applied to the invoice. It can be either in % or in amount. e.g. 12.5% or 190. Maximum length [100]
is_discount_before_tax
boolean
Check if discount is exclusive of tax
discount_type
string
Type of discount. Allowed values: entity_level and item_level.
is_inclusive_tax
boolean
To check if discount is inclusive of tax
exchange_rate
double
Exchange-Rate for the currency.
invoiced_estimate_id
string
ID of the invoice from which the invoice is created.
salesperson_name
string
Name of the sales person associated with the invoice for offline payments.
custom_fields
array
Custom fields for an invoice.
Show Sub-Attributes arrow
label
string
Label of the Custom Field
value
string
Value of the Custom Field
project_id
string
Unique ID of the projet associated to an invoice
invoice_items
array
(Required)
Line items of an invoice.
Show Sub-Attributes arrow
product_id
string
(Required)
The ID of the item included in the invoice.
project_id
string
Unique ID of the projet associated to an invoice
time_entry_ids
array
Unique ID's of all the time entries associated to the linked project
expense_id
string
Unique ID of the expenses associated
name
string
Name of the item included in the invoice.
product_type
string
VAT , India GST only
Product type for UK Edition.
hsn_or_sac
string
India GST only
HSN or SAC code for Goods/Services
sat_item_key_code
string
🇲🇽 Mexico
only
Add SAT Item Key Code for your goods/services. Download the CFDI Catalogs.
unitkey_code
string
🇲🇽 Mexico
only
Add SAT Unit Key Code for your goods/services. Download the CFDI Catalogs.
description
string
Small description of the payment made for the invoice.
item_order
integer
The order of the line item_order
price
string
Price of the item included in the invoice.
quantity
integer
Quantity of the item included in the invoice.
unit
string
Unit of the line item e.g. kgs, Nos. Maximum length [100]
discount
float
Discount applied to the invoice. It can be either in % or in amount. e.g. 12.5% or 190. Maximum length [100]
tax_id
string
Tax ID to which you would like to associate with this plan.
tds_tax_id
string
🇲🇽 Mexico
only
ID of the TDS tax.
tax_exemption_id
string
Unique Tax Exemption ID if you dont want to associate a tax to the plan.
avatax_use_code
string
Avalara Integration only
Used to group like customers for exemption purposes. It is a custom value that links customers to a tax rule. Select from Avalara [standard codes][1] or enter a custom code. Maximum length [25]
avatax_exempt_no
string
Avalara Integration only
Exemption certificate number of the customer. Maximum length [25]
tax_name
string
The name of the tax
tax_type
string
The type of the tax
tax_percentage
float
The percentage of tax levied
item_total
integer
Cost of an item included in the invoice. This would be the product of quantity of the item included and the price of that item.
payment_options
object
Payment options available for payment
Show Sub-Attributes arrow
payment_gateways
array
Payment gateways integrated and supported
Show Sub-Attributes arrow
configured
boolean
Boolean check to see if a payment gateway has been configured
additional_field1
string
Paypal payment method. Allowed Values: standard and adaptive
gateway_name
string
Name of the payment gateway associated with the invoice. E.g. paypal, stripe.Allowed Values: paypal, authorize_net, payflow_pro, stripe, 2checkout and braintree
allow_partial_payments
boolean
Boolean to check if partial payments are allowed for the contact
custom_body
string
Customized email content
custom_subject
string
Customized Subject line
notes
string
The notes added below expressing gratitude or for conveying some information.
terms
string
The terms added below expressing gratitude or for conveying some information.
shipping_charge
string
Shipping charges applied to the invoice. Maximum length [100]
adjustment
double
Adjustments made to the invoice.
adjustment_description
string
Customize the adjustment description. E.g. Rounding off.
reason
string
Description of the attachment
tax_authority_id
string
🇺🇸 United States
, 🇨🇦 Canada
only
ID of the tax authority. Tax authority depends on the location of the customer. For example, if the customer is located in NY, then the tax authority is NY tax authority.
tax_exemption_id
string
Unique Tax Exemption ID if you dont want to associate a tax to the plan.
avatax_use_code
string
Avalara Integration only
Used to group like customers for exemption purposes. It is a custom value that links customers to a tax rule. Select from Avalara [standard codes][1] or enter a custom code. Maximum length [25]
avatax_tax_code
string
Avalara Integration only
A tax code is a unique label used to group Items (products, services, or charges) together. Maximum length [25]
avatax_exempt_no
string
Avalara Integration only
Exemption certificate number of the customer. Maximum length [25]

Query Parameters

ignore_auto_number_generation
Ignore auto invoice number generation for this invoice. This mandates the invoice number. Allowed values true and false

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" 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"}'

Body Parameters

Click to copy
{ "customer_id": "903000000000099", "contact_persons": [ "982000000870911", "982000000870915" ], "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" }

Response Example

{ "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": [ "982000000870911", "982000000870915" ], "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

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", "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

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: 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'

Response Example

{ "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

customfield_id
long
value
string
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/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"}'

Body Parameters

Click to copy
[ { "customfield_id": "46000000012845", "value": "string" } ]

Response Example

{ "code": 0, "message": "Custom Fields Updated Successfully" }

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." }