Documentation
¶
Overview ¶
Package expensify provides a client for the Expensify API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Expense ExpenseService // contains filtered or unexported fields }
Client provides the Expensify HTTP API operations.
func NewClient ¶
NewClient returns a new Expensify API client. The credentials can be retrieved from https://www.expensify.com/tools/integrations.
type Expense ¶
type Expense struct { // The name of the expense's merchant. Merchant string `json:"merchant"` // The date of the expense. Created Time `json:"created"` // The amount of the expense, in cents. Amount int `json:"amount"` // The three-letter currency code of the expense. Currency string `json:"currency"` // An unique, custom string that you specify. This will help identify the // expense after being exported. Optional. ExternalID string `json:"externalID,omitempty"` // The name of the category to assign to the expense. Optional. Category string `json:"category,omitempty"` // The name of the tag to assign to the expense. Optional. Tag string `json:"tag,omitempty"` // Whether to mark the expense as billable or not. Optional. Billable bool `json:"billable,omitempty"` // Whether to mark the expense as reimbursable or not. Optional. Reimbursable bool `json:"reimbursable,omitempty"` // An expense comment. Optional. Comment string `json:"comment,omitempty"` // The ID of the report you want to attach the expense to. Optional. ReportID int `json:"reportID,omitempty"` // The ID of the policy the tax belongs to. Optional. PolicyID string `json:"policyID,omitempty"` // Optional. Tax *Tax `json:"tax,omitempty"` }
Expense is an Expensify expense.
type ExpenseService ¶
type ExpenseService interface { // Create submits expenses to the given account. Create(ctx context.Context, employeeEmail string, expenses []*Expense) ([]*SubmittedExpense, error) }
ExpenseService bundles all operations on expenses.
type SubmittedExpense ¶
type SubmittedExpense struct { Expense // The transaction ID for the submitted expense. TransactionID string `json:"transactionID,omitempty"` }
SubmittedExpense is an Expensify expense which has been submitted to Expensify and contains additional details.
type Tax ¶
type Tax struct { // The tax RateID as defined in the policy. RateID string `json:"rateID"` // Amount paid on the expense. Specify it when only a sub-part of the // expense was taxed. Optional Amount int `json:"amount,omitempty"` }
Tax applied to an expense.
type Time ¶
Time which marshals to and unmarshals from "yyyy-mm-dd" format.
func (Time) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Time) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
Click to show internal directories.
Click to hide internal directories.