/// <summary>
        ///     Get the details of a simple tax, compound tax or tax group.
        /// </summary>
        /// <param name="tax_id">The tax_id is the identifier of the tax.</param>
        /// <returns>Tax object.</returns>
        public Tax GetTax(string tax_id)
        {
            var url      = baseAddress + "/taxes/" + tax_id;
            var response = ZohoHttpClient.get(url, getQueryParameters());

            return(SettingsParser.getTax(response));
        }
        /// <summary>
        ///     Update the details of a simple or compound tax.
        /// </summary>
        /// <param name="tax_id">The tax_id is the identifier of the tax.</param>
        /// <param name="update_info">The update_info is the Tax object which contains the updation information.</param>
        /// <returns>Tax.</returns>
        public Tax UpdateTax(string tax_id, Tax update_info)
        {
            var url        = baseAddress + "/taxes/" + tax_id;
            var json       = JsonConvert.SerializeObject(update_info);
            var jsonstring = new Dictionary <object, object>();

            jsonstring.Add("JSONString", json);
            var response = ZohoHttpClient.put(url, getQueryParameters(jsonstring));

            return(SettingsParser.getTax(response));
        }
示例#3
0
        /// <summary>
        /// Create a simple or compound tax that can be associated with an item.
        /// </summary>
        /// <param name="new_tax_info">The new_tax_info is the Tax object with tax_name and tax_percentage as mandatory attributes.</param>
        /// <returns>Tax object.</returns>
        public Tax CreateTax(Tax new_tax_info)
        {
            string url        = baseAddress + "/taxes";
            var    json       = JsonConvert.SerializeObject(new_tax_info);
            var    jsonstring = new Dictionary <object, object>();

            jsonstring.Add("JSONString", json);
            var response = ZohoHttpClient.post(url, getQueryParameters(jsonstring));

            return(SettingsParser.getTax(response));
        }