invoice

package
Version: v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InvoiceAPIEndpoint       string = "https://invoice.zoho.com/api/v3/"
	InvoiceAPIEndpointHeader string = "X-com-zoho-invoice-organizationid"
	ContactsModule           string = "contacts"
	ContactsPersonSubModule  string = "contactpersons"
	InvoicesModule           string = "invoices"
	ItemsModule              string = "items"
	RecurringInvoicesModule  string = "recurringinvoices"
	CustomerPaymentsModule   string = "customerpayments"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	*zoho.Zoho
	// contains filtered or unexported fields
}

API is used for interacting with the Zoho expense API the exposed methods are primarily access to expense modules which provide access to expense Methods

func New

func New(z *zoho.Zoho) *API

New returns a *invoice.API with the provided zoho.Zoho as an embedded field

func (*API) CreateContact

func (c *API) CreateContact(request interface{}, enablePortal bool) (data CreateContactResponse, err error)

https://www.zoho.com/invoice/api/v3/#Contacts_Create_a_Contact func (c *API) CreateContact(request interface{}, OrganizationID string, params map[string]zoho.Parameter) (data ListContactsResponse, err error) {

func (*API) CreateContactPerson

func (c *API) CreateContactPerson(request interface{}) (data CreateContactPersonResponse, err error)

https://www.zoho.com/invoice/api/v3/#Contact_Persons_Create_a_contact_person func (c *API) CreateContactPerson(request interface{}, OrganizationID string, params map[string]zoho.Parameter) (data CreateContactPersonResponse, err error) {

func (*API) CreateInvoice

func (c *API) CreateInvoice(request interface{}) (data CreateInvoiceResponse, err error)

https://www.zoho.com/invoice/api/v3/#Invoices_Create_an_invoice func (c *API) CreateInvoice(request interface{}, OrganizationID string, params map[string]zoho.Parameter) (data ListContactsResponse, err error) {

func (*API) CreatePayment

func (c *API) CreatePayment(request interface{}) (data CreatePaymentResponse, err error)

https://www.zoho.com/invoice/api/v3/#Customer_Payments_Create_a_payment func (c *API) CreatePayment(request interface{}, OrganizationID string, params map[string]zoho.Parameter) (data ListContactsResponse, err error) {

func (*API) CreateRecurringInvoice

func (c *API) CreateRecurringInvoice(request interface{}) (data CreateRecurringInvoiceResponse, err error)

https://www.zoho.com/invoice/api/v3/#Recurring_Invoices_Create_a_Recurring_Invoice func (c *API) CreateRecurringInvoice(request interface{}, OrganizationID string, params map[string]zoho.Parameter) (data ListContactsResponse, err error) {

func (*API) DeleteContactPerson

func (c *API) DeleteContactPerson(contactPersonID string) (data DeleteContactPersonResponse, err error)

https://www.zoho.com/invoice/api/v3/#Contact_Persons_Delete_a_contact_person func (c *API) DeleteContactPerson(request interface{}, OrganizationID string, params map[string]zoho.Parameter) (data DeleteContactPersonResponse, err error) {

func (*API) GetContact

func (c *API) GetContact(contactId string) (data GetContactResponse, err error)

https://www.zoho.com/invoice/api/v3/#Contacts_Get_a_Contact func (c *API) GetContact(request interface{}, OrganizationID string, params map[string]zoho.Parameter) (data GetContactResponse, err error) {

func (*API) GetInvoice

func (c *API) GetInvoice(invoiceId string) (data GetInvoiceResponse, err error)

https://www.zoho.com/invoice/api/v3/#Invoices_Get_an_invoice func (c *API) GetInvoice(request interface{}, OrganizationID string, params map[string]zoho.Parameter) (data GetInvoiceResponse, err error) {

func (*API) GetRecurringInvoice

func (c *API) GetRecurringInvoice(recurringInvoiceId string) (data RecurringInvoiceResponse, err error)

https://www.zoho.com/invoice/api/v3/#Recurring_Invoices_Get_a_Recurring_Invoice func (c *API) GetRecurringInvoice(request interface{}, OrganizationID string, params map[string]zoho.Parameter) (data ListContactsResponse, err error) {

func (*API) ListContactPersons

func (c *API) ListContactPersons() (data ListContactPersonsResponse, err error)

https://www.zoho.com/invoice/api/v3/#Contact_Persons_List_contact_persons func (c *API) ListContactPersons(request interface{}, OrganizationID string, params map[string]zoho.Parameter) (data ListContactPersonsResponse, err error) {

func (*API) ListContacts

func (c *API) ListContacts() (data ListContactsResponse, err error)

https://www.zoho.com/invoice/api/v3/#Contacts_List_Contacts func (c *API) ListContacts(request interface{}, OrganizationID string, params map[string]zoho.Parameter) (data ListContactsResponse, err error) {

func (*API) ListCustomerPayments

func (c *API) ListCustomerPayments() (data ListCustomerPaymentsResponse, err error)

https://www.zoho.com/invoice/api/v3/#Recurring_Invoices_List_Recurring_Invoice func (c *API) ListCustomerPayments(request interface{}, OrganizationID string, params map[string]zoho.Parameter) (data ListCustomerPaymentsResponse, err error) {

func (*API) ListInvoices

func (c *API) ListInvoices() (data ListInvoicesResponse, err error)

https://www.zoho.com/invoice/api/v3/#Invoices_List_invoices func (c *API) ListInvoices(request interface{}, OrganizationID string, params map[string]zoho.Parameter) (data ListInvoicesResponse, err error) {

func (*API) ListItems

func (c *API) ListItems() (data ListItemsResponse, err error)

func (*API) ListRecurringInvoices

func (c *API) ListRecurringInvoices() (data ListRecurringInvoicesResponse, err error)

https://www.zoho.com/invoice/api/v3/#Recurring_Invoices_List_Recurring_Invoice func (c *API) ListRecurringInvoices(request interface{}, OrganizationID string, params map[string]zoho.Parameter) (data ListRecurringInvoicesResponse, err error) {

func (*API) RetrievePayment

func (c *API) RetrievePayment(paymentId string) (data RetrievePaymentResponse, err error)

https://www.zoho.com/invoice/api/v3/#Customer_Payments_Retrieve_a_payment func (c *API) RetrievePayment(request interface{}, OrganizationID string, params map[string]zoho.Parameter) (data RetrievePaymentResponse, err error) {

func (*API) StopRecurringInvoice

func (c *API) StopRecurringInvoice(recurringInvoiceId string) (data StopRecurringInvoiceResponse, err error)

https://www.zoho.com/invoice/api/v3/#Recurring_Invoices_Stop_a_Recurring_Invoice func (c *API) StopRecurringInvoice(request interface{}, OrganizationID string, params map[string]zoho.Parameter) (data StopRecurringInvoiceResponse, err error) {

func (*API) UpdateContact

func (c *API) UpdateContact(request interface{}, contactId string) (data UpdateContactResponse, err error)

https://www.zoho.com/invoice/api/v3/#Contacts_Update_a_Contact func (c *API) UpdateContact(request interface{}, OrganizationID string, params map[string]zoho.Parameter) (data UpdateContactResponse, err error) {

func (*API) UpdateInvoice

func (c *API) UpdateInvoice(request interface{}, invoiceId string) (data UpdateInvoiceResponse, err error)

https://www.zoho.com/invoice/api/v3/#Invoices_Update_an_invoice func (c *API) UpdateRecurringInvoice(request interface{}, OrganizationID string, params map[string]zoho.Parameter) (data UpdateInvoiceResponse, err error) {

func (*API) UpdateRecurringInvoice

func (c *API) UpdateRecurringInvoice(request interface{}, recurringInvoiceId string) (data UpdateRecurringInvoiceResponse, err error)

https://www.zoho.com/invoice/api/v3/#Recurring_Invoices_Update_Recurring_Invoice func (c *API) UpdateRecurringInvoice(request interface{}, OrganizationID string, params map[string]zoho.Parameter) (data UpdateRecurringInvoiceRequest, err error) {

type ContactAddress

type ContactAddress struct {
	Attention string `json:"attention,omitempty"`
	Address   string `json:"address,omitempty"`
	Street2   string `json:"street2,omitempty"`
	StateCode string `json:"state_code,omitempty"`
	City      string `json:"city,omitempty"`
	State     string `json:"state,omitempty"`
	Zip       string `json:"zip,omitempty"`
	Country   string `json:"country,omitempty"`
	Fax       string `json:"fax,omitempty"`
	Phone     string `json:"phone,omitempty"`
}

type ContactDefaultTemplates

type ContactDefaultTemplates struct {
	InvoiceTemplateID           string `json:"invoice_template_id,omitempty"`
	InvoiceTemplateName         string `json:"invoice_template_name,omitempty"`
	EstimateTemplateID          string `json:"estimate_template_id,omitempty"`
	EstimateTemplateName        string `json:"estimate_template_name,omitempty"`
	CreditnoteTemplateID        string `json:"creditnote_template_id,omitempty"`
	CreditnoteTemplateName      string `json:"creditnote_template_name,omitempty"`
	InvoiceEmailTemplateID      string `json:"invoice_email_template_id,omitempty"`
	InvoiceEmailTemplateName    string `json:"invoice_email_template_name,omitempty"`
	EstimateEmailTemplateID     string `json:"estimate_email_template_id,omitempty"`
	EstimateEmailTemplateName   string `json:"estimate_email_template_name,omitempty"`
	CreditnoteEmailTemplateID   string `json:"creditnote_email_template_id,omitempty"`
	CreditnoteEmailTemplateName string `json:"creditnote_email_template_name,omitempty"`
}

type ContactPerson

type ContactPerson struct {
	ContactPersonID  string `json:"contact_person_id,omitempty"`
	Salutation       string `json:"salutation,omitempty"`
	FirstName        string `json:"first_name"`
	LastName         string `json:"last_name"`
	Email            string `json:"email"`
	Phone            string `json:"phone"`
	Mobile           string `json:"mobile,omitempty"`
	IsPrimaryContact bool   `json:"is_primary_contact,omitempty"`
}

type CreateContactPersonRequest

type CreateContactPersonRequest struct {
	ContactID    string `json:"contact_id"`
	Salutation   string `json:"salutation,omitempty"`
	FirstName    string `json:"first_name"`
	LastName     string `json:"last_name"`
	Email        string `json:"email"`
	Phone        string `json:"phone,omitempty"`
	Mobile       string `json:"mobile,omitempty"`
	Skype        string `json:"skype,omitempty"`
	Designation  string `json:"designation,omitempty"`
	Department   string `json:"department,omitempty"`
	EnablePortal bool   `json:"enable_portal"`
}

type CreateContactPersonResponse

type CreateContactPersonResponse struct {
	Code          int    `json:"code"`
	Message       string `json:"message"`
	ContactPerson struct {
		ContactID        string `json:"contact_id"`
		ContactPersonID  string `json:"contact_person_id"`
		Salutation       string `json:"salutation"`
		FirstName        string `json:"first_name"`
		LastName         string `json:"last_name"`
		Email            string `json:"email"`
		Phone            string `json:"phone,omitempty"`
		Mobile           string `json:"mobile,omitempty"`
		IsPrimaryContact bool   `json:"is_primary_contact"`
		Skype            string `json:"skype,omitempty"`
		Designation      string `json:"designation,omitempty"`
		Department       string `json:"department,omitempty"`
		IsAddedInPortal  bool   `json:"is_added_in_portal"`
	} `json:"contact_person"`
}

type CreateContactRequest

type CreateContactRequest struct {
	ContactName      string                  `json:"contact_name"`
	CompanyName      string                  `json:"company_name"`
	CustomerSubType  string                  `json:"customer_sub_type,omitempty"`
	PaymentTerms     int64                   `json:"payment_terms,omitempty"`
	CurrencyID       string                  `json:"currency_id,omitempty"`
	Website          string                  `json:"website,omitempty"`
	CustomFields     []CustomFieldRequest    `json:"custom_fields"`
	BillingAddress   ContactAddress          `json:"billing_address"`
	ShippingAddress  ContactAddress          `json:"shipping_address"`
	ContactPersons   []ContactPerson         `json:"contact_persons"`
	DefaultTemplates ContactDefaultTemplates `json:"default_templates,omitempty"`
	LanguageCode     string                  `json:"language_code"`
	Notes            string                  `json:"notes,omitempty"`
	PlaceOfContact   string                  `json:"place_of_contact,omitempty"`
	GSTNo            string                  `json:"gst_no,omitempty"`
	GSTTreatment     string                  `json:"gst_treatment,omitempty"`
	TaxExemptionID   string                  `json:"tax_exemption_id,omitempty"`
	TaxAuthorityID   string                  `json:"tax_authority_id,omitempty"`
	TaxID            string                  `json:"tax_id,omitempty"`
	IsTaxable        string                  `json:"is_taxable,omitempty"`
	Facebook         string                  `json:"facebook,omitempty"`
	Twitter          string                  `json:"twitter,omitempty"`
}

type CreateContactResponse

type CreateContactResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Contact struct {
		ContactID                        string  `json:"contact_id"`
		ContactName                      string  `json:"contact_name"`
		CompanyName                      string  `json:"company_name"`
		HasTransaction                   bool    `json:"has_transaction"`
		ContactType                      string  `json:"contact_type"`
		IsTaxable                        bool    `json:"is_taxable"`
		TaxID                            string  `json:"tax_id"`
		TaxName                          string  `json:"tax_name"`
		TaxPercentage                    float64 `json:"tax_percentage"`
		TaxExemptionID                   string  `json:"tax_exemption_id"`
		TaxAuthorityID                   string  `json:"tax_authority_id"`
		GSTNo                            string  `json:"gst_no"`
		GSTTreatment                     string  `json:"gst_treatment"`
		IsLinkedWithZohocrm              bool    `json:"is_linked_with_zohocrm"`
		Website                          string  `json:"website"`
		PrimaryContactID                 string  `json:"primary_contact_id"`
		PaymentTerms                     int64   `json:"payment_terms"`
		PaymentTermsLabel                string  `json:"payment_terms_label"`
		CurrencyID                       string  `json:"currency_id"`
		CurrencyCode                     string  `json:"currency_code"`
		CurrencySymbol                   string  `json:"currency_symbol"`
		LanguageCode                     string  `json:"language_code"`
		OutstandingReceivableAmount      float64 `json:"outstanding_receivable_amount"`
		OutstandingReceivableAmountBcy   float64 `json:"outstanding_receivable_amount_bcy"`
		UnusedCreditsReceivableAmount    float64 `json:"unused_credits_receivable_amount"`
		UnusedCreditsReceivableAmountBcy float64 `json:"unused_credits_receivable_amount_bcy"`
		Status                           string  `json:"status"`
		PaymentReminderEnabled           bool    `json:"payment_reminder_enabled"`
		CustomFields                     []struct {
			Value string `json:"value"`
			Index int64  `json:"index"`
			Label string `json:"label"`
		} `json:"custom_fields"`
		BillingAddress   ContactAddress          `json:"billing_address"`
		ShippingAddress  ContactAddress          `json:"shipping_address"`
		Facebook         string                  `json:"facebook"`
		Twitter          string                  `json:"twitter"`
		ContactPersons   []ContactPerson         `json:"contact_persons"`
		DefaultTemplates ContactDefaultTemplates `json:"default_templates"`
		Notes            string                  `json:"notes"`
		CreatedTime      string                  `json:"created_time"`
		LastModifiedTime string                  `json:"last_modified_time"`
	} `json:"contact"`
}

type CreateInvoiceRequest

type CreateInvoiceRequest struct {
	CustomerId string `json:"customer_id"`
	//ContactName          string   `json:"contact_name,omitempty"`
	ContactPersons        []string             `json:"contact_persons,omitempty"`
	InvoiceNumber         string               `json:"invoice_number,omitempty"`
	ReferenceNumber       string               `json:"reference_number,omitempty"`
	PlaceOfSupply         string               `json:"place_of_supply,omitempty"`
	GstTreatment          string               `json:"gst_treatment,omitempty"`
	GstNo                 string               `json:"gst_no,omitempty"`
	TemplateId            string               `json:"template_id,omitempty"`
	Date                  string               `json:"date,omitempty"`
	PaymentTerms          int64                `json:"payment_terms,omitempty"`
	PaymentTermsLabel     string               `json:"payment_terms_label,omitempty"`
	DueDate               string               `json:"due_date,omitempty"`
	Discount              float64              `json:"discount,omitempty"`
	IsDiscountBeforeTax   bool                 `json:"is_discount_before_tax,omitempty"`
	DiscountType          string               `json:"discount_type,omitempty"`
	IsInclusiveTax        bool                 `json:"is_inclusive_tax,omitempty"`
	ExchangeRate          float64              `json:"exchange_rate,omitempty"`
	RecurringInvoiceId    string               `json:"recurring_invoice_id,omitempty"`
	InvoicedEstimateId    string               `json:"invoiced_estimate_id,omitempty"`
	SalespersonId         string               `json:"salesperson_id,omitempty"`
	CustomFields          []CustomFieldRequest `json:"custom_fields,omitempty"`
	ProjectId             string               `json:"project_id,omitempty"`
	LineItems             []InvoiceLineItem    `json:"line_items"`
	PaymentOptions        PaymentOptions       `json:"payment_options"`
	AllowPartialPayments  bool                 `json:"allow_partial_payments"`
	CustomBody            string               `json:"custom_body,omitempty"`
	CustomSubject         string               `json:"custom_subject,omitempty"`
	Notes                 string               `json:"notes,omitempty"`
	Terms                 string               `json:"terms,omitempty"`
	ShippingCharge        float64              `json:"shipping_charge,omitempty"`
	Adjustment            float64              `json:"adjustment,omitempty"`
	AdjustmentDescription string               `json:"adjustment_description"`
	Reason                string               `json:"reason,omitempty"`
	TaxAuthorityId        string               `json:"tax_authority_id,omitempty"`
	TaxExemptionId        string               `json:"tax_exemption_id,omitempty"`
}

type CreateInvoiceResponse

type CreateInvoiceResponse struct {
	Code    int64  `json:"code"`
	Message string `json:"message"`
	Invoice struct {
		InvoiceId             string            `json:"invoice_id"`
		AchPaymentInitiated   bool              `json:"ach_payment_initiated"`
		InvoiceNumber         string            `json:"invoice_number"`
		IsPreGst              bool              `json:"is_pre_gst"`
		PlaceOfSupply         string            `json:"place_of_supply"`
		GstNo                 string            `json:"gst_no"`
		GstTreatment          string            `json:"gst_treatment"`
		Date                  string            `json:"date"`
		Status                string            `json:"status"`
		PaymentTerms          int64             `json:"payment_terms"`
		PaymentTermsLabel     string            `json:"payment_terms_label"`
		DueDate               string            `json:"due_date"`
		PaymentExpectedDate   string            `json:"payment_expected_date"`
		LastPaymentDate       string            `json:"last_payment_date"`
		ReferenceNumber       string            `json:"reference_number"`
		CustomerId            string            `json:"customer_id"`
		CustomerName          string            `json:"customer_name"`
		ContactPersons        []string          `json:"contact_persons"`
		CurrencyId            string            `json:"currency_id"`
		CurrencyCode          string            `json:"currency_code"`
		ExchangeRate          float64           `json:"exchange_rate"`
		Discount              float64           `json:"discount"`
		IsDiscountBeforeTax   bool              `json:"is_discount_before_tax"`
		DiscountType          string            `json:"discount_type"`
		IsInclusiveTax        bool              `json:"is_inclusive_tax"`
		RecurringInvoiceId    string            `json:"recurring_invoice_id"`
		IsViewedByClient      bool              `json:"is_viewed_by_client"`
		HasAttachment         bool              `json:"has_attachment"`
		ClientViewedTime      string            `json:"client_viewed_time"`
		LineItems             []InvoiceLineItem `json:"line_items"`
		ShippingCharge        float64           `json:"shipping_charge"`
		Adjustment            float64           `json:"adjustment"`
		AdjustmentDescription string            `json:"adjustment_description"`
		SubTotal              float64           `json:"sub_total"`
		TaxTotal              float64           `json:"tax_total"`
		Total                 float64           `json:"total"`
		Taxes                 []struct {
			TaxName   string  `json:"tax_name"`
			TaxAmount float64 `json:"tax_amount"`
		} `json:"taxes"`
		PaymentReminderEnabled bool           `json:"payment_reminder_enabled"`
		PaymentMade            float64        `json:"payment_made"`
		CreditsApplied         float64        `json:"credits_applied"`
		TaxAmountWithheld      float64        `json:"tax_amount_withheld"`
		Balance                float64        `json:"balance"`
		WriteOffAmount         float64        `json:"write_off_amount"`
		AllowPartialPayments   bool           `json:"allow_partial_payments"`
		PricePrecision         int64          `json:"price_precision"`
		PaymentOptions         PaymentOptions `json:"payment_options"`
		IsEmailed              bool           `json:"is_emailed"`
		RemindersSent          int64          `json:"reminders_sent"`
		LastReminderSentDate   string         `json:"last_reminder_sent_date"`
		BillingAddress         ContactAddress `json:"billing_address"`
		ShippingAddress        ContactAddress `json:"shipping_address"`
		Notes                  string         `json:"notes"`
		Terms                  string         `json:"terms"`
		CustomFields           []struct {
			CustomfieldId string `json:"customfield_id"`
			DataType      string `json:"data_type"`
			Index         int64  `json:"index"`
			Label         string `json:"label"`
			ShowOnPdf     bool   `json:"show_on_pdf"`
			ShowInAllPdf  bool   `json:"show_in_all_pdf"`
			Value         string `json:"value"`
		} `json:"custom_fields"`
		TemplateId       string `json:"template_id"`
		TemplateName     string `json:"template_name"`
		CreatedTime      string `json:"created_time"`
		LastModifiedTime string `json:"last_modified_time"`
		AttachmentName   string `json:"attachment_name"`
		CanSendInMail    bool   `json:"can_send_in_mail"`
		SalespersonId    string `json:"salesperson_id"`
		SalespersonName  string `json:"salesperson_name"`
		InvoiceUrl       string `json:"invoice_url"`
	} `json:"invoice"`
}

type CreatePaymentInvoice

type CreatePaymentInvoice struct {
	CustomerId    string  `json:"invoice_id"`
	AmountApplied float64 `json:"amount_applied"`
}

type CreatePaymentRequest

type CreatePaymentRequest struct {
	CustomerId      string                 `json:"customer_id"`
	PaymentMode     string                 `json:"payment_mode"`
	Amount          float64                `json:"amount"`
	Date            string                 `json:"date"`
	ReferenceNumber string                 `json:"reference_number"`
	Description     string                 `json:"description"`
	Invoices        []CreatePaymentInvoice `json:"invoices"`
	ExchangeRate    float64                `json:"exchange_rate"`
	BankCharges     float64                `json:"bank_charges"`
	CustomFields    []struct {
		Label string `json:"label"`
		Value string `json:"value"`
	}
}

type CreatePaymentResponse

type CreatePaymentResponse struct {
	Code    int64  `json:"code"`
	Message string `json:"message"`
	Payment struct {
		PaymentId       string  `json:"payment_id"`
		PaymentMode     string  `json:"payment_mode"`
		Amount          float64 `json:"amount"`
		AmountRefunded  float64 `json:"amount_refunded"`
		BankCharges     float64 `json:"bank_charges"`
		Date            float64 `json:"date"`
		Status          string  `json:"status"`
		ReferenceNumber string  `json:"reference_number"`
		CustomerId      string  `json:"customer_id"`
		CustomerName    string  `json:"customer_name"`
		Email           string  `json:"email"`
		Invoices        []struct {
			InvoiceId        string  `json:"invoice_id"`
			InvoicePaymentId string  `json:"invoice_payment_id"`
			InvoiceNumber    string  `json:"invoice_number"`
			Date             string  `json:"date"`
			InvoiceAmount    float64 `json:"invoice_amount"`
			AmountApplied    float64 `json:"amount_applied"`
			BalanceAmount    float64 `json:"balance_amount"`
		}
		CurrencyCode   string `json:"currency_code"`
		CurrencySymbol string `json:"currency_symbol"`
		CustomFields   []struct {
			CustomfieldId int64  `json:"customfield_id"`
			DataType      string `json:"data_type"`
			Index         int64  `json:"index"`
			Label         string `json:"label"`
			ShowOnPdf     bool   `json:"show_on_pdf"`
			ShowInAllPdf  bool   `json:"show_in_all_pdf"`
			Value         string `json:"value"`
		}
	}
}

type CreateRecurringInvoiceRequest

type CreateRecurringInvoiceRequest struct {
	RecurrenceName      string               `json:"recurrence_name"`
	ReferenceNumber     string               `json:"reference_number,omitempty"`
	CustomerId          string               `json:"customer_id"`
	TemplateId          string               `json:"template_id"`
	SalespersonId       string               `json:"salesperson_id,omitempty"`
	IsInclusiveTax      bool                 `json:"is_inclusive_tax,omitempty"`
	ContactPersons      []string             `json:"contact_persons,omitempty"`
	StartDate           string               `json:"start_date"`
	EndDate             string               `json:"end_date,omitempty"`
	PlaceOfSupply       string               `json:"place_of_supply,omitempty"`
	GstTreatment        string               `json:"gst_treatment,omitempty"`
	GstNo               string               `json:"gst_no,omitempty"`
	RecurrenceFrequency string               `json:"recurrence_frequency"`
	RepeatEvery         int64                `json:"repeat_every,omitempty"`
	PaymentTerms        int64                `json:"payment_terms,omitempty"`
	PaymentTermsLabel   string               `json:"payment_terms_label,omitempty"`
	CustomFields        []CustomFieldRequest `json:"custom_fields,omitempty"`
	LineItems           []InvoiceLineItem    `json:"line_items,omitempty"`
	TaxId               string               `json:"tax_id,omitempty"`
	Email               string               `json:"email,omitempty"`
	PaymentOptions      PaymentOptions       `json:"payment_options,omitempty"`
	TaxAuthorityId      string               `json:"tax_authority_id,omitempty"`
	TaxExemptionId      string               `json:"tax_exemption_id,omitempty"`
}

type CreateRecurringInvoiceResponse

type CreateRecurringInvoiceResponse struct {
	Code             int64  `json:"code"`
	Message          string `json:"message"`
	RecurringInvoice struct {
		RecurringInvoiceId string `json:"recurring_invoice_id"`
		RecurrenceName     string `json:"recurrence_name"`
		ReferenceNumber    string `json:"reference_number"`
		IsPreGst           bool   `json:"is_pre_gst"`
		GstNo              string `json:"gst_no"`
		GstTreatment       string `json:"gst_treatment"`
		PlaceOfSupply      string `json:"place_of_supply"`
		CustomerName       string `json:"customer_name"`
		CustomerId         string `json:"customer_id"`
		CurrencyId         string `json:"currency_id"`
		CurrencyCode       string `json:"currency_code"`
		StartDate          string `json:"start_date"`
		EndDate            string `json:"end_date"`
		LastSentDate       string `json:"last_sent_date"`
		NextInvoiceDate    string `json:"next_invoice_date"`
		LineItems          []struct {
			LineItemId  string  `json:"line_item_id"`
			Quantity    int64   `json:"quantity"`
			Name        string  `json:"name"`
			ItemTotal   float64 `json:"item_total"`
			Sku         string  `json:"sku"`
			ProductType string  `json:"product_type"`
			ProjectId   string  `json:"project_id"`
			ProjectName string  `json:"project_name"`
		} `json:"line_items"`
		BillingAddress  ContactAddress `json:"billing_address"`
		ShippingAddress ContactAddress `json:"shipping_address"`
		CustomFields    []struct {
			CustomfieldId string `json:"customfield_id"`
			DataType      string `json:"data_type"`
			Index         int64  `json:"index"`
			IsActive      bool   `json:"is_active"`
			Label         string `json:"label"`
			ShowInAllPdf  bool   `json:"show_in_all_pdf"`
			ShowOnPdf     bool   `json:"show_on_pdf"`
			Value         string `json:"value"`
		} `json:"custom_fields"`
		PaymentOptions PaymentOptions `json:"payment_options"`
	} `json:"recurring_invoice"`
}

type CustomFieldRequest

type CustomFieldRequest struct {
	CustomfieldID string `json:"customfield_id,omitempty"`
	Label         string `json:"label"`
	Value         string `json:"value,omitempty"`
}

type DeleteContactPersonResponse

type DeleteContactPersonResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type EnableContactDashboardRequest

type EnableContactDashboardRequest struct {
	ContactPersons []EnableContactDashboardRequestPersonID `json:"contact_persons"`
}

type EnableContactDashboardRequestPersonID

type EnableContactDashboardRequestPersonID struct {
	ContactPersonID string `json:"contact_person_id"`
}

type EnableContactDashboardResponse

type EnableContactDashboardResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type GetContactResponse

type GetContactResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Contact struct {
		ContactID                        string  `json:"contact_id"`
		ContactName                      string  `json:"contact_name"`
		CompanyName                      string  `json:"company_name"`
		HasTransaction                   bool    `json:"has_transaction"`
		ContactType                      string  `json:"contact_type"`
		IsTaxable                        bool    `json:"is_taxable"`
		TaxID                            string  `json:"tax_id"`
		TaxName                          string  `json:"tax_name"`
		TaxPercentage                    float64 `json:"tax_percentage"`
		TaxAuthorityID                   string  `json:"tax_authority_id"`
		TaxExemptionID                   string  `json:"tax_exemption_id"`
		GSTNo                            string  `json:"gst_no"`
		GSTTreatment                     string  `json:"gst_treatment"`
		IsLinkedWithZohocrm              bool    `json:"is_linked_with_zohocrm"`
		Website                          string  `json:"website"`
		PrimaryContactID                 string  `json:"primary_contact_id"`
		PaymentTerms                     int64   `json:"payment_terms"`
		PaymentTermsLabel                string  `json:"payment_terms_label"`
		CurrencyID                       string  `json:"currency_id"`
		CurrencyCode                     string  `json:"currency_code"`
		CurrencySymbol                   string  `json:"currency_symbol"`
		LanguageCode                     string  `json:"language_code"`
		OutstandingReceivableAmount      float64 `json:"outstanding_receivable_amount"`
		OutstandingReceivableAmountBcy   float64 `json:"outstanding_receivable_amount_bcy"`
		UnusedCreditsReceivableAmount    float64 `json:"unused_credits_receivable_amount"`
		UnusedCreditsReceivableAmountBcy float64 `json:"unused_credits_receivable_amount_bcy"`
		Status                           string  `json:"status"`
		Facebook                         string  `json:"facebook"`
		Twitter                          string  `json:"twitter"`
		PaymentReminderEnabled           bool    `json:"payment_reminder_enabled"`
		CustomFields                     []struct {
			Value string `json:"value"`
			Index int64  `json:"index"`
			Label string `json:"label"`
		} `json:"custom_fields"`
		BillingAddress   ContactAddress          `json:"billing_address"`
		ShippingAddress  ContactAddress          `json:"shipping_address"`
		ContactPersons   []ContactPerson         `json:"contact_persons"`
		DefaultTemplates ContactDefaultTemplates `json:"default_templates"`
		Notes            string                  `json:"notes"`
		CreatedTime      string                  `json:"created_time"`
		LastModifiedTime string                  `json:"last_modified_time"`
	} `json:"contact"`
}

type GetInvoiceResponse

type GetInvoiceResponse struct {
	Code    int64  `json:"code"`
	Message string `json:"message"`
	Invoice struct {
		InvoiceId           string   `json:"invoice_id"`
		AchPaymentInitiated bool     `json:"ach_payment_initiated"`
		InvoiceNumber       string   `json:"invoice_number"`
		IsPreGst            bool     `json:"is_pre_gst"`
		PlaceOfSupply       string   `json:"place_of_supply"`
		GstNo               string   `json:"gst_no"`
		GstTreatment        string   `json:"gst_treatment"`
		Date                string   `json:"date"`
		Status              string   `json:"status"`
		PaymentTerms        int64    `json:"payment_terms"`
		PaymentTermsLabel   string   `json:"payment_terms_label"`
		DueDate             string   `json:"due_date"`
		PaymentExpectedDate string   `json:"payment_expected_date"`
		LastPaymentDate     string   `json:"last_payment_date"`
		ReferenceNumber     string   `json:"reference_number"`
		CustomerId          string   `json:"customer_id"`
		CustomerName        string   `json:"customer_name"`
		ContactPersons      []string `json:"contact_persons"`
		CurrencyId          string   `json:"currency_id"`
		CurrencyCode        string   `json:"currency_code"`
		ExchangeRate        float64  `json:"exchange_rate"`
		Discount            float64  `json:"discount"`
		IsDiscountBeforeTax bool     `json:"is_discount_before_tax"`
		DiscountType        string   `json:"discount_type"`
		IsInclusiveTax      bool     `json:"is_inclusive_tax"`
		RecurringInvoiceId  string   `json:"recurring_invoice_id"`
		IsViewedByClient    bool     `json:"is_viewed_by_client"`
		HasAttachment       bool     `json:"has_attachment"`
		ClientViewedTime    string   `json:"client_viewed_time"`
		LineItems           []struct {
			LineItemId     string   `json:"line_item_id"`
			ItemId         string   `json:"item_id"`
			ProjectId      string   `json:"project_id"`
			ProjectName    string   `json:"project_name"`
			ItemType       string   `json:"item_type"`
			ProductType    string   `json:"product_type"`
			TimeEntryIds   []string `json:"time_entry_ids"`
			ExpenseId      string   `json:"expense_id"`
			Name           string   `json:"name"`
			ItemOrder      float64  `json:"item_order"`
			BcyRate        float64  `json:"bcy_rate"`
			Rate           float64  `json:"rate"`
			Quantity       int64    `json:"quantity"`
			Unit           string   `json:"unit"`
			DiscountAmount float64  `json:"discount_amount"`
			Discount       float64  `json:"discount"`
			TaxId          string   `json:"tax_id"`
			TaxName        string   `json:"tax_name"`
			TaxType        string   `json:"tax_type"`
			TaxPercentage  float64  `json:"tax_percentage"`
			ItemTotal      float64  `json:"item_total"`
		} `json:"line_items"`
		ShippingCharge        float64 `json:"shipping_charge"`
		Adjustment            float64 `json:"adjustment"`
		AdjustmentDescription string  `json:"adjustment_description"`
		SubTotal              float64 `json:"sub_total"`
		TaxTotal              float64 `json:"tax_total"`
		Total                 float64 `json:"total"`
		Taxes                 []struct {
			TaxName   string  `json:"tax_name"`
			TaxAmount float64 `json:"tax_amount"`
		} `json:"taxes"`
		PaymentReminderEnabled bool           `json:"payment_reminder_enabled"`
		PaymentMade            float64        `json:"payment_made"`
		CreditsApplied         float64        `json:"credits_applied"`
		TaxAmountWithheld      float64        `json:"tax_amount_withheld"`
		Balance                float64        `json:"balance"`
		WriteOffAmount         float64        `json:"write_off_amount"`
		AllowPartialPayments   bool           `json:"allow_partial_payments"`
		PricePrecision         int64          `json:"price_precision"`
		PaymentOptions         PaymentOptions `json:"payment_options"`
		IsEmailed              bool           `json:"is_emailed"`
		RemindersSent          int64          `json:"reminders_sent"`
		LastReminderSentDate   string         `json:"last_reminder_sent_date"`
		BillingAddress         struct {
			Address string `json:"address"`
			Street2 string `json:"street2"`
			City    string `json:"city"`
			State   string `json:"state"`
			Zip     string `json:"zip"`
			Country string `json:"country"`
			Fax     string `json:"fax"`
		} `json:"billing_address"`
		ShippingAddress struct {
			Address string `json:"address"`
			City    string `json:"city"`
			State   string `json:"state"`
			Zip     string `json:"zip"`
			Country string `json:"country"`
			Fax     string `json:"fax"`
		} `json:"shipping_address"`
		Notes string `json:"notes"`
		Terms string `json:"terms"`
		/*CustomFields []struct {
		    CustomfieldId int64  `json:"customfield_id"`
		    DataType      string `json:"data_type"`
		    Index         int64  `json:"index"`
		    Label         string `json:"label"`
		    ShowOnPdf     bool   `json:"show_on_pdf"`
		    ShowInAllPdf  bool   `json:"show_in_all_pdf"`
		    Value         int64  `json:"value"`
		} `json:"custom_fields"`*/
		TemplateId       string `json:"template_id"`
		TemplateName     string `json:"template_name"`
		CreatedTime      string `json:"created_time"`
		LastModifiedTime string `json:"last_modified_time"`
		AttachmentName   string `json:"attachment_name"`
		CanSendInMail    bool   `json:"can_send_in_mail"`
		SalespersonId    string `json:"salesperson_id"`
		SalespersonName  string `json:"salesperson_name"`
		InvoiceUrl       string `json:"invoice_url"`
	} `json:"invoice"`
}

type InvoiceLineItem

type InvoiceLineItem struct {
	LineItemId       string               `json:"line_item_id,omitempty"`
	ItemId           string               `json:"item_id,omitempty"`
	Description      string               `json:"description,omitempty"`
	ProjectId        string               `json:"project_id,omitempty"`
	ProjectName      string               `json:"project_name,omitempty"`
	TimeEntryIds     []string             `json:"time_entry_ids,omitempty"`
	ItemType         string               `json:"item_type,omitempty"`
	ProductType      string               `json:"product_type,omitempty"`
	ExpenseId        string               `json:"expense_id,omitempty"`
	Name             string               `json:"name,omitempty"`
	ItemOrder        float64              `json:"item_order,omitempty"`
	BcyRate          float64              `json:"bcy_rate,omitempty"`
	Rate             float64              `json:"rate,omitempty"`
	Quantity         int64                `json:"quantity,omitempty"`
	Unit             string               `json:"unit,omitempty"`
	DiscountAmount   float64              `json:"discount_amount,omitempty"`
	Discount         float64              `json:"discount,omitempty"`
	TaxId            string               `json:"tax_id,omitempty"`
	TaxExemptionId   string               `json:"tax_exemption_id,omitempty"`
	TaxName          string               `json:"tax_name,omitempty"`
	TaxType          string               `json:"tax_type,omitempty"`
	TaxPercentage    float64              `json:"tax_percentage,omitempty"`
	ItemTotal        float64              `json:"item_total,omitempty"`
	HsnOrSac         int64                `json:"hsn_or_sac,omitempty"`
	ItemCustomFields []CustomFieldRequest `json:"item_custom_fields,omitempty"`
}

type InvoiceSent

type InvoiceSent struct {
	Code    int64  `json:"code"`
	Message string `json:"message"`
}

type ListContactPersonsResponse

type ListContactPersonsResponse struct {
	Code           int    `json:"code"`
	Message        string `json:"message"`
	ContactPersons []struct {
		ContactID        string `json:"contact_id"`
		ContactPersonID  string `json:"contact_person_id"`
		Salutation       string `json:"salutation"`
		FirstName        string `json:"first_name"`
		LastName         string `json:"last_name"`
		Email            string `json:"email"`
		Phone            string `json:"phone,omitempty"`
		Mobile           string `json:"mobile,omitempty"`
		IsPrimaryContact bool   `json:"is_primary_contact"`
		Skype            string `json:"skype,omitempty"`
		Designation      string `json:"designation,omitempty"`
		Department       string `json:"department,omitempty"`
		IsAddedInPortal  bool   `json:"is_added_in_portal"`
	} `json:"contact_persons"`
}

type ListContactsResponse

type ListContactsResponse struct {
	Code     int    `json:"code"`
	Message  string `json:"message"`
	Contacts []struct {
		ContactID                     string  `json:"contact_id"`
		ContactName                   string  `json:"contact_name"`
		CompanyName                   string  `json:"company_name"`
		ContactType                   string  `json:"contact_type"`
		Status                        string  `json:"status"`
		PaymentTerms                  int64   `json:"payment_terms"`
		PaymentTermsLabel             string  `json:"payment_terms_label"`
		CurrencyID                    string  `json:"currency_id"`
		CurrencyCode                  string  `json:"currency_code"`
		OutstandingReceivableAmount   float64 `json:"outstanding_receivable_amount"`
		UnusedCreditsReceivableAmount float64 `json:"unused_credits_receivable_amount"`
		FirstName                     string  `json:"first_name"`
		LastName                      string  `json:"last_name"`
		Email                         string  `json:"email"`
		Phone                         string  `json:"phone"`
		Mobile                        string  `json:"mobile"`
		CreatedTime                   string  `json:"created_time"`
		LastModifiedTime              string  `json:"last_modified_time"`
	} `json:"contacts"`
}

ListContactsResponse is the data returned by GetExpenseReports

type ListCustomerPaymentsResponse

type ListCustomerPaymentsResponse struct {
	Code             int    `json:"code"`
	Message          string `json:"message"`
	CustomerPayments []struct {
		PaymentId     string  `json:"payment_id"`
		PaymentNumber string  `json:"payment_number"`
		InvoiceNumber string  `json:"invoice_number"`
		Date          string  `json:"date"`
		PaymentMode   string  `json:"payment_mode"`
		Amount        float64 `json:"amount"`
		BcyAmount     float64 `json:"bcy_amount"`
	} `json:"customerpayments"`
}

type ListInvoicesResponse

type ListInvoicesResponse struct {
	Code     int    `json:"code"`
	Message  string `json:"message"`
	Invoices []struct {
		InvoiceID            string  `json:"invoice_id"`
		AchPaymentInitiated  bool    `json:"ach_payment_initiated"`
		CustomerName         string  `json:"customer_name"`
		CustomerID           string  `json:"customer_id"`
		Status               string  `json:"status"`
		InvoiceNumber        string  `json:"invoice_number"`
		ReferenceNumber      string  `json:"reference_number"`
		Date                 string  `json:"date"`
		DueDate              string  `json:"due_date"`
		DueDays              string  `json:"due_days"`
		CurrencyID           string  `json:"currency_id"`
		ScheduleTime         string  `json:"schedule_time"`
		CurrencyCode         string  `json:"currency_code"`
		IsViewedByClient     bool    `json:"is_viewed_by_client"`
		HasAttachment        bool    `json:"has_attachment"`
		ClientViewedTime     string  `json:"client_viewed_time"`
		Total                float64 `json:"total"`
		Balance              float64 `json:"balance"`
		CreatedTime          string  `json:"created_time"`
		LastModifiedTime     string  `json:"last_modified_time"`
		IsEmailed            bool    `json:"is_emailed"`
		RemindersSent        int64   `json:"reminders_sent"`
		LastReminderSentDate string  `json:"last_reminder_sent_date"`
		PaymentExpectedDate  string  `json:"payment_expected_date"`
		LastPaymentDate      string  `json:"last_payment_date"`
		/*CustomFields  []struct {
			CustomfieldID string `json:"customfield_id"`
			Label         string `json:"label"`
			Value         string `json:"value"`
		} `json:"custom_fields"`*/
		Documents       string  `json:"documents"`
		SalespersonID   string  `json:"salesperson_id"`
		SalespersonName string  `json:"salesperson_name"`
		ShippingCharge  float32 `json:"shipping_charge"`
		Adjustment      float32 `json:"adjustment"`
		WriteOffAmount  float32 `json:"write_off_amount"`
		ExchangeRate    float32 `json:"exchange_rate"`
	} `json:"invoices"`
}

ListContactsResponse is the data returned by GetExpenseReports

type ListItemsResponse

type ListItemsResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Items   []struct {
		ItemID        string  `json:"item_id"`
		Name          string  `json:"name"`
		Status        string  `json:"status"`
		Description   string  `json:"description"`
		Rate          float64 `json:"rate"`
		Unit          string  `json:"unit"`
		TaxID         string  `json:"tax_id"`
		TaxName       string  `json:"tax_name"`
		TaxPercentage float64 `json:"tax_percentage"`
		TaxType       string  `json:"tax_type"`
		SKU           string  `json:"sku"`
		ProductType   string  `json:"product_type"`
	} `json:"items"`
}

type ListRecurringInvoicesResponse

type ListRecurringInvoicesResponse struct {
	Code              int    `json:"code"`
	Message           string `json:"message"`
	RecurringInvoices []struct {
		RecurringInvoiceId  string  `json:"recurring_invoice_id"`
		RecurrenceName      string  `json:"recurrence_name"`
		ReferenceNumber     string  `json:"reference_number"`
		Status              string  `json:"status"`
		Total               float64 `json:"total"`
		CustomerId          string  `json:"customer_id"`
		CustomerName        string  `json:"customer_name"`
		StartDate           string  `json:"start_date"`
		EndDate             string  `json:"end_date"`
		LastSentDate        string  `json:"last_sent_date"`
		NextInvoiceDate     string  `json:"next_invoice_date"`
		RecurrenceFrequency string  `json:"recurrence_frequency"`
		RepeatEvery         int64   `json:"repeat_every"`
	} `json:"recurring_invoices"`
}

type PaymentGateway

type PaymentGateway struct {
	AdditionalField1     string `json:"additional_field1,omitempty"`
	Configured           bool   `json:"configured,omitempty"`
	GatewayName          string `json:"gateway_name,omitempty"`
	GatewayNameFormatted string `json:"gateway_name_formatted,omitempty"`
}

type PaymentOptions

type PaymentOptions struct {
	PaymentGateways []PaymentGateway `json:"payment_gateways,omitempty"`
}

type RecurringInvoiceResponse

type RecurringInvoiceResponse struct {
	Code             int64  `json:"code"`
	Message          string `json:"message"`
	RecurringInvoice struct {
		RecurringInvoiceId  string `json:"recurring_invoice_id"`
		RecurrenceName      string `json:"recurrence_name"`
		ReferenceNumber     string `json:"reference_number"`
		CustomerName        string `json:"customer_name"`
		CustomerId          string `json:"customer_id"`
		IsPreGst            bool   `json:"is_pre_gst"`
		GstNo               string `json:"gst_no"`
		GstTreatment        string `json:"gst_treatment"`
		PlaceOfSupply       string `json:"place_of_supply"`
		RecurrenceFrequency string `json:"recurrence_frequency"`
		CompanyName         string `json:"company_name"`
		CustomerEmail       string `json:"customer_email"`
		CustomerMobilePhone string `json:"customer_mobile_phone"`
		CustomerPhone       string `json:"customer_phone"`
		PhotoUrl            string `json:"photo_url"`
		CurrencyId          string `json:"currency_id"`
		CurrencyCode        string `json:"currency_code"`
		StartDate           string `json:"start_date"`
		EndDate             string `json:"end_date"`
		LastSentDate        string `json:"last_sent_date"`
		NextInvoiceDate     string `json:"next_invoice_date"`
		LineItems           []struct {
			LineItemId     string  `json:"line_item_id"`
			ItemId         string  `json:"item_id"`
			ItemOrder      float64 `json:"item_order"`
			DiscountAmount float64 `json:"discount_amount"`
			Quantity       int64   `json:"quantity"`
			Rate           float64 `json:"rate"`
			//Discount         float64 `json:"discount"`
			Name             string  `json:"name"`
			ItemTotal        float64 `json:"item_total"`
			Sku              string  `json:"sku"`
			ProductType      string  `json:"product_type"`
			ProjectId        string  `json:"project_id"`
			ProjectName      string  `json:"project_name"`
			ItemCustomFields []struct {
				CustomfieldID string `json:"customfield_id,omitempty"`
				Label         string `json:"label"`
				Value         string `json:"value,omitempty"`
			} `json:"item_custom_fields"`
		} `json:"line_items"`
		PaidInvoicesTotal     float64        `json:"paid_invoices_total"`
		UnpaidInvoicesBalance float64        `json:"unpaid_invoices_balance"`
		BillingAddress        ContactAddress `json:"billing_address"`
		ShippingAddress       ContactAddress `json:"shipping_address"`
		CustomFields          []struct {
			CustomfieldId string `json:"customfield_id"`
			DataType      string `json:"data_type"`
			Index         int64  `json:"index"`
			IsActive      bool   `json:"is_active"`
			Label         string `json:"label"`
			ShowInAllPdf  bool   `json:"show_in_all_pdf"`
			ShowOnPdf     bool   `json:"show_on_pdf"`
			Value         string `json:"value"`
		} `json:"custom_fields"`
		PaymentOptions PaymentOptions `json:"payment_options"`
		ContactPersons []string       `json:"contact_persons"`
	} `json:"recurring_invoice"`
}

type RetrievePaymentResponse

type RetrievePaymentResponse struct {
	Code    int64  `json:"code"`
	Message string `json:"message"`
	Payment struct {
		PaymentId           string  `json:"payment_id"`
		PaymentMode         string  `json:"payment_mode"`
		Amount              float64 `json:"amount"`
		AmountRefunded      float64 `json:"amount_refunded"`
		BankCharges         float64 `json:"bank_charges"`
		Date                string  `json:"date"`
		Status              string  `json:"status"`
		ReferenceNumber     string  `json:"reference_number"`
		OnlineTransactionId string  `json:"online_transaction_id"`
		CustomerId          string  `json:"customer_id"`
		CustomerName        string  `json:"customer_name"`
		Email               string  `json:"email"`
		Invoices            []struct {
			InvoiceId        string  `json:"invoice_id"`
			InvoicePaymentId string  `json:"invoice_payment_id"`
			InvoiceNumber    string  `json:"invoice_number"`
			Date             string  `json:"date"`
			InvoiceAmount    float64 `json:"invoice_amount"`
			AmountApplied    float64 `json:"amount_applied"`
			BalanceAmount    float64 `json:"balance_amount"`
		} `json:"invoices"`
		CurrencyCode   string `json:"currency_code"`
		CurrencySymbol string `json:"currency_symbol"`
	} `json:"payment"`
}

type StopRecurringInvoiceResponse

type StopRecurringInvoiceResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type UpdateContactRequest

type UpdateContactRequest struct {
	ContactName      string                  `json:"contact_name,omitempty"`
	CompanyName      string                  `json:"company_name,omitempty"`
	CustomerSubType  string                  `json:"customer_sub_type,omitempty"`
	PaymentTerms     int64                   `json:"payment_terms,omitempty"`
	CurrencyID       string                  `json:"currency_id,omitempty"`
	Website          string                  `json:"website,omitempty"`
	CustomFields     []CustomFieldRequest    `json:"custom_fields,omitempty"`
	BillingAddress   ContactAddress          `json:"billing_address,omitempty"`
	ShippingAddress  ContactAddress          `json:"shipping_address,omitempty"`
	ContactPersons   []ContactPerson         `json:"contact_persons,omitempty"`
	DefaultTemplates ContactDefaultTemplates `json:"default_templates,omitempty"`
	LanguageCode     string                  `json:"language_code,omitempty"`
	Notes            string                  `json:"notes,omitempty"`
	PlaceOfContact   string                  `json:"place_of_contact,omitempty"`
	GSTNo            string                  `json:"gst_no,omitempty"`
	GSTTreatment     string                  `json:"gst_treatment,omitempty"`
	TaxExemptionID   string                  `json:"tax_exemption_id,omitempty"`
	TaxAuthorityID   string                  `json:"tax_authority_id,omitempty"`
	TaxID            string                  `json:"tax_id,omitempty"`
	IsTaxable        string                  `json:"is_taxable,omitempty"`
	Facebook         string                  `json:"facebook,omitempty"`
	Twitter          string                  `json:"twitter,omitempty"`
}

type UpdateContactResponse

type UpdateContactResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Contact struct {
		ContactID                        string  `json:"contact_id"`
		ContactName                      string  `json:"contact_name"`
		CompanyName                      string  `json:"company_name"`
		HasTransaction                   bool    `json:"has_transaction"`
		ContactType                      string  `json:"contact_type"`
		IsTaxable                        bool    `json:"is_taxable"`
		TaxID                            string  `json:"tax_id"`
		TaxName                          string  `json:"tax_name"`
		TaxPercentage                    float64 `json:"tax_percentage"`
		TaxExemptionID                   string  `json:"tax_exemption_id"`
		TaxAuthorityID                   string  `json:"tax_authority_id"`
		GSTNo                            string  `json:"gst_no"`
		GSTTreatment                     string  `json:"gst_treatment"`
		IsLinkedWithZohocrm              bool    `json:"is_linked_with_zohocrm"`
		Website                          string  `json:"website"`
		PrimaryContactID                 string  `json:"primary_contact_id"`
		PaymentTerms                     int64   `json:"payment_terms"`
		PaymentTermsLabel                string  `json:"payment_terms_label"`
		CurrencyID                       string  `json:"currency_id"`
		CurrencyCode                     string  `json:"currency_code"`
		CurrencySymbol                   string  `json:"currency_symbol"`
		LanguageCode                     string  `json:"language_code"`
		OutstandingReceivableAmount      float64 `json:"outstanding_receivable_amount"`
		OutstandingReceivableAmountBcy   float64 `json:"outstanding_receivable_amount_bcy"`
		UnusedCreditsReceivableAmount    float64 `json:"unused_credits_receivable_amount"`
		UnusedCreditsReceivableAmountBcy float64 `json:"unused_credits_receivable_amount_bcy"`
		Status                           string  `json:"status"`
		PaymentReminderEnabled           bool    `json:"payment_reminder_enabled"`
		CustomFields                     []struct {
			Value string `json:"value"`
			Index int64  `json:"index"`
			Label string `json:"label"`
		} `json:"custom_fields"`
		BillingAddress   ContactAddress          `json:"billing_address"`
		ShippingAddress  ContactAddress          `json:"shipping_address"`
		Facebook         string                  `json:"facebook"`
		Twitter          string                  `json:"twitter"`
		ContactPersons   []ContactPerson         `json:"contact_persons"`
		DefaultTemplates ContactDefaultTemplates `json:"default_templates"`
		Notes            string                  `json:"notes"`
		CreatedTime      string                  `json:"created_time"`
		LastModifiedTime string                  `json:"last_modified_time"`
	}
}

type UpdateInvoiceRequest

type UpdateInvoiceRequest struct {
	CustomerId string `json:"customer_id"`
	//ContactName          string   `json:"contact_name,omitempty"`
	ContactPersons        []string             `json:"contact_persons,omitempty"`
	InvoiceNumber         string               `json:"invoice_number,omitempty"`
	ReferenceNumber       string               `json:"reference_number,omitempty"`
	PlaceOfSupply         string               `json:"place_of_supply,omitempty"`
	GstTreatment          string               `json:"gst_treatment,omitempty"`
	GstNo                 string               `json:"gst_no,omitempty"`
	TemplateId            string               `json:"template_id,omitempty"`
	Date                  string               `json:"date,omitempty"`
	PaymentTerms          int64                `json:"payment_terms,omitempty"`
	PaymentTermsLabel     string               `json:"payment_terms_label,omitempty"`
	DueDate               string               `json:"due_date,omitempty"`
	Discount              float64              `json:"discount,omitempty"`
	IsDiscountBeforeTax   bool                 `json:"is_discount_before_tax,omitempty"`
	DiscountType          string               `json:"discount_type,omitempty"`
	IsInclusiveTax        bool                 `json:"is_inclusive_tax,omitempty"`
	ExchangeRate          float64              `json:"exchange_rate,omitempty"`
	RecurringInvoiceId    string               `json:"recurring_invoice_id,omitempty"`
	InvoicedEstimateId    string               `json:"invoiced_estimate_id,omitempty"`
	SalespersonId         string               `json:"salesperson_id,omitempty"`
	CustomFields          []CustomFieldRequest `json:"custom_fields,omitempty"`
	ProjectId             string               `json:"project_id,omitempty"`
	LineItems             []InvoiceLineItem    `json:"line_items"`
	PaymentOptions        PaymentOptions       `json:"payment_options"`
	AllowPartialPayments  bool                 `json:"allow_partial_payments"`
	CustomBody            string               `json:"custom_body,omitempty"`
	CustomSubject         string               `json:"custom_subject,omitempty"`
	Notes                 string               `json:"notes,omitempty"`
	Terms                 string               `json:"terms,omitempty"`
	ShippingCharge        float64              `json:"shipping_charge,omitempty"`
	Adjustment            float64              `json:"adjustment,omitempty"`
	AdjustmentDescription string               `json:"adjustment_description"`
	Reason                string               `json:"reason,omitempty"`
	TaxAuthorityId        string               `json:"tax_authority_id,omitempty"`
	TaxExemptionId        string               `json:"tax_exemption_id,omitempty"`
}

type UpdateInvoiceResponse

type UpdateInvoiceResponse struct {
	Code    int64  `json:"code"`
	Message string `json:"message"`
	Invoice struct {
		InvoiceId             string            `json:"invoice_id"`
		AchPaymentInitiated   bool              `json:"ach_payment_initiated"`
		InvoiceNumber         string            `json:"invoice_number"`
		IsPreGst              bool              `json:"is_pre_gst"`
		PlaceOfSupply         string            `json:"place_of_supply"`
		GstNo                 string            `json:"gst_no"`
		GstTreatment          string            `json:"gst_treatment"`
		Date                  string            `json:"date"`
		Status                string            `json:"status"`
		PaymentTerms          int64             `json:"payment_terms"`
		PaymentTermsLabel     string            `json:"payment_terms_label"`
		DueDate               string            `json:"due_date"`
		PaymentExpectedDate   string            `json:"payment_expected_date"`
		LastPaymentDate       string            `json:"last_payment_date"`
		ReferenceNumber       string            `json:"reference_number"`
		CustomerId            string            `json:"customer_id"`
		CustomerName          string            `json:"customer_name"`
		ContactPersons        []string          `json:"contact_persons"`
		CurrencyId            string            `json:"currency_id"`
		CurrencyCode          string            `json:"currency_code"`
		ExchangeRate          float64           `json:"exchange_rate"`
		Discount              float64           `json:"discount"`
		IsDiscountBeforeTax   bool              `json:"is_discount_before_tax"`
		DiscountType          string            `json:"discount_type"`
		IsInclusiveTax        bool              `json:"is_inclusive_tax"`
		RecurringInvoiceId    string            `json:"recurring_invoice_id"`
		IsViewedByClient      bool              `json:"is_viewed_by_client"`
		HasAttachment         bool              `json:"has_attachment"`
		ClientViewedTime      string            `json:"client_viewed_time"`
		LineItems             []InvoiceLineItem `json:"line_items"`
		ShippingCharge        float64           `json:"shipping_charge"`
		Adjustment            float64           `json:"adjustment"`
		AdjustmentDescription string            `json:"adjustment_description"`
		SubTotal              float64           `json:"sub_total"`
		TaxTotal              float64           `json:"tax_total"`
		Total                 float64           `json:"total"`
		Taxes                 []struct {
			TaxName   string  `json:"tax_name"`
			TaxAmount float64 `json:"tax_amount"`
		} `json:"taxes"`
		PaymentReminderEnabled bool           `json:"payment_reminder_enabled"`
		PaymentMade            float64        `json:"payment_made"`
		CreditsApplied         float64        `json:"credits_applied"`
		TaxAmountWithheld      float64        `json:"tax_amount_withheld"`
		Balance                float64        `json:"balance"`
		WriteOffAmount         float64        `json:"write_off_amount"`
		AllowPartialPayments   bool           `json:"allow_partial_payments"`
		PricePrecision         int64          `json:"price_precision"`
		PaymentOptions         PaymentOptions `json:"payment_options"`
		IsEmailed              bool           `json:"is_emailed"`
		RemindersSent          int64          `json:"reminders_sent"`
		LastReminderSentDate   string         `json:"last_reminder_sent_date"`
		BillingAddress         ContactAddress `json:"billing_address"`
		ShippingAddress        ContactAddress `json:"shipping_address"`
		Notes                  string         `json:"notes"`
		Terms                  string         `json:"terms"`
		CustomFields           []struct {
			CustomfieldId string `json:"customfield_id"`
			DataType      string `json:"data_type"`
			Index         int64  `json:"index"`
			Label         string `json:"label"`
			ShowOnPdf     bool   `json:"show_on_pdf"`
			ShowInAllPdf  bool   `json:"show_in_all_pdf"`
			Value         string `json:"value"`
		} `json:"custom_fields"`
		TemplateId       string `json:"template_id"`
		TemplateName     string `json:"template_name"`
		CreatedTime      string `json:"created_time"`
		LastModifiedTime string `json:"last_modified_time"`
		AttachmentName   string `json:"attachment_name"`
		CanSendInMail    bool   `json:"can_send_in_mail"`
		SalespersonId    string `json:"salesperson_id"`
		SalespersonName  string `json:"salesperson_name"`
		InvoiceUrl       string `json:"invoice_url"`
	} `json:"invoice"`
}

type UpdateRecurringInvoiceRequest

type UpdateRecurringInvoiceRequest struct {
	RecurrenceName      string               `json:"recurrence_name"`
	ReferenceNumber     string               `json:"reference_number,omitempty"`
	CustomerId          string               `json:"customer_id"`
	TemplateId          string               `json:"template_id,omitempty"`
	SalespersonId       string               `json:"salesperson_id,omitempty"`
	IsInclusiveTax      bool                 `json:"is_inclusive_tax,omitempty"`
	ContactPersons      []string             `json:"contact_persons,omitempty"`
	StartDate           string               `json:"start_date,omitempty"`
	EndDate             string               `json:"end_date,omitempty"`
	PlaceOfSupply       string               `json:"place_of_supply,omitempty"`
	GstTreatment        string               `json:"gst_treatment,omitempty"`
	GstNo               string               `json:"gst_no,omitempty"`
	RecurrenceFrequency string               `json:"recurrence_frequency"`
	RepeatEvery         int64                `json:"repeat_every,omitempty"`
	PaymentTerms        int64                `json:"payment_terms,omitempty"`
	PaymentTermsLabel   string               `json:"payment_terms_label,omitempty"`
	CustomFields        []CustomFieldRequest `json:"custom_fields,omitempty"`
	LineItems           []InvoiceLineItem    `json:"line_items,omitempty"`
	TaxId               string               `json:"tax_id,omitempty"`
	Email               string               `json:"email,omitempty"`
	PaymentOptions      PaymentOptions       `json:"payment_options,omitempty"`
	TaxAuthorityId      string               `json:"tax_authority_id,omitempty"`
	TaxExemptionId      string               `json:"tax_exemption_id,omitempty"`
}

type UpdateRecurringInvoiceResponse

type UpdateRecurringInvoiceResponse struct {
	Code             int64  `json:"code"`
	Message          string `json:"message"`
	RecurringInvoice struct {
		RecurringInvoiceId string `json:"recurring_invoice_id"`
		RecurrenceName     string `json:"recurrence_name"`
		ReferenceNumber    string `json:"reference_number"`
		IsPreGst           bool   `json:"is_pre_gst"`
		GstNo              string `json:"gst_no"`
		GstTreatment       string `json:"gst_treatment"`
		PlaceOfSupply      string `json:"place_of_supply"`
		CustomerName       string `json:"customer_name"`
		CustomerId         string `json:"customer_id"`
		CurrencyId         string `json:"currency_id"`
		CurrencyCode       string `json:"currency_code"`
		StartDate          string `json:"start_date"`
		EndDate            string `json:"end_date"`
		LastSentDate       string `json:"last_sent_date"`
		NextInvoiceDate    string `json:"next_invoice_date"`
		LineItems          []struct {
			LineItemId  string  `json:"line_item_id"`
			Quantity    int64   `json:"quantity"`
			Name        string  `json:"name"`
			ItemTotal   float64 `json:"item_total"`
			Sku         string  `json:"sku"`
			ProductType string  `json:"product_type"`
			ProjectId   string  `json:"project_id"`
			ProjectName string  `json:"project_name"`
		} `json:"line_items"`
		BillingAddress  ContactAddress `json:"billing_address"`
		ShippingAddress ContactAddress `json:"shipping_address"`
		CustomFields    []struct {
			CustomfieldId string `json:"customfield_id"`
			DataType      string `json:"data_type"`
			Index         int64  `json:"index"`
			IsActive      bool   `json:"is_active"`
			Label         string `json:"label"`
			ShowInAllPdf  bool   `json:"show_in_all_pdf"`
			ShowOnPdf     bool   `json:"show_on_pdf"`
			Value         string `json:"value"`
		} `json:"custom_fields"`
		PaymentOptions PaymentOptions `json:"payment_options"`
	}
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL