View Source Stripe.Treasury.OutboundTransfer (stripity_stripe v3.2.0)

Use OutboundTransfers to transfer funds from a FinancialAccount to a PaymentMethod belonging to the same entity. To send funds to a different party, use OutboundPayments instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account.

Simulate OutboundTransfer state changes with the /v1/test_helpers/treasury/outbound_transfers endpoints. These methods can only be called on test mode objects.

Summary

Types

Hash describing payment method configuration details.

Details about a returned OutboundTransfer.

t()

The treasury.outbound_transfer type.

Functions

An OutboundTransfer can be canceled if the funds have not yet been paid out.

Creates an OutboundTransfer.

Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state.

Returns a list of OutboundTransfers sent from the specified FinancialAccount.

Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state.

Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID from either the OutboundTransfer creation request or OutboundTransfer list.

Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state.

Types

Link to this type

destination_payment_method_options()

View Source
@type destination_payment_method_options() :: %{
  optional(:us_bank_account) => us_bank_account() | binary()
}

Hash describing payment method configuration details.

@type returned_details() :: %{
  optional(:code) =>
    :account_closed
    | :account_frozen
    | :bank_account_restricted
    | :bank_ownership_changed
    | :declined
    | :incorrect_account_holder_name
    | :invalid_account_number
    | :invalid_currency
    | :no_account
    | :other
}

Details about a returned OutboundTransfer.

@type t() :: %Stripe.Treasury.OutboundTransfer{
  amount: integer(),
  cancelable: boolean(),
  created: integer(),
  currency: binary(),
  description: binary() | nil,
  destination_payment_method: binary() | nil,
  destination_payment_method_details: term(),
  expected_arrival_date: integer(),
  financial_account: binary(),
  hosted_regulatory_receipt_url: binary() | nil,
  id: binary(),
  livemode: boolean(),
  metadata: term(),
  object: binary(),
  returned_details: term() | nil,
  statement_descriptor: binary(),
  status: binary(),
  status_transitions: term(),
  transaction: binary() | Stripe.Treasury.Transaction.t()
}

The treasury.outbound_transfer type.

  • amount Amount (in cents) transferred.
  • cancelable Returns true if the object can be canceled, and false otherwise.
  • created Time at which the object was created. Measured in seconds since the Unix epoch.
  • currency Three-letter ISO currency code, in lowercase. Must be a supported currency.
  • description An arbitrary string attached to the object. Often useful for displaying to users.
  • destination_payment_method The PaymentMethod used as the payment instrument for an OutboundTransfer.
  • destination_payment_method_details
  • expected_arrival_date The date when funds are expected to arrive in the destination account.
  • financial_account The FinancialAccount that funds were pulled from.
  • hosted_regulatory_receipt_url A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses.
  • id Unique identifier for the object.
  • livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode.
  • metadata Set 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.
  • object String representing the object's type. Objects of the same type share the same value.
  • returned_details Details about a returned OutboundTransfer. Only set when the status is returned.
  • statement_descriptor Information about the OutboundTransfer to be sent to the recipient account.
  • status Current status of the OutboundTransfer: processing, failed, canceled, posted, returned. An OutboundTransfer is processing if it has been created and is pending. The status changes to posted once the OutboundTransfer has been "confirmed" and funds have left the account, or to failed or canceled. If an OutboundTransfer fails to arrive at its destination, its status will change to returned.
  • status_transitions
  • transaction The Transaction associated with this object.
@type us_bank_account() :: %{optional(:network) => :ach | :us_domestic_wire}

Functions

Link to this function

cancel(outbound_transfer, params \\ %{}, opts \\ [])

View Source
@spec cancel(
  outbound_transfer :: binary(),
  params :: %{optional(:expand) => [binary()]},
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

An OutboundTransfer can be canceled if the funds have not yet been paid out.

Details

  • Method: post
  • Path: /v1/treasury/outbound_transfers/{outbound_transfer}/cancel
Link to this function

create(params \\ %{}, opts \\ [])

View Source
@spec create(
  params :: %{
    optional(:amount) => integer(),
    optional(:currency) => binary(),
    optional(:description) => binary(),
    optional(:destination_payment_method) => binary(),
    optional(:destination_payment_method_options) =>
      destination_payment_method_options(),
    optional(:expand) => [binary()],
    optional(:financial_account) => binary(),
    optional(:metadata) => %{optional(binary()) => binary()},
    optional(:statement_descriptor) => binary()
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Creates an OutboundTransfer.

Details

  • Method: post
  • Path: /v1/treasury/outbound_transfers
Link to this function

fail(outbound_transfer, params \\ %{}, opts \\ [])

View Source
@spec fail(
  outbound_transfer :: binary(),
  params :: %{optional(:expand) => [binary()]},
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state.

Details

  • Method: post
  • Path: /v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail
Link to this function

list(params \\ %{}, opts \\ [])

View Source
@spec list(
  params :: %{
    optional(:ending_before) => binary(),
    optional(:expand) => [binary()],
    optional(:financial_account) => binary(),
    optional(:limit) => integer(),
    optional(:starting_after) => binary(),
    optional(:status) => :canceled | :failed | :posted | :processing | :returned
  },
  opts :: Keyword.t()
) ::
  {:ok, Stripe.List.t(t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Returns a list of OutboundTransfers sent from the specified FinancialAccount.

Details

  • Method: get
  • Path: /v1/treasury/outbound_transfers
Link to this function

post(outbound_transfer, params \\ %{}, opts \\ [])

View Source
@spec post(
  outbound_transfer :: binary(),
  params :: %{optional(:expand) => [binary()]},
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state.

Details

  • Method: post
  • Path: /v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post
Link to this function

retrieve(outbound_transfer, params \\ %{}, opts \\ [])

View Source
@spec retrieve(
  outbound_transfer :: binary(),
  params :: %{optional(:expand) => [binary()]},
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID from either the OutboundTransfer creation request or OutboundTransfer list.

Details

  • Method: get
  • Path: /v1/treasury/outbound_transfers/{outbound_transfer}
Link to this function

return_outbound_transfer(outbound_transfer, params \\ %{}, opts \\ [])

View Source
@spec return_outbound_transfer(
  outbound_transfer :: binary(),
  params :: %{
    optional(:expand) => [binary()],
    optional(:returned_details) => returned_details()
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state.

Details

  • Method: post
  • Path: /v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return