コード例 #1
0
        /// <summary>
        /// Delete the file attached to the invoice.
        /// </summary>
        /// <param name="invoice_id">The invoice_id is the identifier of the invoice.</param>
        /// <returns>System.String<br></br> The success message is "Your file is no longer attached to the invoice." </returns>
        public string DeleteAttachment(string invoice_id)
        {
            string url      = baseAddress + "/" + invoice_id + "/attachment";
            var    responce = ZohoHttpClient.delete(url, getQueryParameters());

            return(InvoiceParser.getMessage(responce));
        }
コード例 #2
0
        /// <summary>
        /// Delete the expense receipts attached to an invoice which is raised from an expense.
        /// </summary>
        /// <param name="expense_id">The expense_id is the identifier of the expense.</param>
        /// <returns>System.String<br></br> The success message is "The attached expense receipt has been deleted."</returns>
        public string DeleteExpenseReceipt(string expense_id)
        {
            string url      = baseAddress + "/expenses/" + expense_id + "/receipt";
            var    responce = ZohoHttpClient.delete(url, getQueryParameters());

            return(InvoiceParser.getMessage(responce));
        }
コード例 #3
0
        /// <summary>
        /// Deltes the applied credit.
        /// </summary>
        /// <param name="invoice_id">The invoice_id is the identifier of the invoice.</param>
        /// <param name="creditnote_id">The creditnote_id is the identifier of the creditnote which applied for the specified invoice.</param>
        /// <returns>System.String<br></br> The success message is "Credits applied to an invoice have been deleted." </returns>
        public string DelteAppliedCredit(string invoice_id, string creditnote_id)
        {
            string url      = baseAddress + "/" + invoice_id + "/creditsapplied/" + creditnote_id;;
            var    responce = ZohoHttpClient.delete(url, getQueryParameters());

            return(InvoiceParser.getMessage(responce));
        }
コード例 #4
0
        /// <summary>
        /// Set whether you want to send the attached file while emailing the invoice.
        /// </summary>
        /// <param name="invoice_id">The invoice_id is the identifier of the invoice.</param>
        /// <param name="parameters">The parameters is the Dictionary object which contains the following mandatory parameter in the form of key,value pair.<br></br>
        /// <table><tr><td>can_send_in_mail*</td><td>True to send the attachment with the invoice when emailed.</td></tr></table>
        /// </param>
        /// <returns>System.String<br></br> The success message is "Invoice information has been updated." </returns>
        public string UpdateAttachment(string invoice_id, Dictionary <object, object> parameters)
        {
            string url      = baseAddress + "/" + invoice_id + "/attachment";
            var    responce = ZohoHttpClient.put(url, getQueryParameters(parameters));

            return(InvoiceParser.getMessage(responce));
        }
コード例 #5
0
        /// <summary>
        /// Delete an invoice comment.
        /// </summary>
        /// <param name="invoice_id">The invoice_id is the identifier of the invoice.</param>
        /// <param name="comment_id">The comment_id is the identifier of the comment of specified invoice.</param>
        /// <returns>System.String<br></br> The success message is "The comment has been deleted." </returns>
        public string DeleteComment(string invoice_id, string comment_id)
        {
            string url      = baseAddress + "/" + invoice_id + "/comments/" + comment_id;
            var    responce = ZohoHttpClient.delete(url, getQueryParameters());

            return(InvoiceParser.getMessage(responce));
        }
コード例 #6
0
        /// <summary>
        /// Enables automated payment reminders for an invoice.
        /// </summary>
        /// <param name="invoice_id">The invoice_id is the identifier of the invoice.</param>
        /// <returns>System.String<br></br> The success message is "Reminders enabled." </returns>
        public string EnablePaymentReminder(string invoice_id)
        {
            string url      = baseAddress + "/" + invoice_id + "/paymentreminder/enable";
            var    responce = ZohoHttpClient.post(url, getQueryParameters());

            return(InvoiceParser.getMessage(responce));
        }
コード例 #7
0
        /// <summary>
        /// Update the pdf template associated with the invoice.
        /// </summary>
        /// <param name="invoice_id">The invoice_id is the identifier of the invoice.</param>
        /// <param name="template_id">The template_id is the identifer of the template .</param>
        /// <returns>System.String<br></br> The success message is "Invoice information has been updated." </returns>
        public string UpdateTemplate(string invoice_id, string template_id)
        {
            string url      = baseAddress + "/" + invoice_id + "/templates/" + template_id;
            var    responce = ZohoHttpClient.put(url, getQueryParameters());

            return(InvoiceParser.getMessage(responce));
        }
コード例 #8
0
        /// <summary>
        /// Cancel the write off amount of an invoice.
        /// </summary>
        /// <param name="invoice_id">The invoice_id is the identifier of the invoice.</param>
        /// <returns>System.String<br></br> The success message is "The write off done for this invoice has been cancelled." </returns>
        public string CancelWriteoff(string invoice_id)
        {
            string url      = baseAddress + "/" + invoice_id + "/writeoff/cancel";
            var    responce = ZohoHttpClient.post(url, getQueryParameters());

            return(InvoiceParser.getMessage(responce));
        }
コード例 #9
0
        /// <summary>
        /// Remind your customer about an unpaid invoices by email. Reminder mail will be send, only for the invoices is in open or overdue status. Maximum 10 invoices can be reminded at once.
        /// </summary>
        /// <param name="parameters">The parameters is the dictionary object which conatins the following mandatory pameter in the key value pair format.<br></br>
        /// <table><tr><td>invoice_ids*</td><td>Array of invoice ids for which the reminder has to be sent.</td></tr></table>
        /// </param>
        /// <returns>System.String<br></br> The success message is "Success! All reminders have been sent." </returns>
        public string BulkInvoiceReminder(Dictionary <object, object> parameters)
        {
            string url      = baseAddress + "/paymentreminder";
            var    responce = ZohoHttpClient.post(url, getQueryParameters(parameters));

            return(InvoiceParser.getMessage(responce));
        }
コード例 #10
0
        /// <summary>
        ///Mark a voided invoice as draft.
        /// </summary>
        /// <param name="invoice_id">The invoice_id is the identifier of the invoice.</param>
        /// <returns>System.String<br></br> The success message is "Status of invoice changed from void to draft."</returns>
        public string MarkAsDraft(string invoice_id)
        {
            string url      = baseAddress + "/" + invoice_id + "/status/draft";
            var    responce = ZohoHttpClient.post(url, getQueryParameters());

            return(InvoiceParser.getMessage(responce));
        }
コード例 #11
0
        /// <summary>
        /// Attach a file to an invoice.
        /// </summary>
        /// <param name="invoice_id">The invoice_id is the identifier of the invoice.</param>
        /// <param name="attachment_Path">The attachment_ path is the file information which is going to be attached to thr invoice.</param>
        /// <param name="parameters">The parameters is the Dictionary object which contains the following optional parameter in the form of key,value pair.<br></br>
        /// <table><tr><td>can_send_in_mail</td><td>True to send the attachment with the invoice when emailed.</td></tr></table>
        /// </param>
        /// <returns>System.String<br></br> The success message is "Your file has been successfully attached to the invoice." </returns>
        public string AddAttachment(string invoice_id, string attachment_Path, Dictionary <object, object> parameters)
        {
            string url        = baseAddress + "/" + invoice_id + "/attachment";
            var    attachment = new string[] { attachment_Path };
            var    file       = new KeyValuePair <string, string[]>("attachment", attachment);
            var    responce   = ZohoHttpClient.post(url, getQueryParameters(parameters), null, file);

            return(InvoiceParser.getMessage(responce));
        }
コード例 #12
0
        /// <summary>
        /// Remind your customer about an unpaid invoice by email. Reminder will be sent, only for the invoices which are in open or overdue status.
        /// </summary>
        /// <param name="invoice_id">The invoice_id is the identifier of the invoice.</param>
        /// <param name="notify_details">The notify_details is the EmailNotification object with to_mail_ids as mandatory parameter.</param>
        /// <param name="parameters">The parameters is the dictionary object which contains the following optional parameter in the key,value pair format.<br></br>
        /// <table><tr><td>send_customer_statement</td><td>Send customer statement pdf a with payment reminder.</td></tr></table>
        /// </param>
        /// <returns>System.String<br></br> The success message is "Your payment reminder has been sent."</returns>
        public string RemindCustomer(string invoice_id, EmailNotification notify_details, Dictionary <object, object> parameters)
        {
            string url  = baseAddress + "/" + invoice_id + "/paymentreminder";
            var    json = JsonConvert.SerializeObject(notify_details);

            parameters.Add("JSONString", json);
            var responce = ZohoHttpClient.post(url, getQueryParameters(parameters));

            return(InvoiceParser.getMessage(responce));
        }
コード例 #13
0
        /// <summary>
        /// Updates the shipping address for this invoice. You can set this address as default shipping address for your customer by specifying 'is_update_customer' param as true.
        /// </summary>
        /// <param name="invoice_id">The invoice_id is the identifier of the invoice.</param>
        /// <param name="update_info">The update_info ois the Address object which contains the updation information.</param>
        /// <returns>System.String<br></br> The success message is "Shipping address updated"</returns>
        public string UpdateShippingAddress(string invoice_id, Address update_info)
        {
            string url        = baseAddress + "/" + invoice_id + "/address/shipping";
            var    json       = JsonConvert.SerializeObject(update_info);
            var    jsonstring = new Dictionary <object, object>();

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

            return(InvoiceParser.getMessage(responce));
        }
コード例 #14
0
        /// <summary>
        /// Send invoices to your customers by email. Maximum of 10 invoices can be sent at once.
        /// </summary>
        /// <param name="contacts">The contacts is the Contacts object with contact_id as a mandatory attribute.</param>
        /// <param name="parameters">The parameters is the dictionary object which is having the following mandatory parameter in the form of key,value pair.<br></br>
        /// <table><tr><td>invoice_ids</td><td>Comma separated invoice ids which are to be emailed.</td></tr></table>
        /// </param>
        /// <returns>System.String<br></br> The success message is "Mission accomplished! We've sent all the invoices." </returns>
        public string EmailInvoices(Contacts contacts, Dictionary <object, object> parameters)
        {
            string url  = baseAddress + "/email";
            var    json = JsonConvert.SerializeObject(contacts);

            parameters.Add("JSONString", json);
            var    responce        = ZohoHttpClient.post(url, getQueryParameters(parameters));
            string responceContent = responce.Content.ReadAsStringAsync().Result;

            return(InvoiceParser.getMessage(responce));
        }
コード例 #15
0
        /// <summary>
        /// Email an invoice to the customer. Input json string is not mandatory. If input json string is empty, mail will be send with default mail content.
        /// </summary>
        /// <param name="invoice_id">The invoice_id is the identifier of the invoice.</param>
        /// <param name="email_details">The email_details is the EmailNotification object with to_mail_ids as mandatory attribute.</param>
        /// <param name="attachment_paths">The attachment_paths is the file paths which are going to be attached to the mail.</param>
        /// <param name="parameters">The parameters is the dictionary object which contains the following optional parameters in the key,value pair forms.<br></br>
        /// <table>
        /// <tr><td>send_customer_statement</td><td>Send customer statement pdf a with email.</td></tr>
        /// <tr><td>send_attachment</td><td>Send the invoice attachment a with the email.</td></tr>
        /// </table>
        /// </param>
        /// <returns>System.String<br></br> The success message is "Your invoice has been sent."</returns>
        public string SendEmail(string invoice_id, EmailNotification email_details, string[] attachment_paths, Dictionary <object, object> parameters)
        {
            string url        = baseAddress + "/" + invoice_id + "/email";
            var    json       = JsonConvert.SerializeObject(email_details);
            var    jsonString = new Dictionary <object, object>();

            jsonString.Add("JSONString", json);
            var    files           = new KeyValuePair <string, string[]>("attachments", attachment_paths);
            var    responce        = ZohoHttpClient.post(url, getQueryParameters(parameters), jsonString, files);
            string responceContent = responce.Content.ReadAsStringAsync().Result;

            return(InvoiceParser.getMessage(responce));
        }