Credit-Notes
Credit notes are created when a refund is to be made to a customer. A credit note object allows you to keep track of all credit note related information.
End Points
Create a credit note
Retreive a credit note
Delete a credit note
Email a credit note
Void a credit note
Open a voided credit note
Apply Credits to Multiple Invoices
Attribute
creditnote_id
string
Unique ID of the credit note generated by the server.
creditnote_number
string
Unique number generated (starts with CN) which will be displayed in the interface and credit notes.
date
string
The date on which credit note is raised.
status
string
Status of the credit note. This can be
open
, closed
or void
. customer_id
string
Customer ID of the customer for whom the credit note is raised.
customer_name
string
Name of the customer to whom the credit note is raised.
custom_fields
array
Additional fields for the Credit-Notes.
index
integer
Index of the custom field. It can hold any value from 1 to 10.
value
string
Value of the Custom Field
label
string
Label of the Custom Field
data_type
string
Data type of the custom field.
reference_number
string
Reference number generated for the payment. A string of your choice can also be used as the reference number.
email
string
Email address of the customer.
total
double
Total credits raised in this credit note.
balance
double
The unapplied credits.
line_items
array
List of items involved in the credit note. This contains
item_id
, description
, quantity
, price
and item_total
. item_id
string
Unique string generated for the item to which a refund is to be made.
description
string
A small description about the item.
code
string
Unique code for the creditnote line item.
tags
array
tag_id
long
ID of the Tag
tag_option_id
long
Id of the Tag Option
item_custom_fields
array
Custom fields for a item.
label
string
Label of the Custom Field
value
string
Value of the Custom Field
name
string
Name of the credit
type
integer
Type of the creditnote line item.
account_id
string
Unique ID to denote the account.
account_name
string
Name of the account.
quantity
int32
Quantity of the item included.
tax_id
string
Unique to denote the tax associate dto the creditnote
tds_tax_id
string
mx
only
ID of the TDS tax.
price
double
The price of the item included.
item_total
double
Total credits raised by this item. This would be the multiplicative product of item price and quantity.
sat_item_key_code
string
mx
only
Add SAT Item Key Code for your goods/services. Download the CFDI Catalogs.
unitkey_code
string
mx
only
Add SAT Unit Key Code for your goods/services. Download the CFDI Catalogs.
invoices
array
List of invoices for which the credit note has been raised. This contains
invoice_id
and amount
. invoice_id
string
Invoice ID of the required invoice.
invoice_number
string
Invoice number of the required invoice.
amount
double
Amount paid for the invoice.
taxes
array
Taxes associated wit the subscription.
tax_id
string
Unique to denote the tax associate dto the creditnote
tax_name
string
Unique name for tax.
tax_amount
string
Tax amount applied to the subscription.
currency_code
string
Customer's currency code. This currency code is used in credit notes.
currency_symbol
string
Customer's currency symbol.
created_time
string
Time at which the credit note was created.
updated_time
string
Time at which the credit note details were last updated.
template_id
string
Unique ID of the creditnote template
template_name
string
Name of the default template of the creditnote.
notes
string
A short note for the credit note.
terms
string
Terms & condition to be displayed in the credit note.
{
"creditnote_id": "90300000072369",
"creditnote_number": "CN-29",
"date": "2016-06-05",
"status": "open",
"customer_id": "903000000000099",
"customer_name": "Bowman Furniture",
"custom_fields": [
{
"index": 1,
"value": "string",
"label": "string",
"data_type": "text"
}
],
"reference_number": "INV-384",
"email": "benjamin.george@bowmanfurniture.com",
"total": 450,
"balance": 10,
"line_items": [
{
"item_id": "90300000081501",
"description": "prorated amount for items",
"code": "basic-monthly",
"tags": [
{
"tag_id": 0,
"tag_option_id": 0
}
],
"item_custom_fields": [
{
"label": "string",
"value": "string"
}
],
"name": "Basic Monthly",
"type": 1,
"account_id": "903000000000388",
"account_name": "Sales",
"quantity": 1,
"tax_id": "903000000000356",
"tds_tax_id": "982000000557012",
"price": 100,
"item_total": 100,
"sat_item_key_code": 71121206,
"unitkey_code": "E48"
}
],
"invoices": [
{
"invoice_id": "90300000079426",
"invoice_number": "INV-384",
"amount": 450
}
],
"taxes": [
{
"tax_id": "903000000000356",
"tax_name": "Basic Tax",
"tax_amount": "2.50"
}
],
"currency_code": "USD",
"currency_symbol": "$",
"created_time": "2016-06-05T02:30:08-0700",
"updated_time": "2016-06-05T02:30:08-0700",
"template_id": "90300000001336",
"template_name": "Standard Template",
"notes": "Offer for the referral",
"terms": ""
}
Create a credit note
Details of an existing creditnote.oauthscope : ZohoSubscriptions.creditnotes.CREATE
Arguments
customer_id
string
(Required)
Customer ID of the customer for whom the credit note is raised.
contact_persons
array
Contact Persons associated with the credit note.
date
string
(Required)
The date on which credit note is raised.
exchange_rate
string
Exchange rate for the currency associated with the customer.
line_items
array
(Required)
List of items involved in the credit note. This contains
item_id
, description
, quantity
, price
and item_total
. description
string
A small description about the item.
code
string
(Required)
Unique code for the creditnote line item.
account_id
string
Unique ID to denote the account.
quantity
int32
(Required)
Quantity of the item included.
tags
array
tag_id
long
ID of the Tag
tag_option_id
long
Id of the Tag Option
item_custom_fields
array
Custom fields for a item.
label
string
Label of the Custom Field
value
string
Value of the Custom Field
tax_id
string
Unique to denote the tax associate dto the creditnote
tds_tax_id
string
mx
only
ID of the TDS tax.
tax_exemption_id
string
Sales Tax
GST
only
Unique ID of the tax exemption.
tax_exemption_code
string
Sales Tax
GST
only
Unique code of the tax exemption.
price
double
(Required)
The price of the item included.
sat_item_key_code
string
mx
only
Add SAT Item Key Code for your goods/services. Download the CFDI Catalogs.
unitkey_code
string
mx
only
Add SAT Unit Key Code for your goods/services. Download the CFDI Catalogs.
creditnote_number
string
(Required)
Unique number generated (starts with CN) which will be displayed in the interface and credit notes.
ignore_auto_number_generation
boolean
Set to true if you need to provide your own credit note number.
reference_number
string
Reference number generated for the payment. A string of your choice can also be used as the reference number.
custom_fields
array
Additional fields for the Credit-Notes.
label
string
Label of the Custom Field
value
string
Value of the Custom Field
notes
string
A short note for the credit note.
terms
string
Terms & condition to be displayed in the credit note.
template_id
string
Unique ID of the creditnote template
tax_treatment
string
mx
only
VAT treatment for the invoice .Choose whether the contact falls under:
home_country_mexico
,border_region_mexico
,non_mexico
supported only for MX. cfdi_usage
string
mx
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
. cfdi_reference_type
string
mx
only
Choose CFDI Reference Type. Allowed values:
return_of_merchandise
, substitution_previous_cfdi
, transfer_of_goods
, invoice_generated_from_order
, cfdi_for_advance
.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/subscriptions/v1/creditnotes"
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/subscriptions/v1/creditnotes")
.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/subscriptions/v1/creditnotes', 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", "/subscriptions/v1/creditnotes", 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": "/subscriptions/v1/creditnotes",
"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/subscriptions/v1/creditnotes \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'X-com-zoho-subscriptions-organizationid: 10234695' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
{
"customer_id": "903000000000099",
"contact_persons": [
"903000006532"
],
"date": "2016-06-05",
"exchange_rate": "5.5",
"line_items": [
{
"description": "prorated amount for items",
"code": "basic-monthly",
"account_id": "903000000000388",
"quantity": 1,
"tags": [
{
"tag_id": 0,
"tag_option_id": 0
}
],
"item_custom_fields": [
{
"label": "string",
"value": "string"
}
],
"tax_id": "903000000000356",
"tds_tax_id": "982000000557012",
"tax_exemption_id": "903000006345",
"tax_exemption_code": "GST FREE",
"price": 100,
"sat_item_key_code": 71121206,
"unitkey_code": "E48"
}
],
"creditnote_number": "CN-29",
"ignore_auto_number_generation": false,
"reference_number": "INV-384",
"custom_fields": [
{
"label": "string",
"value": "string"
}
],
"notes": "Offer for the referral",
"terms": "",
"template_id": "90300000001336",
"tax_treatment": "vat_registered",
"cfdi_usage": "acquisition_of_merchandise",
"cfdi_reference_type": "return_of_merchandise"
}
{
"code": 0,
"message": "Credit Note created successfully.",
"credit_note": {
"creditnote_id": "90300000072369",
"creditnote_number": "CN-29",
"date": "2016-06-05",
"status": "open",
"customer_id": "903000000000099",
"customer_name": "Bowman Furniture",
"custom_fields": [
{
"index": 1,
"value": "string",
"label": "string",
"data_type": "text"
}
],
"reference_number": "INV-384",
"email": "benjamin.george@bowmanfurniture.com",
"total": 450,
"balance": 10,
"line_items": [
{
"item_id": "90300000081501",
"description": "prorated amount for items",
"code": "basic-monthly",
"tags": [
{
"tag_id": 0,
"tag_option_id": 0
}
],
"item_custom_fields": [
{
"label": "string",
"value": "string"
}
],
"name": "Basic Monthly",
"type": 1,
"account_id": "903000000000388",
"account_name": "Sales",
"quantity": 1,
"tax_id": "903000000000356",
"tds_tax_id": "982000000557012",
"price": 100,
"item_total": 100,
"sat_item_key_code": 71121206,
"unitkey_code": "E48"
}
],
"invoices": [
{
"invoice_id": "90300000079426",
"invoice_number": "INV-384",
"amount": 450
}
],
"taxes": [
{
"tax_id": "903000000000356",
"tax_name": "Basic Tax",
"tax_amount": "2.50"
}
],
"currency_code": "USD",
"currency_symbol": "$",
"created_time": "2016-06-05T02:30:08-0700",
"updated_time": "2016-06-05T02:30:08-0700",
"template_id": "90300000001336",
"template_name": "Standard Template",
"notes": "Offer for the referral",
"terms": ""
}
}
Retreive a credit note
Details of an existing creditnote.oauthscope : ZohoSubscriptions.creditnotes.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/subscriptions/v1/creditnotes/90300000072369"
type: GET
headers: headers_data
content-type: application/octet-stream
connection: <connection_name>
]
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://www.zohoapis.com/subscriptions/v1/creditnotes/90300000072369")
.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/subscriptions/v1/creditnotes/90300000072369', 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", "/subscriptions/v1/creditnotes/90300000072369", 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": "/subscriptions/v1/creditnotes/90300000072369",
"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/subscriptions/v1/creditnotes/90300000072369 \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'X-com-zoho-subscriptions-organizationid: 10234695'
{
"code": 0,
"message": "success",
"credit_note": {
"creditnote_id": "90300000072369",
"creditnote_number": "CN-29",
"date": "2016-06-05",
"status": "open",
"customer_id": "903000000000099",
"customer_name": "Bowman Furniture",
"custom_fields": [
{
"index": 1,
"value": "string",
"label": "string",
"data_type": "text"
}
],
"reference_number": "INV-384",
"email": "benjamin.george@bowmanfurniture.com",
"total": 450,
"balance": 10,
"line_items": [
{
"item_id": "90300000081501",
"description": "prorated amount for items",
"code": "basic-monthly",
"tags": [
{
"tag_id": 0,
"tag_option_id": 0
}
],
"item_custom_fields": [
{
"label": "string",
"value": "string"
}
],
"name": "Basic Monthly",
"type": 1,
"account_id": "903000000000388",
"account_name": "Sales",
"quantity": 1,
"tax_id": "903000000000356",
"tds_tax_id": "982000000557012",
"price": 100,
"item_total": 100,
"sat_item_key_code": 71121206,
"unitkey_code": "E48"
}
],
"invoices": [
{
"invoice_id": "90300000079426",
"invoice_number": "INV-384",
"amount": 450
}
],
"taxes": [
{
"tax_id": "903000000000356",
"tax_name": "Basic Tax",
"tax_amount": "2.50"
}
],
"currency_code": "USD",
"currency_symbol": "$",
"created_time": "2016-06-05T02:30:08-0700",
"updated_time": "2016-06-05T02:30:08-0700",
"template_id": "90300000001336",
"template_name": "Standard Template",
"notes": "Offer for the referral",
"terms": ""
}
}
Delete a credit note
Delete an existing credit note.oauthscope : ZohoSubscriptions.creditnotes.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/subscriptions/v1/creditnotes/90300000072369"
type: DELETE
headers: headers_data
content-type: application/octet-stream
connection: <connection_name>
]
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://www.zohoapis.com/subscriptions/v1/creditnotes/90300000072369")
.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/subscriptions/v1/creditnotes/90300000072369', 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", "/subscriptions/v1/creditnotes/90300000072369", 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": "/subscriptions/v1/creditnotes/90300000072369",
"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/subscriptions/v1/creditnotes/90300000072369 \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'X-com-zoho-subscriptions-organizationid: 10234695'
{
"code": 0,
"message": "The credit note has been deleted."
}
Email a credit note
Email a credit note.oauthscope : ZohoSubscriptions.creditnotes.CREATE
Arguments
to_mail_ids
array
(Required)
The email IDs to which the credit note 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.
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/subscriptions/v1/creditnotes/90300000072369/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/subscriptions/v1/creditnotes/90300000072369/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/subscriptions/v1/creditnotes/90300000072369/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", "/subscriptions/v1/creditnotes/90300000072369/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": "/subscriptions/v1/creditnotes/90300000072369/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/subscriptions/v1/creditnotes/90300000072369/email \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'X-com-zoho-subscriptions-organizationid: 10234695' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
{
"to_mail_ids": [
"benjamin.george@bowmanfurniture.com",
"paul@bowmanfurniture.com"
],
"cc_mail_ids": [
"accounts@bowmanfurniture.com"
],
"subject": "Credit note for subscription.",
"body": "Please find attached the credit note for your subscription."
}
{
"code": 0,
"message": "Your creditnote has been sent."
}
Void a credit note
Details of an existing creditnote.oauthscope : ZohoSubscriptions.creditnotes.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/subscriptions/v1/creditnotes/90300000072369/void"
type: POST
headers: headers_data
content-type: application/octet-stream
connection: <connection_name>
]
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://www.zohoapis.com/subscriptions/v1/creditnotes/90300000072369/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/subscriptions/v1/creditnotes/90300000072369/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", "/subscriptions/v1/creditnotes/90300000072369/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": "/subscriptions/v1/creditnotes/90300000072369/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/subscriptions/v1/creditnotes/90300000072369/void \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'X-com-zoho-subscriptions-organizationid: 10234695'
{
"code": 0,
"message": "The credit note has been marked as void."
}
Open a voided credit note
Convert a voided credit note to open.oauthscope : ZohoSubscriptions.creditnotes.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/subscriptions/v1/creditnotes/90300000072369/converttoopen"
type: POST
headers: headers_data
content-type: application/octet-stream
connection: <connection_name>
]
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://www.zohoapis.com/subscriptions/v1/creditnotes/90300000072369/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/subscriptions/v1/creditnotes/90300000072369/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", "/subscriptions/v1/creditnotes/90300000072369/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": "/subscriptions/v1/creditnotes/90300000072369/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/subscriptions/v1/creditnotes/90300000072369/converttoopen \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'X-com-zoho-subscriptions-organizationid: 10234695'
{
"code": 0,
"message": "Status of the credit note has been changed to open."
}
Apply Credits to Multiple Invoices
To associate a creditnote to multiple invoices.oauthscope : ZohoSubscriptions.creditnotes.CREATE
Arguments
invoices
array
(Required)
List of invoices for which the credit note has been raised. This contains
invoice_id
and amount
. invoice_id
string
(Required)
Invoice ID of the required invoice.
amount_applied
(Required)
Credit amount to be applied to the invoice.
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/subscriptions/v1/creditnotes/90300000072369/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/subscriptions/v1/creditnotes/90300000072369/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/subscriptions/v1/creditnotes/90300000072369/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", "/subscriptions/v1/creditnotes/90300000072369/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": "/subscriptions/v1/creditnotes/90300000072369/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/subscriptions/v1/creditnotes/90300000072369/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"}'
{
"invoices": [
{
"invoice_id": "90300000079426",
"amount_applied": 450
}
]
}
{
"code": 0,
"message": "Credits have been applied to the invoice(s).",
"invoices": [
{
"invoice_id": "90300000079426",
"amount_applied": 450
},
{...},
{...}
]
}