Packages
stripity_stripe
3.3.2
3.3.2
3.3.1
3.2.0
3.1.1
3.1.0
3.0.0
2.17.3
2.17.2
2.17.1
2.17.0
2.16.0
2.15.1
2.15.0
2.14.1
2.14.0
2.13.0
2.12.1
2.12.0
2.11.0
2.10.0
2.9.0
2.8.0
2.7.2
2.7.1
2.7.0
2.6.0
2.5.0
2.4.0
2.3.0
2.2.3
2.2.2
2.2.1
2.2.0
2.1.0
2.0.1
2.0.0
2.0.0-alpha.11
2.0.0-alpha.10
2.0.0-alpha.9
2.0.0-alpha.8
2.0.0-alpha.7
2.0.0-alpha.6
2.0.0-alpha.5
2.0.0-alpha.4
2.0.0-alpha.3
2.0.0-alpha.2
2.0.0-alpha.1
1.6.2
1.6.1
1.6.0
1.4.0
1.3.0
1.2.0
1.1.0
0.5.0
0.4.0
0.3.0
0.2.0
A Stripe client for Elixir.
Current section
Files
Jump to
Current section
Files
lib/generated/treasury__financial_account.ex
defmodule Stripe.Treasury.FinancialAccount do
use Stripe.Entity
@moduledoc "Stripe Treasury provides users with a container for money called a FinancialAccount that is separate from their Payments balance.\nFinancialAccounts serve as the source and destination of Treasury’s money movement APIs."
(
defstruct [
:active_features,
:balance,
:country,
:created,
:features,
:financial_addresses,
:id,
:is_default,
:livemode,
:metadata,
:nickname,
:object,
:pending_features,
:platform_restrictions,
:restricted_features,
:status,
:status_details,
:supported_currencies
]
@typedoc "The `treasury.financial_account` type.\n\n * `active_features` The array of paths to active Features in the Features hash.\n * `balance` \n * `country` Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).\n * `created` Time at which the object was created. Measured in seconds since the Unix epoch.\n * `features` \n * `financial_addresses` The set of credentials that resolve to a FinancialAccount.\n * `id` Unique identifier for the object.\n * `is_default` \n * `livemode` Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.\n * `metadata` Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.\n * `nickname` The nickname for the FinancialAccount.\n * `object` String representing the object's type. Objects of the same type share the same value.\n * `pending_features` The array of paths to pending Features in the Features hash.\n * `platform_restrictions` The set of functionalities that the platform can restrict on the FinancialAccount.\n * `restricted_features` The array of paths to restricted Features in the Features hash.\n * `status` Status of this FinancialAccount.\n * `status_details` \n * `supported_currencies` The currencies the FinancialAccount can hold a balance in. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.\n"
@type t :: %__MODULE__{
active_features: term,
balance: term,
country: binary,
created: integer,
features: Stripe.Treasury.FinancialAccountFeatures.t(),
financial_addresses: term,
id: binary,
is_default: boolean,
livemode: boolean,
metadata: term | nil,
nickname: binary | nil,
object: binary,
pending_features: term,
platform_restrictions: term | nil,
restricted_features: term,
status: binary,
status_details: term,
supported_currencies: term
}
)
(
@typedoc "Adds an ABA FinancialAddress to the FinancialAccount."
@type aba :: %{optional(:requested) => boolean}
)
(
@typedoc "Enables ACH Debits via the InboundTransfers API."
@type ach :: %{optional(:requested) => boolean}
)
(
@typedoc "Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount."
@type card_issuing :: %{optional(:requested) => boolean}
)
(
@typedoc nil
@type created :: %{
optional(:gt) => integer,
optional(:gte) => integer,
optional(:lt) => integer,
optional(:lte) => integer
}
)
(
@typedoc "Represents whether this FinancialAccount is eligible for deposit insurance. Various factors determine the insurance amount."
@type deposit_insurance :: %{optional(:requested) => boolean}
)
(
@typedoc "Encodes whether a FinancialAccount has access to a particular feature. Stripe or the platform can control features via the requested field."
@type features :: %{
optional(:card_issuing) => card_issuing,
optional(:deposit_insurance) => deposit_insurance,
optional(:financial_addresses) => financial_addresses,
optional(:inbound_transfers) => inbound_transfers,
optional(:intra_stripe_flows) => intra_stripe_flows,
optional(:outbound_payments) => outbound_payments,
optional(:outbound_transfers) => outbound_transfers
}
)
(
@typedoc "Contains Features that add FinancialAddresses to the FinancialAccount."
@type financial_addresses :: %{optional(:aba) => aba}
)
(
@typedoc "A different bank account where funds can be deposited/debited in order to get the closing FA's balance to $0"
@type forwarding_settings :: %{
optional(:financial_account) => binary,
optional(:payment_method) => binary,
optional(:type) => :financial_account | :payment_method
}
)
(
@typedoc "Contains settings related to adding funds to a FinancialAccount from another Account with the same owner."
@type inbound_transfers :: %{optional(:ach) => ach}
)
(
@typedoc "Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment)."
@type intra_stripe_flows :: %{optional(:requested) => boolean}
)
(
@typedoc "Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money."
@type outbound_payments :: %{
optional(:ach) => ach,
optional(:us_domestic_wire) => us_domestic_wire
}
)
(
@typedoc "Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner."
@type outbound_transfers :: %{
optional(:ach) => ach,
optional(:us_domestic_wire) => us_domestic_wire
}
)
(
@typedoc "The set of functionalities that the platform can restrict on the FinancialAccount."
@type platform_restrictions :: %{
optional(:inbound_flows) => :restricted | :unrestricted,
optional(:outbound_flows) => :restricted | :unrestricted
}
)
(
@typedoc "Enables US domestic wire transfers via the OutboundPayments API."
@type us_domestic_wire :: %{optional(:requested) => boolean}
)
(
nil
@doc "<p>Returns a list of FinancialAccounts.</p>\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/treasury/financial_accounts`\n"
(
@spec list(
params :: %{
optional(:created) => created | integer,
optional(:ending_before) => binary,
optional(:expand) => list(binary),
optional(:limit) => integer,
optional(:starting_after) => binary,
optional(:status) => :closed | :open
},
opts :: Keyword.t()
) ::
{:ok, Stripe.List.t(Stripe.Treasury.FinancialAccount.t())}
| {:error, Stripe.ApiErrors.t()}
| {:error, term()}
def list(params \\ %{}, opts \\ []) do
path = Stripe.OpenApi.Path.replace_path_params("/v1/treasury/financial_accounts", [], [])
Stripe.Request.new_request(opts)
|> Stripe.Request.put_endpoint(path)
|> Stripe.Request.put_params(params)
|> Stripe.Request.put_method(:get)
|> Stripe.Request.make_request()
end
)
)
(
nil
@doc "<p>Retrieves the details of a FinancialAccount.</p>\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/treasury/financial_accounts/{financial_account}`\n"
(
@spec retrieve(
financial_account :: binary(),
params :: %{optional(:expand) => list(binary)},
opts :: Keyword.t()
) ::
{:ok, Stripe.Treasury.FinancialAccount.t()}
| {:error, Stripe.ApiErrors.t()}
| {:error, term()}
def retrieve(financial_account, params \\ %{}, opts \\ []) do
path =
Stripe.OpenApi.Path.replace_path_params(
"/v1/treasury/financial_accounts/{financial_account}",
[
%{
__struct__: OpenApiGen.Blueprint.Parameter,
in: "path",
name: "financial_account",
required: true,
schema: %{
__struct__: OpenApiGen.Blueprint.Parameter.Schema,
any_of: [],
items: [],
name: "financial_account",
properties: [],
title: nil,
type: "string"
}
}
],
[financial_account]
)
Stripe.Request.new_request(opts)
|> Stripe.Request.put_endpoint(path)
|> Stripe.Request.put_params(params)
|> Stripe.Request.put_method(:get)
|> Stripe.Request.make_request()
end
)
)
(
nil
@doc "<p>Retrieves Features information associated with the FinancialAccount.</p>\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/treasury/financial_accounts/{financial_account}/features`\n"
(
@spec retrieve_features(
financial_account :: binary(),
params :: %{optional(:expand) => list(binary)},
opts :: Keyword.t()
) ::
{:ok, Stripe.Treasury.FinancialAccountFeatures.t()}
| {:error, Stripe.ApiErrors.t()}
| {:error, term()}
def retrieve_features(financial_account, params \\ %{}, opts \\ []) do
path =
Stripe.OpenApi.Path.replace_path_params(
"/v1/treasury/financial_accounts/{financial_account}/features",
[
%{
__struct__: OpenApiGen.Blueprint.Parameter,
in: "path",
name: "financial_account",
required: true,
schema: %{
__struct__: OpenApiGen.Blueprint.Parameter.Schema,
any_of: [],
items: [],
name: "financial_account",
properties: [],
title: nil,
type: "string"
}
}
],
[financial_account]
)
Stripe.Request.new_request(opts)
|> Stripe.Request.put_endpoint(path)
|> Stripe.Request.put_params(params)
|> Stripe.Request.put_method(:get)
|> Stripe.Request.make_request()
end
)
)
(
nil
@doc "<p>Creates a new FinancialAccount. Each connected account can have up to three FinancialAccounts by default.</p>\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/treasury/financial_accounts`\n"
(
@spec create(
params :: %{
optional(:expand) => list(binary),
optional(:features) => features,
optional(:metadata) => %{optional(binary) => binary},
optional(:nickname) => binary | binary,
optional(:platform_restrictions) => platform_restrictions,
optional(:supported_currencies) => list(binary)
},
opts :: Keyword.t()
) ::
{:ok, Stripe.Treasury.FinancialAccount.t()}
| {:error, Stripe.ApiErrors.t()}
| {:error, term()}
def create(params \\ %{}, opts \\ []) do
path = Stripe.OpenApi.Path.replace_path_params("/v1/treasury/financial_accounts", [], [])
Stripe.Request.new_request(opts)
|> Stripe.Request.put_endpoint(path)
|> Stripe.Request.put_params(params)
|> Stripe.Request.put_method(:post)
|> Stripe.Request.make_request()
end
)
)
(
nil
@doc "<p>Updates the details of a FinancialAccount.</p>\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/treasury/financial_accounts/{financial_account}`\n"
(
@spec update(
financial_account :: binary(),
params :: %{
optional(:expand) => list(binary),
optional(:features) => features,
optional(:forwarding_settings) => forwarding_settings,
optional(:metadata) => %{optional(binary) => binary},
optional(:nickname) => binary | binary,
optional(:platform_restrictions) => platform_restrictions
},
opts :: Keyword.t()
) ::
{:ok, Stripe.Treasury.FinancialAccount.t()}
| {:error, Stripe.ApiErrors.t()}
| {:error, term()}
def update(financial_account, params \\ %{}, opts \\ []) do
path =
Stripe.OpenApi.Path.replace_path_params(
"/v1/treasury/financial_accounts/{financial_account}",
[
%{
__struct__: OpenApiGen.Blueprint.Parameter,
in: "path",
name: "financial_account",
required: true,
schema: %{
__struct__: OpenApiGen.Blueprint.Parameter.Schema,
any_of: [],
items: [],
name: "financial_account",
properties: [],
title: nil,
type: "string"
}
}
],
[financial_account]
)
Stripe.Request.new_request(opts)
|> Stripe.Request.put_endpoint(path)
|> Stripe.Request.put_params(params)
|> Stripe.Request.put_method(:post)
|> Stripe.Request.make_request()
end
)
)
(
nil
@doc "<p>Closes a FinancialAccount. A FinancialAccount can only be closed if it has a zero balance, has no pending InboundTransfers, and has canceled all attached Issuing cards.</p>\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/treasury/financial_accounts/{financial_account}/close`\n"
(
@spec close(
financial_account :: binary(),
params :: %{
optional(:expand) => list(binary),
optional(:forwarding_settings) => forwarding_settings
},
opts :: Keyword.t()
) ::
{:ok, Stripe.Treasury.FinancialAccount.t()}
| {:error, Stripe.ApiErrors.t()}
| {:error, term()}
def close(financial_account, params \\ %{}, opts \\ []) do
path =
Stripe.OpenApi.Path.replace_path_params(
"/v1/treasury/financial_accounts/{financial_account}/close",
[
%{
__struct__: OpenApiGen.Blueprint.Parameter,
in: "path",
name: "financial_account",
required: true,
schema: %{
__struct__: OpenApiGen.Blueprint.Parameter.Schema,
any_of: [],
items: [],
name: "financial_account",
properties: [],
title: nil,
type: "string"
}
}
],
[financial_account]
)
Stripe.Request.new_request(opts)
|> Stripe.Request.put_endpoint(path)
|> Stripe.Request.put_params(params)
|> Stripe.Request.put_method(:post)
|> Stripe.Request.make_request()
end
)
)
(
nil
@doc "<p>Updates the Features associated with a FinancialAccount.</p>\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/treasury/financial_accounts/{financial_account}/features`\n"
(
@spec update_features(
financial_account :: binary(),
params :: %{
optional(:card_issuing) => card_issuing,
optional(:deposit_insurance) => deposit_insurance,
optional(:expand) => list(binary),
optional(:financial_addresses) => financial_addresses,
optional(:inbound_transfers) => inbound_transfers,
optional(:intra_stripe_flows) => intra_stripe_flows,
optional(:outbound_payments) => outbound_payments,
optional(:outbound_transfers) => outbound_transfers
},
opts :: Keyword.t()
) ::
{:ok, Stripe.Treasury.FinancialAccountFeatures.t()}
| {:error, Stripe.ApiErrors.t()}
| {:error, term()}
def update_features(financial_account, params \\ %{}, opts \\ []) do
path =
Stripe.OpenApi.Path.replace_path_params(
"/v1/treasury/financial_accounts/{financial_account}/features",
[
%{
__struct__: OpenApiGen.Blueprint.Parameter,
in: "path",
name: "financial_account",
required: true,
schema: %{
__struct__: OpenApiGen.Blueprint.Parameter.Schema,
any_of: [],
items: [],
name: "financial_account",
properties: [],
title: nil,
type: "string"
}
}
],
[financial_account]
)
Stripe.Request.new_request(opts)
|> Stripe.Request.put_endpoint(path)
|> Stripe.Request.put_params(params)
|> Stripe.Request.put_method(:post)
|> Stripe.Request.make_request()
end
)
)
end