View Source Stripe.Topup (stripity_stripe v3.2.0)
To top up your Stripe balance, you create a top-up object. You can retrieve individual top-ups, as well as list all top-ups. Top-ups are identified by a unique, random ID.
Related guide: Topping up your platform account
Summary
Functions
Cancels a top-up. Only pending top-ups can be canceled.
Top up the balance of an account
Returns a list of top-ups.
Retrieves the details of a top-up that has previously been created. Supply the unique top-up ID that was returned from your previous request, and Stripe will return the corresponding top-up information.
Updates the metadata of a top-up. Other top-up details are not editable by design.
Types
@type t() :: %Stripe.Topup{ amount: integer(), balance_transaction: (binary() | Stripe.BalanceTransaction.t()) | nil, created: integer(), currency: binary(), description: binary() | nil, expected_availability_date: integer() | nil, failure_code: binary() | nil, failure_message: binary() | nil, id: binary(), livemode: boolean(), metadata: term(), object: binary(), source: Stripe.Source.t() | nil, statement_descriptor: binary() | nil, status: binary(), transfer_group: binary() | nil }
The topup type.
amountAmount transferred.balance_transactionID of the balance transaction that describes the impact of this top-up on your account balance. May not be specified depending on status of top-up.createdTime at which the object was created. Measured in seconds since the Unix epoch.currencyThree-letter ISO currency code, in lowercase. Must be a supported currency.descriptionAn arbitrary string attached to the object. Often useful for displaying to users.expected_availability_dateDate the funds are expected to arrive in your Stripe account for payouts. This factors in delays like weekends or bank holidays. May not be specified depending on status of top-up.failure_codeError code explaining reason for top-up failure if available (see the errors section for a list of codes).failure_messageMessage to user further explaining reason for top-up failure if available.idUnique identifier for the object.livemodeHas the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.metadataSet of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.objectString representing the object's type. Objects of the same type share the same value.sourceThe source field is deprecated. It might not always be present in the API response.statement_descriptorExtra information about a top-up. This will appear on your source's bank statement. It must contain at least one letter.statusThe status of the top-up is eithercanceled,failed,pending,reversed, orsucceeded.transfer_groupA string that identifies this top-up as part of a group.
Functions
@spec cancel( topup :: binary(), params :: %{optional(:expand) => [binary()]}, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Cancels a top-up. Only pending top-ups can be canceled.
Details
- Method: 
post - Path: 
/v1/topups/{topup}/cancel 
@spec create( params :: %{ optional(:amount) => integer(), optional(:currency) => binary(), optional(:description) => binary(), optional(:expand) => [binary()], optional(:metadata) => %{optional(binary()) => binary()} | binary(), optional(:source) => binary(), optional(:statement_descriptor) => binary(), optional(:transfer_group) => binary() }, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Top up the balance of an account
Details
- Method: 
post - Path: 
/v1/topups 
@spec list( params :: %{ optional(:amount) => amount() | integer(), optional(:created) => created() | integer(), optional(:ending_before) => binary(), optional(:expand) => [binary()], optional(:limit) => integer(), optional(:starting_after) => binary(), optional(:status) => :canceled | :failed | :pending | :succeeded }, opts :: Keyword.t() ) :: {:ok, Stripe.List.t(t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Returns a list of top-ups.
Details
- Method: 
get - Path: 
/v1/topups 
@spec retrieve( topup :: binary(), params :: %{optional(:expand) => [binary()]}, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Retrieves the details of a top-up that has previously been created. Supply the unique top-up ID that was returned from your previous request, and Stripe will return the corresponding top-up information.
Details
- Method: 
get - Path: 
/v1/topups/{topup} 
@spec update( topup :: binary(), params :: %{ optional(:description) => binary(), optional(:expand) => [binary()], optional(:metadata) => %{optional(binary()) => binary()} | binary() }, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Updates the metadata of a top-up. Other top-up details are not editable by design.
Details
- Method: 
post - Path: 
/v1/topups/{topup}