Documentation
¶
Index ¶
- type ACHRoute
- type Account
- type Card
- type Client
- func (c *Client) CreateACHRoute(ctx context.Context, r *CreateACHRouteRequest) (*ACHRoute, error)
- func (c *Client) CreateACHTransfer(ctx context.Context, r *CreateACHTransferRequest) (*Transfer, error)
- func (c *Client) CreateAccount(ctx context.Context, r *CreateAccountRequest) (*Account, error)
- func (c *Client) CreateCard(ctx context.Context, r *CreateCardRequest) (*Card, error)
- func (c *Client) ListACHRoute(ctx context.Context, r *ListACHRouteRequest) (*ListACHRouteResponse, error)
- func (c *Client) ListAccounts(ctx context.Context) (*ListAccountsResponse, error)
- func (c *Client) ListCards(ctx context.Context, r *ListCardsRequest) (*ListCardsResponse, error)
- func (c *Client) ListTransactions(ctx context.Context, r *ListTransactionsRequest) (*ListTransactionsResponse, error)
- type CreateACHRouteRequest
- type CreateACHTransferRequest
- type CreateAccountRequest
- type CreateCardRequest
- type Error
- type ListACHRouteRequest
- type ListACHRouteResponse
- type ListAccountsResponse
- type ListCardsRequest
- type ListCardsResponse
- type ListTransactionsRequest
- type ListTransactionsResponse
- type ResponseMetadata
- type Transaction
- type Transfer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ACHRoute ¶
type ACHRoute struct {
ID string `json:"id,omitempty"` // The ACH route's identifier.
// The identifier for the account this ACH route belongs to.
AccountID string `json:"account_id,omitempty"`
// The path that can be used in the API or your dashboard for the ACH
// route.
Path string `json:"path,omitempty"`
// The American Bankers' Association (ABA) Routing Transit Number (RTN).
RoutingNumber string `json:"routing_number,omitempty"`
// This indicates if payments can be made with the ACH route. The possible
// values are active, disabled, and canceled
Status string `json:"status,omitempty"`
AccountNumber string `json:"account_number,omitempty"` // The account number.
Name string `json:"name,omitempty"` // The name you chose for the ACH route.
}
Each account can have multiple account and routing numbers. We recommend that you use a set per vendor. This is similar to how you use different passwords for different websites.
type Account ¶
type Account struct {
ID string `json:"id,omitempty"` // The account identifier.
// The current balance of the account in the minor unit of the currency.
// For dollars, for example, this is cents.
Balance int `json:"balance,omitempty"`
// The identifier for the entity this account belongs to.
EntityID string `json:"entity_id,omitempty"`
// The interest accrued but not yet paid.
InterestAccrued string `json:"interest_accrued,omitempty"`
// The latest ISO 8601 date on which interest was accrued.
InterestAccruedAt string `json:"interest_accrued_at,omitempty"`
// The account path that can be used in the API or your dashboard.
Path string `json:"path,omitempty"`
Currency string `json:"currency,omitempty"` // The ISO 4217 code for the account currency.
Name string `json:"name,omitempty"` // The name you chose for the account.
}
Accounts are your bank accounts with bnk.dev. They can store money and receive & originate transfers.
type Card ¶
type Card struct {
ID string `json:"id,omitempty"` // The card identifier.
// The identifier for the account this card belongs to.
AccountID string `json:"account_id,omitempty"`
// The street address you set for the card.
AddressLine1 string `json:"address_line1,omitempty"`
// The card's expiry year and month in the form YYYY-MM.
Expiry string `json:"expiry,omitempty"`
// The name you chose for the card. This doesn't necessarily need to be
// the cardholder name and it's not used when authorizing payments.
Name string `json:"name,omitempty"`
// The path that can be used in the API or your dashboard for the card.
Path string `json:"path,omitempty"`
// The credit card number.
PrimaryAccountNumber string `json:"primary_account_number,omitempty"`
// This indicates if payments can be made with the card. The possible
// values are active, disabled, and canceled.
Status string `json:"status,omitempty"`
// This indicates how the card can be used. The possible values are
// card_on_file for cards you use online, physical for cards we mail to
// you, and apple_pay for Apple Pay cards you can load to your phone.
// Currently, all cards are card_on_file.
UseCase string `json:"use_case,omitempty"`
// The three-digit verification code for the card. It's also known as the
// Card Verification Code (CVC), the Card Verification Value (CVV), or the
// Card Identification (CID).
VerificationCode string `json:"verification_code,omitempty"`
AddressZip string `json:"address_zip,omitempty"` // The ZIP code you set for the card.
}
Cards are credit cards. Currently they're online-only but in the future we'll mail you physical cards too.
type Client ¶
type Client struct {
Base string
HTTP http.Client
EnableTelemetry bool
// contains filtered or unexported fields
}
func (*Client) CreateACHRoute ¶
func (*Client) CreateACHTransfer ¶
func (*Client) CreateAccount ¶
func (*Client) CreateCard ¶
func (*Client) ListACHRoute ¶
func (c *Client) ListACHRoute(ctx context.Context, r *ListACHRouteRequest) (*ListACHRouteResponse, error)
Returns a list of agent objects that match the provided query.
func (*Client) ListAccounts ¶
func (c *Client) ListAccounts(ctx context.Context) (*ListAccountsResponse, error)
Returns a list of agent objects that match the provided query.
func (*Client) ListCards ¶
func (c *Client) ListCards(ctx context.Context, r *ListCardsRequest) (*ListCardsResponse, error)
Returns a list of agent objects that match the provided query.
func (*Client) ListTransactions ¶
func (c *Client) ListTransactions(ctx context.Context, r *ListTransactionsRequest) (*ListTransactionsResponse, error)
Returns a list of agent objects that match the provided query.
type CreateACHRouteRequest ¶
type CreateACHTransferRequest ¶
type CreateACHTransferRequest struct {
AccountID string `json:"account_id,omitempty"`
// The account number for the destination account
AccountNumber string `json:"account_number,omitempty"`
// The transfer amount in the minor unit of the account currency. For
// dollars, for example, this is cents.
Amount int `json:"amount,omitempty"`
// The American Bankers' Association (ABA) Routing Transit Number (RTN)
// for the destination account.
RoutingNumber string `json:"routing_number,omitempty"`
// The description you choose to give the transfer. This will be shown to
// the recipient.
StatementDescriptor string `json:"statement_descriptor,omitempty"`
}
type CreateAccountRequest ¶
type CreateAccountRequest struct {
Name string `json:"name,omitempty"` // The name you choose for the account.
}
type CreateCardRequest ¶
type CreateCardRequest struct {
AccountID string `json:"account_id,omitempty"`
// The street address you set for the card.
AddressLine1 string `json:"address_line1,omitempty"`
// The name you chose for the card. This doesn't necessarily need to be
// the cardholder name and it's not used when authorizing payments.
Name string `json:"name,omitempty"`
AddressZip string `json:"address_zip,omitempty"` // The ZIP code you set for the card.
}
type ListACHRouteRequest ¶
type ListACHRouteRequest struct {
AccountID string `json:"account_id,omitempty"`
}
type ListACHRouteResponse ¶
type ListACHRouteResponse struct {
Data []ACHRoute `json:"data,omitempty"`
ResponseMetadata ResponseMetadata `json:"response_metadata,omitempty"`
}
type ListAccountsResponse ¶
type ListAccountsResponse struct {
Data []Account `json:"data,omitempty"`
ResponseMetadata ResponseMetadata `json:"response_metadata,omitempty"`
}
type ListCardsRequest ¶
type ListCardsRequest struct {
AccountID string `json:"account_id,omitempty"`
}
type ListCardsResponse ¶
type ListCardsResponse struct {
Data []Card `json:"data,omitempty"`
ResponseMetadata ResponseMetadata `json:"response_metadata,omitempty"`
}
type ListTransactionsRequest ¶
type ListTransactionsRequest struct {
AccountID string `json:"account_id,omitempty"`
}
type ListTransactionsResponse ¶
type ListTransactionsResponse struct {
Data []Transaction `json:"data,omitempty"`
ResponseMetadata ResponseMetadata `json:"response_metadata,omitempty"`
}
type ResponseMetadata ¶
type ResponseMetadata struct {
NextCursor string `json:"next_cursor,omitempty"`
}
type Transaction ¶
type Transaction struct {
ID string `json:"id,omitempty"` // The account identifier.
// The identifier for the account this transaction belongs to.
AccountID string `json:"account_id,omitempty"`
// The transaction amount in the minor unit of the account currency. For
// dollars, for example, this is cents.
Amount int `json:"amount,omitempty"`
// For a transaction related to a transfer, this is the description you
// provide. For a transaction related to a payment, this is the
// description the vendor provides.
Description string `json:"description,omitempty"`
// The transaction path that can be used in the API or your dashboard.
Path string `json:"path,omitempty"`
// The identifier for the route this transaction came through. Routes are
// things like cards and ACH details.
RouteID string `json:"route_id,omitempty"`
// This is an object giving more details on the network-level event that
// caused the transaction. For example, for a card transaction this lists
// the merchant's industry and location.
Source json.RawMessage `json:"source,omitempty"`
Date string `json:"date,omitempty"` // The ISO 8601 date on which the transaction occured.
}
Transactions are the immutable additions and removals of money from your bank account.
type Transfer ¶
type Transfer struct {
ID string `json:"id,omitempty"`
Amount int `json:"amount,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
Currency string `json:"currency,omitempty"`
Description string `json:"description,omitempty"`
DestinationAccountID string `json:"destination_account_id,omitempty"`
Network string `json:"network,omitempty"`
Status string `json:"status,omitempty"`
TemplateID string `json:"template_id,omitempty"`
}
Transfers are how you move money from your account. You can move money between your bnk.dev accounts or you can move money to accounts held at other banks.