lendingclub

package module
v0.0.0-...-7204cdd Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2017 License: MIT Imports: 10 Imported by: 1

README

Lending Club

Build Status Documentation

Go client for the Lending Club API.

License

Lending Club is released under MIT license. See LICENSE

Documentation

Overview

Go wrapper for the Lending Club API.

See https://www.lendingclub.com/developers/lc-api.action for more details on the API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Field   string `json:"field"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

type AccountsResource

type AccountsResource struct {
	// contains filtered or unexported fields
}

func (*AccountsResource) AddFunds

func (ar *AccountsResource) AddFunds(fundTransfer *FundsPayload) (*Deposit, error)

func (*AccountsResource) AvailableCash

func (ar *AccountsResource) AvailableCash() (*AvailableCash, error)

func (*AccountsResource) CancelFunds

func (ar *AccountsResource) CancelFunds(transferIds []int) (*CancellationResult, error)

func (*AccountsResource) CreatePortfolio

func (ar *AccountsResource) CreatePortfolio(name, description string) (*Portfolio, error)

func (*AccountsResource) Notes

func (ar *AccountsResource) Notes() ([]Note, error)

TODO: Detailed Notes Owned

func (*AccountsResource) PendingFunds

func (ar *AccountsResource) PendingFunds() ([]Transfer, error)

func (*AccountsResource) Portfolios

func (ar *AccountsResource) Portfolios() ([]Portfolio, error)

func (*AccountsResource) SubmitOrder

func (ar *AccountsResource) SubmitOrder(accountID int, orders []OrderSubmission) (*OrderInstruct, error)

func (*AccountsResource) Summary

func (ar *AccountsResource) Summary() (*Summary, error)

func (*AccountsResource) WithdrawFunds

func (ar *AccountsResource) WithdrawFunds(amount decimal.Decimal) (*Withdrawal, error)

type AvailableCash

type AvailableCash struct {
	InvestorID    int
	AvailableCash decimal.Decimal
}

type Cancellation

type Cancellation struct {
	TransferID int    `json:"transferId"`
	Status     string `json:"status"`
	Message    string `json:"message"`
}

type CancellationResult

type CancellationResult struct {
	InvestorID    int            `json:"investorId"`
	Cancellations []Cancellation `json:"cancellationResults"`
}

type Client

type Client struct {
	*http.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(authToken string, client *http.Client) *Client

NewClient creates a new Client with the given auth token and an optional *http.Client. If the *http.Client is nil, http.DefaultClient will be used.

func (*Client) Accounts

func (c *Client) Accounts(investorID int) *AccountsResource

func (*Client) Loans

func (c *Client) Loans() *LoansResource

type Deposit

type Deposit struct {
	FundsPayload
	InvestorID                 int    `json:"investorId"`
	Frequency                  string `json:"frequency"`
	EstimatedFundsTransferDate Time   `json:"estimatedFundsTransferDate"`
}

type ErrorResponse

type ErrorResponse struct {
	Errors []APIError `json:"errors"`
}

type FundsPayload

type FundsPayload struct {
	Amount            decimal.Decimal `json:"amount"`
	TransferFrequency string          `json:"transferFrequency"`
	StartDate         *Time           `json:"startDate,omitempty"`
	EndDate           *Time           `json:"endDate,omitempty"`
}

type Loan

type Loan struct {
	ID                                       int             `json:"id"`
	MemberID                                 int             `json:"memberId"`
	Term                                     int             `json:"term"`
	InterestRate                             decimal.Decimal `json:"intRate"`
	ExpectedDefaultRate                      decimal.Decimal `json:"expDefaultRate"`
	ServiceFeeRate                           decimal.Decimal `json:"serviceFeeRate"`
	Installment                              decimal.Decimal `json:"installment"`
	Grade                                    string          `json:"grade"`
	SubGrade                                 string          `json:"subGrade"`
	EmploymentLength                         *int            `json:"empLength"`
	HomeOwnership                            string          `json:"homeOwnership"`
	AnnualIncome                             decimal.Decimal `json:"annualInc"`
	IsIncomeVerified                         string          `json:"isIncV"`
	AcceptDate                               Time            `json:"acceptD"`
	ExpireDate                               Time            `json:"expD"`
	ListDate                                 Time            `json:"listD"`
	CreditPullDate                           Time            `json:"creditPullD"`
	ReviewStatusDate                         *Time           `json:"reviewStatusD"`
	ReviewStatus                             string          `json:"reviewStatus"`
	Description                              string          `json:"desc"`
	Purpose                                  string          `json:"purpose"`
	AddressZip                               string          `json:"addrZip"`
	AddressState                             string          `json:"addrState"`
	InvestorCount                            int             `json:"investorCount"`
	InitialListStatusExpireDate              *Time           `json:"ilsExpD"`
	InitialListStatus                        string          `json:"initialListStatus"`
	EmploymentTitle                          string          `json:"empTitle"`
	AccountsNowDelinquent                    int             `json:"accNowDelinq"`
	AccountsOpenPast24Months                 int             `json:"accOpenPast24Mths"`
	BankcardsOpenToBuy                       int             `json:"bcOpenToBuy"`
	PercentBankcardsGreaterThan75            decimal.Decimal `json:"percentBcGt75"`
	BankcardsUtilization                     decimal.Decimal `json:"bcUtil"`
	DebtToIncome                             decimal.Decimal `json:"dti"`
	DelinquenciesIn2Years                    int             `json:"delinq2Yrs"`
	DelinquentAmount                         decimal.Decimal `json:"delinqAmnt"`
	EarliestCreditLine                       *Time           `json:"earliestCrLine"`
	FICORangeLow                             int             `json:"ficoRangeLow"`
	FICORangeHigh                            int             `json:"ficoRangeHigh"`
	InquiriesLast6Months                     int             `json:"incLast6Mths"`
	MonthsSinceLastDelinquency               int             `json:"mthsSinceLastDelinq"`
	MonthsSinceLastRecord                    int             `json:"mthsSinceLastRecord"`
	MonthsSinceRecentInquiry                 int             `json:"mthsSinceRecentInq"`
	MonthsSinceRecentRevolvingDelinquency    int             `json:"mthsSinceRecentRevolDelinq"`
	MonthsSinceRecentBankcard                int             `json:"mthsSinceRecentBc"`
	MortgageAccounts                         int             `json:"mortAcc"`
	OpenAccounts                             int             `json:"openAcc"`
	PublicRecords                            int             `json:"pubRec"`
	TotalBalanceExcludingMortgage            int             `json:"totalBalExMort"`
	RevolvingBalance                         decimal.Decimal `json:"revolBal"`
	RevolvingUtilization                     decimal.Decimal `json:"revolUtil"`
	TotalBankcardLimit                       int             `json:"totalBcLimit"`
	TotalAccounts                            int             `json:"totalAcc"`
	TotalInstallmentHighCreditLimit          int             `json:"totalIHighCreditLimit"`
	RevolvingAccounts                        int             `json:"numRevAccts"`
	MonthsSinceRecentBankcardDelinquency     int             `json:"mthsSinceRecentBcDlq"`
	PublicRecordBankruptcies                 int             `json:"pubRecBankruptcies"`
	AccountsEver120DaysPastDue               int             `json:"numAcctsEver120Ppd"`
	ChargeoffWithin12Months                  int             `json:"chargeoffWithin12Mths"`
	CollectionsIn12MonthsExcludingMedical    int             `json:"collections12MthsExMed"`
	TaxLiens                                 int             `json:"taxLiens"`
	MonthsSinceLastMajorDerogatoryMark       int             `json:"mthsSinceLastMajorDerog"`
	SatisfactoryAccounts                     int             `json:"numSats"`
	AccountsOpenedInPast12Months             int             `json:"numTlOpPast12m"`
	MonthsSinceRecentAccountOpened           int             `json:"moSinRcntTl"`
	TotalHighCreditLimit                     int             `json:"totHiCredLim"`
	TotalCurrentBalance                      int             `json:"totCurBal"`
	AverageCurrentBalance                    int             `json:"avgCurBal"`
	BankcardAccounts                         int             `json:"numBcTl"`
	ActiveBankcardAccounts                   int             `json:"numActvBctl"`
	SatisfactoryBankcardAccounts             int             `json:"numBcSats"`
	PercentTradesNeverDelinquent             int             `json:"pctTlNvrDlq"`
	Accounts90DaysPastDueIn24Months          int             `json:"numTl90gDpd24m"`
	Accounts30DaysPastDueIn2Months           int             `json:"numTl30dpd"`
	Accounts120DaysPastDueIn2Months          int             `json:"numTl120dpd2m"`
	InstallmentAccounts                      int             `json:"numIlTl"`
	MonthsSinceOldestInstallmentAccount      int             `json:"moSinOldIlAcct"`
	ActiveRevolvingTrades                    int             `json:"numActvRevTl"`
	MonthsSinceOldestRevolvingAccount        int             `json:"moSinOldRevTlOp"`
	MonthsSinceRecentRevolvingAccount        int             `json:"moSinRcntRevTlOp"`
	TotalRevolvingHighCreditLimit            int             `json:"totalRevHiLim"`
	RevolvingTradesWithPositiveBalance       int             `json:"numRevTlBalGt0"`
	OpenRevolvingAccounts                    int             `json:"numOpRevTl"`
	TotalCollectionAmounts                   int             `json:"totCollAmt"`
	FundedAmount                             decimal.Decimal `json:"fundedAmount"`
	LoanAmount                               decimal.Decimal `json:"loanAmount"`
	ApplicationType                          string          `json:"applicationType"`
	JointAnnualIncome                        decimal.Decimal `json:"annualIncJoint"`
	JointDebtToIncome                        decimal.Decimal `json:"dtiJoint"`
	IsJointIncomeVerified                    string          `json:"isIncVJoint"`
	OpenTradesInLast6Months                  int             `json:"openAcc6m"`
	ActiveInstallmentsInLast6Months          int             `json:"openIl6m"`
	OpenedInstallmentsInLast12Months         int             `json:"openIl12m"`
	OpenedInstallmentsInLast24Months         int             `json:"openIl24m"`
	MonthsSinceRecentInstallments            int             `json:"mthsSinceRcntIl"`
	TotalInstallmentsBalance                 decimal.Decimal `json:"totalBalIl"`
	InstallmentsUtilization                  decimal.Decimal `json:"iLUtil"`
	OpenedRevolvingTradesInLast12Months      int             `json:"openRv12m"`
	OpenedRevolvingTradesInLast24Months      int             `json:"openRv24m"`
	MaximumCurrentBalanceOnRevolvingAccounts decimal.Decimal `json:"maxBalBc"`
	AllUtilization                           decimal.Decimal `json:"allUtil"`
	PersonalFinancialInquiries               int             `json:"inqFi"`
	CreditUnionTrades                        int             `json:"totalCuTl"`
	CreditInquiriesInLast12Months            int             `json:"inqLast12m"`
}

type Loans

type Loans struct {
	AsOfDate Time   `json:"asOfDate"`
	Loans    []Loan `json:"loans"`
}

type LoansResource

type LoansResource struct {
	// contains filtered or unexported fields
}

func (*LoansResource) Listed

func (lr *LoansResource) Listed() (*Loans, error)

type Note

type Note struct {
	ID               decimal.Decimal `json:"noteId"`
	Amount           decimal.Decimal `json:"noteAmount"`
	LoanID           decimal.Decimal `json:"loanId"`
	OrderID          decimal.Decimal `json:"orderId"`
	InterestRate     decimal.Decimal `json:"interestRate"`
	LoanStatus       string          `json:"loanStatus"`
	Grade            string          `json:"grade"`
	LoanAmount       decimal.Decimal `json:"loanAmount"`
	LoanLength       int             `json:"loanLength"`
	OrderDate        Time            `json:"orderDate"`
	PaymentsReceived decimal.Decimal `json:"paymentsReceived"`
	// TODO: this may be nullable so Time should be a pointer
	IssueDate      Time `json:"issueDate"`
	LoanStatusDate Time `json:"loanStatusDate"`
}

type OrderConfirmation

type OrderConfirmation struct {
	LoanID          int             `json:"loanId"`
	RequestedAmount decimal.Decimal `json:"requestedAmount"`
	InvestedAmount  int             `json:"investedAmount"`
	ExecutionStatus string          `json:"executionStatus"`
}

type OrderInstruct

type OrderInstruct struct {
	ID                 int                 `json:"orderInstructId"`
	OrderConfirmations []OrderConfirmation `json:"orderConfirmations"`
}

type OrderSubmission

type OrderSubmission struct {
	LoanID      int             `json:"loanId"`
	Amount      decimal.Decimal `json:"requestedAmount"`
	PortfolioID int             `json:"portfolioId,omitempty"`
}

type Portfolio

type Portfolio struct {
	ID          int    `json:"portfolioId,omitempty"`
	Name        string `json:"portfolioName"`
	Description string `json:"portfolioDescription,omitempty"`
}

type Summary

type Summary struct {
	AvailableCash        decimal.Decimal
	InvestorID           int
	AccruedInterest      decimal.Decimal
	OutstandingPrincipal decimal.Decimal
	AccountTotal         decimal.Decimal
	TotalNotes           int
	TotalPortfolios      int
	InFundingBalance     decimal.Decimal
	ReceivedInterest     decimal.Decimal
	ReceivedPrincipal    decimal.Decimal
	ReceivedLateFees     decimal.Decimal
}

type Time

type Time struct {
	time.Time
}

Time wraps time.Time to provide un/marshaling JSON functionality for lendingclub's time format.

func (Time) MarshalJSON

func (lct Time) MarshalJSON() ([]byte, error)

func (*Time) UnmarshalJSON

func (lct *Time) UnmarshalJSON(b []byte) error

type Transfer

type Transfer struct {
	TransferID    int             `json:"transferId"`
	TransferDate  Time            `json:"transferDate"`
	Amount        decimal.Decimal `json:"amount"`
	SourceAccount string          `json:"sourceAccount"`
	Status        string          `json:"status"`
	Frequency     string          `json:"frequency"`
	EndDate       Time            `json:"endDate"`
	Operation     string          `json:"operation"`
	Cancellable   bool            `json:"cancellable"`
}

type Withdrawal

type Withdrawal struct {
	Amount                     decimal.Decimal `json:"amount"`
	InvestorID                 int             `json:"investorId"`
	EstimatedFundsTransferDate Time            `json:"estimatedFundsTransferDate"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL