Documentation
¶
Index ¶
- func New(httpClient *http.Client, opts ...Option) *client
- func UnmarshalError(status int, body []byte) error
- type Account
- type AccountID
- type Client
- type CounterParty
- type Error
- type FetchTransactionOptions
- type Merchant
- type MerchantID
- type Option
- type Owner
- type Pot
- type PotID
- type Transaction
- type TransactionID
- type UserID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UnmarshalError ¶
Types ¶
type Account ¶
type Account struct {
ID AccountID `json:"id"`
Description string `json:"description"`
CreatedAt time.Time `json:"created"`
Closed bool `json:"closed"`
Currency string `json:"currency"`
Type string `json:"type"`
OwnerType string `json:"owner_type"`
CountryCode string `json:"country_code"`
CountryCodeAlpha3 string `json:"country_code_alpha3"`
AccountNumber string `json:"account_number"`
SortCode string `json:"sort_code"`
Owners []*Owner `json:"owners"`
}
type Client ¶
type Client interface {
FetchAccounts(ctx context.Context) ([]*Account, error)
FetchPots(ctx context.Context, accountID AccountID) ([]*Pot, error)
FetchTransaction(ctx context.Context, transactionID TransactionID) (*Transaction, error)
FetchTransactionsSince(ctx context.Context, opts FetchTransactionOptions) ([]*Transaction, error)
}
type CounterParty ¶
type Error ¶
func (Error) Error ¶
Error (statusCode=400, code=bad_request.bad_time_range, message=Error listing hydrated transactions by account) Error (statusCode=400, code=bad_request.invalid_time_range, message=The time range you have requested is too large, please use the `since` and `before` parameters to request smaller ranges. Learn more in our community post: https://community.monzo.com/t/changes-when-listing-with-our-api/158676) Error (statusCode=403, code=forbidden.verification_required, message=Verification required) when requesting old transactions.
type FetchTransactionOptions ¶
type Merchant ¶
type Merchant struct {
ID MerchantID `json:"id"`
Name string `json:"name"`
Category string `json:"category"`
Online bool `json:"online"`
Atm bool `json:"atm"`
}
type MerchantID ¶
type MerchantID string
type Transaction ¶
type Transaction struct {
ID TransactionID `json:"id"`
Description string `json:"description"`
CreatedAt time.Time `json:"created"`
Amount domain.Money `json:"amount"`
UserNotes string `json:"notes"`
CategoryName string `json:"category"`
SettledAt *time.Time `json:"settled"`
LocalAmount domain.Money `json:"local_money"`
UpdatedAt time.Time `json:"updated"`
AccountID AccountID `json:"account_id"`
AmountIsPending bool `json:"amount_is_pending"`
Scheme string `json:"scheme"`
Merchant *Merchant `json:"merchant"`
CounterParty *CounterParty `json:"counterparty"`
DeclineReason string `json:"decline_reason"`
Metadata map[string]string
}
func (*Transaction) UnmarshalJSON ¶
func (t *Transaction) UnmarshalJSON(data []byte) error
type TransactionID ¶
type TransactionID string
Click to show internal directories.
Click to hide internal directories.