Unbilled-Charges
These are charges to be converted into an invoice at a later point of time, either by manual intervention or during renewal.
End Points
Retrieve an unbilled charge
Delete unbilled charge
Convert unbilled charge to invoice
Attribute
unbilled_charge_id
string
Unique ID generated for an unbilled charge.
number
string
Unique number (starts with UNBILL) generated for display in interface.
status
string
Status of the unbilled charge. It can be
invoiced
, open
unbilled_charge_date
string
The date on which the unbilled charge was raised.
customer_id
array
Customer ID of the customer to whom the unbilled charge was raised.
customer_name
string
Name of the customer to whom the unbilled charge was raised.
email
string
Email address of the customer.
unbilled_charge_items
array
Multiple items can be added as unbilled charges for a subscription : buy one time addon, add charge.
unbilled_charge_item_id
string
Unique ID generated for an item in the unbilled charge.
product_id
string
The ID of the product included in the unbilled charge.
name
string
Name of the item.
description
Description for the item.
code
string
Item code of the item.
price
string
Price of the item included in the invoice.
quantity
integer
Quantity of the item.
discount_amount
double
The discount amount included on applying a coupon.
item_total
integer
This would be the product of quantity of the item included and the price of that item.
tax_id
Unique ID of Tax or Tax Group that must be associated with the item.
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
tax_exemption_id
Unique Tax Exemption ID if you dont want to associate a tax to the plan.
tax_exemption_code
string
Unique code to denote the tax exemption.
coupons
array
The array of objects which contains the details of the added coupon.
coupon_code
and discount_amount
are applied to the total. coupon_code
string
The coupon code of the coupon applied.
coupon_name
string
Name of the coupon applied to the subscription.
discount_amount
double
The discount amount included on applying a coupon.
total
double
Total amount to be paid. This would be the sum of individual costs of all items.
currency_code
string
Currency code in which the payment is made.
currency_symbol
string
Customer's currency symbol.
created_time
string
Time when the unbilled charge was created.
updated_time
string
Time when the unbilled charge details were last updated.
billing_address
object
Customer's billing address object. It contains
street
, city
, state
,zip
and country
. street
string
Name of the street.
city
string
Name of the city.
state
string
Name of the state.
zip
string
Zip code of the customer's address.
country
string
Name of the country.
fax
string
Customer's fax number.
shipping_address
object
Customer's shipping address object. It contains
street
, city
, state
,zip
and country
. street
string
Name of the street.
city
string
Name of the city.
state
string
Name of the state.
zip
string
Zip code of the customer's address.
country
string
Name of the country.
fax
string
Customer's fax number.
{
"unbilled_charge_id": "90300000079200",
"number": "UNBILL-000004",
"status": "open",
"unbilled_charge_date": "2016-06-05",
"customer_id": "903000000000099",
"customer_name": "Bowman Furniture",
"email": "benjamin.george@bowmanfurniture.com",
"unbilled_charge_items": [
{
"unbilled_charge_item_id": "90300000079201",
"product_id": "7000000079434",
"name": "Basic",
"description": "Usage charges for last month",
"code": "basic-monthly",
"price": 50,
"quantity": 1,
"discount_amount": 80,
"item_total": 400,
"tax_id": "90300000079226",
"product_type": "goods",
"hsn_or_sac": "74191010",
"tax_exemption_id": "90300000079226",
"tax_exemption_code": "NGO"
}
],
"coupons": [
{
"coupon_code": "THANKSGIVING20",
"coupon_name": "Flat 10",
"discount_amount": 80
}
],
"total": 370,
"currency_code": "USD",
"currency_symbol": "$",
"created_time": "2016-06-05T02:15:15-0700",
"updated_time": "2016-06-05T02:15:15-0700",
"billing_address": {
"street": "Harrington Bay Street",
"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
}
}
Retrieve an unbilled charge
Details of an unbilled charge.
OAuth Scope : ZohoSubscriptions.invoices.READ
headers_data = Map();
headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695");
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/billing/v1/unbilledcharges/90300000079200"
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/unbilledcharges/90300000079200")
.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/unbilledcharges/90300000079200', 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/unbilledcharges/90300000079200", 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/unbilledcharges/90300000079200",
"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/unbilledcharges/90300000079200 \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'X-com-zoho-subscriptions-organizationid: 10234695'
{
"code": 0,
"message": "success",
"unbilled_charge": {
"unbilled_charge_id": "90300000079200",
"number": "UNBILL-000004",
"status": "open",
"unbilled_charge_date": "2016-06-05",
"customer_id": "903000000000099",
"customer_name": "Bowman Furniture",
"email": "benjamin.george@bowmanfurniture.com",
"unbilled_charge_items": [
{
"unbilled_charge_item_id": "90300000079201",
"product_id": "7000000079434",
"name": "Basic",
"description": "Usage charges for last month",
"code": "basic-monthly",
"price": 50,
"quantity": 1,
"discount_amount": 80,
"item_total": 400,
"tax_id": "90300000079226",
"product_type": "goods",
"hsn_or_sac": "74191010",
"tax_exemption_id": "90300000079226",
"tax_exemption_code": "NGO"
}
],
"coupons": [
{
"coupon_code": "THANKSGIVING20",
"coupon_name": "Flat 10",
"discount_amount": 80
}
],
"total": 370,
"currency_code": "USD",
"currency_symbol": "$",
"created_time": "2016-06-05T02:15:15-0700",
"updated_time": "2016-06-05T02:15:15-0700",
"billing_address": {
"street": "Harrington Bay Street",
"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
}
}
}
Delete unbilled charge
Delete the unbilled charge.
OAuth Scope : ZohoSubscriptions.invoices.DELETE
headers_data = Map();
headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695");
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/billing/v1/unbilledcharges/90300000079200"
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/unbilledcharges/90300000079200")
.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/unbilledcharges/90300000079200', 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/unbilledcharges/90300000079200", 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/unbilledcharges/90300000079200",
"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/unbilledcharges/90300000079200 \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'X-com-zoho-subscriptions-organizationid: 10234695'
{
"code": 0,
"message": "The unbilled charges have been deleted."
}
Convert unbilled charge to invoice
Convert unbilled charges to an invoice by manual intervention instead of waiting for next renewal.
OAuth Scope : ZohoSubscriptions.invoices.CREATE
headers_data = Map();
headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695");
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/billing/v1/unbilledcharges/90300000079200/createinvoice"
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/unbilledcharges/90300000079200/createinvoice")
.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/unbilledcharges/90300000079200/createinvoice', 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/unbilledcharges/90300000079200/createinvoice", 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/unbilledcharges/90300000079200/createinvoice",
"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/unbilledcharges/90300000079200/createinvoice \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'X-com-zoho-subscriptions-organizationid: 10234695'
{
"code": 0,
"message": "Unbilled Charges have been invoiced.",
"invoice": {
"invoice_id": "903000000079426",
"number": "INV-000004",
"status": "open",
"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": "Usage charges for last month",
"code": "basic-monthly",
"price": 50,
"quantity": 1,
"discount_amount": 80,
"item_total": 400,
"tax_id": "90300000079226",
"tax_exemption_id": "90300000079226",
"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": "Usage charges for last month",
"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": {
"street": "Harrington Bay Street",
"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
}
}
}