Documentation
¶
Index ¶
Constants ¶
const ( ExpenseAPIEndpoint string = "https://expense.zoho.com/api/v1/" ExpenseAPIEndpointHeader string = "X-com-zoho-expense-organizationid" OrganizationsModule string = "organizations" ExpenseReportModule string = "expensereports" ExpensesModule string = "expenses" TripsModule string = "trips" ExpenseCategoiesModule string = "expensecategories" UsersModule string = "users" CustomersModule string = "contacts" ProjectsModule string = "projects" CurrenciesModule string = "settings/currencies" TaxesModule string = "settings/taxes" )
Change here only if these values changes over time
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
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 (*API) GetExpenseReports ¶
func (c *API) GetExpenseReports(request interface{}, organizationId string, params map[string]zoho.Parameter) (data ExpenseReportResponse, err error)
GetExpenseReports will return a list of all submitted expense reports as specified by https://www.zoho.com/expense/api/v1/#Expense_Reports_List_of_all_expense_reports
func (*API) GetOrganization ¶
func (c *API) GetOrganization() (data OrganizationResponse, err error)
GetOrganization will return the organization data related to the logged in account Parse this response to get organization_id field and pass this value in each expense apis https://www.zoho.com/expense/api/v1/#organization-id
Alternatively organization_id can also be known after login to zoho web page at https://expense.zoho.com/app#/organizations
type ExpenseReportResponse ¶
type ExpenseReportResponse struct { Code int `json:"code"` ExpenseReports []struct { ApprovedDate string `json:"approved_date"` ApproverEmail string `json:"approver_email"` ApproverID string `json:"approver_id"` ApproverName string `json:"approver_name"` CommentsCount int `json:"comments_count"` CreatedByID string `json:"created_by_id"` CreatedByName string `json:"created_by_name"` CreatedTime string `json:"created_time"` CurrencyCode string `json:"currency_code"` CurrencyID string `json:"currency_id"` CustomFields []struct { CustomfieldID string `json:"customfield_id"` Label string `json:"label"` Value string `json:"value"` } `json:"custom_fields"` CustomerID string `json:"customer_id"` CustomerName string `json:"customer_name"` Description string `json:"description"` DueDate string `json:"due_date"` DueDays string `json:"due_days"` EndDate string `json:"end_date"` IsArchived bool `json:"is_archived"` LastModifiedTime string `json:"last_modified_time"` LastSubmittedDate string `json:"last_submitted_date"` NonReimbursableTotal float64 `json:"non_reimbursable_total"` PolicyID string `json:"policy_id"` PolicyName string `json:"policy_name"` PolicyViolated bool `json:"policy_violated"` ProjectID string `json:"project_id"` ProjectName string `json:"project_name"` ReimbursableTotal float64 `json:"reimbursable_total"` ReimbursementDate string `json:"reimbursement_date"` ReportID string `json:"report_id"` ReportName string `json:"report_name"` ReportNumber string `json:"report_number"` StartDate string `json:"start_date"` Status string `json:"status"` SubmittedBy string `json:"submitted_by"` SubmittedDate string `json:"submitted_date"` SubmittedToEmail string `json:"submitted_to_email"` SubmittedToID string `json:"submitted_to_id"` SubmittedToName string `json:"submitted_to_name"` SubmitterEmail string `json:"submitter_email"` SubmitterName string `json:"submitter_name"` Total float64 `json:"total"` UncategorizedExpenseCount float64 `json:"uncategorized_expense_count"` } `json:"expense_reports"` Message string `json:"message"` }
ExpenseReportResponse is the data returned by GetExpenseReports
type OrganizationResponse ¶
type OrganizationResponse struct { Code int `json:"code"` Message string `json:"message"` Organizations []struct { AccountCreatedDate string `json:"account_created_date"` ContactName string `json:"contact_name"` CurrencyCode string `json:"currency_code"` CurrencyFormat string `json:"currency_format"` CurrencyID string `json:"currency_id"` CurrencySymbol string `json:"currency_symbol"` Email string `json:"email"` FiscalYearStartMonth int `json:"fiscal_year_start_month"` IsDefaultOrg bool `json:"is_default_org"` IsOrgActive bool `json:"is_org_active"` LanguageCode string `json:"language_code"` Name string `json:"name"` OrganizationID string `json:"organization_id"` PricePrecision int `json:"price_precision"` TimeZone string `json:"time_zone"` } `json:"organizations"` }
OrganizationResponse is the data returned by GetOrganization