# `Stripe.Transfer`
[🔗](https://github.com/code-corps/stripity_stripe/blob/v3.3.3/lib/generated/transfer.ex#L1)

A `Transfer` object is created when you move funds between Stripe accounts as
part of Connect.

Before April 6, 2017, transfers also represented movement of funds from a
Stripe account to a card or bank account. This behavior has since been split
out into a [Payout](https://stripe.com/docs/api#payout_object) object, with corresponding payout endpoints. For more
information, read about the
[transfer/payout split](https://stripe.com/docs/transfer-payout-split).

Related guide: [Creating separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers)

# `created`

```elixir
@type created() :: %{
  optional(:gt) =&gt; integer(),
  optional(:gte) =&gt; integer(),
  optional(:lt) =&gt; integer(),
  optional(:lte) =&gt; integer()
}
```

# `t`

```elixir
@type t() :: %Stripe.Transfer{
  amount: integer(),
  amount_reversed: integer(),
  balance_transaction: (binary() | Stripe.BalanceTransaction.t()) | nil,
  created: integer(),
  currency: binary(),
  description: binary() | nil,
  destination: (binary() | Stripe.Account.t()) | nil,
  destination_payment: binary() | Stripe.Charge.t(),
  id: binary(),
  livemode: boolean(),
  metadata: term(),
  object: binary(),
  reversals: term(),
  reversed: boolean(),
  source_transaction: (binary() | Stripe.Charge.t()) | nil,
  source_type: binary(),
  transfer_group: binary() | nil
}
```

The `transfer` type.

  * `amount` Amount in cents (or local equivalent) to be transferred.
  * `amount_reversed` Amount in cents (or local equivalent) reversed (can be less than the amount attribute on the transfer if a partial reversal was issued).
  * `balance_transaction` Balance transaction that describes the impact of this transfer on your account balance.
  * `created` Time that this record of the transfer was first created.
  * `currency` Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
  * `description` An arbitrary string attached to the object. Often useful for displaying to users.
  * `destination` ID of the Stripe account the transfer was sent to.
  * `destination_payment` If the destination is a Stripe account, this will be the ID of the payment that the destination account received for the transfer.
  * `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](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.
  * `object` String representing the object's type. Objects of the same type share the same value.
  * `reversals` A list of reversals that have been applied to the transfer.
  * `reversed` Whether the transfer has been fully reversed. If the transfer is only partially reversed, this attribute will still be false.
  * `source_transaction` ID of the charge that was used to fund the transfer. If null, the transfer was funded from the available balance.
  * `source_type` The source balance this transfer came from. One of `card`, `fpx`, or `bank_account`.
  * `transfer_group` A string that identifies this transaction as part of a group. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details.

# `create`

```elixir
@spec create(
  params :: %{
    optional(:amount) =&gt; integer(),
    optional(:currency) =&gt; binary(),
    optional(:description) =&gt; binary(),
    optional(:destination) =&gt; binary(),
    optional(:expand) =&gt; [binary()],
    optional(:metadata) =&gt; %{optional(binary()) =&gt; binary()},
    optional(:source_transaction) =&gt; binary(),
    optional(:source_type) =&gt; :bank_account | :card | :fpx,
    optional(:transfer_group) =&gt; binary()
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
```

<p>To send funds from your Stripe account to a connected account, you create a new transfer object. Your <a href="#balance">Stripe balance</a> must be able to cover the transfer amount, or you’ll receive an “Insufficient Funds” error.</p>

#### Details

 * Method: `post`
 * Path: `/v1/transfers`

# `list`

```elixir
@spec list(
  params :: %{
    optional(:created) =&gt; created() | integer(),
    optional(:destination) =&gt; binary(),
    optional(:ending_before) =&gt; binary(),
    optional(:expand) =&gt; [binary()],
    optional(:limit) =&gt; integer(),
    optional(:starting_after) =&gt; binary(),
    optional(:transfer_group) =&gt; binary()
  },
  opts :: Keyword.t()
) ::
  {:ok, Stripe.List.t(t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
```

<p>Returns a list of existing transfers sent to connected accounts. The transfers are returned in sorted order, with the most recently created transfers appearing first.</p>

#### Details

 * Method: `get`
 * Path: `/v1/transfers`

# `retrieve`

```elixir
@spec retrieve(
  transfer :: binary(),
  params :: %{optional(:expand) =&gt; [binary()]},
  opts :: Keyword.t()
) ::
  {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
```

<p>Retrieves the details of an existing transfer. Supply the unique transfer ID from either a transfer creation request or the transfer list, and Stripe will return the corresponding transfer information.</p>

#### Details

 * Method: `get`
 * Path: `/v1/transfers/{transfer}`

# `update`

```elixir
@spec update(
  transfer :: binary(),
  params :: %{
    optional(:description) =&gt; binary(),
    optional(:expand) =&gt; [binary()],
    optional(:metadata) =&gt; %{optional(binary()) =&gt; binary()} | binary()
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
```

<p>Updates the specified transfer by setting the values of the parameters passed. Any parameters not provided will be left unchanged.</p>

<p>This request accepts only metadata as an argument.</p>

#### Details

 * Method: `post`
 * Path: `/v1/transfers/{transfer}`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
