Documentation
¶
Index ¶
- func WithClientID(id int64) requestOption
- type Attachment
- type Client
- func (hv *Client) CreateExpense(e *CreateExpense) error
- func (hv *Client) CreateInvoice(invoice *Invoice) error
- func (hv *Client) FetchCustomers() ([]*Customer, error)
- func (hv *Client) FetchExpenses() ([]*Expense, error)
- func (hv *Client) FetchInvoices(opts ...requestOption) ([]*Invoice, error)
- func (hv *Client) GetCompanyInfo() (*Company, error)
- func (hv *Client) GetRecipients(customer int64) ([]*Recipient, error)
- type Company
- type CreateExpense
- type Customer
- type Expense
- type Invoice
- type LineItem
- type Project
- type Recipient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithClientID ¶
func WithClientID(id int64) requestOption
Types ¶
type Attachment ¶
func (*Attachment) Download ¶
func (a *Attachment) Download() (io.ReadCloser, error)
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateExpense ¶
func (hv *Client) CreateExpense(e *CreateExpense) error
func (*Client) CreateInvoice ¶
func (*Client) FetchCustomers ¶
func (*Client) FetchExpenses ¶
func (*Client) FetchInvoices ¶
func (*Client) GetCompanyInfo ¶
type Company ¶
type Company struct { BaseURI string `json:"base_uri"` FullDomain string `json:"full_domain"` Name string `json:"name"` IsActive bool `json:"is_active"` WeekStartDay string `json:"week_start_day"` WantsTimestampTimers bool `json:"wants_timestamp_timers"` TimeFormat string `json:"time_format"` PlanType string `json:"plan_type"` ExpenseFeature bool `json:"expense_feature"` InvoiceFeature bool `json:"invoice_feature"` EstimateFeature bool `json:"estimate_feature"` ApprovalFeature bool `json:"approval_feature"` Clock string `json:"clock"` DecimalSymbol string `json:"decimal_symbol"` ThousandsSeparator string `json:"thousands_separator"` ColorScheme string `json:"color_scheme"` }
type CreateExpense ¶
type Invoice ¶
type Invoice struct { ID int64 `json:"id,omitempty"` ClientID int64 `json:"client_id,omitempty"` ClientKey string `json:"client_key,omitempty"` Number string `json:"number,omitempty"` PurchaseOrder string `json:"purchase_order,omitempty"` State string `json:"state,omitempty"` SentAt time.Time `json:"sent_at,omitempty"` PaidAt time.Time `json:"paid_at,omitempty"` ClosedAt time.Time `json:"closed_at,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` Customer *Customer `json:"client,omitempty"` Amount float64 `json:"amount,omitempty"` DueAmount float64 `json:"due_amount,omitempty"` Tax float64 `json:"tax,omitempty"` TaxAmount float64 `json:"tax_amount,omitempty"` Tax2 float64 `json:"tax2,omitempty"` Tax2Amount float64 `json:"tax2_amount,omitempty"` Discount float64 `json:"discount,omitempty"` DiscountAmount float64 `json:"discount_amount,omitempty"` Subject string `json:"subject,omitempty"` Notes string `json:"notes,omitempty"` Currency string `json:"currency,omitempty"` PeriodStart string `json:"period_start,omitempty"` PeriodEnd string `json:"period_end,omitempty"` IssueDate string `json:"issue_date,omitempty"` DueDate string `json:"due_date,omitempty"` PaymentTerm string `json:"payment_term,omitempty"` PaymentOptions []string `json:"payment_options"` PaidDate string `json:"paid_date,omitempty"` LineItems []*LineItem `json:"line_items,omitempty"` // contains filtered or unexported fields }
func (*Invoice) AddPayment ¶
func (*Invoice) GetAttachments ¶
func (i *Invoice) GetAttachments() ([]*Attachment, error)
type LineItem ¶
type LineItem struct { // Unique ID for the line item. ID int64 `json:"id,omitempty"` // An object containing the associated project’s id, name, and code. Project *Project `json:"project,omitempty"` // The name of an invoice item category. Kind string `json:"kind,omitempty"` // Text description of the line item. Description string `json:"description,omitempty"` // The unit quantity of the item. Quantity float64 `json:"quantity,omitempty"` // The individual price per unit. UnitPrice float64 `json:"unit_price,omitempty"` // The line item subtotal (quantity * unit_price). Amount float64 `json:"amount,omitempty"` // Whether the invoice’s tax percentage applies to this line item. Taxed bool `json:"taxed,omitempty"` // Whether the invoice’s tax2 percentage applies to this line item. Taxed2 bool `json:"taxed_2,omitempty"` }
Click to show internal directories.
Click to hide internal directories.