Api === Customers ```````````````````` The **Customers** API will be used to get, create, update and delete information of customers. Get Customers List ^^^^^^^^^^^^^^^^^^^^ **Request Method :** GET **Endpoint :** https://payinvoice.dailymails.org/mysite/api/v1/customers/?api_key={api_key} Parameters ----------------- .. list-table:: :widths: 10 20 20 20 :header-rows: 1 * - Name - Type - Description - Required * - | api_key - | String - | The api key of your account - | True Curl ------------------ .. code-block:: bash curl --location --request GET 'https://payinvoice.dailymails.org/mysite/api/v1/customers/?api_key=your_api_key' C# ------------------ .. code-block:: bash var client = new RestClient("https://payinvoice.dailymails.org/mysite/api/v1/customers/?api_key=your_api_key"); client.Timeout = -1; var request = new RestRequest(Method.GET); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content); Ruby ------------------ .. code-block:: bash require "uri" require "net/http" url = URI("https://payinvoice.dailymails.org/mysite/api/v1/customers/?api_key=your_api_key") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Get.new(url) response = https.request(request) puts response.read_body Java ----------------- .. code-block:: bash Unirest.setTimeouts(0, 0); HttpResponse response = Unirest.get("https://payinvoice.dailymails.org/mysite/api/v1/customers/?api_key=your_api_key") .asString(); Php --------------------------- .. code-block:: bash setUrl('https://payinvoice.dailymails.org/mysite/api/v1/customers/?api_key=your_api_key'); $request->setMethod(HTTP_Request2::METHOD_GET); $request->setConfig(array( 'follow_redirects' => TRUE )); try { $response = $request->send(); if ($response->getStatus() == 200) { echo $response->getBody(); } else { echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' . $response->getReasonPhrase(); } } catch(HTTP_Request2_Exception $e) { echo 'Error: ' . $e->getMessage(); } Python ------------------------- .. code-block:: bash import requests url = "https://payinvoice.dailymails.org/mysite/api/v1/customers/?api_key=your_api_key" payload={} headers = {} response = requests.request("GET", url, headers=headers, data=payload) print(response.text) Nodejs ----------------- .. code-block:: bash var request = require('request'); var options = { 'method': 'GET', 'url': 'https://payinvoice.dailymails.org/mysite/api/v1/customers/?api_key=your_api_key', 'headers': { } }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); }); Delete Customer ^^^^^^^^^^^^^^^^^^^^^^^^ **Request Method :** DELETE **Endpoint :** https://payinvoice.dailymails.org/mysite/api/v1/customers/{id}/?api_key={api_key} Parameters ------------------------- .. list-table:: :widths: 10 20 20 20 :header-rows: 1 * - Name - Type - Description - Required * - | api_key - | String - | The api key of your account - | True * - | id - | String - | Customer id which will be delete - | True Curl ------------------ .. code-block:: bash curl --location --request DELETE 'https://payinvoice.dailymails.org/mysite/api/v1/customers/{id}/?api_key=your_api_key' C# ------------------ .. code-block:: bash var client = new RestClient("https://payinvoice.dailymails.org/mysite/api/v1/customers/{id}/?api_key=your_api_key"); client.Timeout = -1; var request = new RestRequest(Method.DELETE); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content); Ruby ------------------ .. code-block:: bash require "uri" require "net/http" url = URI("https://payinvoice.dailymails.org/mysite/api/v1/customers/{id}/?api_key=your_api_key") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Delete.new(url) response = https.request(request) puts response.read_body Java ----------------- .. code-block:: bash Unirest.setTimeouts(0, 0); HttpResponse response = Unirest.delete("https://payinvoice.dailymails.org/mysite/api/v1/customers/{id}/?api_key=your_api_key") .asString(); Php --------------------------- .. code-block:: bash setUrl('https://payinvoice.dailymails.org/mysite/api/v1/customers/{id}/?api_key=your_api_key'); $request->setMethod(HTTP_Request2::METHOD_DELETE); $request->setConfig(array( 'follow_redirects' => TRUE )); try { $response = $request->send(); if ($response->getStatus() == 200) { echo $response->getBody(); } else { echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' . $response->getReasonPhrase(); } } catch(HTTP_Request2_Exception $e) { echo 'Error: ' . $e->getMessage(); } Python ------------------------- .. code-block:: bash import requests url = "https://payinvoice.dailymails.org/mysite/api/v1/customers/{id}/?api_key=your_api_key" payload={} headers = {} response = requests.request("DELETE", url, headers=headers, data=payload) print(response.text) Nodejs ----------------- .. code-block:: bash var request = require('request'); var options = { 'method': 'DELETE', 'url': 'https://payinvoice.dailymails.org/mysite/api/v1/customers/{id}/?api_key=your_api_key', 'headers': { } }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); }); Get Customer Detail ^^^^^^^^^^^^^^^^^^^^ **Request Method :** GET **Endpoint :** https://payinvoice.dailymails.org/mysite/api/v1/customers/{id}/?api_key={api_key} Parameters ------------------------- .. list-table:: :widths: 10 20 20 20 :header-rows: 1 * - NAME - Type - Description - Required * - | api_key - | String - | The api key of your account - | True * - | id - | String - | Customer id of your account - | True Curl ------------------ .. code-block:: bash curl --location --request GET 'https://payinvoice.dailymails.org/mysite/api/v1/customers/{id}/?api_key=your_api_key' C# ------------------ .. code-block:: bash var client = new RestClient("https://payinvoice.dailymails.org/mysite/api/v1/customers/{id}/?api_key=your_api_key"); client.Timeout = -1; var request = new RestRequest(Method.GET); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content); Ruby ------------------ .. code-block:: bash require "uri" require "net/http" url = URI("https://payinvoice.dailymails.org/mysite/api/v1/customers/{id}/?api_key=your_api_key") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Get.new(url) response = https.request(request) puts response.read_body Java ----------------- .. code-block:: bash Unirest.setTimeouts(0, 0); HttpResponse response = Unirest.get("https://payinvoice.dailymails.org/mysite/api/v1/customers/{id}/?api_key=your_api_key") .asString(); Php --------------------------- .. code-block:: bash setUrl('https://payinvoice.dailymails.org/mysite/api/v1/customers/{id}/?api_key=your_api_key'); $request->setMethod(HTTP_Request2::METHOD_GET); $request->setConfig(array( 'follow_redirects' => TRUE )); try { $response = $request->send(); if ($response->getStatus() == 200) { echo $response->getBody(); } else { echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' . $response->getReasonPhrase(); } } catch(HTTP_Request2_Exception $e) { echo 'Error: ' . $e->getMessage(); } Python ------------------------- .. code-block:: bash import requests url = "https://payinvoice.dailymails.org/mysite/api/v1/customers/{id}/?api_key=your_api_key" payload={} headers = {} response = requests.request("GET", url, headers=headers, data=payload) print(response.text) Nodejs ----------------- .. code-block:: bash var request = require('request'); var options = { 'method': 'GET', 'url': 'https://payinvoice.dailymails.org/mysite/api/v1/customers/{id}/?api_key=your_api_key', 'headers': { } }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); }); Create Customer ^^^^^^^^^^^^^^^^^^^^^^^^ **Request Method :** POST **Endpoint :** https://payinvoice.dailymails.org/mysite/api/v1/customers/?api_key={api_key} **Content-Type :** application/json Parameters ------------------------- .. list-table:: :widths: 10 20 20 20 :header-rows: 1 * - Name - Type - Description - Required * - | customer_type - | Integer - | 1 - Business, 2 - Individual - | True * - | first_name - | String - | Enter First name - | True * - | last_name - | String - | Enter Last name - | False * - | crn_number - | String - | Enter CRN Number - | False * - | company_name - | String - | Enter the Company name - | False * - | email - | String ( Valid Email Address) - | Enter The Email - | True * - | phone - | String - | Enter The Phone Number - | False * - | website - | String - | Enter The Website name - | False * - | billing_state - | String - | Enter The Billing state - | False * - | billing_city - | String - | Enter The Billing city - | False * - | billing_zipcode - | String - | Select Billing zipcode - | False * - | billing_address - | String - | Enter The Billing address - | False * - | currency - | Integer - | 0 - AUD, 1 - CAD, 2 - EUR, 3 - INR, 4 - USD, 5 - SAD - | False * - | payment_terms - | Integer - | 0 - NET15, 1 - NET30, 2 - NET45, 3 - NET60, 4 - Due End of the month, 5 - Due End of the next month - | False * - | enable_portal - | Boolean - | True/False - | False * - | portal_language - | Integer - | 0 - English - | False * - | shipping_state - | String - | Enter Shipping state - | False * - | shipping_city - | String - | Enter Shipping city - | False * - | shipping_zipcode - | String - | Enter The Shipping zipcode - | False * - | shipping_address - | String - | Enter The Shipping address - | False * - | billing_country - | Integer - | Select Billing country (1, 26 to 247) - | False * - | shipping_country - | String - | Select The Shipping country (1, 26 to 247) - | False Request Body ------------------------ .. code-block:: bash { "customer_type": 1, "first_name": "test", "last_name": null, "crn_number": null, "company_name": null, "email": "2@ws.com", "phone": "9818966660", "website": null, "billing_state": null, "billing_city": null, "billing_zipcode": null, "billing_address": null, "currency": 3, "payment_terms": 0, "enable_portal": false, "portal_language": 0, "shipping_state": null, "shipping_city": null, "shipping_zipcode": null, "shipping_address": null, "billing_country": 115, "shipping_country": 1 } Curl ----------- .. code-block:: bash curl --location --request POST 'https://payinvoice.dailymails.org/mysite/api/v1/customers/?api_key=your_api_key' \ --header 'Content-Type: application/json' \ --data-raw '{ "customer_type": 2, "first_name": "kamta", "last_name": "Singh", "crn_number": "CRN001", "company_name": "kambi", "email": "kamta.singh@gmail.com", "phone": "9818966660", "website": "abc.com", "billing_state": "UP", "billing_city": "Gzb", "billing_zipcode": 201012, "billing_address": "9/64", "currency": 2, "payment_terms": 1, "enable_portal": true, "portal_language": 0, "shipping_state": "UP", "shipping_city": "Gzb", "shipping_zipcode": 201012, "shipping_address": "9/64", "billing_country": 115, "shipping_country": 1 }' C# ----------- .. code-block:: bash var client = new RestClient("https://payinvoice.dailymails.org/mysite/api/v1/customers/?api_key=your_api_key"); client.Timeout = -1; var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); var body = @"{ " + "\n" + @" ""customer_type"": 2, " + "\n" + @" ""first_name"": ""kamta"", " + "\n" + @" ""last_name"": ""Singh"", " + "\n" + @" ""crn_number"": ""CRN001"", " + "\n" + @" ""company_name"": ""kambi"", " + "\n" + @" ""email"": ""kamta.singh@gmail.com"", " + "\n" + @" ""phone"": ""9818966660"", " + "\n" + @" ""website"": ""abc.com"", " + "\n" + @" ""billing_state"": ""UP"", " + "\n" + @" ""billing_city"": ""Gzb"", " + "\n" + @" ""billing_zipcode"": 201012, " + "\n" + @" ""billing_address"": ""9/64"", " + "\n" + @" ""currency"": 2, " + "\n" + @" ""payment_terms"": 1, " + "\n" + @" ""enable_portal"": true, " + "\n" + @" ""portal_language"": 0, " + "\n" + @" ""shipping_state"": ""UP"", " + "\n" + @" ""shipping_city"": ""Gzb"", " + "\n" + @" ""shipping_zipcode"": 201012, " + "\n" + @" ""shipping_address"": ""9/64"", " + "\n" + @" ""billing_country"": 115, " + "\n" + @" ""shipping_country"": 1 " + "\n" + @"}"; request.AddParameter("application/json", body, ParameterType.RequestBody); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content); Ruby ----------- .. code-block:: bash require "uri" require "json" require "net/http" url = URI("https://payinvoice.dailymails.org/mysite/api/v1/customers/?api_key=your_api_key") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "customer_type": 2, "first_name": "kamta", "last_name": "Singh", "crn_number": "CRN001", "company_name": "kambi", "email": "kamta.singh@gmail.com", "phone": "9818966660", "website": "abc.com", "billing_state": "UP", "billing_city": "Gzb", "billing_zipcode": 201012, "billing_address": "9/64", "currency": 2, "payment_terms": 1, "enable_portal": true, "portal_language": 0, "shipping_state": "UP", "shipping_city": "Gzb", "shipping_zipcode": 201012, "shipping_address": "9/64", "billing_country": 115, "shipping_country": 1 }) response = https.request(request) puts response.read_body Java ---------- .. code-block:: bash Unirest.setTimeouts(0, 0); HttpResponse response = Unirest.post("https://payinvoice.dailymails.org/mysite/api/v1/customers/?api_key=your_api_key") .header("Content-Type", "application/json") .body("{\r\n \"customer_type\": 2,\r\n \"first_name\": \"kamta\",\r\n \"last_name\": \"Singh\",\r\n \"crn_number\": \"CRN001\",\r\n \"company_name\": \"kambi\",\r\n \"email\": \"kamta.singh@gmail.com\",\r\n \"phone\": \"9818966660\",\r\n \"website\": \"abc.com\",\r\n \"billing_state\": \"UP\",\r\n \"billing_city\": \"Gzb\",\r\n \"billing_zipcode\": 201012,\r\n \"billing_address\": \"9/64\",\r\n \"currency\": 2,\r\n \"payment_terms\": 1,\r\n \"enable_portal\": true,\r\n \"portal_language\": 0,\r\n \"shipping_state\": \"UP\",\r\n \"shipping_city\": \"Gzb\",\r\n \"shipping_zipcode\": 201012,\r\n \"shipping_address\": \"9/64\",\r\n \"billing_country\": 115,\r\n \"shipping_country\": 1\r\n}") .asString(); Php ---------- .. code-block:: bash setUrl('https://payinvoice.dailymails.org/mysite/api/v1/customers/?api_key=your_api_key'); $request->setMethod(HTTP_Request2::METHOD_POST); $request->setConfig(array( 'follow_redirects' => TRUE )); $request->setHeader(array( 'Content-Type' => 'application/json' )); $request->setBody('{ \n "customer_type": 2, \n "first_name": "kamta", \n "last_name": "Singh", \n "crn_number": "CRN001", \n "company_name": "kambi", \n "email": "kamta.singh@gmail.com", \n "phone": "9818966660", \n "website": "abc.com", \n "billing_state": "UP", \n "billing_city": "Gzb", \n "billing_zipcode": 201012, \n "billing_address": "9/64", \n "currency": 2, \n "payment_terms": 1, \n "enable_portal": true, \n "portal_language": 0, \n "shipping_state": "UP", \n "shipping_city": "Gzb", \n "shipping_zipcode": 201012, \n "shipping_address": "9/64", \n "billing_country": 115, \n "shipping_country": 1 \n}'); try { $response = $request->send(); if ($response->getStatus() == 200) { echo $response->getBody(); } else { echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' . $response->getReasonPhrase(); } } catch(HTTP_Request2_Exception $e) { echo 'Error: ' . $e->getMessage(); } Python ------------------------ .. code-block:: bash import requests import json url = "https://payinvoice.dailymails.org/mysite/api/v1/customers/?api_key=your_api_key" payload = json.dumps({ "customer_type": 2, "first_name": "kamta", "last_name": "Singh", "crn_number": "CRN001", "company_name": "kambi", "email": "kamta.singh@gmail.com", "phone": "9818966660", "website": "abc.com", "billing_state": "UP", "billing_city": "Gzb", "billing_zipcode": 201012, "billing_address": "9/64", "currency": 2, "payment_terms": 1, "enable_portal": True, "portal_language": 0, "shipping_state": "UP", "shipping_city": "Gzb", "shipping_zipcode": 201012, "shipping_address": "9/64", "billing_country": 115, "shipping_country": 1 }) headers = { 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) Nodejs --------------------------- .. code-block:: bash var request = require('request'); var options = { 'method': 'POST', 'url': 'https://payinvoice.dailymails.org/mysite/api/v1/customers/?api_key=your_api_key', 'headers': { 'Content-Type': 'application/json' }, body: JSON.stringify({ "customer_type": 2, "first_name": "kamta", "last_name": "Singh", "crn_number": "CRN001", "company_name": "kambi", "email": "kamta.singh@gmail.com", "phone": "9818966660", "website": "abc.com", "billing_state": "UP", "billing_city": "Gzb", "billing_zipcode": 201012, "billing_address": "9/64", "currency": 2, "payment_terms": 1, "enable_portal": true, "portal_language": 0, "shipping_state": "UP", "shipping_city": "Gzb", "shipping_zipcode": 201012, "shipping_address": "9/64", "billing_country": 115, "shipping_country": 1 }) Update Customer ^^^^^^^^^^^^^^^^^^^^^^^^ **Request Method :** PUT **Endpoint :** https://payinvoice.dailymails.org/mysite/api/v1/customers/{id}/?api_key={api_key} **Content-Type :** application/json Parameters ------------------------- .. list-table:: :widths: 10 20 20 20 :header-rows: 1 * - Name - Type - Description - Required * - | customer_type - | Integer - | 1 - Business, 2 - Individual - | False * - | first_name - | String - | Enter First name - | False * - | last_name - | String - | Enter Last name - | False * - | crn_number - | String - | Enter CRN Number - | False * - | company_name - | String - | Enter the Company name - | False * - | email - | String ( Valid Email Address) - | Enter The Email - | True * - | phone - | String - | Enter The Phone Number - | False * - | website - | String - | Enter The Website name - | False * - | billing_state - | String - | Enter The Billing state - | False * - | billing_city - | String - | Enter The Billing city - | False * - | billing_zipcode - | String - | Select Billing zipcode - | False * - | billing_address - | String - | Enter The Billing address - | False * - | currency - | Integer - | 0 - AUD, 1 - CAD, 2 - EUR, 3 - INR, 4 - USD, 5 - SAD - | False * - | payment_terms - | Integer - | 0 - NET15, 1 - NET30, 2 - NET45, 3 - NET60, 4 - Due End of the month, 5 - Due End of the next month - | False * - | enable_portal - | Boolean - | True/False - | False * - | portal_language - | Integer - | 0 - English - | False * - | shipping_state - | String - | Enter Shipping state - | False * - | shipping_city - | String - | Enter Shipping city - | False * - | shipping_zipcode - | String - | Enter The Shipping zipcode - | False * - | shipping_address - | String - | Enter The Shipping address - | False * - | billing_country - | Integer - | Select Billing country (1, 26 to 247) - | False * - | shipping_country - | String - | Select The Shipping country (1, 26 to 247) - | False Request Body ------------------------ .. code-block:: bash { "customer_type": 1, "first_name": "test", "last_name": null, "crn_number": null, "company_name": null, "email": "2@ws.com", "phone": "9818966660", "website": null, "billing_state": null, "billing_city": null, "billing_zipcode": null, "billing_address": null, "currency": 3, "payment_terms": 0, "enable_portal": false, "portal_language": 0, "shipping_state": null, "shipping_city": null, "shipping_zipcode": null, "shipping_address": null, "billing_country": 115, "shipping_country": 1 } Curl -------------------------- .. code-block:: bash curl --location --request PUT 'https://payinvoice.dailymails.org/mysite/api/v1/customers/{id}/?api_key=your_api_key' \ --header 'Content-Type: application/json' \ --data-raw '{ "customer_type": 1, "email": "kamta.singh1@gmail.com" }' C# ----------------------- .. code-block:: bash var client = new RestClient("https://payinvoice.dailymails.org/mysite/api/v1/customers/{id}/?api_key=your_api_key"); client.Timeout = -1; var request = new RestRequest(Method.PUT); request.AddHeader("Content-Type", "application/json"); var body = @"{ " + "\n" + @" ""customer_type"": 1, " + "\n" + @" ""email"": ""kamta.singh1@gmail.com"" " + "\n" + @" " + "\n" + @"}"; request.AddParameter("application/json", body, ParameterType.RequestBody); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content); Ruby ----------------------- .. code-block:: bash require "uri" require "json" require "net/http" url = URI("https://payinvoice.dailymails.org/mysite/api/v1/customers/{id}/?api_key=your_api_key") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Put.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "customer_type": 1, "email": "kamta.singh1@gmail.com" }) response = https.request(request) puts response.read_body JAVA ----------------------- .. code-block:: bash Unirest.setTimeouts(0, 0); HttpResponse response = Unirest.put("https://payinvoice.dailymails.org/mysite/api/v1/customers/{id}/?api_key=your_api_key") .header("Content-Type", "application/json") .body("{\r\n \"customer_type\": 1,\r\n \"email\": \"kamta.singh1@gmail.com\"\r\n \r\n}") .asString(); Php --------------------------- .. code-block:: bash setUrl('https://payinvoice.dailymails.org/mysite/api/v1/customers/{id}/?api_key=your_api_key'); $request->setMethod(HTTP_Request2::METHOD_PUT); $request->setConfig(array( 'follow_redirects' => TRUE )); $request->setHeader(array( 'Content-Type' => 'application/json' )); $request->setBody('{ \n "customer_type": 1, \n "email": "kamta.singh1@gmail.com" \n \n}'); try { $response = $request->send(); if ($response->getStatus() == 200) { echo $response->getBody(); } else { echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' . $response->getReasonPhrase(); } } catch(HTTP_Request2_Exception $e) { echo 'Error: ' . $e->getMessage(); } Python -------------------------- .. code-block:: bash import requests import json url = "https://payinvoice.dailymails.org/mysite/api/v1/customers/{id}/?api_key=your_api_key" payload = json.dumps({ "customer_type": 1, "email": "kamta.singh1@gmail.com" }) headers = { 'Content-Type': 'application/json' } response = requests.request("PUT", url, headers=headers, data=payload) print(response.text) Nodejs -------------------------- .. code-block:: bash var request = require('request'); var options = { 'method': 'PUT', 'url': 'https://payinvoice.dailymails.org/mysite/api/v1/customers/{id}/?api_key=your_api_key', 'headers': { 'Content-Type': 'application/json' }, body: JSON.stringify({ "customer_type": 1, "email": "kamta.singh1@gmail.com" }) }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); }); Products ````````````` The **PRODUCTS** API will be used to get, create, update and delete information of products. Get Products List ^^^^^^^^^^^^^^^^^^^^^^ **Request Method :** GET **Endpoint :** https://payinvoice.dailymails.org/mysite/api/v1/products/?api_key={api_key} PARAMETERS ------------------------- .. list-table:: :widths: 10 20 20 20 :header-rows: 1 * - Name - Type - Description - Required * - | api_key - | String - | The api key of your account - | True Curl ------------------ .. code-block:: bash curl --location --request GET 'https://payinvoice.dailymails.org/mysite/api/v1/products/?api_key=your_api_key' C# ------------------ .. code-block:: bash var client = new RestClient("https://payinvoice.dailymails.org/mysite/api/v1/products/?api_key=your_api_key"); client.Timeout = -1; var request = new RestRequest(Method.GET); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content); Ruby ------------------ .. code-block:: bash require "uri" require "net/http" url = URI("https://payinvoice.dailymails.org/mysite/api/v1/products/?api_key=your_api_key") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Get.new(url) response = https.request(request) puts response.read_body Java ----------------- .. code-block:: bash Unirest.setTimeouts(0, 0); HttpResponse response = Unirest.get("https://payinvoice.dailymails.org/mysite/api/v1/products/?api_key=your_api_key") .asString(); Php --------------------------- .. code-block:: bash setUrl('https://payinvoice.dailymails.org/mysite/api/v1/products/?api_key=your_api_key'); $request->setMethod(HTTP_Request2::METHOD_GET); $request->setConfig(array( 'follow_redirects' => TRUE )); try { $response = $request->send(); if ($response->getStatus() == 200) { echo $response->getBody(); } else { echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' . $response->getReasonPhrase(); } } catch(HTTP_Request2_Exception $e) { echo 'Error: ' . $e->getMessage(); } Python ------------------------- .. code-block:: bash import requests url = "https://payinvoice.dailymails.org/mysite/api/v1/products/?api_key=your_api_key" payload={} headers = {} response = requests.request("GET", url, headers=headers, data=payload) print(response.text) Nodejs ----------------- .. code-block:: bash var request = require('request'); var options = { 'method': 'GET', 'url': 'https://payinvoice.dailymails.org/mysite/api/v1/products/?api_key=your_api_key', 'headers': { } }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); }); Delete Product ^^^^^^^^^^^^^^^^^^^^^^^^ **Request Method :** DELETE **Endpoint :** https://payinvoice.dailymails.org/mysite/api/v1/products/{id}/?api_key=your_api_key Parameters ------------------------- .. list-table:: :widths: 10 20 20 20 :header-rows: 1 * - Name - Type - Description - Required * - | api_key - | String - | The api key of your account - | True * - | id - | String - | Product id which will be delete - | True Curl ------------------ .. code-block:: bash curl --location --request DELETE 'https://payinvoice.dailymails.org/mysite/api/v1/products/{id}/?api_key=your_api_key' C# ------------------ .. code-block:: bash var client = new RestClient("https://payinvoice.dailymails.org/mysite/api/v1/products/{id}/?api_key=your_api_key"); client.Timeout = -1; var request = new RestRequest(Method.DELETE); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content); Ruby ------------------ .. code-block:: bash require "uri" require "net/http" url = URI("https://payinvoice.dailymails.org/mysite/api/v1/products/{id}/?api_key=your_api_key") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Delete.new(url) response = https.request(request) puts response.read_body Java ----------------- .. code-block:: bash Unirest.setTimeouts(0, 0); HttpResponse response = Unirest.delete("https://payinvoice.dailymails.org/mysite/api/v1/products/{id}/?api_key=your_api_key") .asString(); Php --------------------------- .. code-block:: bash setUrl('https://payinvoice.dailymails.org/mysite/api/v1/products/{id}/?api_key=your_api_key'); $request->setMethod(HTTP_Request2::METHOD_DELETE); $request->setConfig(array( 'follow_redirects' => TRUE )); try { $response = $request->send(); if ($response->getStatus() == 200) { echo $response->getBody(); } else { echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' . $response->getReasonPhrase(); } } catch(HTTP_Request2_Exception $e) { echo 'Error: ' . $e->getMessage(); } Python ------------------------- .. code-block:: bash import requests url = "https://payinvoice.dailymails.org/mysite/api/v1/products/{id}/?api_key=your_api_key" payload={} headers = {} response = requests.request("DELETE", url, headers=headers, data=payload) print(response.text) Nodejs ----------------- .. code-block:: bash var request = require('request'); var options = { 'method': 'DELETE', 'url': 'https://payinvoice.dailymails.org/mysite/api/v1/products/{id}/?api_key=your_api_key', 'headers': { } }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); }); Get Product Details ^^^^^^^^^^^^^^^^^^^^^^ **Request Method :** GET **Endpoint :** https://payinvoice.dailymails.org/mysite/api/v1/products/{id}/?api_key={api_key} Parameters ------------------------- .. list-table:: :widths: 10 20 20 20 :header-rows: 1 * - Name - Type - Description - Required * - | api_key - | String - | The api key of your account - | True * - | id - | String - | Product id of your account - | True Curl ------------------ .. code-block:: bash curl --location --request GET 'https://payinvoice.dailymails.org/mysite/api/v1/products/{id}/?api_key=your_api_key' C# ------------------ .. code-block:: bash var client = new RestClient("https://payinvoice.dailymails.org/mysite/api/v1/products/{id}/?api_key=your_api_key"); client.Timeout = -1; var request = new RestRequest(Method.GET); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content); Ruby ------------------ .. code-block:: bash require "uri" require "net/http" url = URI("https://payinvoice.dailymails.org/mysite/api/v1/products/{id}/?api_key=your_api_key") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Get.new(url) response = https.request(request) puts response.read_body Java ----------------- .. code-block:: bash Unirest.setTimeouts(0, 0); HttpResponse response = Unirest.get("https://payinvoice.dailymails.org/mysite/api/v1/products/{id}/?api_key=your_api_key") .asString(); Php --------------------------- .. code-block:: bash setUrl('https://payinvoice.dailymails.org/mysite/api/v1/products/{id}/?api_key=your_api_key'); $request->setMethod(HTTP_Request2::METHOD_GET); $request->setConfig(array( 'follow_redirects' => TRUE )); try { $response = $request->send(); if ($response->getStatus() == 200) { echo $response->getBody(); } else { echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' . $response->getReasonPhrase(); } } catch(HTTP_Request2_Exception $e) { echo 'Error: ' . $e->getMessage(); } Python ------------------------- .. code-block:: bash import requests url = "https://payinvoice.dailymails.org/mysite/api/v1/products/{id}/?api_key=your_api_key" payload={} headers = {} response = requests.request("GET", url, headers=headers, data=payload) print(response.text) Nodejs ----------------- .. code-block:: bash var request = require('request'); var options = { 'method': 'GET', 'url': 'https://payinvoice.dailymails.org/mysite/api/v1/products/{id}/?api_key=your_api_key', 'headers': { } }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); }); Create Product ^^^^^^^^^^^^^^^^^^^^^^^^ **Request Method :** POST **Endpoint :** https://payinvoice.dailymails.org/mysite/api/v1/products/?api_key={api_key} **Content-Type :** application/json Parameters ------------------------- .. list-table:: :widths: 10 20 20 20 :header-rows: 1 * - Name - Type - Description - Required * - | product_type - | Integer - | 0 -'Goods', 1 -'Services' - | False * - | name - | String - | Enter Name - | True * - | unit - | Integer - | 0 -'m', 1 - 'cm', 2 - 'gm', 3 - 'kg', 4 - 'pc', 5 - 'dozen', 6 -'units' - | False * - | selling_price - | String - | Enter the Selling price - | True * - | sku - | String - | Enter The Sku - | False * - | description - | String - | Enter The Description - | False Request Body ------------------ .. code-block:: bash { "product_type": 1, "name": "testapiprodut", "unit": 1, "selling_price": "12.00", "sku": "testapiprodut", "description": "this is test api call" } Curl ------------------ .. code-block:: bash curl --location --request POST 'https://payinvoice.dailymails.org/mysite/api/v1/products/?api_key=your_api_key' \ --header 'Content-Type: application/json' \ --data-raw '{ "product_type": 1, "name": "testapiprodut", "unit": 1, "selling_price": "12.00", "sku": "testapiprodut", "description": "this is test api call" }' C# ------------------ .. code-block:: bash var client = new RestClient("https://payinvoice.dailymails.org/mysite/api/v1/products/?api_key=your_api_key"); client.Timeout = -1; var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); var body = @"{ " + "\n" + @" ""product_type"": 1, " + "\n" + @" ""name"": ""testapiprodut"", " + "\n" + @" ""unit"": 1, " + "\n" + @" ""selling_price"": ""12.00"", " + "\n" + @" ""sku"": ""testapiprodut"", " + "\n" + @" ""description"": ""this is test api call"" " + "\n" + @"}"; request.AddParameter("application/json", body, ParameterType.RequestBody); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content); Ruby ------------------ .. code-block:: bash require "uri" require "json" require "net/http" url = URI("https://payinvoice.dailymails.org/mysite/api/v1/products/?api_key=your_api_key") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "product_type": 1, "name": "testapiprodut", "unit": 1, "selling_price": "12.00", "sku": "testapiprodut", "description": "this is test api call" }) response = https.request(request) puts response.read_body Java ----------------- .. code-block:: bash Unirest.setTimeouts(0, 0); HttpResponse response = Unirest.post("https://payinvoice.dailymails.org/mysite/api/v1/products/?api_key=your_api_key") .header("Content-Type", "application/json") .body("{\r\n \"product_type\": 1,\r\n \"name\": \"testapiprodut\",\r\n \"unit\": 1,\r\n \"selling_price\": \"12.00\",\r\n \"sku\": \"testapiprodut\",\r\n \"description\": \"this is test api call\"\r\n}") .asString(); Php --------------------------- .. code-block:: bash setUrl('https://payinvoice.dailymails.org/mysite/api/v1/products/?api_key=your_api_key'); $request->setMethod(HTTP_Request2::METHOD_POST); $request->setConfig(array( 'follow_redirects' => TRUE )); $request->setHeader(array( 'Content-Type' => 'application/json' )); $request->setBody('{ \n "product_type": 1, \n "name": "testapiprodut", \n "unit": 1, \n "selling_price": "12.00", \n "sku": "testapiprodut", \n "description": "this is test api call" \n}'); try { $response = $request->send(); if ($response->getStatus() == 200) { echo $response->getBody(); } else { echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' . $response->getReasonPhrase(); } } catch(HTTP_Request2_Exception $e) { echo 'Error: ' . $e->getMessage(); } Python ---------------------- .. code-block:: bash import requests import json url = "https://payinvoice.dailymails.org/mysite/api/v1/products/?api_key=your_api_key" payload = json.dumps({ "product_type": 1, "name": "testapiprodut", "unit": 1, "selling_price": "12.00", "sku": "testapiprodut", "description": "this is test api call" }) headers = { 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) Nodejs ------------------ .. code-block:: bash var request = require('request'); var options = { 'method': 'POST', 'url': 'https://payinvoice.dailymails.org/mysite/api/v1/products/?api_key=your_api_key', 'headers': { 'Content-Type': 'application/json' }, body: JSON.stringify({ "product_type": 1, "name": "testapiprodut", "unit": 1, "selling_price": "12.00", "sku": "testapiprodut", "description": "this is test api call" }) }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); }); Update Product ^^^^^^^^^^^^^^^^^^^^^^^^ **Request Method :** PUT **Endpoint :** https://payinvoice.dailymails.org/mysite/api/v1/products/{id}/?api_key={api_key} **Content-Type :** application/json Parameters ------------------------- .. list-table:: :widths: 10 20 20 20 :header-rows: 1 * - Name - Type - Description - Required * - | product_type - | Integer - | 0 -'Goods', 1 -'Services' - | False * - | name - | String - | Enter Name - | True * - | Unit - | Integer - | 0 -'m', 1 - 'cm', 2 - 'gm', 3 - 'kg', 4 - 'pc', 5 - 'dozen', 6 -'units' - | False * - | selling_price - | String - | Enter the Selling price - | True * - | sku - | String - | Enter The Sku - | False * - | description - | String - | Enter The Description - | False Curl -------------------------- .. code-block:: bash curl --location --request PUT 'https://payinvoice.dailymails.org/mysite/api/v1/products/{id}/?api_key=your_api_key' \ --header 'Content-Type: application/json' \ --data-raw '{ "name": "testapiprodut1", "unit": 2, "selling_price": "13.00" }' C# ----------------------- .. code-block:: bash var client = new RestClient("https://payinvoice.dailymails.org/mysite/api/v1/products/{id}/?api_key=your_api_key"); client.Timeout = -1; var request = new RestRequest(Method.PUT); request.AddHeader("Content-Type", "application/json"); var body = @"{ " + "\n" + @" ""name"": ""testapiprodut1"", " + "\n" + @" ""unit"": 2, " + "\n" + @" ""selling_price"": ""13.00"" " + "\n" + @" " + "\n" + @"}"; request.AddParameter("application/json", body, ParameterType.RequestBody); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content); Ruby ----------------------- .. code-block:: bash require "uri" require "json" require "net/http" url = URI("https://payinvoice.dailymails.org/mysite/api/v1/products/{id}/?api_key=your_api_key") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Put.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "name": "testapiprodut1", "unit": 2, "selling_price": "13.00" }) response = https.request(request) puts response.read_body Java ----------------------- .. code-block:: bash Unirest.setTimeouts(0, 0); HttpResponse response = Unirest.put("https://payinvoice.dailymails.org/mysite/api/v1/products/{id}/?api_key=your_api_key") .header("Content-Type", "application/json") .body("{\r\n \"name\": \"testapiprodut1\",\r\n \"unit\": 2,\r\n \"selling_price\": \"13.00\"\r\n \r\n}") .asString(); Php --------------------------- .. code-block:: bash setUrl('https://payinvoice.dailymails.org/mysite/api/v1/products/{id}/?api_key=your_api_key'); $request->setMethod(HTTP_Request2::METHOD_PUT); $request->setConfig(array( 'follow_redirects' => TRUE )); $request->setHeader(array( 'Content-Type' => 'application/json' )); $request->setBody('{ \n "name": "testapiprodut1", \n "unit": 2, \n "selling_price": "13.00" \n \n}'); try { $response = $request->send(); if ($response->getStatus() == 200) { echo $response->getBody(); } else { echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' . $response->getReasonPhrase(); } } catch(HTTP_Request2_Exception $e) { echo 'Error: ' . $e->getMessage(); } Python -------------------------- .. code-block:: bash import requests import json url = "https://payinvoice.dailymails.org/mysite/api/v1/products/{id}/?api_key=your_api_key" payload = json.dumps({ "name": "testapiprodut1", "unit": 2, "selling_price": "13.00" }) headers = { 'Content-Type': 'application/json' } response = requests.request("PUT", url, headers=headers, data=payload) print(response.text) Nodejs -------------------------- .. code-block:: bash var request = require('request'); var options = { 'method': 'PUT', 'url': 'https://payinvoice.dailymails.org/mysite/api/v1/products/{id}/?api_key=your_api_key', 'headers': { 'Content-Type': 'application/json' }, body: JSON.stringify({ "name": "testapiprodut1", "unit": 2, "selling_price": "13.00" }) }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); }); Invoice & Estimates ```````````````````` The **Invoice & Estimates** API will be used to get, create, update and delete information of invoice & estimates. Get Invoices list ^^^^^^^^^^^^^^^^^ **Request Method :** GET **Endpoint :** https://payinvoice.dailymails.org/mysite/api/v1/invoices/?api_key={api_key} Parameters ------------------------- .. list-table:: :widths: 10 20 20 20 :header-rows: 1 * - Name - Type - Description - Required * - | api_key - | String - | The api key of your account - | True Curl ------------------ .. code-block:: bash curl --location --request GET 'https://payinvoice.dailymails.org/mysite/api/v1/invoices/?api_key=your_api_key' C# ------------------ .. code-block:: bash var client = new RestClient("https://payinvoice.dailymails.org/mysite/api/v1/invoices/?api_key=your_api_key"); client.Timeout = -1; var request = new RestRequest(Method.GET); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content); Ruby ------------------ .. code-block:: bash require "uri" require "net/http" url = URI("https://payinvoice.dailymails.org/mysite/api/v1/invoices/?api_key=your_api_key") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Get.new(url) response = https.request(request) puts response.read_body Java ----------------- .. code-block:: bash Unirest.setTimeouts(0, 0); HttpResponse response = Unirest.get("https://payinvoice.dailymails.org/mysite/api/v1/invoices/?api_key=your_api_key") .asString(); Php --------------------------- .. code-block:: bash setUrl('https://payinvoice.dailymails.org/mysite/api/v1/invoices/?api_key=your_api_key'); $request->setMethod(HTTP_Request2::METHOD_GET); $request->setConfig(array( 'follow_redirects' => TRUE )); try { $response = $request->send(); if ($response->getStatus() == 200) { echo $response->getBody(); } else { echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' . $response->getReasonPhrase(); } } catch(HTTP_Request2_Exception $e) { echo 'Error: ' . $e->getMessage(); } Python ------------------------- .. code-block:: bash import requests url = "https://payinvoice.dailymails.org/mysite/api/v1/invoices/?api_key=your_api_key" payload={} headers = {} response = requests.request("GET", url, headers=headers, data=payload) print(response.text) Nodejs ----------------- .. code-block:: bash var request = require('request'); var options = { 'method': 'GET', 'url': 'https://payinvoice.dailymails.org/mysite/api/v1/invoices/?api_key=your_api_key', 'headers': { } }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); }); Delete Invoice ^^^^^^^^^^^^^^^^^^^^^^^^ **Request Method :** DELETE **Endpoint :** https://payinvoice.dailymails.org/mysite/api/v1/invoices/{id}/?api_key={api_key} Parameters ------------------------- .. list-table:: :widths: 10 20 20 20 :header-rows: 1 * - NAME - Type - Description - Required * - | api_key - | String - | The api key of your account - | True * - | id - | String - | Invoice id which will be delete - | True Curl ------------------ .. code-block:: bash curl --location --request DELETE 'https://payinvoice.dailymails.org/mysite/api/v1/invoices/{id}/?api_key=your_api_key' C# ------------------ .. code-block:: bash var client = new RestClient("https://payinvoice.dailymails.org/mysite/api/v1/invoices/{id}/?api_key=your_api_key"); client.Timeout = -1; var request = new RestRequest(Method.DELETE); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content); Ruby ------------------ .. code-block:: bash require "uri" require "net/http" url = URI("https://payinvoice.dailymails.org/mysite/api/v1/invoices/{id}/?api_key=your_api_key") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Delete.new(url) response = https.request(request) puts response.read_body Java ----------------- .. code-block:: bash Unirest.setTimeouts(0, 0); HttpResponse response = Unirest.delete("https://payinvoice.dailymails.org/mysite/api/v1/invoices/{id}/?api_key=your_api_key") .asString(); Php --------------------------- .. code-block:: bash setUrl('https://payinvoice.dailymails.org/mysite/api/v1/invoices/{id}/?api_key=your_api_key'); $request->setMethod(HTTP_Request2::METHOD_DELETE); $request->setConfig(array( 'follow_redirects' => TRUE )); try { $response = $request->send(); if ($response->getStatus() == 200) { echo $response->getBody(); } else { echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' . $response->getReasonPhrase(); } } catch(HTTP_Request2_Exception $e) { echo 'Error: ' . $e->getMessage(); } Python ------------------------- .. code-block:: bash import requests url = "https://payinvoice.dailymails.org/mysite/api/v1/invoices/{id}/?api_key=your_api_key" payload={} headers = {} response = requests.request("DELETE", url, headers=headers, data=payload) print(response.text) Nodejs ----------------- .. code-block:: bash var request = require('request'); var options = { 'method': 'DELETE', 'url': 'https://payinvoice.dailymails.org/mysite/api/v1/invoices/{id}/?api_key=your_api_key', 'headers': { } }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); }); Get Invoice Details ^^^^^^^^^^^^^^^^^^^^^^^^ **Request Method :** GET **Endpoint :** https://payinvoice.dailymails.org/mysite/api/v1/invoices/{id}/?api_key={api_key} Parameters ------------------------- .. list-table:: :widths: 10 20 20 20 :header-rows: 1 * - NAME - Type - Description - Required * - | api_key - | String - | The api key of your account - | True * - | id - | String - | Invoice id of your account - | True Curl ------------------ .. code-block:: bash curl --location --request GET 'https://payinvoice.dailymails.org/mysite/api/v1/invoices/{id}/?api_key=your_api_key' C# ------------------ .. code-block:: bash var client = new RestClient("https://payinvoice.dailymails.org/mysite/api/v1/invoices/{id}/?api_key=your_api_key"); client.Timeout = -1; var request = new RestRequest(Method.GET); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content); Ruby ------------------ .. code-block:: bash require "uri" require "net/http" url = URI("https://payinvoice.dailymails.org/mysite/api/v1/invoices/{id}/?api_key=your_api_key") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Get.new(url) response = https.request(request) puts response.read_body Java ----------------- .. code-block:: bash Unirest.setTimeouts(0, 0); HttpResponse response = Unirest.get("https://payinvoice.dailymails.org/mysite/api/v1/invoices/{id}/?api_key=your_api_key") .asString(); Php --------------------------- .. code-block:: bash setUrl('https://payinvoice.dailymails.org/mysite/api/v1/invoices/{id}/?api_key=your_api_key'); $request->setMethod(HTTP_Request2::METHOD_GET); $request->setConfig(array( 'follow_redirects' => TRUE )); try { $response = $request->send(); if ($response->getStatus() == 200) { echo $response->getBody(); } else { echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' . $response->getReasonPhrase(); } } catch(HTTP_Request2_Exception $e) { echo 'Error: ' . $e->getMessage(); } Python ------------------------- .. code-block:: bash import requests url = "https://payinvoice.dailymails.org/mysite/api/v1/invoices/{id}/?api_key=your_api_key" payload={} headers = {} response = requests.request("GET", url, headers=headers, data=payload) print(response.text) Nodejs ----------------- .. code-block:: bash var request = require('request'); var options = { 'method': 'GET', 'url': 'https://payinvoice.dailymails.org/mysite/api/v1/invoices/{id}/?api_key=your_api_key', 'headers': { } }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); }); Create Invoice ^^^^^^^^^^^^^^^^^^^ **Request Method :** POST **Endpoint :** https://payinvoice.dailymails.org/mysite/api/v1/invoices/?api_key={api_key} **Content-Type :** application/json Parameters ------------------------- .. list-table:: :widths: 10 20 20 20 :header-rows: 1 * - Name - Type - Description - Required * - | invoice_number - | String - | Enter Invoice number - | True * - | order_number - | String - | Enter Order number - | False * - | invoice_date - | String - | Enter Invoice date in format "YYYY-MM-DD" - | True * - | terms - | Integer - | 0 - NET15, 1 - NET30, 2 - NET45, 3 - NET60, 4 - Due End of the month, 5 - Due End of the next month, 6 - Due on Receipt, 7 - Custom - | False * - | due_date - | String - | Enter Due date in format "YYYY-MM-DD" - | True * - | subject - | String - | Enter Subject - | False * - | status - | String - | 0 - Draft, 1 - Sent, 2 - Paid - | False * - | invoice_type - | Integer - | 1 - Invoice, 2 - Estimates - | False * - | customer - | Integer - | Get Customer ID from CustomerList API - | True * - | productinvoices - | List - | Invoice Items List of Dictionary - | True * - | products - | Integer - | Get products ID from products List API - | True * - | quantity - | String - | Enter Product quantity - | True * - | rate - | String - | Enter Products rate - | True * - | discount - | String - | Enter Products Discount - | True * - | discount_unit - | Integer - | 0 - '%', 1 - 'Amount' - | True Request Body ------------------- .. code-block:: bash { "productinvoices": [ { "quantity": "1.00", "rate": "11.00", "discount": "5", "discount_unit": 1, "products": 41 } ], "invoice_number": "123TESTAPI", "order_number": "123TESTAPI", "invoice_date": "2021-12-29", "terms": 0, "due_date": "2022-1-2", "subject": "hjdhjdhjd", "status": 0, "invoice_type": 1, "is_recurring_invoices": true, "customer": 39 } Curl -------------------- .. code-block:: bash curl --location --request POST 'https://payinvoice.dailymails.org/mysite/api/v1/invoices/?api_key=your_api_key' \ --header 'Content-Type: application/json' \ --data-raw '{ "productinvoices": [ { "quantity": "1.00", "rate": "11.00", "discount": "5", "discount_unit": 1, "products": 41 } ], "invoice_number": "123TESTAPI", "order_number": "123TESTAPI", "invoice_date": "2021-12-29", "terms": 0, "due_date": "2022-1-2", "subject": "hjdhjdhjd", "status": 0, "invoice_type": 1, "is_recurring_invoices": true, "customer": 39 }' C# -------------------- .. code-block:: bash var client = new RestClient("https://payinvoice.dailymails.org/mysite/api/v1/invoices/?api_key=your_api_key"); client.Timeout = -1; var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); var body = @"{ " + "\n" + @" ""productinvoices"": [ " + "\n" + @" { " + "\n" + @" ""quantity"": ""1.00"", " + "\n" + @" ""rate"": ""11.00"", " + "\n" + @" ""discount"": ""5"", " + "\n" + @" ""discount_unit"": 1, " + "\n" + @" ""products"": 41 " + "\n" + @" } " + "\n" + @" ], " + "\n" + @" ""invoice_number"": ""123TESTAPI"", " + "\n" + @" ""order_number"": ""123TESTAPI"", " + "\n" + @" ""invoice_date"": ""2021-12-29"", " + "\n" + @" ""terms"": 0, " + "\n" + @" ""due_date"": ""2022-1-2"", " + "\n" + @" ""subject"": ""hjdhjdhjd"", " + "\n" + @" ""status"": 0, " + "\n" + @" ""invoice_type"": 1, " + "\n" + @" ""is_recurring_invoices"": true, " + "\n" + @" ""customer"": 39 " + "\n" + @"}"; request.AddParameter("application/json", body, ParameterType.RequestBody); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content); Ruby -------------------- .. code-block:: bash require "uri" require "json" require "net/http" url = URI("https://payinvoice.dailymails.org/mysite/api/v1/invoices/?api_key=your_api_key") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "productinvoices": [ { "quantity": "1.00", "rate": "11.00", "discount": "5", "discount_unit": 1, "products": 41 } ], "invoice_number": "123TESTAPI", "order_number": "123TESTAPI", "invoice_date": "2021-12-29", "terms": 0, "due_date": "2022-1-2", "subject": "hjdhjdhjd", "status": 0, "invoice_type": 1, "is_recurring_invoices": true, "customer": 39 }) response = https.request(request) puts response.read_body Java --------------- .. code-block:: bash Unirest.setTimeouts(0, 0); HttpResponse response = Unirest.post("https://payinvoice.dailymails.org/mysite/api/v1/invoices/?api_key=your_api_key") .header("Content-Type", "application/json") .body("{\r\n \"productinvoices\": [\r\n {\r\n \"quantity\": \"1.00\",\r\n \"rate\": \"11.00\",\r\n \"discount\": \"5\",\r\n \"discount_unit\": 1,\r\n \"products\": 41\r\n }\r\n ],\r\n \"invoice_number\": \"123TESTAPI\",\r\n \"order_number\": \"123TESTAPI\",\r\n \"invoice_date\": \"2021-12-29\",\r\n \"terms\": 0,\r\n \"due_date\": \"2022-1-2\",\r\n \"subject\": \"hjdhjdhjd\",\r\n \"status\": 0,\r\n \"invoice_type\": 1,\r\n \"is_recurring_invoices\": true,\r\n \"customer\": 39\r\n}") .asString(); Php ----------------- .. code-block:: bash setUrl('https://payinvoice.dailymails.org/mysite/api/v1/invoices/?api_key=your_api_key'); $request->setMethod(HTTP_Request2::METHOD_POST); $request->setConfig(array( 'follow_redirects' => TRUE )); $request->setHeader(array( 'Content-Type' => 'application/json' )); $request->setBody('{ \n "productinvoices": [ \n { \n "quantity": "1.00", \n "rate": "11.00", \n "discount": "5", \n "discount_unit": 1, \n "products": 41 \n } \n ], \n "invoice_number": "123TESTAPI", \n "order_number": "123TESTAPI", \n "invoice_date": "2021-12-29", \n "terms": 0, \n "due_date": "2022-1-2", \n "subject": "hjdhjdhjd", \n "status": 0, \n "invoice_type": 1, \n "is_recurring_invoices": true, \n "customer": 39 \n}'); try { $response = $request->send(); if ($response->getStatus() == 200) { echo $response->getBody(); } else { echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' . $response->getReasonPhrase(); } } catch(HTTP_Request2_Exception $e) { echo 'Error: ' . $e->getMessage(); } Python ----------------- .. code-block:: bash import requests import json url = "https://payinvoice.dailymails.org/mysite/api/v1/invoices/?api_key=your_api_key" payload = json.dumps({ "productinvoices": [ { "quantity": "1.00", "rate": "11.00", "discount": "5", "discount_unit": 1, "products": 41 } ], "invoice_number": "123TESTAPI", "order_number": "123TESTAPI", "invoice_date": "2021-12-29", "terms": 0, "due_date": "2022-1-2", "subject": "hjdhjdhjd", "status": 0, "invoice_type": 1, "is_recurring_invoices": True, "customer": 39 }) headers = { 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) Nodejs --------------- .. code-block:: bash var request = require('request'); var options = { 'method': 'POST', 'url': 'https://payinvoice.dailymails.org/mysite/api/v1/invoices/?api_key=your_api_key', 'headers': { 'Content-Type': 'application/json' }, body: JSON.stringify({ "productinvoices": [ { "quantity": "1.00", "rate": "11.00", "discount": "5", "discount_unit": 1, "products": 41 } ], "invoice_number": "123TESTAPI", "order_number": "123TESTAPI", "invoice_date": "2021-12-29", "terms": 0, "due_date": "2022-1-2", "subject": "hjdhjdhjd", "status": 0, "invoice_type": 1, "is_recurring_invoices": true, "customer": 39 }) }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); }); Update Invoice ^^^^^^^^^^^^^^^^^^^^^^^^ **Request Method :** PUT **Endpoint :** https://payinvoice.dailymails.org/mysite/api/v1/invoices/{id}/?api_key={api_key} **Content-Type :** application/json Parameters ------------------------- .. list-table:: :widths: 10 20 20 20 :header-rows: 1 * - Name - Type - Description - Required * - | id - | Integer - | Enter Invoice id - | True * - | invoice_number - | String - | Enter Invoice number - | True * - | order_number - | String - | Enter Order number - | False * - | invoice_date - | String - | Enter Invoice date in format "YYYY-MM-DD" - | True * - | terms - | Integer - | 0 - NET15, 1 - NET30, 2 - NET45, 3 - NET60, 4 - Due End of the month, 5 - Due End of the next month, 6 - Due on Receipt, 7 - Custom - | False * - | due_date - | String - | Enter Due date in format "YYYY-MM-DD" - | True * - | subject - | String - | Enter Subject - | False * - | status - | String - | 0 - Draft, 1 - Sent, 2 - Paid - | False * - | invoice_type - | Integer - | 1 - Invoice, 2 - Estimates - | False * - | customer - | Integer - | Get Customer ID from CustomerList API - | True * - | productinvoices - | List - | Invoice Items List of Dictionary - | True * - | products - | Integer - | Get products ID from products List API - | True * - | quantity - | String - | Enter Product quantity - | True * - | rate - | String - | Enter Products rate - | True * - | discount - | String - | Enter Products Discount - | True * - | discount_unit - | Integer - | 0 - '%', 1 - 'Amount' - | True Curl -------------------------- .. code-block:: bash curl --location --request PUT 'https://payinvoice.dailymails.org/mysite/api/v1/invoices/{id}/?api_key=your_api_key' \ --header 'Content-Type: application/json' \ --data-raw ' { "id": 74, "productinvoices": [ { "quantity": "2.00", "rate": "11.00", "discount": "5.00", "discount_unit": 1, "products": 41 } ], "invoice_number": "123TESTAPI", "order_number": "123TESTAPI", "invoice_date": "2021-12-29", "terms": 0, "due_date": "2022-01-02", "subject": "hjdhjdhjd", "status": 1, "invoice_type": 1, "is_recurring_invoices": true, "customer": 39 }' C# -------------------------- .. code-block:: bash var client = new RestClient("https://payinvoice.dailymails.org/mysite/api/v1/invoices/{id}/?api_key=your_api_key"); client.Timeout = -1; var request = new RestRequest(Method.PUT); request.AddHeader("Content-Type", "application/json"); var body = @" " + "\n" + @" { " + "\n" + @" ""id"": 74, " + "\n" + @" ""productinvoices"": [ " + "\n" + @" { " + "\n" + @" " + "\n" + @" ""quantity"": ""2.00"", " + "\n" + @" ""rate"": ""11.00"", " + "\n" + @" ""discount"": ""5.00"", " + "\n" + @" ""discount_unit"": 1, " + "\n" + @" ""products"": 41 " + "\n" + @" } " + "\n" + @" ], " + "\n" + @" ""invoice_number"": ""123TESTAPI"", " + "\n" + @" ""order_number"": ""123TESTAPI"", " + "\n" + @" ""invoice_date"": ""2021-12-29"", " + "\n" + @" ""terms"": 0, " + "\n" + @" ""due_date"": ""2022-01-02"", " + "\n" + @" ""subject"": ""hjdhjdhjd"", " + "\n" + @" ""status"": 1, " + "\n" + @" ""invoice_type"": 1, " + "\n" + @" ""is_recurring_invoices"": true, " + "\n" + @" ""customer"": 39 " + "\n" + @" }"; request.AddParameter("application/json", body, ParameterType.RequestBody); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content); Ruby -------------------------- .. code-block:: bash require "uri" require "json" require "net/http" url = URI("https://payinvoice.dailymails.org/mysite/api/v1/invoices/{id}/?api_key=your_api_key") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Put.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "id": 74, "productinvoices": [ { "quantity": "2.00", "rate": "11.00", "discount": "5.00", "discount_unit": 1, "products": 41 } ], "invoice_number": "123TESTAPI", "order_number": "123TESTAPI", "invoice_date": "2021-12-29", "terms": 0, "due_date": "2022-01-02", "subject": "hjdhjdhjd", "status": 1, "invoice_type": 1, "is_recurring_invoices": true, "customer": 39 }) response = https.request(request) puts response.read_body Java ----------------------- .. code-block:: bash Unirest.setTimeouts(0, 0); HttpResponse response = Unirest.put("https://payinvoice.dailymails.org/mysite/api/v1/invoices/{id}/?api_key=your_api_key") .header("Content-Type", "application/json") .body("\r\n {\r\n \"id\": 74,\r\n \"productinvoices\": [\r\n {\r\n \r\n \"quantity\": \"2.00\",\r\n \"rate\": \"11.00\",\r\n \"discount\": \"5.00\",\r\n \"discount_unit\": 1,\r\n \"products\": 41\r\n }\r\n ],\r\n \"invoice_number\": \"123TESTAPI\",\r\n \"order_number\": \"123TESTAPI\",\r\n \"invoice_date\": \"2021-12-29\",\r\n \"terms\": 0,\r\n \"due_date\": \"2022-01-02\",\r\n \"subject\": \"hjdhjdhjd\",\r\n \"status\": 1,\r\n \"invoice_type\": 1,\r\n \"is_recurring_invoices\": true,\r\n \"customer\": 39\r\n }") .asString(); Php --------------------------- .. code-block:: bash setUrl('https://payinvoice.dailymails.org/mysite/api/v1/invoices/{id}/?api_key=your_api_key'); $request->setMethod(HTTP_Request2::METHOD_PUT); $request->setConfig(array( 'follow_redirects' => TRUE )); $request->setHeader(array( 'Content-Type' => 'application/json' )); $request->setBody(' \n { \n "id": 74, \n "productinvoices": [ \n { \n \n "quantity": "2.00", \n "rate": "11.00", \n "discount": "5.00", \n "discount_unit": 1, \n "products": 41 \n } \n ], \n "invoice_number": "123TESTAPI", \n "order_number": "123TESTAPI", \n "invoice_date": "2021-12-29", \n "terms": 0, \n "due_date": "2022-01-02", \n "subject": "hjdhjdhjd", \n "status": 1, \n "invoice_type": 1, \n "is_recurring_invoices": true, \n "customer": 39 \n }'); try { $response = $request->send(); if ($response->getStatus() == 200) { echo $response->getBody(); } else { echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' . $response->getReasonPhrase(); } } catch(HTTP_Request2_Exception $e) { echo 'Error: ' . $e->getMessage(); } Python -------------------------- .. code-block:: bash import requests import json url = "https://payinvoice.dailymails.org/mysite/api/v1/invoices/{id}/?api_key=your_api_key" payload = json.dumps({ "id": 74, "productinvoices": [ { "quantity": "2.00", "rate": "11.00", "discount": "5.00", "discount_unit": 1, "products": 41 } ], "invoice_number": "123TESTAPI", "order_number": "123TESTAPI", "invoice_date": "2021-12-29", "terms": 0, "due_date": "2022-01-02", "subject": "hjdhjdhjd", "status": 1, "invoice_type": 1, "is_recurring_invoices": True, "customer": 39 }) headers = { 'Content-Type': 'application/json' } response = requests.request("PUT", url, headers=headers, data=payload) print(response.text) Nodejs -------------------------- .. code-block:: bash var request = require('request'); var options = { 'method': 'PUT', 'url': 'https://payinvoice.dailymails.org/mysite/api/v1/invoices/{id}/?api_key=your_api_key', 'headers': { 'Content-Type': 'application/json' }, body: JSON.stringify({ "id": 74, "productinvoices": [ { "quantity": "2.00", "rate": "11.00", "discount": "5.00", "discount_unit": 1, "products": 41 } ], "invoice_number": "123TESTAPI", "order_number": "123TESTAPI", "invoice_date": "2021-12-29", "terms": 0, "due_date": "2022-01-02", "subject": "hjdhjdhjd", "status": 1, "invoice_type": 1, "is_recurring_invoices": true, "customer": 39 }) }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); });