### Time Entry Timer Start Response Example Source: https://www.zoho.com/invoice/api/v3/time-entries This is a successful response (200 OK) when starting a time entry timer. It confirms the timer has been started and provides details of the time entry. ```JSON { "code": 0, "message": "The timer has been started.", "time_entry": { "time_entry_id": "460000000044021", "project_id": "460000000044019", "project_name": "REAL TIME TRAFFIC FLUX", "customer_id": "460000000044001", "customer_name": "SAF Instruments Inc", "task_id": "460000000044009", "task_name": "Distribution Analysis", "user_id": "460000000024003", "user_name": "John David", "is_current_user": true, "log_date": "2013-09-17", "begin_time": "03:00", "end_time": "04:00", "log_time": "05:00", "is_billable": true, "billed_status": "unbilled", "invoice_id": "", "notes": " ", "timer_started_at": " ", "timer_started_at_utc_time": "", "timer_duration_in_minutes": " ", "timer_duration_in_seconds": " ", "created_time": "2013-09-11T18:05:27+0530", "timesheet_custom_fields": "" } } ``` -------------------------------- ### Start Time Entry Timer - Python Source: https://www.zoho.com/invoice/api/v3/time-entries Utilize Python's http.client to start a time entry timer. This example sets up the HTTPS connection and headers for the POST request. ```Python import http.client conn = http.client.HTTPSConnection("www.zohoapis.com") headers = { 'X-com-zoho-invoice-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("POST", "/invoice/v3/projects/timeentries/460000000044021/timer/start", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` -------------------------------- ### Get Running Time Entry - Python Source: https://www.zoho.com/invoice/api/v3/time-entries This Python example uses the http.client library to make a GET request for the running time entry. It demonstrates setting up the connection and headers. ```python import http.client conn = http.client.HTTPSConnection("www.zohoapis.com") headers = { 'X-com-zoho-invoice-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("GET", "/invoice/v3/projects/timeentries/runningtimer/me", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` -------------------------------- ### Start Time Entry Timer - Java Source: https://www.zoho.com/invoice/api/v3/time-entries Control time entry timers with Java using OkHttpClient. This example demonstrates setting up the request with necessary headers. ```Java OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/invoice/v3/projects/timeentries/460000000044021/timer/start") .post(null) .addHeader("X-com-zoho-invoice-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute(); ``` -------------------------------- ### Get Customer Payments with Headers (Java) Source: https://www.zoho.com/invoice/api/v3/customer-payments Example of how to fetch customer payments using Java with OkHttpClient, including required headers for organization ID and authorization. ```java OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/invoice/v3/customerpayments") .get() .addHeader("X-com-zoho-invoice-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute(); ``` -------------------------------- ### Get Customer Payments with Headers (Python) Source: https://www.zoho.com/invoice/api/v3/customer-payments Example of how to fetch customer payments using Python's http.client, including required headers for organization ID and authorization. ```python import http.client conn = http.client.HTTPSConnection("www.zohoapis.com") headers = { 'X-com-zoho-invoice-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("GET", "/invoice/v3/customerpayments", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` -------------------------------- ### Get Taxes with Java Source: https://www.zoho.com/invoice/api/v3/taxes Example of retrieving tax data using Java with OkHttpClient. This snippet shows how to set up the request, including the URL and required headers for authentication and organization identification. ```java OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/invoice/v3/settings/taxes") .get() .addHeader("X-com-zoho-invoice-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute(); ``` -------------------------------- ### Get Currencies Response Example Source: https://www.zoho.com/invoice/api/v3/currency Example of a successful response when retrieving a list of currencies. The response includes details for each currency, such as ID, code, name, symbol, precision, format, and base currency status. ```JSON { "code": 0, "message": "success.", "currency": [ { "currency_id": "982000000004012", "currency_code": "AUD", "currency_name": "AUD- Australian Dollar", "currency_symbol": "$", "price_precision": 2, "currency_format": "1,234,567.89", "is_base_currency": false }, {...}, {...} ] } ``` -------------------------------- ### Get Item Details using Java Source: https://www.zoho.com/invoice/api/v3/items Example of retrieving item details using Java with OkHttpClient. This code snippet shows how to set up the request with the necessary headers and URL. ```Java OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/invoice/v3/items/903000000045027") .get() .addHeader("X-com-zoho-invoice-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute(); ``` -------------------------------- ### Export Invoices as PDF using Java Source: https://www.zoho.com/invoice/api/v3/invoices Java code example using OkHttpClient to make a GET request to export invoices as PDF. Includes setting the organization ID and authorization headers. ```Java OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/invoice/v3/invoices/pdf?invoice_ids=") .get() .addHeader("X-com-zoho-invoice-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute(); ``` -------------------------------- ### Response Example for Get Credit Note Source: https://www.zoho.com/invoice/api/v3/credit-notes Example JSON response for a successful retrieval of credit note details. ```JSON { "code": 0, "message": "success", "creditnote": { "creditnote_id": "90300000072369", "creditnote_number": "CN-29", "date": "2016-06-05", "status": "open", "customer_id": "903000000000099", "product_type": "goods", "serial_numbers": "string", "customer_name": "Bowman Furniture", "custom_fields": [ { "customfield_id": 439910000000236000, "data_type": "text", "label": "label", "show_on_pdf": true, "show_in_all_pdf": true, "value": 129890 } ], "reference_number": "INV-384", "email": "test@zylker.org", "total": 450, "balance": 10, "line_items": [ { "item_id": "90300000081501", "description": "500GB, USB 2.0 interface 1400 rpm, protective hard case.", "name": "Hard Drive", "type": 1, "quantity": 1, "tax_id": "903000000000356", "tds_tax_id": "903000000000357", "rate": 100, "item_total": 100, "product_type": "goods", "hsn_or_sac": 80540, "project_id": 90300000087378, "project_name": "Sample Project", "sat_item_key_code": 71121206, "unitkey_code": "box" } ], "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-07-05T02:30:08-0700", "billing_address": { "address": "4900 Hopyard Rd, Suite 310", "city": "Pleasanton", "state": "CA", "zip": 94588, "country": "U.S.A", "fax": "+1-925-924-9600" }, "shipping_address": { "address": "4900 Hopyard Rd, Suite 310", "city": "Pleasanton", "state": "CA", "zip": 94588, "country": "U.S.A", "fax": "+1-925-924-9600" }, "template_id": "90300000001336", "template_name": "Standard Template", "notes": "Offer for the referral", "terms": "Can be added for refund only if purchased again" } } ``` -------------------------------- ### Project User Response Example (201 Created) Source: https://www.zoho.com/invoice/api/v3/projects Example of a successful response when adding a user to a project. Details the added users and their properties. ```json { "code": 0, "message": "Users added.", "users": [ { "user_id": "460000000024003", "is_current_user": true, "user_name": "John David", "email": "test@zylker.org", "user_role": "admin", "status": "active", "rate": 5000, "budget_hours": "0" }, {...}, {...} ] } ``` -------------------------------- ### Create Price List - Java Source: https://www.zoho.com/invoice/api/v3/price-lists This Java code demonstrates how to create a price list using OkHttpClient. It includes setting up the request body and headers. ```java OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}"); Request request = new Request.Builder() .url("https://www.zohoapis.com/invoice/v3/pricebooks") .post(body) .addHeader("X-com-zoho-invoice-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute(); ``` -------------------------------- ### Get Expense Comments using Javascript (Fetch API) Source: https://www.zoho.com/invoice/api/v3/expenses This Javascript example uses the Fetch API to get expense comments. It configures the request with GET method and required headers for authorization. ```javascript const options = { method: 'GET', headers: { 'X-com-zoho-invoice-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/invoice/v3/expenses/982000000030049/comments', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err)); ``` -------------------------------- ### Invite User to Project using Java (OkHttpClient) Source: https://www.zoho.com/invoice/api/v3/projects Example of inviting a user to a project using Java with OkHttpClient. Ensure the correct URL, headers, and request body are provided. ```Java OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}"); Request request = new Request.Builder() .url("https://www.zohoapis.com/invoice/v3/projects/460000000044019/users/invite") .post(body) .addHeader("X-com-zoho-invoice-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute(); ``` -------------------------------- ### Successful Response Example for Get Expense Category Source: https://www.zoho.com/invoice/api/v3/expense-category This is an example of a successful JSON response when retrieving an expense category. It includes the category details and a success code. ```json { "code": 0, "message": "success", "expense_category": { "account_id": 982000000561057, "account_name": "Rent", "description": " ", "status": "active", "created_time": "2013-11-18T02:17:40-0800", "last_modified_time": "2013-12-18T02:17:40-0800" } } ``` -------------------------------- ### Project User Response Example Source: https://www.zoho.com/invoice/api/v3/projects Example of a successful response when updating project user details, confirming the update and listing user information. ```JSON { "code": 0, "message": "The staff information has been updated.", "users": [ { "user_id": "460000000024003", "user_name": "John David", "email": "test@zylker.org", "user_role": "admin", "is_current_user": true }, {...}, {...} ] } ``` -------------------------------- ### Add User to Project (Java) Source: https://www.zoho.com/invoice/api/v3/projects Java code example for adding a user to a project using OkHttpClient. Requires setting up the OkHttpClient and request details. ```java OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}"); Request request = new Request.Builder() .url("https://www.zohoapis.com/invoice/v3/projects/460000000044019/users") .post(body) .addHeader("X-com-zoho-invoice-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute(); ``` -------------------------------- ### Get Recurring Expenses Request Examples Source: https://www.zoho.com/invoice/api/v3/recurring-expenses Examples for fetching recurring expenses using various programming languages. Ensure the 'X-com-zoho-invoice-organizationid' and 'Authorization' headers are correctly set. ```cURL curl --request GET \ --url https://www.zohoapis.com/invoice/v3/recurringexpenses \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-invoice-organizationid: 10234695' ``` ```Deluge headers_data = Map(); headers_data.put("X-com-zoho-invoice-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/invoice/v3/recurringexpenses" type: GET headers: headers_data connection: ]; info response; ``` ```Java OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/invoice/v3/recurringexpenses") .get() .addHeader("X-com-zoho-invoice-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute(); ``` ```Javascript const options = { method: 'GET', headers: { 'X-com-zoho-invoice-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/invoice/v3/recurringexpenses', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err)); ``` ```Python import http.client conn = http.client.HTTPSConnection("www.zohoapis.com") headers = { 'X-com-zoho-invoice-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("GET", "/invoice/v3/recurringexpenses", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```Node.js const http = require("https"); const options = { "method": "GET", "hostname": "www.zohoapis.com", "port": null, "path": "/invoice/v3/recurringexpenses", "headers": { "X-com-zoho-invoice-organizationid": "10234695", "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); ``` -------------------------------- ### Project User Invitation Response Example Source: https://www.zoho.com/invoice/api/v3/projects Example of a successful response (201 Created) when inviting a user to a project. It confirms the user addition and provides user details. ```JSON { "code": 0, "message": "The staff has been added.", "users": [ { "user_id": "460000000024003", "user_name": "John David", "email": "test@zylker.org", "user_role": "admin", "is_current_user": true }, {...}, {...} ] } ``` -------------------------------- ### Response Example for Get Credit Note Refunds Source: https://www.zoho.com/invoice/api/v3/credit-notes Example of a successful response (200 OK) when retrieving credit note refunds, detailing the structure of the returned data. ```JSON { "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": "Offer", "amount_bcy": 10, "amount_fcy": 10 }, {...}, {...} ] } ``` -------------------------------- ### Create Price List Example Source: https://www.zoho.com/invoice/api/v3/price-lists This example demonstrates how to create a new price list with specific item rates. Ensure you have the necessary OAuth scope ('ZohoInvoice.settings.CREATE') to perform this action. ```json { "pricebook_id": 1152891000000265000, "name": "Price List Per Item", "description": "checktest", "currency_id": 982000000004012, "currency_code": "INR", "pricebook_items": [ { "item_id": 982000000030049, "pricebook_rate": 120 } ], "status": "active", "is_default": false, "pricebook_type": "per_item", "is_increase": false, "rounding_type": "no_rounding", "sales_or_purchase_type": "sales" } ``` -------------------------------- ### Make GET Request to Expenses API Source: https://www.zoho.com/invoice/api/v3/expenses Examples of making a GET request to the expenses endpoint with required headers. Ensure you replace placeholder tokens with your actual credentials. ```cURL curl --request GET \ --url https://www.zohoapis.com/invoice/v3/expenses \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-invoice-organizationid: 10234695' ``` ```Deluge headers_data = Map(); headers_data.put("X-com-zoho-invoice-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/invoice/v3/expenses" type: GET headers: headers_data connection: ]; info response; ``` ```Java OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/invoice/v3/expenses") .get() .addHeader("X-com-zoho-invoice-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute(); ``` ```Javascript const options = { method: 'GET', headers: { 'X-com-zoho-invoice-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/invoice/v3/expenses', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err)); ``` ```Python import http.client conn = http.client.HTTPSConnection("www.zohoapis.com") headers = { 'X-com-zoho-invoice-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("GET", "/invoice/v3/expenses", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```Node.js const http = require("https"); const options = { "method": "GET", "hostname": "www.zohoapis.com", "port": null, "path": "/invoice/v3/expenses", "headers": { "X-com-zoho-invoice-organizationid": "10234695", "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); ``` -------------------------------- ### Get Tax Authorities with Headers (Python) Source: https://www.zoho.com/invoice/api/v3/taxes This Python example shows how to make an HTTPS request to get tax authorities, including the essential organization ID and authorization headers. ```python import http.client conn = http.client.HTTPSConnection("www.zohoapis.com") headers = { 'X-com-zoho-invoice-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("GET", "/invoice/v3/settings/taxauthorities", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` -------------------------------- ### Create Tax using OkHttpClient Source: https://www.zoho.com/invoice/api/v3/taxes This Java example demonstrates creating a tax using OkHttpClient. It sets up the request with the correct URL, headers, and JSON body. ```Java OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}"); Request request = new Request.Builder() .url("https://www.zohoapis.com/invoice/v3/settings/taxes") .post(body) .addHeader("X-com-zoho-invoice-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute(); ``` -------------------------------- ### Get Recurring Expense Details (Node.js) Source: https://www.zoho.com/invoice/api/v3/recurring-expenses Retrieve recurring expense information using Node.js. This example utilizes the 'https' module to send a GET request with specified headers. ```Node.js const http = require("https"); const options = { "method": "GET", "hostname": "www.zohoapis.com", "port": null, "path": "/invoice/v3/recurringexpenses/982000000567240", "headers": { "X-com-zoho-invoice-organizationid": "10234695", "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); ``` -------------------------------- ### Invite User to Project using Python Source: https://www.zoho.com/invoice/api/v3/projects Python example for inviting a user to a project using the http.client library. Ensure correct headers and payload are configured. ```Python import http.client conn = http.client.HTTPSConnection("www.zohoapis.com") payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}" headers = { 'X-com-zoho-invoice-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", 'content-type': "application/json" } conn.request("POST", "/invoice/v3/projects/460000000044019/users/invite", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` -------------------------------- ### Clone Project using Java Source: https://www.zoho.com/invoice/api/v3/projects Example of cloning a project using Java with OkHttpClient. This snippet shows how to set up the request body, headers, and execute the POST request. ```Java OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}"); Request request = new Request.Builder() .url("https://www.zohoapis.com/invoice/v3/projects/460000000044019/clone") .post(body) .addHeader("X-com-zoho-invoice-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute(); ``` -------------------------------- ### Get Recurring Expense Details (Python) Source: https://www.zoho.com/invoice/api/v3/recurring-expenses Make a GET request in Python to fetch recurring expense data. This example uses the http.client library to construct and send the request. ```Python import http.client conn = http.client.HTTPSConnection("www.zohoapis.com") headers = { 'X-com-zoho-invoice-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("GET", "/invoice/v3/recurringexpenses/982000000567240", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` -------------------------------- ### Get Contact Person Details - JavaScript (Fetch API) Source: https://www.zoho.com/invoice/api/v3/contact-persons Use the Fetch API in JavaScript to get contact person details. This example includes error handling for the request. ```javascript const options = { method: 'GET', headers: { 'X-com-zoho-invoice-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/invoice/v3/contacts/460000000026049/contactpersons', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err)); ``` -------------------------------- ### Make a GET Request to Invoices Source: https://www.zoho.com/invoice/api/v3/errors Example of how to make a GET request to retrieve invoice details using cURL. Ensure you replace placeholders with your actual organization ID and invoice ID. ```bash $ curl https://www.zohoapis.com/invoice/v3/invoices/700000007942?organization_id=10234695 ``` -------------------------------- ### Create Expense with Java (OkHttpClient) Source: https://www.zoho.com/invoice/api/v3/expenses Example using OkHttpClient in Java to send a POST request to create an expense. Includes setting up the request body and headers. ```java OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}"); Request request = new Request.Builder() .url("https://www.zohoapis.com/invoice/v3/expenses") .post(body) .addHeader("X-com-zoho-invoice-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute(); ``` -------------------------------- ### Create Project Source: https://www.zoho.com/invoice/api/v3/projects This section details the arguments required to create a new project. It includes project name, customer ID, description, billing type, hourly rate, budget type and hours, budget amount, user ID, and associated tasks and users. ```APIDOC ## POST /projects ### Description Creates a new project with specified details. ### Method POST ### Endpoint /projects ### Parameters #### Request Body - **project_name** (string) - Required - Name of the project. `Maximum length [100]` - **customer_id** (string) - Required - ID of the customer. - **description** (string) - Project description. `Maximum length [500]` - **billing_type** (string) - Required - The way you bill your customer. Allowed Values: `fixed_cost_for_project`, `based_on_project_hours`, `based_on_staff_hours` and `based_on_task_hours` - **rate** (string) - Hourly rate for a task. - **budget_type** (string) - The way you budget. Allowed Values: `total_project_cost`, `total_project_hours`, `hours_per_task` and `hours_per_staff` - **budget_hours** (string) - Task budget hours - **budget_amount** (string) - Give value, if you are estimating total project cost. - **user_id** (string) - Required - ID of the user to be added to the project. - **tasks** (array) - Tasks comprising a project - **task_name** (string) - Required - Name of the task. `Maximum length [100]` - **description** (string) - Task description. `Maximum length [500]` - **rate** (string) - Hourly rate of a task. - **budget_hours** (string) - Task budgeting. - **users** (array) - Users of a project - **user_id** (string) - Required - ID of the user to be added to the project. - **is_current_user** (boolean) - Indicates if the user is the current user - **user_name** (string) - Name of the user. `Maximum length [200]` - **email** (string) - Email of the user. `Maximum length [100]` - **user_role** (string) - Role to be assigned. Allowed Values: `staff`, `admin` and `timesheetstaff` - **status** (string) - Project Status - **rate** (string) - Hourly rate for a task. - **budget_hours** (string) - Task budget hours - **total_hours** (string) - Total hours spent on project - **billed_hours** (string) - Total duration/hours of a project that is billed - **un_billed_hours** (string) - Hours of the project that cannot be billed ### Request Example ```json { "project_name": "Project Alpha", "customer_id": "1234567890", "description": "This is a sample project.", "billing_type": "based_on_project_hours", "rate": "50", "budget_type": "total_project_hours", "budget_hours": "100", "user_id": "9876543210", "tasks": [ { "task_name": "Task 1", "description": "Description for Task 1", "rate": "25", "budget_hours": "20", "users": [ { "user_id": "1122334455", "user_role": "staff" } ] } ] } ``` ### Response #### Success Response (200) - **project_id** (string) - ID of the created project. - **project_name** (string) - Name of the created project. #### Response Example ```json { "project_id": "XYZ789", "project_name": "Project Alpha" } ``` ``` -------------------------------- ### Get Project Details using Node.js Source: https://www.zoho.com/invoice/api/v3/projects This Node.js example uses the built-in https module to make a GET request for project details. It outlines how to configure the request options and handle the response stream. ```Node.js const http = require("https"); const options = { "method": "GET", "hostname": "www.zohoapis.com", "port": null, "path": "/invoice/v3/projects/460000000044019", "headers": { "X-com-zoho-invoice-organizationid": "10234695", "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); ``` -------------------------------- ### Project Request Body Example Source: https://www.zoho.com/invoice/api/v3/projects Example of the JSON payload required to create a project, including details like project name, customer ID, description, billing type, and associated tasks and users. ```JSON { "project_name": "Network Distribution", "customer_id": "460000000044001", "description": "Distribution for the system of intermediaries between the producer of goods and/or services and the final user", "billing_type": "based_on_task_hours", "rate": " ", "budget_type": " ", "budget_hours": " ", "budget_amount": " ", "user_id": "INV-00003", "tasks": [ { "task_name": "INV-00003", "description": "INV-00003", "rate": "INV-00003", "budget_hours": "INV-00003" } ], "users": [ { "user_id": "INV-00003", "is_current_user": true, "user_name": "John David", "email": "test@zylker.org", "user_role": "admin", "status": "active", "rate": " ", "budget_hours": " ", "total_hours": "12:26", "billed_hours": "12:27", "un_billed_hours": "00:00" } ] } ``` -------------------------------- ### Get Expense Comments using Node.js Source: https://www.zoho.com/invoice/api/v3/expenses This Node.js example uses the built-in https module to make a GET request for expense comments. It defines request options including hostname, path, and headers for authentication. ```javascript const http = require("https"); const options = { "method": "GET", "hostname": "www.zohoapis.com", "port": null, "path": "/invoice/v3/expenses/982000000030049/comments", "headers": { "X-com-zoho-invoice-organizationid": "10234695", "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); ``` -------------------------------- ### Get Project Details using Python Source: https://www.zoho.com/invoice/api/v3/projects This Python code snippet shows how to fetch project details using the http.client library. It includes setting up the connection, headers, and printing the response. ```Python import http.client conn = http.client.HTTPSConnection("www.zohoapis.com") headers = { 'X-com-zoho-invoice-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("GET", "/invoice/v3/projects/460000000044019", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` -------------------------------- ### Get Expense Details using JavaScript (Fetch API) Source: https://www.zoho.com/invoice/api/v3/expenses This JavaScript example uses the Fetch API to get expense details. It shows how to configure request options, including headers, and handle the JSON response. ```JavaScript const options = { method: 'GET', headers: { 'X-com-zoho-invoice-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/invoice/v3/expenses/982000000030049', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err)); ``` -------------------------------- ### Get Project Details using Javascript (Fetch API) Source: https://www.zoho.com/invoice/api/v3/projects This Javascript example uses the Fetch API to retrieve project details. It demonstrates setting request options including headers and handling the JSON response. ```Javascript const options = { method: 'GET', headers: { 'X-com-zoho-invoice-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/invoice/v3/projects/460000000044019', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err)); ``` -------------------------------- ### Get Currency Details Source: https://www.zoho.com/invoice/api/v3/currency This example demonstrates how to retrieve the details of a specific currency using its unique identifier. The OAuth scope required is ZohoInvoice.settings.READ. ```N/A Get the details of a currency. OAuth Scope : ZohoInvoice.settings.READ ``` -------------------------------- ### Make GET Request to Zoho Invoice API with Headers Source: https://www.zoho.com/invoice/api/v3/estimates Examples demonstrate how to make a GET request to the Zoho Invoice API, including setting required headers like Organization ID and Authorization. Use these snippets when you need to fetch estimate data. ```cURL curl --request GET \ --url https://www.zohoapis.com/invoice/v3/estimates/982000000567011/comments \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-invoice-organizationid: 10234695' ``` ```Deluge headers_data = Map(); headers_data.put("X-com-zoho-invoice-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/invoice/v3/estimates/982000000567011/comments" type: GET headers: headers_data connection: ]; info response; ``` ```Java OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/invoice/v3/estimates/982000000567011/comments") .get() .addHeader("X-com-zoho-invoice-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute(); ``` ```Javascript const options = { method: 'GET', headers: { 'X-com-zoho-invoice-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/invoice/v3/estimates/982000000567011/comments', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err)); ``` ```Python import http.client conn = http.client.HTTPSConnection("www.zohoapis.com") headers = { 'X-com-zoho-invoice-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("GET", "/invoice/v3/estimates/982000000567011/comments", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```Node.js const http = require("https"); const options = { "method": "GET", "hostname": "www.zohoapis.com", "port": null, "path": "/invoice/v3/estimates/982000000567011/comments", "headers": { "X-com-zoho-invoice-organizationid": "10234695", "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); ``` -------------------------------- ### Get Project Details using Java Source: https://www.zoho.com/invoice/api/v3/projects This Java code snippet uses OkHttpClient to make a GET request for project details. It shows how to set the URL, headers, and process the response. ```Java OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/invoice/v3/projects/460000000044019") .get() .addHeader("X-com-zoho-invoice-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .build(); Response response = client.newCall(request).execute(); ```