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. Note While creating credit notes from Sales Order Invoice or Sales Return, it is recommended to use the same values which are used in the Invoice for corresponding nodes in the credit note.

Attribute

  • creditnote_idstring

    Unique ID of the credit note generated by the server.

  • creditnote_numberstring

    Unique number generated (starts with CN) which will be displayed in the interface and credit notes. Max-Length [100]

  • datestring

    The date on which the credit note was raised. Format [yyyy-mm-dd]

  • is_pre_gstboolean

    Applicable for transactions that were created before July 1, 2017

  • vat_reg_nostring

    Enter VAT registration number.

  • gst_nostring

    15 digit GST identification number of the customer.

  • gst_treatmentstring

    Choose whether the contact is GST registered/unregistered/consumer/overseas. Allowed values are business_gst , business_none , overseas , consumer .

  • statusstring

    Status of the credit note. This can be open, closed or void.

  • customer_idstring

    Customer ID of the customer for whom the credit note is raised.

  • customer_namestring

    Name of the customer to whom the credit note is raised. Max-Length [100]

  • custom_fieldsarray

    Additional fields for the Credit-Notes.

    Show Sub-Attributes

    • valuestring

      Value of the custom field.

    • indexinteger

      Index of the custom field. It can hold any value from 1 to 10.

    • labelstring

      Label of the custom field.

  • reference_numberstring

    Reference number generated for the payment. A string of your choice can also be used as the reference number. Max-Length [100]

  • emailstring

    Email address of the customer.

  • totaldouble

    Total credits raised in this credit note.

  • balancedouble

    The unapplied credits.

  • line_itemsarray

    Line items of a credit note.

    Show Sub-Attributes

    • item_idstring

      Unique string generated for the item for which a refund has to be made.

    • line_item_idstring

      Search credit notes by credit note line item id.

    • account_idstring

      Unique ID to denote the account.

    • namestring

      Name of the credit

    • descriptionstring

      A brief description about the item.

    • item_orderinteger

      Order of the item in the list of line items.

    • ratedouble

      Rate of the line item.

    • quantityint32

      Quantity of the item included.

    • unitstring

      Measurement unit of the line item. For example, kgs, Nos..

    • discountdouble

      Enter discount percentage.

    • tax_idstring

      Unique ID to denote the tax associated with the credit note.

    • tax_exemption_idstring

      Unique ID of the tax exemption.

    • tax_exemption_codestring

      Unique code of the tax exemption.

    • hsn_or_sacstring

      Add HSN/SAC code for your goods/services

    • item_custom_fieldsarray

      Enter custom field information

      Show Sub-Attributes

      • valuestring

        Value of the custom field.

      • indexinteger

        Index of the custom field. It can hold any value from 1 to 10.

      • labelstring

        Label of the custom field.

    • warehouse_idstring

      ID of the warehouse

    • serial_numbersstring

      Enter serial number

    • invoice_idstring

      Invoice ID of the required invoice.

    • invoice_item_idstring

      line_item_id of the underlying items in the invoice. This node is used when an invoice (of a sales order) or a sales return is converted to a credit note. Along with this node, the invoice_id and the is_item_shipped nodes are mandatory to create a credit note from an invoice and the nodes invoice_id, is_item_shipped, is_returned_to_stock and salesreturn_item_id are required to create a credit note from sales return.

    • is_item_shippedboolean

      Defines the shipping status of the line item in the corresponding sales order. The value of this node should be 'True' in order to create a credit note from sales return since a sales return can only be created for shipped goods. The value of this node should be 'False' to create a credit note from an invoice since the unshipped items are allowed to be cancelled in the sales order. Along with this node, invoice_id and invoice_item_id nodes are mandatory to create a credit note from an invoice and the nodes invoice_id, invoice_item_id, is_returned_to_stock and salesreturn_item_id are required to create a credit note from sales return.

    • is_returned_to_stockboolean

      Defines the receivability of the items in the sales return. For example, if a sales return has been raised for five units of an item where three units are receivable and two are credit-only, then that sales return line item has to be split in to two line items in the credit note - receivable quantity and the credit-only quantity. The value of this node has to be true for receivable line item and false for credit-only line item in Credit note. Along with this node, invoice_id, invoice_item_id, is_item_shipped, salesreturn_item_id are also needed to create credit note from Sales Return.

    • salesreturn_item_idstring

      line_item_id of the underlying items in the sales return. This node is needed for converting sales return to credit note. Other nodes such as invoice_id, invoice_item_id, is_item_shipped, is_returned_to_stock are also needed to create credit note from Sales Return.

  • invoicesarray

    List of invoices for which the credit note has been raised. This contains invoice_id and amount.

    Show Sub-Attributes

    • invoice_idstring

      Invoice ID of the required invoice.

    • invoice_numberstring

      Invoice number of the required invoice.

    • amountdouble

      Amount paid for the invoice.

  • taxesarray

    Taxes associated with the subscription.

    Show Sub-Attributes

    • tax_idstring

      Unique ID to denote the tax associated with the credit note.

    • tax_namestring

      Unique name for tax.

    • tax_amountstring

      Tax amount applied to the subscription.

  • currency_codestring

    Customer's currency code. This currency code is used in credit notes.

  • currency_symbolstring

    Customer's currency symbol.

  • billing_addressobject

    Show Sub-Attributes

    • addressstring

      Billing address for the invoice

    • street2string

       

    • citystring

      City of the customer’s billing address.

    • statestring

      State of the customer’s billing address.

    • zipstring

      Zip code of the customer’s billing address.

    • countrystring

      Country of the customer’s billing address.

    • faxstring

      Customer's fax number.

  • shipping_addressobject

    Show Sub-Attributes

    • addressstring

      Billing address for the invoice

    • street2string

      city

    • stringCity of the customer’s billing address.

      state

    • stringState of the customer’s billing address.

      zip

    • stringZip code of the customer’s billing address.

      country

    • stringCountry of the customer’s billing address.

      fax

    • stringCustomer's fax number.

      undefined

  • created_timestring

    Time at which the credit note was created.

  • updated_timestring

    Time at which the credit note details were last updated.

  • template_idstring

    Unique ID of the creditnote template

  • template_namestring

    Name of the default template of the creditnote.

  • notesstring

    A short note for the credit note. Max-length [5000]

  • termsstring

    Terms & condition to be displayed in the credit note. Max-length [10000]

End Points
ExampleCopy
{
    "creditnote_id": "90300000072369",
    "creditnote_number": "CN-29",
    "date": "2016-06-05",
    "is_pre_gst": true,
    "vat_reg_no": "string",
    "gst_no": "22AAAAA0000A1Z5",
    "gst_treatment": "business_gst",
    "status": "draft",
    "customer_id": "903000000000099",
    "customer_name": "Bowman Furniture",
    "custom_fields": [
        {
            "value": 129890,
            "index": 1,
            "label": "label"
        }
    ],
    "reference_number": "INV-384",
    "email": "benjamin.george@bowmanfurniture.com",
    "total": 450,
    "balance": 10,
    "line_items": [
        {
            "item_id": "90300000081501",
            "line_item_id": 903000006245,
            "account_id": "903000000000388",
            "name": "Basic Monthly",
            "description": "prorated amount for items",
            "item_order": 0,
            "rate": 0,
            "quantity": 1,
            "unit": "kgs",
            "discount": 10,
            "tax_id": "903000000000356",
            "tax_exemption_id": "903000006345",
            "tax_exemption_code": "GST FREE",
            "hsn_or_sac": 80540,
            "item_custom_fields": [
                {
                    "value": 129890,
                    "index": 1,
                    "label": "label"
                }
            ],
            "warehouse_id": 90300000072378,
            "serial_numbers": "string",
            "invoice_id": "90300000079426",
            "invoice_item_id": 90300000072369,
            "is_item_shipped": true,
            "is_returned_to_stock": true,
            "salesreturn_item_id": 90300000072369
        }
    ],
    "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": "$",
    "billing_address": {
        "address": "4900 Hopyard Rd, Suite 310",
        "street2": "McMillan Avenue",
        "city": "Pleasanton",
        "state": "CA",
        "zip": 94588,
        "country": "U.S.A",
        "fax": "+1-925-924-9600"
    },
    "shipping_address": {
        "address": "4900 Hopyard Rd, Suite 310",
        "street2": "McMillan Avenue",
        "city": "Pleasanton",
        "state": "CA",
        "zip": 94588,
        "country": "U.S.A",
        "fax": "+1-925-924-9600"
    },
    "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

To create a credit note for a customer.

OAuth Scope : ZakyaAPI.creditnotes.CREATE

Arguments

  • customer_idstring (Required)

    Customer ID of the customer for whom the credit note is raised.

  • contact_personsarray

    Contact Persons associated with the credit note.

  • datestring (Required)

    The date on which the credit note was raised. Format [yyyy-mm-dd]

  • is_draftboolean

    Set to true if credit note has to be created in draft status.

  • exchange_ratestring

    Exchange rate for the currency associated with the customer.

  • line_itemsarray (Required)

    Line items of a credit note.

    Show Sub-Attributes

    • item_idstring

      Unique string generated for the item for which a refund has to be made.

    • descriptionstring

      A brief description about the item.

    • codestring

      Unique code for the underlying line item of a credit note.

    • namestring

      Name of the credit

    • typeinteger

      Type of the creditnote line item.

    • account_idstring

      Unique ID to denote the account.

    • account_namestring

      Name of the account.

    • quantityint32

      Quantity of the item included.

    • tax_idstring

      Unique ID to denote the tax associated with the credit note.

    • serial_numbersstring

      Enter serial number

    • warehouse_idstring

      ID of the warehouse

    • warehouse_namestring

      Name of the warehouse.

    • invoice_idstring

      Invoice ID of the required invoice.

    • invoice_item_idstring

      line_item_id of the underlying items in the invoice. This node is used when an invoice (of a sales order) or a sales return is converted to a credit note. Along with this node, the invoice_id and the is_item_shipped nodes are mandatory to create a credit note from an invoice and the nodes invoice_id, is_item_shipped, is_returned_to_stock and salesreturn_item_id are required to create a credit note from sales return.

    • is_item_shippedboolean

      Defines the shipping status of the line item in the corresponding sales order. The value of this node should be 'True' in order to create a credit note from sales return since a sales return can only be created for shipped goods. The value of this node should be 'False' to create a credit note from an invoice since the unshipped items are allowed to be cancelled in the sales order. Along with this node, invoice_id and invoice_item_id nodes are mandatory to create a credit note from an invoice and the nodes invoice_id, invoice_item_id, is_returned_to_stock and salesreturn_item_id are required to create a credit note from sales return.

    • is_returned_to_stockboolean

      Defines the receivability of the items in the sales return. For example, if a sales return has been raised for five units of an item where three units are receivable and two are credit-only, then that sales return line item has to be split in to two line items in the credit note - receivable quantity and the credit-only quantity. The value of this node has to be true for receivable line item and false for credit-only line item in Credit note. Along with this node, invoice_id, invoice_item_id, is_item_shipped, salesreturn_item_id are also needed to create credit note from Sales Return.

    • salesreturn_item_idstring

      line_item_id of the underlying items in the sales return. This node is needed for converting sales return to credit note. Other nodes such as invoice_id, invoice_item_id, is_item_shipped, is_returned_to_stock are also needed to create credit note from Sales Return.

  • creditnote_numberstring (Required)

    Unique number generated (starts with CN) which will be displayed in the interface and credit notes. Max-Length [100]

  • gst_treatmentstring

    Choose whether the contact is GST registered/unregistered/consumer/overseas. Allowed values are business_gst , business_none , overseas , consumer .

  • gst_nostring

    15 digit GST identification number of the customer.

  • ignore_auto_number_generationboolean

    Set to true if you need to provide your own credit note number.

  • reference_numberstring

    Reference number generated for the payment. A string of your choice can also be used as the reference number. Max-Length [100]

  • custom_fieldsarray

    Additional fields for the Credit-Notes.

    Show Sub-Attributes

    • valuestring

      Value of the custom field.

    • indexinteger

      Index of the custom field. It can hold any value from 1 to 10.

    • labelstring

      Label of the custom field.

  • notesstring

    A short note for the credit note. Max-length [5000]

  • termsstring

    Terms & condition to be displayed in the credit note. Max-length [10000]

  • template_idstring

    Unique ID of the creditnote template

  • tax_idstring

    Unique ID to denote the tax associated with the credit note.

  • tax_exemption_idstring

    Unique ID of the tax exemption.

  • is_inclusive_taxboolean Not applicable in United States, Canada

    Used to specify whether the line item rates are inclusive(true) or exclusive(false) of tax.

Query Parameters

  • invoice_id 

    Invoice ID of the required invoice.

  • ignore_auto_number_generation 

    Set to true if you need to provide your own credit note number.

Request ExampleCopy
curl --request POST \
  --url 'https://api.zakya.com/inventory/v1/creditnotes?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
  --header 'content-type: application/json' \
  --data '{"field1":"value1","field2":"value2"}'
parameters_data='{"field1":"value1","field2":"value2"}';
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/creditnotes?organization_id=10234695"
type: POST
headers: headers_data
content-type: application/json
parameters: parameters_data
connection: 
]
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://api.zakya.com/inventory/v1/creditnotes?organization_id=10234695")
  .post(body)
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "POST",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/creditnotes?organization_id=10234695",
  "headers": {
    "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();
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
    'content-type': 'application/json'
  },
  body: '{"field1":"value1","field2":"value2"}'
};

fetch('https://api.zakya.com/inventory/v1/creditnotes?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}"

headers = {
    'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
    'content-type': "application/json"
    }

conn.request("POST", "/inventory/v1/creditnotes?organization_id=10234695", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Body ParametersCopy
{
    "customer_id": "903000000000099",
    "contact_persons": [
        "903000006532"
    ],
    "date": "2016-06-05",
    "is_draft": true,
    "exchange_rate": "5.5",
    "line_items": [
        {
            "item_id": "90300000081501",
            "description": "prorated amount for items",
            "code": "basic-monthly",
            "name": "Basic Monthly",
            "type": 1,
            "account_id": "903000000000388",
            "account_name": "Sales",
            "quantity": 1,
            "tax_id": "903000000000356",
            "serial_numbers": "string",
            "warehouse_id": 90300000072378,
            "warehouse_name": "string",
            "invoice_id": "90300000079426",
            "invoice_item_id": 90300000072369,
            "is_item_shipped": true,
            "is_returned_to_stock": true,
            "salesreturn_item_id": 90300000072369
        }
    ],
    "creditnote_number": "CN-29",
    "gst_treatment": "business_gst",
    "gst_no": "22AAAAA0000A1Z5",
    "ignore_auto_number_generation": false,
    "reference_number": "INV-384",
    "custom_fields": [
        {
            "value": 129890,
            "index": 1,
            "label": "label"
        }
    ],
    "notes": "Offer for the referral",
    "terms": "",
    "template_id": "90300000001336",
    "tax_id": "903000000000356",
    "tax_exemption_id": "903000006345",
    "is_inclusive_tax": false
}
Response ExampleCopy
{
    "code": 0,
    "message": "The credit note has been created.",
    "creditnote": {
        "creditnote_id": "90300000072369",
        "creditnote_number": "CN-29",
        "date": "2016-06-05",
        "is_pre_gst": true,
        "vat_reg_no": "string",
        "gst_no": "22AAAAA0000A1Z5",
        "gst_treatment": "business_gst",
        "status": "draft",
        "customer_id": "903000000000099",
        "customer_name": "Bowman Furniture",
        "custom_fields": [
            {
                "value": 129890,
                "index": 1,
                "label": "label"
            }
        ],
        "reference_number": "INV-384",
        "email": "benjamin.george@bowmanfurniture.com",
        "total": 450,
        "balance": 10,
        "line_items": [
            {
                "item_id": "90300000081501",
                "line_item_id": 903000006245,
                "account_id": "903000000000388",
                "name": "Basic Monthly",
                "description": "prorated amount for items",
                "item_order": 0,
                "rate": 0,
                "quantity": 1,
                "unit": "kgs",
                "discount": 10,
                "tax_id": "903000000000356",
                "tax_exemption_id": "903000006345",
                "tax_exemption_code": "GST FREE",
                "hsn_or_sac": 80540,
                "item_custom_fields": [
                    {
                        "value": 129890,
                        "index": 1,
                        "label": "label"
                    }
                ],
                "warehouse_id": 90300000072378,
                "serial_numbers": "string",
                "invoice_id": "90300000079426",
                "invoice_item_id": 90300000072369,
                "is_item_shipped": true,
                "is_returned_to_stock": true,
                "salesreturn_item_id": 90300000072369
            }
        ],
        "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": "$",
        "billing_address": {
            "address": "4900 Hopyard Rd, Suite 310",
            "street2": "McMillan Avenue",
            "city": "Pleasanton",
            "state": "CA",
            "zip": 94588,
            "country": "U.S.A",
            "fax": "+1-925-924-9600"
        },
        "shipping_address": {
            "address": "4900 Hopyard Rd, Suite 310",
            "street2": "McMillan Avenue",
            "city": "Pleasanton",
            "state": "CA",
            "zip": 94588,
            "country": "U.S.A",
            "fax": "+1-925-924-9600"
        },
        "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": ""
    }
}

List all Credit Notes

List all the Credit Notes.

OAuth Scope : ZakyaAPI.creditnotes.READ

Query Parameters

  • creditnote_number 

    Unique number generated (starts with CN) which will be displayed in the interface and credit notes. Max-Length [100]

  • date 

    The date on which the credit note was raised. Format [yyyy-mm-dd]

  • status 

    Status of the credit note. This can be open, closed or void.

  • total 

    Total credits raised in this credit note.

  • reference_number 

    Reference number generated for the payment. A string of your choice can also be used as the reference number. Max-Length [100]

  • customer_name 

    Name of the customer to whom the credit note is raised. Max-Length [100]

  • item_name 

    Search credit notes by item name.Max_length [100]

  • customer_id 

    Customer ID of the customer for whom the credit note is raised.

  • item_description 

    description for the item.Variants item_description_startswith and item_description_contains. Max-length [100]

  • item_id 

    Unique string generated for the item for which a refund has to be made.

  • line_item_id 

    Search credit notes by credit note line item id.

  • tax_id 

    Unique ID to denote the tax associated with the credit note.

  • filter_by 

    Filter credit notes by statuses. Allowed values Status.All Status.Open Status.Draft Status.Closed and Status.Void

  • search_text 

    Search credit notes by credit note number or customer name or credit note reference number. Max-length [100]

  • sort_column 

    Sort the credit notes by the following columns - customer_name, creditnote_number, balance, total, date and created_time. Allowed Values customer_name creditnote_number balance total date and created_time

Request ExampleCopy
curl --request GET \
  --url 'https://api.zakya.com/inventory/v1/creditnotes?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/creditnotes?organization_id=10234695"
type: GET
headers: headers_data
connection: 
]
info response;
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.zakya.com/inventory/v1/creditnotes?organization_id=10234695")
  .get()
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "GET",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/creditnotes?organization_id=10234695",
  "headers": {
    "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();
const options = {
  method: 'GET',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
  }
};

fetch('https://api.zakya.com/inventory/v1/creditnotes?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }

conn.request("GET", "/inventory/v1/creditnotes?organization_id=10234695", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response ExampleCopy
{
    "code": 0,
    "message": "success",
    "creditnotes": [
        {
            "creditnote_id": "90300000072369",
            "creditnote_number": "CN-29",
            "status": "draft",
            "reference_number": "INV-384",
            "date": "2016-06-05",
            "total": 450,
            "balance": 10,
            "customer_id": "903000000000099",
            "customer_name": "Bowman Furniture",
            "currency_id": "982000000567240",
            "currency_code": "USD",
            "created_time": "2016-06-05T02:30:08-0700",
            "last_modified_time": "2016-06-05T02:30:08-0700",
            "is_emailed": true
        },
        {...},
        {...}
    ]
}

Update a credit note

To update the details of an existing creditnote.

OAuth Scope : ZakyaAPI.creditnotes.UPDATE

Arguments

  • customer_idstring (Required)

    Customer ID of the customer for whom the credit note is raised.

  • contact_personsarray

    Contact Persons associated with the credit note.

  • datestring (Required)

    The date on which the credit note was raised. Format [yyyy-mm-dd]

  • is_draftboolean

    Set to true if credit note has to be created in draft status.

  • exchange_ratestring

    Exchange rate for the currency associated with the customer.

  • line_itemsarray (Required)

    Line items of a credit note.

    Show Sub-Attributes

    • item_idstring

      Unique string generated for the item for which a refund has to be made.

    • line_item_idstring

      Search credit notes by credit note line item id.

    • account_idstring

      Unique ID to denote the account.

    • namestring

      Name of the credit

    • descriptionstring

      A brief description about the item.

    • item_orderinteger

      Order of the item in the list of line items.

    • ratedouble

      Rate of the line item.

    • quantityint32

      Quantity of the item included.

    • unitstring

      Measurement unit of the line item. For example, kgs, Nos..

    • discountdouble

      Enter discount percentage.

    • tax_idstring

      Unique ID to denote the tax associated with the credit note.

    • tax_exemption_idstring

      Unique ID of the tax exemption.

    • tax_exemption_codestring

      Unique code of the tax exemption.

    • hsn_or_sacstring

      Add HSN/SAC code for your goods/services

    • item_custom_fieldsarray

      Enter custom field information

      Show Sub-Attributes

      • valuestring

        Value of the custom field.

      • indexinteger

        Index of the custom field. It can hold any value from 1 to 10.

      • labelstring

        Label of the custom field.

    • warehouse_idstring

      ID of the warehouse

    • serial_numbersstring

      Enter serial number

    • invoice_idstring

      Invoice ID of the required invoice.

    • invoice_item_idstring

      line_item_id of the underlying items in the invoice. This node is used when an invoice (of a sales order) or a sales return is converted to a credit note. Along with this node, the invoice_id and the is_item_shipped nodes are mandatory to create a credit note from an invoice and the nodes invoice_id, is_item_shipped, is_returned_to_stock and salesreturn_item_id are required to create a credit note from sales return.

    • is_item_shippedboolean

      Defines the shipping status of the line item in the corresponding sales order. The value of this node should be 'True' in order to create a credit note from sales return since a sales return can only be created for shipped goods. The value of this node should be 'False' to create a credit note from an invoice since the unshipped items are allowed to be cancelled in the sales order. Along with this node, invoice_id and invoice_item_id nodes are mandatory to create a credit note from an invoice and the nodes invoice_id, invoice_item_id, is_returned_to_stock and salesreturn_item_id are required to create a credit note from sales return.

    • is_returned_to_stockboolean

      Defines the receivability of the items in the sales return. For example, if a sales return has been raised for five units of an item where three units are receivable and two are credit-only, then that sales return line item has to be split in to two line items in the credit note - receivable quantity and the credit-only quantity. The value of this node has to be true for receivable line item and false for credit-only line item in Credit note. Along with this node, invoice_id, invoice_item_id, is_item_shipped, salesreturn_item_id are also needed to create credit note from Sales Return.

    • salesreturn_item_idstring

      line_item_id of the underlying items in the sales return. This node is needed for converting sales return to credit note. Other nodes such as invoice_id, invoice_item_id, is_item_shipped, is_returned_to_stock are also needed to create credit note from Sales Return.

  • creditnote_numberstring (Required)

    Unique number generated (starts with CN) which will be displayed in the interface and credit notes. Max-Length [100]

  • gst_treatmentstring

    Choose whether the contact is GST registered/unregistered/consumer/overseas. Allowed values are business_gst , business_none , overseas , consumer .

  • gst_nostring

    15 digit GST identification number of the customer.

  • ignore_auto_number_generationboolean

    Set to true if you need to provide your own credit note number.

  • reference_numberstring

    Reference number generated for the payment. A string of your choice can also be used as the reference number. Max-Length [100]

  • custom_fieldsarray

    Additional fields for the Credit-Notes.

    Show Sub-Attributes

    • valuestring

      Value of the custom field.

    • indexinteger

      Index of the custom field. It can hold any value from 1 to 10.

    • labelstring

      Label of the custom field.

  • notesstring

    A short note for the credit note. Max-length [5000]

  • termsstring

    Terms & condition to be displayed in the credit note. Max-length [10000]

  • template_idstring

    Unique ID of the creditnote template

  • tax_idstring

    Unique ID to denote the tax associated with the credit note.

  • tax_exemption_idstring

    Unique ID of the tax exemption.

  • is_inclusive_taxboolean

    Not applicable United states, Canada. Used to specify whether the line item rates are inclusive(true) or exclusive(false) of tax.

  • item_idstring

    Unique string generated for the item for which a refund has to be made.

  • account_idstring

    Unique ID to denote the account.

  • namestring

    Name of the credit

  • descriptionstring

    A brief description about the item.

  • unitstring

    Measurement unit of the line item. For example, kgs, Nos..

  • ratedouble

    Rate of the line item.

  • quantityint32

    Quantity of the item included.

Query Parameters

  • ignore_auto_number_generation 

    Set to true if you need to provide your own credit note number.

Request ExampleCopy
curl --request PUT \
  --url 'https://api.zakya.com/inventory/v1/creditnotes/90300000072369?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
  --header 'content-type: application/json' \
  --data '{"field1":"value1","field2":"value2"}'
parameters_data='{"field1":"value1","field2":"value2"}';
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/creditnotes/90300000072369?organization_id=10234695"
type: PUT
headers: headers_data
content-type: application/json
parameters: parameters_data
connection: 
]
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://api.zakya.com/inventory/v1/creditnotes/90300000072369?organization_id=10234695")
  .put(body)
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "PUT",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/creditnotes/90300000072369?organization_id=10234695",
  "headers": {
    "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();
const options = {
  method: 'PUT',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
    'content-type': 'application/json'
  },
  body: '{"field1":"value1","field2":"value2"}'
};

fetch('https://api.zakya.com/inventory/v1/creditnotes/90300000072369?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}"

headers = {
    'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
    'content-type': "application/json"
    }

conn.request("PUT", "/inventory/v1/creditnotes/90300000072369?organization_id=10234695", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Body ParametersCopy
{
    "customer_id": "903000000000099",
    "contact_persons": [
        "903000006532"
    ],
    "date": "2016-06-05",
    "is_draft": true,
    "exchange_rate": "5.5",
    "line_items": [
        {
            "item_id": "90300000081501",
            "line_item_id": 903000006245,
            "account_id": "903000000000388",
            "name": "Basic Monthly",
            "description": "prorated amount for items",
            "item_order": 0,
            "rate": 0,
            "quantity": 1,
            "unit": "kgs",
            "discount": 10,
            "tax_id": "903000000000356",
            "tax_exemption_id": "903000006345",
            "tax_exemption_code": "GST FREE",
            "hsn_or_sac": 80540,
            "item_custom_fields": [
                {
                    "value": 129890,
                    "index": 1,
                    "label": "label"
                }
            ],
            "warehouse_id": 90300000072378,
            "serial_numbers": "string",
            "invoice_id": "90300000079426",
            "invoice_item_id": 90300000072369,
            "is_item_shipped": true,
            "is_returned_to_stock": true,
            "salesreturn_item_id": 90300000072369
        }
    ],
    "creditnote_number": "CN-29",
    "gst_treatment": "business_gst",
    "gst_no": "22AAAAA0000A1Z5",
    "ignore_auto_number_generation": false,
    "reference_number": "INV-384",
    "custom_fields": [
        {
            "value": 129890,
            "index": 1,
            "label": "label"
        }
    ],
    "notes": "Offer for the referral",
    "terms": "",
    "template_id": "90300000001336",
    "tax_id": "903000000000356",
    "tax_exemption_id": "903000006345",
    "is_inclusive_tax": false,
    "item_id": "90300000081501",
    "account_id": "903000000000388",
    "name": "Basic Monthly",
    "description": "prorated amount for items",
    "unit": "kgs",
    "rate": 0,
    "quantity": 1
}
Response ExampleCopy
{
    "code": 0,
    "message": "The credit note has been updated.",
    "creditnote": {
        "creditnote_id": "90300000072369",
        "creditnote_number": "CN-29",
        "date": "2016-06-05",
        "is_pre_gst": true,
        "vat_reg_no": "string",
        "gst_no": "22AAAAA0000A1Z5",
        "gst_treatment": "business_gst",
        "status": "draft",
        "customer_id": "903000000000099",
        "customer_name": "Bowman Furniture",
        "custom_fields": [
            {
                "value": 129890,
                "index": 1,
                "label": "label"
            }
        ],
        "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",
                "name": "Basic Monthly",
                "type": 1,
                "account_id": "903000000000388",
                "account_name": "Sales",
                "quantity": 1,
                "tax_id": "903000000000356",
                "serial_numbers": "string",
                "warehouse_id": 90300000072378,
                "warehouse_name": "string",
                "invoice_id": "90300000079426",
                "invoice_item_id": 90300000072369,
                "is_item_shipped": true,
                "is_returned_to_stock": true,
                "salesreturn_item_id": 90300000072369
            }
        ],
        "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": "$",
        "billing_address": {
            "address": "4900 Hopyard Rd, Suite 310",
            "street2": "McMillan Avenue",
            "city": "Pleasanton",
            "state": "CA",
            "zip": 94588,
            "country": "U.S.A",
            "fax": "+1-925-924-9600",
            "attention": " "
        },
        "shipping_address": {
            "address": "4900 Hopyard Rd, Suite 310",
            "street2": "McMillan Avenue",
            "city": "Pleasanton",
            "state": "CA",
            "zip": 94588,
            "country": "U.S.A",
            "fax": "+1-925-924-9600",
            "attention": " "
        },
        "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": ""
    }
}

Get a credit note

Fetch the details of an existing creditnote.

OAuth Scope : ZakyaAPI.creditnotes.READ

Query Parameters

  • print 

    Export credit note PDF using the default print option. The allowed values are true, false, on and off

  • accept 

    You can fetch the credit note details as json/pdf/html. The default format is html. The allowed values are json, pdf and html

Request ExampleCopy
curl --request GET \
  --url 'https://api.zakya.com/inventory/v1/creditnotes/90300000072369?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/creditnotes/90300000072369?organization_id=10234695"
type: GET
headers: headers_data
connection: 
]
info response;
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.zakya.com/inventory/v1/creditnotes/90300000072369?organization_id=10234695")
  .get()
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "GET",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/creditnotes/90300000072369?organization_id=10234695",
  "headers": {
    "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();
const options = {
  method: 'GET',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
  }
};

fetch('https://api.zakya.com/inventory/v1/creditnotes/90300000072369?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }

conn.request("GET", "/inventory/v1/creditnotes/90300000072369?organization_id=10234695", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response ExampleCopy
{
    "code": 0,
    "message": "success",
    "creditnote": {
        "creditnote_id": "90300000072369",
        "creditnote_number": "CN-29",
        "date": "2016-06-05",
        "is_pre_gst": true,
        "vat_reg_no": "string",
        "gst_no": "22AAAAA0000A1Z5",
        "gst_treatment": "business_gst",
        "status": "draft",
        "customer_id": "903000000000099",
        "customer_name": "Bowman Furniture",
        "custom_fields": [
            {
                "value": 129890,
                "index": 1,
                "label": "label"
            }
        ],
        "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",
                "name": "Basic Monthly",
                "type": 1,
                "account_id": "903000000000388",
                "account_name": "Sales",
                "quantity": 1,
                "tax_id": "903000000000356",
                "serial_numbers": "string",
                "warehouse_id": 90300000072378,
                "warehouse_name": "string",
                "invoice_id": "90300000079426",
                "invoice_item_id": 90300000072369,
                "is_item_shipped": true,
                "is_returned_to_stock": true,
                "salesreturn_item_id": 90300000072369
            }
        ],
        "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",
        "billing_address": {
            "address": "4900 Hopyard Rd, Suite 310",
            "street2": "McMillan Avenue",
            "city": "Pleasanton",
            "state": "CA",
            "zip": 94588,
            "country": "U.S.A",
            "fax": "+1-925-924-9600",
            "attention": " "
        },
        "shipping_address": {
            "address": "4900 Hopyard Rd, Suite 310",
            "street2": "McMillan Avenue",
            "city": "Pleasanton",
            "state": "CA",
            "zip": 94588,
            "country": "U.S.A",
            "fax": "+1-925-924-9600",
            "attention": " "
        },
        "template_id": "90300000001336",
        "template_name": "Standard Template",
        "notes": "Offer for the referral",
        "terms": ""
    }
}

Delete a credit note

Delete an existing credit note.

OAuth Scope : ZakyaAPI.creditnotes.DELETE

Request ExampleCopy
curl --request DELETE \
  --url 'https://api.zakya.com/inventory/v1/creditnotes/90300000072369?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/creditnotes/90300000072369?organization_id=10234695"
type: DELETE
headers: headers_data
connection: 
]
info response;
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.zakya.com/inventory/v1/creditnotes/90300000072369?organization_id=10234695")
  .delete(null)
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "DELETE",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/creditnotes/90300000072369?organization_id=10234695",
  "headers": {
    "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();
const options = {
  method: 'DELETE',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
  }
};

fetch('https://api.zakya.com/inventory/v1/creditnotes/90300000072369?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }

conn.request("DELETE", "/inventory/v1/creditnotes/90300000072369?organization_id=10234695", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response ExampleCopy
{
    "code": 0,
    "message": "The credit note has been deleted."
}

Email a credit note

Email a credit note.

OAuth Scope : ZakyaAPI.creditnotes.CREATE

Arguments

  • to_mail_idsarray (Required)

    The email IDs to which the credit note is to be mailed.

  • cc_mail_idsarray

    The email IDs that have to be copied when the credit note is to be mailed.

  • subjectstring (Required)

    The subject of the email. Max-length [1000]

  • bodystring (Required)

    The body of the email. Max-length [5000]

Query Parameters

  • customer_id 

    Customer ID of the customer for whom the credit note is raised.

  • attachments 

    The files to be attached with the email.

Request ExampleCopy
curl --request POST \
  --url 'https://api.zakya.com/inventory/v1/creditnotes/90300000072369/email?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
  --header 'content-type: application/json' \
  --data '{"field1":"value1","field2":"value2"}'
parameters_data='{"field1":"value1","field2":"value2"}';
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/creditnotes/90300000072369/email?organization_id=10234695"
type: POST
headers: headers_data
content-type: application/json
parameters: parameters_data
connection: 
]
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://api.zakya.com/inventory/v1/creditnotes/90300000072369/email?organization_id=10234695")
  .post(body)
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "POST",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/creditnotes/90300000072369/email?organization_id=10234695",
  "headers": {
    "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();
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
    'content-type': 'application/json'
  },
  body: '{"field1":"value1","field2":"value2"}'
};

fetch('https://api.zakya.com/inventory/v1/creditnotes/90300000072369/email?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}"

headers = {
    'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
    'content-type': "application/json"
    }

conn.request("POST", "/inventory/v1/creditnotes/90300000072369/email?organization_id=10234695", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Body ParametersCopy
{
    "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."
}
Response ExampleCopy
{
    "code": 0,
    "message": "Your creditnote has been sent."
}

Get email content

Get email content of a credit note.

OAuth Scope : ZakyaAPI.creditnotes.READ

Query Parameters

  • email_template_id 

    Get the email content based on a specific email template. If this param is not inputted, then the content will be based on the email template associated with the customer. If no template is associated with the customer, then default template will be used.

Request ExampleCopy
curl --request GET \
  --url 'https://api.zakya.com/inventory/v1/creditnotes/90300000072369/email?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/creditnotes/90300000072369/email?organization_id=10234695"
type: GET
headers: headers_data
connection: 
]
info response;
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.zakya.com/inventory/v1/creditnotes/90300000072369/email?organization_id=10234695")
  .get()
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "GET",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/creditnotes/90300000072369/email?organization_id=10234695",
  "headers": {
    "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();
const options = {
  method: 'GET',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
  }
};

fetch('https://api.zakya.com/inventory/v1/creditnotes/90300000072369/email?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }

conn.request("GET", "/inventory/v1/creditnotes/90300000072369/email?organization_id=10234695", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response ExampleCopy
{
    "code": 0,
    "message": "success",
    "data": [
        {
            "body": "The credit note is attached with this email.",
            "error_list": [],
            "subject": "Credit Note from Zillium Inc(Credit Note #: CN-00001)",
            "emailtemplates": [
                {
                    "selected": "fasle",
                    "name": "Default",
                    "email_template_id": "460000000000085"
                }
            ],
            "to_contacts": [
                {
                    "first_name": "Will",
                    "selected": "fasle",
                    "phone": "+1-925-921-9201",
                    "email": "willsmith@bowmanfurniture.com",
                    "contact_person_id": "460000000026051",
                    "last_name": "Parker",
                    "salutation": "Mr.",
                    "mobile": "+1-4054439760"
                }
            ],
            "file_name": "CN-00001.pdf",
            "from_emails": [
                {
                    "user_name": "John Smith",
                    "selected": "fasle",
                    "email": "willsmith@bowmanfurniture.com"
                }
            ],
            "customer_id": "46000000002609"
        },
        {...},
        {...}
    ]
}

Void a Credit Note

Mark the credit note as Void.

OAuth Scope : ZakyaAPI.creditnotes.CREATE

Request ExampleCopy
curl --request POST \
  --url 'https://api.zakya.com/inventory/v1/creditnotes/90300000072369/void?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/creditnotes/90300000072369/void?organization_id=10234695"
type: POST
headers: headers_data
connection: 
]
info response;
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.zakya.com/inventory/v1/creditnotes/90300000072369/void?organization_id=10234695")
  .post(null)
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "POST",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/creditnotes/90300000072369/void?organization_id=10234695",
  "headers": {
    "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();
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
  }
};

fetch('https://api.zakya.com/inventory/v1/creditnotes/90300000072369/void?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }

conn.request("POST", "/inventory/v1/creditnotes/90300000072369/void?organization_id=10234695", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response ExampleCopy
{
    "code": 0,
    "message": "The credit note has been marked as void."
}

Convert Credit Note to Draft

Convert a voided credit note to Draft.

OAuth Scope : ZakyaAPI.creditnotes.CREATE

Request ExampleCopy
curl --request POST \
  --url 'https://api.zakya.com/inventory/v1/creditnotes/90300000072369/draft?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/creditnotes/90300000072369/draft?organization_id=10234695"
type: POST
headers: headers_data
connection: 
]
info response;
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.zakya.com/inventory/v1/creditnotes/90300000072369/draft?organization_id=10234695")
  .post(null)
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "POST",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/creditnotes/90300000072369/draft?organization_id=10234695",
  "headers": {
    "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();
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
  }
};

fetch('https://api.zakya.com/inventory/v1/creditnotes/90300000072369/draft?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }

conn.request("POST", "/inventory/v1/creditnotes/90300000072369/draft?organization_id=10234695", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response ExampleCopy
{
    "code": 0,
    "message": "The credit note has been marked as Draft."
}

Convert credit note to Open

Convert a credit note in Draft status to Open.

OAuth Scope : ZakyaAPI.creditnotes.CREATE

Request ExampleCopy
curl --request POST \
  --url 'https://api.zakya.com/inventory/v1/creditnotes/90300000072369/converttoopen?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/creditnotes/90300000072369/converttoopen?organization_id=10234695"
type: POST
headers: headers_data
connection: 
]
info response;
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.zakya.com/inventory/v1/creditnotes/90300000072369/converttoopen?organization_id=10234695")
  .post(null)
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "POST",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/creditnotes/90300000072369/converttoopen?organization_id=10234695",
  "headers": {
    "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();
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
  }
};

fetch('https://api.zakya.com/inventory/v1/creditnotes/90300000072369/converttoopen?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }

conn.request("POST", "/inventory/v1/creditnotes/90300000072369/converttoopen?organization_id=10234695", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response ExampleCopy
{
    "code": 0,
    "message": "Status of the credit note has been changed to open."
}

Submit a credit note for approval

Submit a credit note for approval.

OAuth Scope : ZakyaAPI.creditnotes.CREATE

Request ExampleCopy
curl --request POST \
  --url 'https://api.zakya.com/inventory/v1/creditnotes/90300000072369/submit?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/creditnotes/90300000072369/submit?organization_id=10234695"
type: POST
headers: headers_data
connection: 
]
info response;
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.zakya.com/inventory/v1/creditnotes/90300000072369/submit?organization_id=10234695")
  .post(null)
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "POST",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/creditnotes/90300000072369/submit?organization_id=10234695",
  "headers": {
    "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();
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
  }
};

fetch('https://api.zakya.com/inventory/v1/creditnotes/90300000072369/submit?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }

conn.request("POST", "/inventory/v1/creditnotes/90300000072369/submit?organization_id=10234695", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response ExampleCopy
{
    "code": 0,
    "message": "The Credit Note has been successfully submitted for approval."
}

Approve a credit note

Approve a credit note.

OAuth Scope : ZakyaAPI.creditnotes.CREATE

Request ExampleCopy
curl --request POST \
  --url 'https://api.zakya.com/inventory/v1/creditnotes/90300000072369/approve?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/creditnotes/90300000072369/approve?organization_id=10234695"
type: POST
headers: headers_data
connection: 
]
info response;
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.zakya.com/inventory/v1/creditnotes/90300000072369/approve?organization_id=10234695")
  .post(null)
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "POST",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/creditnotes/90300000072369/approve?organization_id=10234695",
  "headers": {
    "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();
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
  }
};

fetch('https://api.zakya.com/inventory/v1/creditnotes/90300000072369/approve?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }

conn.request("POST", "/inventory/v1/creditnotes/90300000072369/approve?organization_id=10234695", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response ExampleCopy
{
    "code": 0,
    "message": "You have approved the Credit Note."
}

Email history

Get email history of a credit code.

OAuth Scope : ZakyaAPI.creditnotes.READ

Request ExampleCopy
curl --request GET \
  --url 'https://api.zakya.com/inventory/v1/creditnotes/90300000072369/emailhistory?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/creditnotes/90300000072369/emailhistory?organization_id=10234695"
type: GET
headers: headers_data
connection: 
]
info response;
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.zakya.com/inventory/v1/creditnotes/90300000072369/emailhistory?organization_id=10234695")
  .get()
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "GET",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/creditnotes/90300000072369/emailhistory?organization_id=10234695",
  "headers": {
    "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();
const options = {
  method: 'GET',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
  }
};

fetch('https://api.zakya.com/inventory/v1/creditnotes/90300000072369/emailhistory?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }

conn.request("GET", "/inventory/v1/creditnotes/90300000072369/emailhistory?organization_id=10234695", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response ExampleCopy
{
    "code": 0,
    "message": "success",
    "email_history": [
        {
            "mailhistory_id": 982000000570005,
            "from": "gator@zillum.com",
            "to_mail_ids": [
                "benjamin.george@bowmanfurniture.com",
                "paul@bowmanfurniture.com"
            ],
            "subject": "Credit note for subscription.",
            "date": "2016-06-05"
        },
        {...},
        {...}
    ]
}

Update billing address

Updates the billing address for an existing credit note.

OAuth Scope : ZakyaAPI.creditnotes.UPDATE

Arguments

  • addressstring

    Billing address for the invoice

  • citystring

    City of the customer’s billing address.

  • statestring

    State of the customer’s billing address.

  • zipstring

    Zip code of the customer’s billing address.

  • countrystring

    Country of the customer’s billing address.

  • faxstring

    Customer's fax number.

Request ExampleCopy
curl --request PUT \
  --url 'https://api.zakya.com/inventory/v1/creditnotes/90300000072369/address/billing?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
  --header 'content-type: application/json' \
  --data '{"field1":"value1","field2":"value2"}'
parameters_data='{"field1":"value1","field2":"value2"}';
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/creditnotes/90300000072369/address/billing?organization_id=10234695"
type: PUT
headers: headers_data
content-type: application/json
parameters: parameters_data
connection: 
]
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://api.zakya.com/inventory/v1/creditnotes/90300000072369/address/billing?organization_id=10234695")
  .put(body)
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "PUT",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/creditnotes/90300000072369/address/billing?organization_id=10234695",
  "headers": {
    "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();
const options = {
  method: 'PUT',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
    'content-type': 'application/json'
  },
  body: '{"field1":"value1","field2":"value2"}'
};

fetch('https://api.zakya.com/inventory/v1/creditnotes/90300000072369/address/billing?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}"

headers = {
    'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
    'content-type': "application/json"
    }

conn.request("PUT", "/inventory/v1/creditnotes/90300000072369/address/billing?organization_id=10234695", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Body ParametersCopy
{
    "address": "4900 Hopyard Rd, Suite 310",
    "city": "Pleasanton",
    "state": "CA",
    "zip": 94588,
    "country": "USA",
    "fax": "+1-925-924-9600"
}
Response ExampleCopy
{
    "code": 0,
    "message": "Billing address updated"
}

Update Shipping address

Updates the shipping address for an existing credit note.

OAuth Scope : ZakyaAPI.creditnotes.UPDATE

Arguments

  • addressstring

    Billing address for the invoice

  • citystring

    City of the customer’s billing address.

  • statestring

    State of the customer’s billing address.

  • zipstring

    Zip code of the customer’s billing address.

  • countrystring

    Country of the customer’s billing address.

  • faxstring

    Customer's fax number.

Request ExampleCopy
curl --request PUT \
  --url 'https://api.zakya.com/inventory/v1/creditnotes/90300000072369/address/shipping?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
  --header 'content-type: application/json' \
  --data '{"field1":"value1","field2":"value2"}'
parameters_data='{"field1":"value1","field2":"value2"}';
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/creditnotes/90300000072369/address/shipping?organization_id=10234695"
type: PUT
headers: headers_data
content-type: application/json
parameters: parameters_data
connection: 
]
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://api.zakya.com/inventory/v1/creditnotes/90300000072369/address/shipping?organization_id=10234695")
  .put(body)
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "PUT",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/creditnotes/90300000072369/address/shipping?organization_id=10234695",
  "headers": {
    "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();
const options = {
  method: 'PUT',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
    'content-type': 'application/json'
  },
  body: '{"field1":"value1","field2":"value2"}'
};

fetch('https://api.zakya.com/inventory/v1/creditnotes/90300000072369/address/shipping?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}"

headers = {
    'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
    'content-type': "application/json"
    }

conn.request("PUT", "/inventory/v1/creditnotes/90300000072369/address/shipping?organization_id=10234695", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Body ParametersCopy
{
    "address": "Suite 125, McMillan Avenue",
    "city": "San Francisco",
    "state": "CA",
    "zip": 94134,
    "country": "USA",
    "fax": "+1-925-924-9600"
}
Response ExampleCopy
{
    "code": 0,
    "message": "Shipping address updated"
}

List the credit note templates

Get all credit note pdf templates.

OAuth Scope : ZakyaAPI.creditnotes.READ

Request ExampleCopy
curl --request GET \
  --url 'https://api.zakya.com/inventory/v1/creditnotes/templates?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/creditnotes/templates?organization_id=10234695"
type: GET
headers: headers_data
connection: 
]
info response;
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.zakya.com/inventory/v1/creditnotes/templates?organization_id=10234695")
  .get()
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "GET",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/creditnotes/templates?organization_id=10234695",
  "headers": {
    "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();
const options = {
  method: 'GET',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
  }
};

fetch('https://api.zakya.com/inventory/v1/creditnotes/templates?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }

conn.request("GET", "/inventory/v1/creditnotes/templates?organization_id=10234695", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response ExampleCopy
{
    "code": 0,
    "message": "success",
    "templates": [
        {
            "template_name": "Standard Template",
            "template_id": "90300000001336",
            "template_type": "professional"
        },
        {...},
        {...}
    ]
}

Update a credit note template

Update the pdf template associated with the credit note.

OAuth Scope : ZakyaAPI.creditnotes.UPDATE

Request ExampleCopy
curl --request PUT \
  --url 'https://api.zakya.com/inventory/v1/creditnotes/90300000072369/templates/90300000001336?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/creditnotes/90300000072369/templates/90300000001336?organization_id=10234695"
type: PUT
headers: headers_data
connection: 
]
info response;
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.zakya.com/inventory/v1/creditnotes/90300000072369/templates/90300000001336?organization_id=10234695")
  .put(null)
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "PUT",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/creditnotes/90300000072369/templates/90300000001336?organization_id=10234695",
  "headers": {
    "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();
const http = require("https");

const options = {
  "method": "PUT",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/creditnotes/90300000072369/templates/90300000001336?organization_id=10234695",
  "headers": {
    "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();
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }

conn.request("PUT", "/inventory/v1/creditnotes/90300000072369/templates/90300000001336?organization_id=10234695", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response ExampleCopy
{
    "code": 0,
    "message": "The credit note template has been updated."
}

Apply credits to invoices

Apply credit note to existing invoices.

OAuth Scope : ZakyaAPI.creditnotes.CREATE

Arguments

  • invoicesarray

    List of invoices for which the credit note has been raised. This contains invoice_id and amount.

    Show Sub-Attributes

    • invoice_idstring (Required)

      Invoice ID of the required invoice.

    • amount_applieddouble (Required)

      The total amount applied from the credit note on an invoice.

  • invoice_idstring (Required)

    Invoice ID of the required invoice.

  • amount_applieddouble (Required)

    The total amount applied from the credit note on an invoice.

Request ExampleCopy
curl --request POST \
  --url 'https://api.zakya.com/inventory/v1/creditnotes/90300000072369/invoices?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
  --header 'content-type: application/json' \
  --data '{"field1":"value1","field2":"value2"}'
parameters_data='{"field1":"value1","field2":"value2"}';
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/creditnotes/90300000072369/invoices?organization_id=10234695"
type: POST
headers: headers_data
content-type: application/json
parameters: parameters_data
connection: 
]
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://api.zakya.com/inventory/v1/creditnotes/90300000072369/invoices?organization_id=10234695")
  .post(body)
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "POST",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/creditnotes/90300000072369/invoices?organization_id=10234695",
  "headers": {
    "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();
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
    'content-type': 'application/json'
  },
  body: '{"field1":"value1","field2":"value2"}'
};

fetch('https://api.zakya.com/inventory/v1/creditnotes/90300000072369/invoices?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}"

headers = {
    'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
    'content-type': "application/json"
    }

conn.request("POST", "/inventory/v1/creditnotes/90300000072369/invoices?organization_id=10234695", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Body ParametersCopy
{
    "invoices": [
        {
            "invoice_id": "90300000079426",
            "amount_applied": 41.82
        }
    ],
    "invoice_id": "90300000079426",
    "amount_applied": 41.82
}
Response ExampleCopy
{
    "code": 0,
    "message": "Credits have been applied to the invoice(s)."
}

List invoices credited

List invoices to which the credit note is applied.

OAuth Scope : ZakyaAPI.creditnotes.READ

Request ExampleCopy
curl --request GET \
  --url 'https://api.zakya.com/inventory/v1/creditnotes/90300000072369/invoices?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/creditnotes/90300000072369/invoices?organization_id=10234695"
type: GET
headers: headers_data
connection: 
]
info response;
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.zakya.com/inventory/v1/creditnotes/90300000072369/invoices?organization_id=10234695")
  .get()
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "GET",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/creditnotes/90300000072369/invoices?organization_id=10234695",
  "headers": {
    "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();
const options = {
  method: 'GET',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
  }
};

fetch('https://api.zakya.com/inventory/v1/creditnotes/90300000072369/invoices?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }

conn.request("GET", "/inventory/v1/creditnotes/90300000072369/invoices?organization_id=10234695", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response ExampleCopy
{
    "code": 0,
    "message": "success",
    "invoices_credited": [
        {
            "creditnote_id": "90300000072369",
            "invoice_id": "90300000079426",
            "creditnote_invoice_id": "982000000567172",
            "date": "2016-06-05",
            "invoice_number": "INV-384",
            "creditnote_number": "CN-29",
            "credited_amount": 12.02
        },
        {...},
        {...}
    ]
}

Delete credits applied to an invoice

Delete the credits applied to an invoice.

OAuth Scope : ZakyaAPI.creditnotes.DELETE

Request ExampleCopy
curl --request DELETE \
  --url 'https://api.zakya.com/inventory/v1/creditnotes/90300000072369/invoices/982000000567172?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/creditnotes/90300000072369/invoices/982000000567172?organization_id=10234695"
type: DELETE
headers: headers_data
connection: 
]
info response;
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.zakya.com/inventory/v1/creditnotes/90300000072369/invoices/982000000567172?organization_id=10234695")
  .delete(null)
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "DELETE",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/creditnotes/90300000072369/invoices/982000000567172?organization_id=10234695",
  "headers": {
    "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();
const options = {
  method: 'DELETE',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
  }
};

fetch('https://api.zakya.com/inventory/v1/creditnotes/90300000072369/invoices/982000000567172?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }

conn.request("DELETE", "/inventory/v1/creditnotes/90300000072369/invoices/982000000567172?organization_id=10234695", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response ExampleCopy
{
    "code": 0,
    "message": "Credits applied to an invoice have been deleted."
}

Add a comment

Add a comment to an existing credit note.

OAuth Scope : ZakyaAPI.creditnotes.CREATE

Arguments

  • descriptionstring

    A brief description about the item.

Request ExampleCopy
curl --request POST \
  --url 'https://api.zakya.com/inventory/v1/creditnotes/90300000072369/comments?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
  --header 'content-type: application/json' \
  --data '{"field1":"value1","field2":"value2"}'
parameters_data='{"field1":"value1","field2":"value2"}';
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/creditnotes/90300000072369/comments?organization_id=10234695"
type: POST
headers: headers_data
content-type: application/json
parameters: parameters_data
connection: 
]
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://api.zakya.com/inventory/v1/creditnotes/90300000072369/comments?organization_id=10234695")
  .post(body)
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "POST",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/creditnotes/90300000072369/comments?organization_id=10234695",
  "headers": {
    "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();
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
    'content-type': 'application/json'
  },
  body: '{"field1":"value1","field2":"value2"}'
};

fetch('https://api.zakya.com/inventory/v1/creditnotes/90300000072369/comments?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}"

headers = {
    'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
    'content-type': "application/json"
    }

conn.request("POST", "/inventory/v1/creditnotes/90300000072369/comments?organization_id=10234695", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Body ParametersCopy
{
    "description": "Credits applied to invoice INV-00004"
}
Response ExampleCopy
{
    "code": 0,
    "message": "Comments added."
}

List credit note comments & history

Get history and comments of a credit note.

OAuth Scope : ZakyaAPI.creditnotes.READ

Request ExampleCopy
curl --request GET \
  --url 'https://api.zakya.com/inventory/v1/creditnotes/90300000072369/comments?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/creditnotes/90300000072369/comments?organization_id=10234695"
type: GET
headers: headers_data
connection: 
]
info response;
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.zakya.com/inventory/v1/creditnotes/90300000072369/comments?organization_id=10234695")
  .get()
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "GET",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/creditnotes/90300000072369/comments?organization_id=10234695",
  "headers": {
    "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();
const options = {
  method: 'GET',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
  }
};

fetch('https://api.zakya.com/inventory/v1/creditnotes/90300000072369/comments?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }

conn.request("GET", "/inventory/v1/creditnotes/90300000072369/comments?organization_id=10234695", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response ExampleCopy
{
    "code": 0,
    "message": "Comments of the credit note are displayed successfully.",
    "comments": [
        {
            "comment_id": "982000000570001",
            "creditnote_id": "90300000072369",
            "description": "Credits applied to invoice INV-00004",
            "commented_by_id": "982000000554041",
            "commented_by": "Sujin Kumar",
            "comment_type": "system",
            "date": "2016-06-05",
            "date_description": "7 hours ago",
            "time": "10:43 PM",
            "operation_type": "Updated",
            "transaction_id": "903000002072369",
            "transaction_type": "email"
        },
        {...},
        {...}
    ]
}

Delete a Comment

Delete a credit note comment.

OAuth Scope : ZakyaAPI.creditnotes.DELETE

Request ExampleCopy
curl --request DELETE \
  --url 'https://api.zakya.com/inventory/v1/creditnotes/90300000072369/comments/982000000570001?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/creditnotes/90300000072369/comments/982000000570001?organization_id=10234695"
type: DELETE
headers: headers_data
connection: 
]
info response;
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.zakya.com/inventory/v1/creditnotes/90300000072369/comments/982000000570001?organization_id=10234695")
  .delete(null)
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "DELETE",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/creditnotes/90300000072369/comments/982000000570001?organization_id=10234695",
  "headers": {
    "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();
const options = {
  method: 'DELETE',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
  }
};

fetch('https://api.zakya.com/inventory/v1/creditnotes/90300000072369/comments/982000000570001?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }

conn.request("DELETE", "/inventory/v1/creditnotes/90300000072369/comments/982000000570001?organization_id=10234695", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response ExampleCopy
{
    "code": 0,
    "message": "The comment has been deleted."
}

List credit note refunds

List all refunds with pagination.

OAuth Scope : ZakyaAPI.creditnotes.READ

Query Parameters

  • customer_id 

    Customer ID of the customer for whom the credit note is raised.

  • sort_column 

    Sort refunds list. Allowed Values refund_mode, reference_number, date, creditnote_number, customer_name, amount_bcy and amount_fcy

Request ExampleCopy
curl --request GET \
  --url 'https://api.zakya.com/inventory/v1/creditnotes/refunds?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/creditnotes/refunds?organization_id=10234695"
type: GET
headers: headers_data
connection: 
]
info response;
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.zakya.com/inventory/v1/creditnotes/refunds?organization_id=10234695")
  .get()
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "GET",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/creditnotes/refunds?organization_id=10234695",
  "headers": {
    "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();
const options = {
  method: 'GET',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
  }
};

fetch('https://api.zakya.com/inventory/v1/creditnotes/refunds?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }

conn.request("GET", "/inventory/v1/creditnotes/refunds?organization_id=10234695", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response ExampleCopy
{
    "code": 0,
    "message": "The list of credit note refunds are displayed successfully.",
    "creditnote_refunds": [
        {
            "creditnote_refund_id": "982000000567158",
            "creditnote_id": "90300000072369",
            "date": "2016-06-05",
            "refund_mode": "cash",
            "reference_number": "INV-384",
            "creditnote_number": "CN-29",
            "customer_name": "Bowman Furniture",
            "description": "",
            "amount_bcy": 10,
            "amount_fcy": 10
        },
        {...},
        {...}
    ],
    "page_context": {
        "page": 1,
        "per_page": 200,
        "has_more_page": false,
        "report_name": "Credit Notes Refund",
        "sort_column": "created_time",
        "sort_order": "D"
    }
}

Refund credit note

Refund credit note amount.

OAuth Scope : ZakyaAPI.creditnotes.CREATE

Arguments

  • datestring

    The date on which the credit note was raised. Format [yyyy-mm-dd]

  • refund_modestring

    The method of refund.

  • reference_numberstring

    Reference number generated for the payment. A string of your choice can also be used as the reference number. Max-Length [100]

  • amountdouble

    Amount paid for the invoice.

  • exchange_ratestring

    Exchange rate for the currency associated with the customer.

  • from_account_idstring

    The account from which credit note is refunded.

  • descriptionstring

    A brief description about the item.

Request ExampleCopy
curl --request POST \
  --url 'https://api.zakya.com/inventory/v1/creditnotes/90300000072369/refunds?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
  --header 'content-type: application/json' \
  --data '{"field1":"value1","field2":"value2"}'
parameters_data='{"field1":"value1","field2":"value2"}';
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/creditnotes/90300000072369/refunds?organization_id=10234695"
type: POST
headers: headers_data
content-type: application/json
parameters: parameters_data
connection: 
]
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://api.zakya.com/inventory/v1/creditnotes/90300000072369/refunds?organization_id=10234695")
  .post(body)
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "POST",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/creditnotes/90300000072369/refunds?organization_id=10234695",
  "headers": {
    "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();
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
    'content-type': 'application/json'
  },
  body: '{"field1":"value1","field2":"value2"}'
};

fetch('https://api.zakya.com/inventory/v1/creditnotes/90300000072369/refunds?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}"

headers = {
    'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
    'content-type': "application/json"
    }

conn.request("POST", "/inventory/v1/creditnotes/90300000072369/refunds?organization_id=10234695", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Body ParametersCopy
{
    "date": "2016-06-05",
    "refund_mode": "cash",
    "reference_number": "INV-384",
    "amount": 450,
    "exchange_rate": "5.5",
    "from_account_id": " ",
    "description": "prorated amount for items"
}
Response ExampleCopy
{
    "code": 0,
    "message": "The refund information for this credit note has been saved.",
    "creditnote_refund": {
        "creditnote_refund_id": "982000000567158",
        "creditnote_id": "90300000072369",
        "date": "2016-06-05",
        "refund_mode": "cash",
        "reference_number": "INV-384",
        "amount": 450,
        "customer_name": "Bowman Furniture",
        "description": "prorated amount for items"
    }
}

List refunds of a credit note

List all refunds of an existing credit note.

OAuth Scope : ZakyaAPI.creditnotes.READ

Request ExampleCopy
curl --request GET \
  --url 'https://api.zakya.com/inventory/v1/creditnotes/90300000072369/refunds?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/creditnotes/90300000072369/refunds?organization_id=10234695"
type: GET
headers: headers_data
connection: 
]
info response;
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.zakya.com/inventory/v1/creditnotes/90300000072369/refunds?organization_id=10234695")
  .get()
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "GET",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/creditnotes/90300000072369/refunds?organization_id=10234695",
  "headers": {
    "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();
const options = {
  method: 'GET',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
  }
};

fetch('https://api.zakya.com/inventory/v1/creditnotes/90300000072369/refunds?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }

conn.request("GET", "/inventory/v1/creditnotes/90300000072369/refunds?organization_id=10234695", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response ExampleCopy
{
    "code": 0,
    "message": "The refunds of the existing credit note are displayed successfully.",
    "creditnote_refunds": [
        {
            "creditnote_refund_id": "982000000567158",
            "creditnote_id": "90300000072369",
            "date": "2016-06-05",
            "refund_mode": "cash",
            "reference_number": "INV-384",
            "creditnote_number": "CN-29",
            "customer_name": "Bowman Furniture",
            "description": "",
            "amount_bcy": 10,
            "amount_fcy": 10
        },
        {...},
        {...}
    ],
    "page_context": {
        "page": 1,
        "per_page": 200,
        "has_more_page": false,
        "report_name": "Credit Notes Refund",
        "sort_column": "created_time",
        "sort_order": "D"
    }
}

Update credit note refund

Update the refunded transaction.

OAuth Scope : ZakyaAPI.creditnotes.UPDATE

Arguments

  • datestring

    The date on which the credit note was raised. Format [yyyy-mm-dd]

  • refund_modestring

    The method of refund.

  • reference_numberstring

    Reference number generated for the payment. A string of your choice can also be used as the reference number. Max-Length [100]

  • amountdouble

    Amount paid for the invoice.

  • exchange_ratestring

    Exchange rate for the currency associated with the customer.

  • from_account_idstring

    The account from which credit note is refunded.

  • descriptionstring

    A brief description about the item.

Request ExampleCopy
curl --request PUT \
  --url 'https://api.zakya.com/inventory/v1/creditnotes/90300000072369/refunds/982000000567158?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
  --header 'content-type: application/json' \
  --data '{"field1":"value1","field2":"value2"}'
parameters_data='{"field1":"value1","field2":"value2"}';
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/creditnotes/90300000072369/refunds/982000000567158?organization_id=10234695"
type: PUT
headers: headers_data
content-type: application/json
parameters: parameters_data
connection: 
]
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://api.zakya.com/inventory/v1/creditnotes/90300000072369/refunds/982000000567158?organization_id=10234695")
  .put(body)
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "PUT",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/creditnotes/90300000072369/refunds/982000000567158?organization_id=10234695",
  "headers": {
    "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();
const options = {
  method: 'PUT',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
    'content-type': 'application/json'
  },
  body: '{"field1":"value1","field2":"value2"}'
};

fetch('https://api.zakya.com/inventory/v1/creditnotes/90300000072369/refunds/982000000567158?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}"

headers = {
    'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
    'content-type': "application/json"
    }

conn.request("PUT", "/inventory/v1/creditnotes/90300000072369/refunds/982000000567158?organization_id=10234695", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Body ParametersCopy
{
    "date": "2016-06-05",
    "refund_mode": "cash",
    "reference_number": "INV-384",
    "amount": 450,
    "exchange_rate": "5.5",
    "from_account_id": " ",
    "description": "prorated amount for items"
}
Response ExampleCopy
{
    "code": 0,
    "message": "The refund information has been saved.",
    "creditnote_refund": {
        "creditnote_refund_id": "982000000567158",
        "creditnote_id": "90300000072369",
        "date": "2016-06-05",
        "refund_mode": "cash",
        "reference_number": "INV-384",
        "amount": 450,
        "customer_name": "Bowman Furniture",
        "description": "prorated amount for items"
    }
}

Get credit note refund

Fetch the refund of a particular credit note.

OAuth Scope : ZakyaAPI.creditnotes.READ

Request ExampleCopy
curl --request GET \
  --url 'https://api.zakya.com/inventory/v1/creditnotes/90300000072369/refunds/982000000567158?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/creditnotes/90300000072369/refunds/982000000567158?organization_id=10234695"
type: GET
headers: headers_data
connection: 
]
info response;
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.zakya.com/inventory/v1/creditnotes/90300000072369/refunds/982000000567158?organization_id=10234695")
  .get()
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "GET",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/creditnotes/90300000072369/refunds/982000000567158?organization_id=10234695",
  "headers": {
    "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();
const options = {
  method: 'GET',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
  }
};

fetch('https://api.zakya.com/inventory/v1/creditnotes/90300000072369/refunds/982000000567158?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import http.client

conn = http.client.HTTPSConnection("api.zakya.com")

headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }

conn.request("GET", "/inventory/v1/creditnotes/90300000072369/refunds/982000000567158?organization_id=10234695", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Response ExampleCopy
{
    "code": 0,
    "message": "The refund of the credit note is displayed successfully.",
    "creditnote_refund": {
        "creditnote_refund_id": "982000000567158",
        "creditnote_id": "90300000072369",
        "date": "2016-06-05",
        "refund_mode": "cash",
        "reference_number": "INV-384",
        "amount": 450,
        "customer_name": "Bowman Furniture",
        "description": "prorated amount for items"
    }
}

Delete credit note refund

Delete a credit note refund.

OAuth Scope : ZakyaAPI.creditnotes.DELETE

Request ExampleCopy
curl --request DELETE \
  --url 'https://api.zakya.com/inventory/v1/creditnotes/90300000072369/refunds/982000000567158?organization_id=10234695' \
  --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://api.zakya.com/inventory/v1/creditnotes/90300000072369/refunds/982000000567158?organization_id=10234695"
type: DELETE
headers: headers_data
connection: 
]
info response;
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.zakya.com/inventory/v1/creditnotes/90300000072369/refunds/982000000567158?organization_id=10234695")
  .delete(null)
  .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
  .build();

Response response = client.newCall(request).execute();
const http = require("https");

const options = {
  "method": "DELETE",
  "hostname": "api.zakya.com",
  "port": null,
  "path": "/inventory/v1/creditnotes/90300000072369/refunds/982000000567158?organization_id=10234695",
  "headers": {
    "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();
const options = {
  method: 'DELETE',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
  }
};

fetch('https://api.zakya.com/inventory/v1/creditnotes/90300000072369/refunds/982000000567158?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
const options = {
  method: 'DELETE',
  headers: {
    Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
  }
};

fetch('https://api.zakya.com/inventory/v1/creditnotes/90300000072369/refunds/982000000567158?organization_id=10234695', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
Response ExampleCopy
{
    "code": 0,
    "message": "The refund has been deleted."
}