github.com/stripe/stripe-go/v76@v76.25.0/financialconnections_account.go (about)

     1  //
     2  //
     3  // File generated from our OpenAPI spec
     4  //
     5  //
     6  
     7  package stripe
     8  
     9  // Type of account holder that this account belongs to.
    10  type FinancialConnectionsAccountAccountHolderType string
    11  
    12  // List of values that FinancialConnectionsAccountAccountHolderType can take
    13  const (
    14  	FinancialConnectionsAccountAccountHolderTypeAccount  FinancialConnectionsAccountAccountHolderType = "account"
    15  	FinancialConnectionsAccountAccountHolderTypeCustomer FinancialConnectionsAccountAccountHolderType = "customer"
    16  )
    17  
    18  // The `type` of the balance. An additional hash is included on the balance with a name matching this value.
    19  type FinancialConnectionsAccountBalanceType string
    20  
    21  // List of values that FinancialConnectionsAccountBalanceType can take
    22  const (
    23  	FinancialConnectionsAccountBalanceTypeCash   FinancialConnectionsAccountBalanceType = "cash"
    24  	FinancialConnectionsAccountBalanceTypeCredit FinancialConnectionsAccountBalanceType = "credit"
    25  )
    26  
    27  // The status of the last refresh attempt.
    28  type FinancialConnectionsAccountBalanceRefreshStatus string
    29  
    30  // List of values that FinancialConnectionsAccountBalanceRefreshStatus can take
    31  const (
    32  	FinancialConnectionsAccountBalanceRefreshStatusFailed    FinancialConnectionsAccountBalanceRefreshStatus = "failed"
    33  	FinancialConnectionsAccountBalanceRefreshStatusPending   FinancialConnectionsAccountBalanceRefreshStatus = "pending"
    34  	FinancialConnectionsAccountBalanceRefreshStatusSucceeded FinancialConnectionsAccountBalanceRefreshStatus = "succeeded"
    35  )
    36  
    37  // The type of the account. Account category is further divided in `subcategory`.
    38  type FinancialConnectionsAccountCategory string
    39  
    40  // List of values that FinancialConnectionsAccountCategory can take
    41  const (
    42  	FinancialConnectionsAccountCategoryCash       FinancialConnectionsAccountCategory = "cash"
    43  	FinancialConnectionsAccountCategoryCredit     FinancialConnectionsAccountCategory = "credit"
    44  	FinancialConnectionsAccountCategoryInvestment FinancialConnectionsAccountCategory = "investment"
    45  	FinancialConnectionsAccountCategoryOther      FinancialConnectionsAccountCategory = "other"
    46  )
    47  
    48  // The status of the last refresh attempt.
    49  type FinancialConnectionsAccountOwnershipRefreshStatus string
    50  
    51  // List of values that FinancialConnectionsAccountOwnershipRefreshStatus can take
    52  const (
    53  	FinancialConnectionsAccountOwnershipRefreshStatusFailed    FinancialConnectionsAccountOwnershipRefreshStatus = "failed"
    54  	FinancialConnectionsAccountOwnershipRefreshStatusPending   FinancialConnectionsAccountOwnershipRefreshStatus = "pending"
    55  	FinancialConnectionsAccountOwnershipRefreshStatusSucceeded FinancialConnectionsAccountOwnershipRefreshStatus = "succeeded"
    56  )
    57  
    58  // The list of permissions granted by this account.
    59  type FinancialConnectionsAccountPermission string
    60  
    61  // List of values that FinancialConnectionsAccountPermission can take
    62  const (
    63  	FinancialConnectionsAccountPermissionBalances      FinancialConnectionsAccountPermission = "balances"
    64  	FinancialConnectionsAccountPermissionOwnership     FinancialConnectionsAccountPermission = "ownership"
    65  	FinancialConnectionsAccountPermissionPaymentMethod FinancialConnectionsAccountPermission = "payment_method"
    66  	FinancialConnectionsAccountPermissionTransactions  FinancialConnectionsAccountPermission = "transactions"
    67  )
    68  
    69  // The status of the link to the account.
    70  type FinancialConnectionsAccountStatus string
    71  
    72  // List of values that FinancialConnectionsAccountStatus can take
    73  const (
    74  	FinancialConnectionsAccountStatusActive       FinancialConnectionsAccountStatus = "active"
    75  	FinancialConnectionsAccountStatusDisconnected FinancialConnectionsAccountStatus = "disconnected"
    76  	FinancialConnectionsAccountStatusInactive     FinancialConnectionsAccountStatus = "inactive"
    77  )
    78  
    79  // If `category` is `cash`, one of:
    80  //
    81  //   - `checking`
    82  //   - `savings`
    83  //   - `other`
    84  //
    85  // If `category` is `credit`, one of:
    86  //
    87  //   - `mortgage`
    88  //   - `line_of_credit`
    89  //   - `credit_card`
    90  //   - `other`
    91  //
    92  // If `category` is `investment` or `other`, this will be `other`.
    93  type FinancialConnectionsAccountSubcategory string
    94  
    95  // List of values that FinancialConnectionsAccountSubcategory can take
    96  const (
    97  	FinancialConnectionsAccountSubcategoryChecking     FinancialConnectionsAccountSubcategory = "checking"
    98  	FinancialConnectionsAccountSubcategoryCreditCard   FinancialConnectionsAccountSubcategory = "credit_card"
    99  	FinancialConnectionsAccountSubcategoryLineOfCredit FinancialConnectionsAccountSubcategory = "line_of_credit"
   100  	FinancialConnectionsAccountSubcategoryMortgage     FinancialConnectionsAccountSubcategory = "mortgage"
   101  	FinancialConnectionsAccountSubcategoryOther        FinancialConnectionsAccountSubcategory = "other"
   102  	FinancialConnectionsAccountSubcategorySavings      FinancialConnectionsAccountSubcategory = "savings"
   103  )
   104  
   105  // The list of data refresh subscriptions requested on this account.
   106  type FinancialConnectionsAccountSubscription string
   107  
   108  // List of values that FinancialConnectionsAccountSubscription can take
   109  const (
   110  	FinancialConnectionsAccountSubscriptionTransactions FinancialConnectionsAccountSubscription = "transactions"
   111  )
   112  
   113  // The [PaymentMethod type](https://stripe.com/docs/api/payment_methods/object#payment_method_object-type)(s) that can be created from this account.
   114  type FinancialConnectionsAccountSupportedPaymentMethodType string
   115  
   116  // List of values that FinancialConnectionsAccountSupportedPaymentMethodType can take
   117  const (
   118  	FinancialConnectionsAccountSupportedPaymentMethodTypeLink          FinancialConnectionsAccountSupportedPaymentMethodType = "link"
   119  	FinancialConnectionsAccountSupportedPaymentMethodTypeUSBankAccount FinancialConnectionsAccountSupportedPaymentMethodType = "us_bank_account"
   120  )
   121  
   122  // The status of the last refresh attempt.
   123  type FinancialConnectionsAccountTransactionRefreshStatus string
   124  
   125  // List of values that FinancialConnectionsAccountTransactionRefreshStatus can take
   126  const (
   127  	FinancialConnectionsAccountTransactionRefreshStatusFailed    FinancialConnectionsAccountTransactionRefreshStatus = "failed"
   128  	FinancialConnectionsAccountTransactionRefreshStatusPending   FinancialConnectionsAccountTransactionRefreshStatus = "pending"
   129  	FinancialConnectionsAccountTransactionRefreshStatusSucceeded FinancialConnectionsAccountTransactionRefreshStatus = "succeeded"
   130  )
   131  
   132  // If present, only return accounts that belong to the specified account holder. `account_holder[customer]` and `account_holder[account]` are mutually exclusive.
   133  type FinancialConnectionsAccountListAccountHolderParams struct {
   134  	// The ID of the Stripe account whose accounts will be retrieved.
   135  	Account *string `form:"account"`
   136  	// The ID of the Stripe customer whose accounts will be retrieved.
   137  	Customer *string `form:"customer"`
   138  }
   139  
   140  // Returns a list of Financial Connections Account objects.
   141  type FinancialConnectionsAccountListParams struct {
   142  	ListParams `form:"*"`
   143  	// If present, only return accounts that belong to the specified account holder. `account_holder[customer]` and `account_holder[account]` are mutually exclusive.
   144  	AccountHolder *FinancialConnectionsAccountListAccountHolderParams `form:"account_holder"`
   145  	// Specifies which fields in the response should be expanded.
   146  	Expand []*string `form:"expand"`
   147  	// If present, only return accounts that were collected as part of the given session.
   148  	Session *string `form:"session"`
   149  }
   150  
   151  // AddExpand appends a new field to expand.
   152  func (p *FinancialConnectionsAccountListParams) AddExpand(f string) {
   153  	p.Expand = append(p.Expand, &f)
   154  }
   155  
   156  // Retrieves the details of an Financial Connections Account.
   157  type FinancialConnectionsAccountParams struct {
   158  	Params `form:"*"`
   159  	// Specifies which fields in the response should be expanded.
   160  	Expand []*string `form:"expand"`
   161  }
   162  
   163  // AddExpand appends a new field to expand.
   164  func (p *FinancialConnectionsAccountParams) AddExpand(f string) {
   165  	p.Expand = append(p.Expand, &f)
   166  }
   167  
   168  // Lists all owners for a given Account
   169  type FinancialConnectionsAccountListOwnersParams struct {
   170  	ListParams `form:"*"`
   171  	Account    *string `form:"-"` // Included in URL
   172  	// Specifies which fields in the response should be expanded.
   173  	Expand []*string `form:"expand"`
   174  	// The ID of the ownership object to fetch owners from.
   175  	Ownership *string `form:"ownership"`
   176  }
   177  
   178  // AddExpand appends a new field to expand.
   179  func (p *FinancialConnectionsAccountListOwnersParams) AddExpand(f string) {
   180  	p.Expand = append(p.Expand, &f)
   181  }
   182  
   183  // Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions).
   184  type FinancialConnectionsAccountDisconnectParams struct {
   185  	Params `form:"*"`
   186  	// Specifies which fields in the response should be expanded.
   187  	Expand []*string `form:"expand"`
   188  }
   189  
   190  // AddExpand appends a new field to expand.
   191  func (p *FinancialConnectionsAccountDisconnectParams) AddExpand(f string) {
   192  	p.Expand = append(p.Expand, &f)
   193  }
   194  
   195  // Refreshes the data associated with a Financial Connections Account.
   196  type FinancialConnectionsAccountRefreshParams struct {
   197  	Params `form:"*"`
   198  	// Specifies which fields in the response should be expanded.
   199  	Expand []*string `form:"expand"`
   200  	// The list of account features that you would like to refresh.
   201  	Features []*string `form:"features"`
   202  }
   203  
   204  // AddExpand appends a new field to expand.
   205  func (p *FinancialConnectionsAccountRefreshParams) AddExpand(f string) {
   206  	p.Expand = append(p.Expand, &f)
   207  }
   208  
   209  // Subscribes to periodic refreshes of data associated with a Financial Connections Account.
   210  type FinancialConnectionsAccountSubscribeParams struct {
   211  	Params `form:"*"`
   212  	// Specifies which fields in the response should be expanded.
   213  	Expand []*string `form:"expand"`
   214  	// The list of account features to which you would like to subscribe.
   215  	Features []*string `form:"features"`
   216  }
   217  
   218  // AddExpand appends a new field to expand.
   219  func (p *FinancialConnectionsAccountSubscribeParams) AddExpand(f string) {
   220  	p.Expand = append(p.Expand, &f)
   221  }
   222  
   223  // Unsubscribes from periodic refreshes of data associated with a Financial Connections Account.
   224  type FinancialConnectionsAccountUnsubscribeParams struct {
   225  	Params `form:"*"`
   226  	// Specifies which fields in the response should be expanded.
   227  	Expand []*string `form:"expand"`
   228  	// The list of account features from which you would like to unsubscribe.
   229  	Features []*string `form:"features"`
   230  }
   231  
   232  // AddExpand appends a new field to expand.
   233  func (p *FinancialConnectionsAccountUnsubscribeParams) AddExpand(f string) {
   234  	p.Expand = append(p.Expand, &f)
   235  }
   236  
   237  // The account holder that this account belongs to.
   238  type FinancialConnectionsAccountAccountHolder struct {
   239  	// The ID of the Stripe account this account belongs to. Should only be present if `account_holder.type` is `account`.
   240  	Account *Account `json:"account"`
   241  	// ID of the Stripe customer this account belongs to. Present if and only if `account_holder.type` is `customer`.
   242  	Customer *Customer `json:"customer"`
   243  	// Type of account holder that this account belongs to.
   244  	Type FinancialConnectionsAccountAccountHolderType `json:"type"`
   245  }
   246  type FinancialConnectionsAccountBalanceCash struct {
   247  	// The funds available to the account holder. Typically this is the current balance less any holds.
   248  	//
   249  	// Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
   250  	//
   251  	// Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder.
   252  	Available map[string]int64 `json:"available"`
   253  }
   254  type FinancialConnectionsAccountBalanceCredit struct {
   255  	// The credit that has been used by the account holder.
   256  	//
   257  	// Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
   258  	//
   259  	// Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder.
   260  	Used map[string]int64 `json:"used"`
   261  }
   262  
   263  // The most recent information about the account's balance.
   264  type FinancialConnectionsAccountBalance struct {
   265  	// The time that the external institution calculated this balance. Measured in seconds since the Unix epoch.
   266  	AsOf   int64                                     `json:"as_of"`
   267  	Cash   *FinancialConnectionsAccountBalanceCash   `json:"cash"`
   268  	Credit *FinancialConnectionsAccountBalanceCredit `json:"credit"`
   269  	// The balances owed to (or by) the account holder.
   270  	//
   271  	// Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
   272  	//
   273  	// Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder.
   274  	Current map[string]int64 `json:"current"`
   275  	// The `type` of the balance. An additional hash is included on the balance with a name matching this value.
   276  	Type FinancialConnectionsAccountBalanceType `json:"type"`
   277  }
   278  
   279  // The state of the most recent attempt to refresh the account balance.
   280  type FinancialConnectionsAccountBalanceRefresh struct {
   281  	// The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch.
   282  	LastAttemptedAt int64 `json:"last_attempted_at"`
   283  	// Time at which the next balance refresh can be initiated. This value will be `null` when `status` is `pending`. Measured in seconds since the Unix epoch.
   284  	NextRefreshAvailableAt int64 `json:"next_refresh_available_at"`
   285  	// The status of the last refresh attempt.
   286  	Status FinancialConnectionsAccountBalanceRefreshStatus `json:"status"`
   287  }
   288  
   289  // The state of the most recent attempt to refresh the account owners.
   290  type FinancialConnectionsAccountOwnershipRefresh struct {
   291  	// The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch.
   292  	LastAttemptedAt int64 `json:"last_attempted_at"`
   293  	// The status of the last refresh attempt.
   294  	Status FinancialConnectionsAccountOwnershipRefreshStatus `json:"status"`
   295  }
   296  
   297  // The state of the most recent attempt to refresh the account transactions.
   298  type FinancialConnectionsAccountTransactionRefresh struct {
   299  	// Unique identifier for the object.
   300  	ID string `json:"id"`
   301  	// The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch.
   302  	LastAttemptedAt int64 `json:"last_attempted_at"`
   303  	// Time at which the next transaction refresh can be initiated. This value will be `null` when `status` is `pending`. Measured in seconds since the Unix epoch.
   304  	NextRefreshAvailableAt int64 `json:"next_refresh_available_at"`
   305  	// The status of the last refresh attempt.
   306  	Status FinancialConnectionsAccountTransactionRefreshStatus `json:"status"`
   307  }
   308  
   309  // A Financial Connections Account represents an account that exists outside of Stripe, to which you have been granted some degree of access.
   310  type FinancialConnectionsAccount struct {
   311  	APIResource
   312  	// The account holder that this account belongs to.
   313  	AccountHolder *FinancialConnectionsAccountAccountHolder `json:"account_holder"`
   314  	// The most recent information about the account's balance.
   315  	Balance *FinancialConnectionsAccountBalance `json:"balance"`
   316  	// The state of the most recent attempt to refresh the account balance.
   317  	BalanceRefresh *FinancialConnectionsAccountBalanceRefresh `json:"balance_refresh"`
   318  	// The type of the account. Account category is further divided in `subcategory`.
   319  	Category FinancialConnectionsAccountCategory `json:"category"`
   320  	// Time at which the object was created. Measured in seconds since the Unix epoch.
   321  	Created int64 `json:"created"`
   322  	// A human-readable name that has been assigned to this account, either by the account holder or by the institution.
   323  	DisplayName string `json:"display_name"`
   324  	// Unique identifier for the object.
   325  	ID string `json:"id"`
   326  	// The name of the institution that holds this account.
   327  	InstitutionName string `json:"institution_name"`
   328  	// The last 4 digits of the account number. If present, this will be 4 numeric characters.
   329  	Last4 string `json:"last4"`
   330  	// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
   331  	Livemode bool `json:"livemode"`
   332  	// String representing the object's type. Objects of the same type share the same value.
   333  	Object string `json:"object"`
   334  	// The most recent information about the account's owners.
   335  	Ownership *FinancialConnectionsAccountOwnership `json:"ownership"`
   336  	// The state of the most recent attempt to refresh the account owners.
   337  	OwnershipRefresh *FinancialConnectionsAccountOwnershipRefresh `json:"ownership_refresh"`
   338  	// The list of permissions granted by this account.
   339  	Permissions []FinancialConnectionsAccountPermission `json:"permissions"`
   340  	// The status of the link to the account.
   341  	Status FinancialConnectionsAccountStatus `json:"status"`
   342  	// If `category` is `cash`, one of:
   343  	//
   344  	//  - `checking`
   345  	//  - `savings`
   346  	//  - `other`
   347  	//
   348  	// If `category` is `credit`, one of:
   349  	//
   350  	//  - `mortgage`
   351  	//  - `line_of_credit`
   352  	//  - `credit_card`
   353  	//  - `other`
   354  	//
   355  	// If `category` is `investment` or `other`, this will be `other`.
   356  	Subcategory FinancialConnectionsAccountSubcategory `json:"subcategory"`
   357  	// The list of data refresh subscriptions requested on this account.
   358  	Subscriptions []FinancialConnectionsAccountSubscription `json:"subscriptions"`
   359  	// The [PaymentMethod type](https://stripe.com/docs/api/payment_methods/object#payment_method_object-type)(s) that can be created from this account.
   360  	SupportedPaymentMethodTypes []FinancialConnectionsAccountSupportedPaymentMethodType `json:"supported_payment_method_types"`
   361  	// The state of the most recent attempt to refresh the account transactions.
   362  	TransactionRefresh *FinancialConnectionsAccountTransactionRefresh `json:"transaction_refresh"`
   363  }
   364  
   365  // FinancialConnectionsAccountList is a list of Accounts as retrieved from a list endpoint.
   366  type FinancialConnectionsAccountList struct {
   367  	APIResource
   368  	ListMeta
   369  	Data []*FinancialConnectionsAccount `json:"data"`
   370  }