stripity_stripe v1.6.0 Stripe.Accounts
Functions for working with accounts at Stripe. Through this API you can:
- create an account,
- get an account,
- delete an account,
- delete all accounts,
- list accounts,
- list all accounts,
- count accounts.
Stripe API reference: https://stripe.com/docs/api/curl#account_object
Summary
Functions
List all accounts
List all accounts. Accepts Stripe API key
Get total number of accounts
Get total number of accounts. Accepts Stripe API key
Create an account
Create an account. Accepts Stripe API key
Delete an account
Delete an account. Accepts Stripe API key
Delete all accounts
Delete all accounts. Accepts Stripe API key
Get an account
Get an account. Accepts Stripe API key
Get a list of accounts
Get a list of accounts. Accepts Stripe API key
Updates an Account with the given parameters - all of which are optional.
Example
new_fields = [
email: "new_email@test.com"
]
{:ok, res} = Stripe.Accounts.update(account_id, new_fields)
Updates an Account with the given parameters - all of which are optional. Using a given stripe key to apply against the account associated.
Example
{:ok, res} = Stripe.Accounts.update(account_id, new_fields, key)
Functions
List all accounts.
Lists all accounts.
Accepts the following parameters:
accum
- a list to start accumulating accounts to (optional; defaults to[]
).,starting_after
- an offset (optional; defaults to""
).
Returns {:ok, accounts}
tuple.
Examples
{:ok, accounts} = Stripe.Accounts.all([], 5)
List all accounts. Accepts Stripe API key.
Lists all accounts.
Accepts the following parameters:
accum
- a list to start accumulating accounts to (optional; defaults to[]
).,starting_after
- an offset (optional; defaults to""
).
Returns {:ok, accounts}
tuple.
Examples
{:ok, accounts} = Stripe.Accounts.all("my_key", [], 5)
Get total number of accounts.
Gets total number of accounts.
Returns {:ok, count}
tuple.
Examples
{:ok, count} = Stripe.Accounts.count()
Get total number of accounts. Accepts Stripe API key.
Gets total number of accounts.
Returns {:ok, count}
tuple.
Examples
{:ok, count} = Stripe.Accounts.count("my_key")
Create an account.
Creates an account using params.
Returns created account.
At the bare minimum, to create and connect to a managed account, simply set managed to true in the creation request, and provide a country. The country, once set, cannot be changed.
https://stripe.com/docs/connect/managed-accounts
Examples
params = [
email: "test@example.com",
managed: true,
tos_acceptance: [
date: :os.system_time(:seconds),
ip: "127.0.0.1"
],
legal_entity: [
type: "individual",
dob: [
day: 1,
month: 1,
year: 1991
],
first_name: "John",
last_name: "Doe"
],
external_account: [
object: "bank_account",
country: "US",
currency: "usd",
routing_number: "110000000",
account_number: "000123456789"
]
]
{:ok, account} = Stripe.Accounts.create(params)
Create an account. Accepts Stripe API key.
Creates an account given the account params.
Returns created account.
Example
{:ok, account} = Stripe.Account.create(params, "my_key")
Delete an account.
Deletes an account given the account ID.
Returns a {:ok, account}
tuple.
Examples
{:ok, deleted_account} = Stripe.Accounts.delete("account_id")
Delete an account. Accepts Stripe API key.
Deletes an account given the account ID.
Returns a {:ok, account}
tuple.
Examples
{:ok, deleted_account} = Stripe.Accounts.delete("account_id", "my_key")
Delete all accounts.
Deletes all accounts.
Returns :ok
atom.
Examples
Stripe.Accounts.delete_all()
Delete all accounts. Accepts Stripe API key.
Deletes all accounts.
Returns :ok
atom.
Examples
Stripe.Accounts.delete_all("my_key")
Get an account.
Gets an account using account ID.
Examples
{:ok, account} = Stripe.Accounts.get("account_id")
Get an account. Accepts Stripe API key.
Gets an account using account ID.
Examples
{:ok, account} = Stripe.Accounts.get("account_id", "my_key")
Get a list of accounts.
Gets a list of accounts.
Accepts the following parameters:
limit
- a limit of items to be returned (optional; defaults to 10).
Returns a {:ok, accounts}
tuple, where accounts
is a list of accounts.
Examples
{:ok, accounts} = Stripe.Accounts.list() # Get a list of 10 accounts
{:ok, accounts} = Stripe.Accounts.list(20) # Get a list of 20 accounts
Get a list of accounts. Accepts Stripe API key.
Gets a list of accounts.
Accepts the following parameters:
limit
- a limit of items to be returned (optional; defaults to 10).
Returns a {:ok, accounts}
tuple, where accounts
is a list of accounts.
Examples
{:ok, accounts} = Stripe.Accounts.list("my_key") # Get a list of 10 accounts
{:ok, accounts} = Stripe.Accounts.list(20, "my_key") # Get a list of 20 accounts
Updates an Account with the given parameters - all of which are optional.
Example
new_fields = [
email: "new_email@test.com"
]
{:ok, res} = Stripe.Accounts.update(account_id, new_fields)