### Get Projects API Request Examples Source: https://www.zoho.com/billing/api/v1/introduction/#overview/projects Demonstrates how to make a GET request to retrieve project details from the Zoho Billing API. Examples include required headers for authentication and organization ID across multiple programming languages. ```Deluge headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/projects" type: GET headers: headers_data connection: ]; info response; ``` ```Java OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/billing/v1/projects") .get() .addHeader("X-com-zoho-subscriptions-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-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/billing/v1/projects', 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-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("GET", "/billing/v1/projects", 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": "/billing/v1/projects", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); ``` ```cURL curl --request GET \ --url https://www.zohoapis.com/billing/v1/projects \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' ``` -------------------------------- ### Fetch Subscriptions API Request Examples Source: https://www.zoho.com/billing/api/v1/introduction/#overview/subscription Demonstrates how to make a GET request to the Zoho Billing API v1 `/subscriptions` endpoint. Examples include setting necessary headers like `X-com-zoho-subscriptions-organizationid` and `Authorization` for authentication. ```Deluge headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/subscriptions" type: GET headers: headers_data connection: ]; info response; ``` ```Java OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/billing/v1/subscriptions") .get() .addHeader("X-com-zoho-subscriptions-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-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/billing/v1/subscriptions', 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-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("GET", "/billing/v1/subscriptions", 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": "/billing/v1/subscriptions", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); ``` ```cURL curl --request GET \ --url https://www.zohoapis.com/billing/v1/subscriptions \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' ``` -------------------------------- ### List Addons API Request Examples Source: https://www.zoho.com/billing/api/v1/introduction/#overview/addons Demonstrates how to make a GET request to the Zoho Billing API's /addons endpoint to retrieve a list of addons. Examples are provided for various programming languages, showing how to set required headers like X-com-zoho-subscriptions-organizationid and Authorization. ```Deluge headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/addons" type: GET headers: headers_data connection: ]; info response; ``` ```Java OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/billing/v1/addons") .get() .addHeader("X-com-zoho-subscriptions-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-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/billing/v1/addons', 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-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("GET", "/billing/v1/addons", 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": "/billing/v1/addons", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); ``` ```cURL curl --request GET \ --url https://www.zohoapis.com/billing/v1/addons \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' ``` -------------------------------- ### Retrieve Zoho Billing Plans via GET Request Source: https://www.zoho.com/billing/api/v1/introduction/#overview/plans Demonstrates how to make a GET request to the Zoho Billing API to retrieve a list of plans. Includes examples for Deluge, Java, Node.js, Javascript, Python, and cURL, showing required headers for authorization and organization ID. ```Deluge headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/plans" type: GET headers: headers_data connection: ]; info response; ``` ```Java OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/billing/v1/plans") .get() .addHeader("X-com-zoho-subscriptions-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-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/billing/v1/plans', 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-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("GET", "/billing/v1/plans", 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": "/billing/v1/plans", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); ``` ```cURL curl --request GET \\ --url https://www.zohoapis.com/billing/v1/plans \\ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \\ --header 'X-com-zoho-subscriptions-organizationid: 10234695' ``` -------------------------------- ### Example Request Body for Product Creation Source: https://www.zoho.com/billing/api/v1/introduction/#overview/products Illustrates the JSON structure required for the request body when creating a new product. It includes example values for the 'name', 'description', 'email_ids', and 'redirect_url' fields, matching the API arguments. ```JSON { "name": "PiperHost", "description": "Dedicated server for web hosting", "email_ids": "piper@zillum.com", "redirect_url": "http://www.zillum.com/products/piperhost" } ``` -------------------------------- ### Zoho Billing API Product Object Example Source: https://www.zoho.com/billing/api/v1/introduction/#overview/products An example JSON object illustrating the structure and typical values for a product entity in the Zoho Billing API. ```JSON { "product_id": "903000000045027", "name": "PiperHost", "description": "Dedicated server for web hosting", "email_ids": "piper@zillum.com", "redirect_url": "http://www.zillum.com/products/piperhost", "status": "active", "created_time": "2016-06-05T17:38:06-0700", "updated_time": "2016-06-05T20:09:23-0700" } ``` -------------------------------- ### Example Request Body for Project Clone API Source: https://www.zoho.com/billing/api/v1/introduction/#overview/projects An example JSON payload demonstrating the structure for the project cloning API request body, including `project_name` and `description` fields. ```JSON { "project_name": "Network Distribution", "description": "Distribution for the system of intermediaries between the producer of goods and/or services and the final user" } ``` -------------------------------- ### Example Plan Object Structure Source: https://www.zoho.com/billing/api/v1/introduction/#overview/plans An example JSON object representing the structure of a plan, including details like pricing, custom fields, addons, and timestamps. ```JSON { "plan_code": "basic-monthly", "name": "Basic", "description": "Basic monthly plan.", "store_markup_description": "Mailbox Storage-100GB | User & Docs Storage-500GB | User", "status": "active", "product_id": "903000000045027", "account_id": "903000987009900", "account_name": "Sales", "tax_id": "903000000065300", "trial_period": 1, "setup_fee": 0, "setup_fee_account_id": "903000987009903", "setup_fee_account_name": "General Income", "tags": [ { "tag_option_id": "460000000054280", "is_tag_mandatory": false, "tag_name": "Colors", "tag_id": "460000000054182", "tag_option_name": "Black" } ], "custom_fields": [ { "customfield_id": "2000000029001", "is_active": "true", "show_in_all_pdf": "true", "value_formatted": "Normal", "data_type": "string", "index": 1, "label": "cfitem", "show_on_pdf": false, "placeholder": "cf_cfitem", "value": "Normal" } ], "recurring_price": 400, "unit": "kg", "interval": 1, "interval_unit": "months", "billing_cycles": -1, "product_type": "goods", "hsn_or_sac": "74191010", "sat_item_key_code": 71121206, "unitkey_code": "E48", "item_tax_preferences": [ { "tax_specification": "intra", "tax_name": "GST", "tax_percentage": 10, "tax_id": "903000000065300" } ], "addons": [ { "addon_code": "Email-basic", "name": "Monthly_Addon", "status": "active", "pricing_scheme": "unit", "unit_name": "Email", "price_brackets": [ { "start_quantity": 1, "end_quantity": 50, "price": 10 } ] } ], "url": "https://billing.zoho.com/subscribe/3b884751f87f05e584c3952b6388e7f96a2bba0f6b0532177e00f0ba8db832fc/basic-monthly", "created_time": "2016-06-05T17:40:49-0700", "updated_time": "2016-06-05T24:40:49-0700" } ``` -------------------------------- ### Send Invoice API Request Examples Source: https://www.zoho.com/billing/api/v1/introduction/#overview/invoices Examples demonstrating how to send a POST request to the Zoho Billing API to create an invoice, including required headers and a sample body, across various programming languages. ```Deluge `parameters_data='{"field1":"value1","field2":"value2"}'; headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/invoices" type: POST headers: headers_data content-type: application/json parameters: parameters_data connection: ]; info response;` ``` ```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/billing/v1/invoices") .post(body) .addHeader("X-com-zoho-subscriptions-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();` ``` ```Javascript `const options = { method: 'POST', headers: { 'X-com-zoho-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f', 'content-type': 'application/json' }, body: '{"field1":"value1","field2":"value2"}' }; fetch('https://www.zohoapis.com/billing/v1/invoices', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));` ``` ```Python `import http.client conn = http.client.HTTPSConnection("www.zohoapis.com") payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}" headers = { 'X-com-zoho-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", 'content-type': "application/json" } conn.request("POST", "/billing/v1/invoices", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))` ``` ```Node.js `const http = require("https"); const options = { "method": "POST", "hostname": "www.zohoapis.com", "port": null, "path": "/billing/v1/invoices", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", "content-type": "application/json" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({field1: 'value1', field2: 'value2'})); req.end();` ``` ```cURL `curl --request POST \ --url https://www.zohoapis.com/billing/v1/invoices \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'` ``` -------------------------------- ### API Response Example for Get Subscriptions Source: https://www.zoho.com/billing/api/v1/introduction/#overview/subscription Illustrates a successful JSON response (HTTP 200 OK) from the `/subscriptions` endpoint, showing the structure of subscription objects including customer details, plan information, status, amounts, and timestamps. ```APIDOC { "code": 0, "message": "success", "subscriptions": [ { "customer_id": "903000000000099", "customer_name": "Benjamin", "email": "benjamin.george@bowmanfurniture.com", "plan_name": "Basic Monthly", "subscription_id": "90300000079200", "name": "GatorHost-Basic", "status": "live", "amount": 50, "created_at": "2016-06-11", "activated_at": "2016-06-15", "current_term_ends_at": "2016-06-05", "current_term_starts_at": "2016-06-05", "last_billing_at": "2016-06-05", "next_billing_at": "2016-06-30", "expires_at": "2016-06-05", "interval": 1, "interval_unit": "months", "auto_collect": true, "created_time": "2016-06-11T17:57:13-0700", "updated_time": "2016-06-04T16:44:15-0700", "reference_id": "bowmanfurniture", "salesperson_id": "903000000058001", "salesperson_name": "Franklin", "currency_code": "USD", "currency_symbol": "$" }, {...}, {...} ] } ``` -------------------------------- ### API Response Example for Get Projects (200 OK) Source: https://www.zoho.com/billing/api/v1/introduction/#overview/projects Illustrates a successful JSON response (HTTP 200 OK) when retrieving project details from the Zoho Billing API. It shows the structure of project objects including ID, name, customer details, status, and billing information. ```APIDOC { "code": 0, "message": "success", "projects": [ { "project_id": "460000000044019", "project_name": "REAL TIME TRAFFIC FLUX", "customer_id": "460000000044001", "customer_name": "SAF Instruments Inc", "description": "A simple algorithm is to be tested with vehicle detection application.", "status": "active", "billing_type": "fixed_cost_for_project", "rate": 5000, "created_time": "2013-11-18T18:05:27+0530", "has_attachment": false, "total_hours": "12:26", "billable_hours": "12:26" }, {...}, {...} ] } ``` -------------------------------- ### Subscription Activities API Response Example Source: https://www.zoho.com/billing/api/v1/introduction/#overview/subscription An example JSON response for a successful (200 OK) request to retrieve subscription activities, showing the structure of activity details including activity ID, description, time, and commenter. ```APIDOC { "code": 0, "message": "success", "activities": [ { "activity_id": "90300000745213", "description": "Invoice created - INV-000241", "activity_time": "2016-06-11T17:57:13-0700", "commented_by": "Zoho Billing" }, {...}, {...} ] } ``` -------------------------------- ### Send Credit Note Email API Request Examples Source: https://www.zoho.com/billing/api/v1/introduction/#overview/credit-notes Provides code examples in multiple programming languages demonstrating how to make a POST request to the Zoho Billing API v1 to email a credit note. Examples include setting headers for authorization and organization ID, and sending a JSON payload. ```Deluge parameters_data='{"field1":"value1","field2":"value2"}'; headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/creditnotes/90300000072369/email" type: POST headers: headers_data content-type: application/json parameters: parameters_data connection: ]; info response; ``` ```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/billing/v1/creditnotes/90300000072369/email") .post(body) .addHeader("X-com-zoho-subscriptions-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute(); ``` ```Javascript const options = { method: 'POST', headers: { 'X-com-zoho-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f', 'content-type': 'application/json' }, body: '{"field1":"value1","field2":"value2"}' }; fetch('https://www.zohoapis.com/billing/v1/creditnotes/90300000072369/email', 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") payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}" headers = { 'X-com-zoho-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", 'content-type': "application/json" } conn.request("POST", "/billing/v1/creditnotes/90300000072369/email", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")); ``` ```Node.js const http = require("https"); const options = { "method": "POST", "hostname": "www.zohoapis.com", "port": null, "path": "/billing/v1/creditnotes/90300000072369/email", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", "content-type": "application/json" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({field1: 'value1', field2: 'value2'})); req.end(); ``` ```cURL curl --request POST \ --url https://www.zohoapis.com/billing/v1/creditnotes/90300000072369/email \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}' ``` -------------------------------- ### Add Payment Method API Request Examples Source: https://www.zoho.com/billing/api/v1/introduction/#overview/hosted-pages Provides code examples in various programming languages for making a POST request to the /billing/v1/hostedpages/addpaymentmethod endpoint. These examples demonstrate how to set required headers for organization ID and authorization, and how to send a JSON payload. ```Deluge parameters_data='{"field1":"value1","field2":"value2"}'; headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/hostedpages/addpaymentmethod" type: POST headers: headers_data content-type: application/json parameters: parameters_data connection: ]; info response; ``` ```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/billing/v1/hostedpages/addpaymentmethod") .post(body) .addHeader("X-com-zoho-subscriptions-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute(); ``` ```Javascript const options = { method: 'POST', headers: { 'X-com-zoho-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f', 'content-type': 'application/json' }, body: '{"field1":"value1","field2":"value2"}' }; fetch('https://www.zohoapis.com/billing/v1/hostedpages/addpaymentmethod', 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") payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}" headers = { 'X-com-zoho-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", 'content-type': "application/json" } conn.request("POST", "/billing/v1/hostedpages/addpaymentmethod", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```Node.js const http = require("https"); const options = { "method": "POST", "hostname": "www.zohoapis.com", "port": null, "path": "/billing/v1/hostedpages/addpaymentmethod", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", "content-type": "application/json" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({field1: 'value1', field2: 'value2'})); req.end(); ``` ```cURL curl --request POST \ --url https://www.zohoapis.com/billing/v1/hostedpages/addpaymentmethod \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}' ``` -------------------------------- ### Zoho Billing API Successful Response Example Source: https://www.zoho.com/billing/api/v1/introduction/#overview/errors Example JSON response indicating a successful API operation, typically for resource creation or a general success message. ```json { "code": 0, "message": "Successfully created." } ``` -------------------------------- ### Zoho Billing Get Organizations API Response Example Source: https://www.zoho.com/billing/api/v1/introduction/#overview/introduction Example JSON response from the Zoho Billing GET /organizations API endpoint, showing the structure of organization data including organization ID, name, and other details. ```JSON { "code": 0, "message": "success", "organizations": [ { "organization_id": "10234695", "name": "Zillum", "contact_name": "John Smith", "email": "johnsmith@zillum.com", "is_default_org": false, "language_code": "en", "fiscal_year_start_month": 0, "account_created_date": "2016-02-18", "time_zone": "PST", "is_org_active": true, "currency_id": "460000000000097", "currency_code": "USD", "currency_symbol": "$", "currency_format": "###,##0.00", "price_precision": 2 }, {...}, {...} ] } ``` -------------------------------- ### Create Plan API Request Example Source: https://www.zoho.com/billing/api/v1/introduction/#overview/plans Demonstrates how to make a POST request to the `/billing/v1/plans` endpoint with required headers and parameters to create a new billing plan, shown in Deluge, Java, and Javascript. ```Deluge parameters_data='{"field1":"value1","field2":"value2"}'; headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/plans" type: POST headers: headers_data content-type: application/json parameters: parameters_data connection: ]; info response; ``` ```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/billing/v1/plans") .post(body) .addHeader("X-com-zoho-subscriptions-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute(); ``` ```Javascript const options = { method: 'POST', headers: { ``` -------------------------------- ### Get Task Details API Request Examples Source: https://www.zoho.com/billing/api/v1/introduction/#overview/tasks This snippet provides various code examples for making a GET request to retrieve the details of a specific task from the Zoho Subscriptions API. All examples require an 'X-com-zoho-subscriptions-organizationid' header and an 'Authorization' header with a Zoho OAuth token. The target URL includes specific project and task IDs. ```Deluge headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/projects/90300000072369/tasks/90300000072369" type: GET headers: headers_data connection: ]; info response; ``` ```Java OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/billing/v1/projects/90300000072369/tasks/90300000072369") .get() .addHeader("X-com-zoho-subscriptions-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-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/billing/v1/projects/90300000072369/tasks/90300000072369', 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-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("GET", "/billing/v1/projects/90300000072369/tasks/90300000072369", 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": "/billing/v1/projects/90300000072369/tasks/90300000072369", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); ``` ```cURL curl --request GET \ --url https://www.zohoapis.com/billing/v1/projects/90300000072369/tasks/90300000072369 \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' ``` -------------------------------- ### Get Time Entry Details API Response Example Source: https://www.zoho.com/billing/api/v1/introduction/#overview/time-entries Example JSON response for a successful GET request to retrieve time entry details. The response includes comprehensive information about the time entry, such as project, customer, task, user, and time-related fields. ```JSON { "code": 0, "message": "success", "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": "" } } ``` -------------------------------- ### Create Product via Zoho Billing API (POST Request) Source: https://www.zoho.com/billing/api/v1/introduction/#overview/products Demonstrates how to send a POST request to the Zoho Billing API's /v1/products endpoint to create a new product. Examples are provided in multiple programming languages, showing how to set headers (Authorization, Organization ID, Content-Type) and include a JSON request body. ```Deluge parameters_data='{"field1":"value1","field2":"value2"}'; headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/products" type: POST headers: headers_data content-type: application/json parameters: parameters_data connection: ]; info response; ``` ```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/billing/v1/products") .post(body) .addHeader("X-com-zoho-subscriptions-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute(); ``` ```Javascript const options = { method: 'POST', headers: { 'X-com-zoho-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f', 'content-type': 'application/json' }, body: '{"field1":"value1","field2":"value2"}' }; fetch('https://www.zohoapis.com/billing/v1/products', 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") payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}" headers = { 'X-com-zoho-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", 'content-type': "application/json" } conn.request("POST", "/billing/v1/products", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```Node.js const http = require("https"); const options = { "method": "POST", "hostname": "www.zohoapis.com", "port": null, "path": "/billing/v1/products", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", "content-type": "application/json" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({field1: 'value1', field2: 'value2'})); req.end(); ``` ```cURL curl --request POST \ --url https://www.zohoapis.com/billing/v1/products \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}' ``` -------------------------------- ### Get Project Comments API Request Source: https://www.zoho.com/billing/api/v1/introduction/#overview/projects This snippet demonstrates how to make a GET request to retrieve comments for a specific project using the Zoho Subscriptions API. It requires the 'ZohoSubscriptions.projects.READ' OAuth scope and includes examples for setting organization ID and authorization headers. The project ID is hardcoded in the example URL. ```Deluge headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/projects/460000000044019/comments" type: GET headers: headers_data connection: ]; info response; ``` ```Java OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/billing/v1/projects/460000000044019/comments") .get() .addHeader("X-com-zoho-subscriptions-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-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/billing/v1/projects/460000000044019/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-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("GET", "/billing/v1/projects/460000000044019/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": "/billing/v1/projects/460000000044019/comments", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); ``` ```cURL curl --request GET \ --url https://www.zohoapis.com/billing/v1/projects/460000000044019/comments \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' ``` -------------------------------- ### Get User Details API Request Examples Source: https://www.zoho.com/billing/api/v1/introduction/#overview/projects This collection of code snippets demonstrates how to retrieve details of a specific user within a Zoho Billing project using various programming languages. All examples perform a GET request to the user endpoint, requiring an OAuth token for authorization and the organization ID in the headers. The required OAuth Scope is ZohoSubscriptions.projects.READ. ```Deluge headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/projects/460000000044019/users/460000000024003" type: GET headers: headers_data connection: ]; info response; ``` ```Java OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/billing/v1/projects/460000000044019/users/460000000024003") .get() .addHeader("X-com-zoho-subscriptions-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-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/billing/v1/projects/460000000044019/users/460000000024003', 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-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("GET", "/billing/v1/projects/460000000044019/users/460000000024003", 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": "/billing/v1/projects/460000000044019/users/460000000024003", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); ``` ```cURL curl --request GET \ --url https://www.zohoapis.com/billing/v1/projects/460000000044019/users/460000000024003 \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' ``` -------------------------------- ### Zoho Billing API v1 Documentation Navigation Source: https://www.zoho.com/billing/api/v1/introduction/#overview/addons This section provides a structured overview of the Zoho Billing API v1 documentation, detailing the main modules and their respective sub-sections, including authentication, resource management for items, products, plans, addons, coupons, and customers. ```APIDOC API Modules: - Introduction: - Overview - Organization ID - Multiple Data Centers - API Call Limit - OAuth: - Overview - Terminologies - Scopes - Step1: Registering New Client - Step2: Make the Authorization Request - Step3: Generating Access and Refresh Tokens - Step4: Refreshing Access Token - Step5: Revoking Refresh token - Step6: Calling An API - Token Validity - Enable Multi DC - HTTP Methods: - Overview - Response: - Overview - Errors: - Overview - Pagination: - Overview - Download API Collection: - Overview - Country & State Codes: - Overview - United States - United Arab Emirates - India - Canada - United Kingdom - Items: - Overview - Create an Item - List items - Update an item - Retrieve an item - Delete an item - Mark as active - Mark as inactive - Products: - Overview - Create a product - List of all products - Update a product - Retrieve a product - Delete a product - Mark as active - Mark as inactive - Plans: - Overview - Create a plan - List all plans - Update a plan - Retrieve a plan - Delete a plan - Mark as active - Mark as inactive - Addons: - Overview - Create an addon - List all addons - Update an addon - Retrieve an addon - Delete an addon - Mark as active - Mark as inactive - Coupons: - Overview - Create an coupon - List all coupons - Update a coupon - Retrieve a coupon - Delete a coupon - Mark as active - Mark as inactive - Customers: - Overview - Create a customer - List all customers - Update a customer - Retrieve a customer - Delete a customer ``` -------------------------------- ### Zoho Billing API Get Invoice Request Example with cURL Source: https://www.zoho.com/billing/api/v1/introduction/#overview/errors Example cURL command to retrieve a specific invoice from the Zoho Billing API, demonstrating the use of Authorization and Organization ID headers for authentication. ```curl $ curl https://www.zohoapis.com/billing/v1/invoices/700000007942 \ -H 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ -H 'X-com-zoho-subscriptions-organizationid: 10234695' ``` -------------------------------- ### Create Customer Request Example Source: https://www.zoho.com/billing/api/v1/introduction/#overview/customers Demonstrates how to make a POST request to the Zoho Billing API v1 to create a new customer, including required headers and a sample request body, across various programming languages. ```Deluge parameters_data='{"field1":"value1","field2":"value2"}'; headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/customers" type: POST headers: headers_data content-type: application/json parameters: parameters_data connection: ]; info response; ``` ```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/billing/v1/customers") .post(body) .addHeader("X-com-zoho-subscriptions-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute(); ``` ```Javascript const options = { method: 'POST', headers: { 'X-com-zoho-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f', 'content-type': 'application/json' }, body: '{"field1":"value1","field2":"value2"}' }; fetch('https://www.zohoapis.com/billing/v1/customers', 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") payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}" headers = { 'X-com-zoho-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", 'content-type': "application/json" } conn.request("POST", "/billing/v1/customers", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```Node.js const http = require("https"); const options = { "method": "POST", "hostname": "www.zohoapis.com", "port": null, "path": "/billing/v1/customers", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", "content-type": "application/json" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({field1: 'value1', field2: 'value2'})); req.end(); ``` ```cURL curl --request POST \ --url https://www.zohoapis.com/billing/v1/customers \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}' ``` ```JSON { "display_name": "Bowman Furniture", "salutation": "Mr.", "first_name": "Benjamin", "last_name": "George", "email": "benjamin.george@bowmanfurniture.com", "tags": [ { "tag_id": "460000000054182", "tag_option_id": "460000000054280" } ] } ``` -------------------------------- ### Retrieve Estimate Details via GET Request Source: https://www.zoho.com/billing/api/v1/introduction/#overview/quotes This section provides examples for making a GET request to retrieve details of a specific estimate using various programming languages. It demonstrates how to set required headers like 'X-com-zoho-subscriptions-organizationid' and 'Authorization' for authentication. ```Deluge headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/estimates/982000000567011" type: GET headers: headers_data connection: ]; info response; ``` ```Java OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/billing/v1/estimates/982000000567011") .get() .addHeader("X-com-zoho-subscriptions-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-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/billing/v1/estimates/982000000567011', 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-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("GET", "/billing/v1/estimates/982000000567011", 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": "/billing/v1/estimates/982000000567011", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); ``` ```cURL curl --request GET \ --url https://www.zohoapis.com/billing/v1/estimates/982000000567011 \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' ``` -------------------------------- ### Clone Project API Request Examples Source: https://www.zoho.com/billing/api/v1/introduction/#overview/projects Demonstrates how to make a POST request to clone an existing project using various programming languages. The examples include setting required headers like `X-com-zoho-subscriptions-organizationid` and `Authorization`, and sending a JSON request body. ```Deluge parameters_data='{"field1":"value1","field2":"value2"}'; headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/projects/460000000044019/clone" type: POST headers: headers_data content-type: application/json parameters: parameters_data connection: ]; info response; ``` ```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/billing/v1/projects/460000000044019/clone") .post(body) .addHeader("X-com-zoho-subscriptions-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute(); ``` ```Javascript const options = { method: 'POST', headers: { 'X-com-zoho-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f', 'content-type': 'application/json' }, body: '{"field1":"value1","field2":"value2"}' }; fetch('https://www.zohoapis.com/billing/v1/projects/460000000044019/clone', 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") payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}" headers = { 'X-com-zoho-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", 'content-type': "application/json" } conn.request("POST", "/billing/v1/projects/460000000044019/clone", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```Node.js const http = require("https"); const options = { "method": "POST", "hostname": "www.zohoapis.com", "port": null, "path": "/billing/v1/projects/460000000044019/clone", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", "content-type": "application/json" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({field1: 'value1', field2: 'value2'})); req.end(); ``` ```cURL curl --request POST \ --url https://www.zohoapis.com/billing/v1/projects/460000000044019/clone \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}' ``` -------------------------------- ### Zoho Billing v1 Subscriptions API Request Example Source: https://www.zoho.com/billing/api/v1/introduction/#overview/subscription This snippet provides examples of how to make a POST request to the Zoho Billing v1 subscriptions API endpoint using different programming languages. It demonstrates setting up request parameters, headers, and invoking the URL. ```Deluge parameters_data='{"field1":"value1","field2":"value2"}'; headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/subscriptions" type: POST headers: headers_data content-type: application/json parameters: parameters_data connection: ]; info response; ``` ```Java OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); ``` -------------------------------- ### Initiate Payment Refund API Request Examples Source: https://www.zoho.com/billing/api/v1/introduction/#overview/refunds Demonstrates how to make a POST request to the Zoho Billing API to refund a payment. Includes examples for Deluge, Java, Node.js, Javascript, Python, and cURL, showing how to set headers for authorization and organization ID, and include a JSON body. ```Deluge parameters_data='{"field1":"value1","field2":"value2"}'; headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/payments/90300000081385/refunds" type: POST headers: headers_data content-type: application/json parameters: parameters_data connection: ]; info response; ``` ```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/billing/v1/payments/90300000081385/refunds") .post(body) .addHeader("X-com-zoho-subscriptions-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute(); ``` ```Javascript const options = { method: 'POST', headers: { 'X-com-zoho-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f', 'content-type': 'application/json' }, body: '{"field1":"value1","field2":"value2"}' }; fetch('https://www.zohoapis.com/billing/v1/payments/90300000081385/refunds', 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") payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}" headers = { 'X-com-zoho-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", 'content-type': "application/json" } conn.request("POST", "/billing/v1/payments/90300000081385/refunds", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```Node.js const http = require("https"); const options = { "method": "POST", "hostname": "www.zohoapis.com", "port": null, "path": "/billing/v1/payments/90300000081385/refunds", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", "content-type": "application/json" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({field1: 'value1', field2: 'value2'})); req.end(); ``` ```cURL curl --request POST \ --url https://www.zohoapis.com/billing/v1/payments/90300000081385/refunds \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}' ``` -------------------------------- ### Make GET Request to Zoho Billing Estimates API Source: https://www.zoho.com/billing/api/v1/introduction/#overview/quotes This snippet demonstrates how to retrieve estimates from the Zoho Billing API using a GET request. It requires an organization ID and an OAuth token for authorization, which are passed in the request headers. Examples are provided for various programming languages. ```Deluge headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/estimates" type: GET headers: headers_data connection: ]; info response; ``` ```Java OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/billing/v1/estimates") .get() .addHeader("X-com-zoho-subscriptions-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-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/billing/v1/estimates', 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-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("GET", "/billing/v1/estimates", 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": "/billing/v1/estimates", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); ``` ```cURL curl --request GET \ --url https://www.zohoapis.com/billing/v1/estimates \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' ``` -------------------------------- ### Retrieve List of Taxes: API Request Examples Source: https://www.zoho.com/billing/api/v1/introduction/#overview/settings This section provides code examples for making a GET request to the Zoho Billing API to retrieve a list of taxes. The request requires an 'X-com-zoho-subscriptions-organizationid' header and an 'Authorization' header with a Zoho OAuth token. The OAuth scope 'ZohoSubscriptions.settings.READ' is required. ```Deluge headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/settings/taxes" type: GET headers: headers_data connection: ]; info response; ``` ```Java OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/billing/v1/settings/taxes") .get() .addHeader("X-com-zoho-subscriptions-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-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/billing/v1/settings/taxes', 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-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("GET", "/billing/v1/settings/taxes", 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": "/billing/v1/settings/taxes", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); ``` ```cURL curl --request GET \ --url https://www.zohoapis.com/billing/v1/settings/taxes \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' ``` -------------------------------- ### Zoho Subscriptions Get Running Timer API Response Source: https://www.zoho.com/billing/api/v1/introduction/#overview/time-entries This JSON example illustrates the successful response structure for the 'Get current running timer' API call. It provides detailed information about the active time entry, including project, customer, task, user, and time tracking details. ```JSON { "code": 0, "message": "success", "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": "" } } ``` -------------------------------- ### Zoho Billing API Introduction Source: https://www.zoho.com/billing/api/v1/introduction/#overview/hosted-pages Provides an overview of the Zoho Billing API v1, including essential details like organization ID, handling multiple data centers, and understanding API call limits. ```APIDOC Introduction: Overview Organization ID Multiple Data Centers API Call Limit ``` -------------------------------- ### Invite User to Project API Request Examples Source: https://www.zoho.com/billing/api/v1/introduction/#overview/projects Demonstrates how to send a POST request to invite a user to a specific project using the Zoho Billing API. Examples are provided for various programming languages, showing how to set headers for authorization and organization ID, and include a JSON payload in the request body. ```Deluge parameters_data='{"field1":"value1","field2":"value2"}'; headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/projects/460000000044019/users/invite" type: POST headers: headers_data content-type: application/json parameters: parameters_data connection: ]; info response; ``` ```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/billing/v1/projects/460000000044019/users/invite") .post(body) .addHeader("X-com-zoho-subscriptions-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute(); ``` ```Javascript const options = { method: 'POST', headers: { 'X-com-zoho-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f', 'content-type': 'application/json' }, body: '{"field1":"value1","field2":"value2"}' }; fetch('https://www.zohoapis.com/billing/v1/projects/460000000044019/users/invite', 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") payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}" headers = { 'X-com-zoho-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", 'content-type': "application/json" } conn.request("POST", "/billing/v1/projects/460000000044019/users/invite", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```Node.js const http = require("https"); const options = { "method": "POST", "hostname": "www.zohoapis.com", "port": null, "path": "/billing/v1/projects/460000000044019/users/invite", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", "content-type": "application/json" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({field1: 'value1', field2: 'value2'})); req.end(); ``` ```cURL curl --request POST \ --url https://www.zohoapis.com/billing/v1/projects/460000000044019/users/invite \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}' ``` -------------------------------- ### Retrieve Recurring Expenses API Request Examples Source: https://www.zoho.com/billing/api/v1/introduction/#overview/recurring-expenses These code examples demonstrate how to make a GET request to the Zoho Billing API v1 recurring expenses endpoint. They include the necessary headers for authentication and organization identification, showcasing implementations in Deluge, Java, Javascript, Python, Node.js, and cURL. ```Deluge headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/recurringexpenses" type: GET headers: headers_data connection: ]; info response; ``` ```Java OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/billing/v1/recurringexpenses") .get() .addHeader("X-com-zoho-subscriptions-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-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/billing/v1/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-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("GET", "/billing/v1/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": "/billing/v1/recurringexpenses", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); ``` ```cURL curl --request GET \ --url https://www.zohoapis.com/billing/v1/recurringexpenses \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' ``` -------------------------------- ### Example JSON for Project Object Source: https://www.zoho.com/billing/api/v1/introduction/#overview/projects Provides a sample JSON payload demonstrating the structure and typical values for a project object, including nested task and user arrays. ```JSON { "project_id": "460000000044019", "project_name": "REAL TIME TRAFFIC FLUX", "customer_id": "460000000044001", "customer_name": "SAF Instruments Inc", "currency_code": "USD", "description": "A simple algorithm is to be tested with vehicle detection application.", "status": "active", "billing_type": "fixed_cost_for_project", "rate": 5000, "budget_type": " ", "total_hours": "12:26", "total_amount": 500, "billed_hours": "12:27", "billed_amount": 500, "un_billed_hours": "00:00", "un_billed_amount": 0, "billable_hours": "12:26", "billable_amount": 500, "non_billable_hours": "0.00", "non_billable_amount": 0, "created_time": "2013-11-18T18:05:27+0530", "show_in_dashboard": true, "tasks": [ { "task_id": "460000000044009", "task_name": "Distribution Analysis", "description": "A simple algorithm is to be tested with vehicle detection application.", "rate": 5000, "budget_hours": "0", "total_hours": "12:26", "billed_hours": "12:27", "un_billed_hours": "00:00", "non_billable_hours": "0.00", "status": "active", "is_billable": true, "task_custom_fields": "" } ], "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", "total_hours": "12:26", "billed_hours": "12:27", "un_billed_hours": "00:00" } ] } ``` -------------------------------- ### Get Project Details via Zoho Subscriptions API Request Source: https://www.zoho.com/billing/api/v1/introduction/#overview/projects This snippet demonstrates how to make a GET request to retrieve the details of a specific project from the Zoho Subscriptions API. It requires the 'ZohoSubscriptions.projects.READ' OAuth Scope and includes examples for setting necessary headers like 'X-com-zoho-subscriptions-organizationid' and 'Authorization' (OAuth token). ```Deluge headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/projects/460000000044019" type: GET headers: headers_data connection: ]; info response; ``` ```Java OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/billing/v1/projects/460000000044019") .get() .addHeader("X-com-zoho-subscriptions-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-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/billing/v1/projects/460000000044019', 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-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("GET", "/billing/v1/projects/460000000044019", 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": "/billing/v1/projects/460000000044019", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); ``` ```cURL curl --request GET \ --url https://www.zohoapis.com/billing/v1/projects/460000000044019 \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' ``` -------------------------------- ### Retrieve Tax Authorities List via API Request Source: https://www.zoho.com/billing/api/v1/introduction/#overview/settings This collection of code examples demonstrates how to make a GET request to the Zoho Subscriptions API's `/billing/v1/settings/taxauthorities` endpoint. Authentication is handled using an OAuth token and an organization ID provided in the request headers. The examples cover various programming languages and command-line tools. ```Deluge headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/settings/taxauthorities" type: GET headers: headers_data connection: ]; info response; ``` ```Java OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/billing/v1/settings/taxauthorities") .get() .addHeader("X-com-zoho-subscriptions-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-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/billing/v1/settings/taxauthorities', 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-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("GET", "/billing/v1/settings/taxauthorities", 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": "/billing/v1/settings/taxauthorities", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); ``` ```cURL curl --request GET \ --url https://www.zohoapis.com/billing/v1/settings/taxauthorities \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' ``` -------------------------------- ### List All Customers API Request Examples Source: https://www.zoho.com/billing/api/v1/introduction/#overview/customers This section provides code examples for making a GET request to retrieve a list of all customers from the Zoho Billing API. The API supports filtering customers by various criteria, including their status (e.g., All, Active, Inactive, Gapps, Crm, NonSubscribers, PortalEnabled, PortalDisabled). Access requires the `ZohoSubscriptions.customers.READ` OAuth scope. ```Deluge headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/customers" type: GET headers: headers_data connection: ]; info response; ``` ```Java OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://www.zohoapis.com/billing/v1/customers") .get() .addHeader("X-com-zoho-subscriptions-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-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' } }; fetch('https://www.zohoapis.com/billing/v1/customers', 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-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } conn.request("GET", "/billing/v1/customers", 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": "/billing/v1/customers", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); ``` ```cURL curl --request GET \\ --url https://www.zohoapis.com/billing/v1/customers \\ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \\ --header 'X-com-zoho-subscriptions-organizationid: 10234695' ``` -------------------------------- ### Create Contact Person API Request Examples Source: https://www.zoho.com/billing/api/v1/introduction/#overview/contact-persons Demonstrates how to make a POST request to the Zoho Billing API to create a new contact person for a customer. Includes examples for various programming languages and cURL, showing how to set headers and the request body. ```Deluge parameters_data='{"field1":"value1","field2":"value2"}'; headers_data = Map(); headers_data.put("X-com-zoho-subscriptions-organizationid", "10234695"); headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://www.zohoapis.com/billing/v1/customers/903000000000099/contactpersons" type: POST headers: headers_data content-type: application/json parameters: parameters_data connection: ]; info response; ``` ```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/billing/v1/customers/903000000000099/contactpersons") .post(body) .addHeader("X-com-zoho-subscriptions-organizationid", "10234695") .addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute(); ``` ```Javascript const options = { method: 'POST', headers: { 'X-com-zoho-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f', 'content-type': 'application/json' }, body: '{"field1":"value1","field2":"value2"}' }; fetch('https://www.zohoapis.com/billing/v1/customers/903000000000099/contactpersons', 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") payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}" headers = { 'X-com-zoho-subscriptions-organizationid': "10234695", 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", 'content-type': "application/json" } conn.request("POST", "/billing/v1/customers/903000000000099/contactpersons", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```Node.js const http = require("https"); const options = { "method": "POST", "hostname": "www.zohoapis.com", "port": null, "path": "/billing/v1/customers/903000000000099/contactpersons", "headers": { "X-com-zoho-subscriptions-organizationid": "10234695", "Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", "content-type": "application/json" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({field1: 'value1', field2: 'value2'})); req.end(); ``` ```cURL curl --request POST \ --url https://www.zohoapis.com/billing/v1/customers/903000000000099/contactpersons \ --header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'X-com-zoho-subscriptions-organizationid: 10234695' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}' ``` -------------------------------- ### Retrieve List of Customers (cURL) Source: https://www.zoho.com/billing/api/v1/introduction/#overview/http-methods This cURL example demonstrates how to use the GET method to retrieve a list of all customers from the Zoho Billing API. It requires an OAuth token for authorization and an organization ID. ```Shell $ curl https://www.zohoapis.com/billing/v1/customers \ -H 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ -H 'X-com-zoho-subscriptions-organizationid: 10234695' ``` -------------------------------- ### Zoho Billing API v1 Introduction Source: https://www.zoho.com/billing/api/v1/introduction/#overview/projects This section introduces the core concepts of the Zoho Billing API v1, including an overview, details on organization ID, handling multiple data centers, and API call limits. ```APIDOC Introduction: Overview: /billing/api/v1/introduction/#overview Organization ID: /billing/api/v1/introduction/#organization-id Multiple Data Centers: /billing/api/v1/introduction/#multidc API Call Limit: /billing/api/v1/introduction/#api-call-limit ``` -------------------------------- ### Zoho Billing API: Introduction Source: https://www.zoho.com/billing/api/v1/introduction/#overview/apicollection Provides foundational information for interacting with the Zoho Billing API, including details on organization ID, multi-data center support, and API call limits. ```APIDOC Introduction: Overview Organization ID Multiple Data Centers API Call Limit ``` -------------------------------- ### Successful Response for Get List of Users API Source: https://www.zoho.com/billing/api/v1/introduction/#overview/projects An example of a successful JSON response (HTTP 200 OK) when retrieving the list of users for a project, detailing user properties like ID, name, email, and role. ```JSON { "code": 0, "message": "success", "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" }, {...}, {...} ] } ``` -------------------------------- ### Zoho Billing API v1 Addon Creation Request (Java) Source: https://www.zoho.com/billing/api/v1/introduction/#overview/addons Example Java (OkHttpClient) code to send a POST request to the Zoho Billing API v1 /addons endpoint, demonstrating how to set the request body and necessary 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/billing/v1/addons") .post(body) .addHeader("X-com-zoho-subscriptions-organizationid", "10234695") ``` -------------------------------- ### Get Customer Contact Persons API Response Source: https://www.zoho.com/billing/api/v1/introduction/#overview/contact-persons Example JSON response returned when successfully listing contact persons for a customer. It includes a list of contact person objects with their details such as ID, name, email, and phone numbers. ```APIDOC { "code": 0, "message": "success", "contact_persons": [ { "contactperson_id": "903000000053362", "first_name": "Mark", "last_name": "Cruizer", "email": "mark.cruzer@bowmanfurniture.com", "mobile": "786663728", "phone": "0417254482" }, {...}, {...} ] } ``` -------------------------------- ### Zoho Billing API v1 Time Entries Operations Source: https://www.zoho.com/billing/api/v1/introduction/#overview/invoices Describes API endpoints for managing time entries, including logging, listing, deleting, updating, retrieving, and controlling timers (start, stop, and get timer status). ```APIDOC Time Entries API: Overview Log time entries List time entries Delete time entries Update time entry Get a time entry Delete time entry Start timer Stop timer Get timer ``` -------------------------------- ### API Request Body Example for Create Addon Source: https://www.zoho.com/billing/api/v1/introduction/#overview/addons Illustrative JSON payload demonstrating the structure and required fields for creating a new addon via the Zoho Billing API's POST /addons endpoint. Includes details for pricing, tags, custom fields, and plan associations. ```JSON { "addon_code": "Email-basic", "name": "Email addon", "unit_name": "Email", "pricing_scheme": "tier", "price_brackets": [ { "start_quantity": 1, "end_quantity": 50, "price": 10 } ], "type": "recurring", "interval_unit": "monthly", "tags": [ { "tag_id": "460000000054182", "tag_option_id": "460000000054280" } ], "custom_fields": [ { "label": "cfitem", "value": "test" } ], "applicable_to_all_plans": false, "plans": [ { "plan_code": "basic-monthly" } ], "product_id": "903000000045027", "description": "The addon for additonal email support", "store_markup_description": "Mailbox Storage-100GB | User & Docs Storage-500GB | User", "tax_id": "903000000065300", "product_type": "goods", "hsn_or_sac": "74191010", "sat_item_key_code": "10128918", "unitkey_code": "Yh7", "item_tax_preferences": [ { "tax_specification": "intra", "tax_name": "GST", "tax_percentage": 10, "tax_id": "903000000065300" } ], "tax_exemption_id": "903000006345", "tax_exemption_code": "GST FREE" } ``` -------------------------------- ### Retrieve Specific Customer Details (cURL) Source: https://www.zoho.com/billing/api/v1/introduction/#overview/http-methods This cURL example shows how to use the GET method to retrieve the details of a specific customer by their unique customer_id from the Zoho Billing API. Authentication requires an OAuth token and organization ID. ```Shell $ curl https://www.zohoapis.com/billing/v1/customers/903000000000099 \ -H 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ -H 'X-com-zoho-subscriptions-organizationid: 10234695' ``` -------------------------------- ### Assign User to Project (Javascript Fetch API) Source: https://www.zoho.com/billing/api/v1/introduction/#overview/projects Javascript example using the Fetch API to assign a user to a project. It illustrates how to configure POST requests with headers and a JSON body, and how to handle the promise-based response. ```Javascript const options = { method: 'POST', headers: { 'X-com-zoho-subscriptions-organizationid': '10234695', Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f', 'content-type': 'application/json' }, body: '{"field1":"value1","field2":"value2"}' }; fetch('https://www.zohoapis.com/billing/v1/projects/460000000044019/users', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err)); ```