Class Transfer

All Implemented Interfaces:
BalanceTransactionSource, HasId, MetadataStore<Transfer>, StripeActiveObject, StripeObjectInterface

public class Transfer extends ApiResource implements MetadataStore<Transfer>, BalanceTransactionSource
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 object, with corresponding payout endpoints. For more information, read about the transfer/payout split.

Related guide: Creating separate charges and transfers

  • Constructor Details

    • Transfer

      public Transfer()
  • Method Details

    • getBalanceTransaction

      public String getBalanceTransaction()
      Get ID of expandable balanceTransaction object.
    • setBalanceTransaction

      public void setBalanceTransaction(String id)
    • getBalanceTransactionObject

      public BalanceTransaction getBalanceTransactionObject()
      Get expanded balanceTransaction.
    • setBalanceTransactionObject

      public void setBalanceTransactionObject(BalanceTransaction expandableObject)
    • getDestination

      public String getDestination()
      Get ID of expandable destination object.
    • setDestination

      public void setDestination(String id)
    • getDestinationObject

      public Account getDestinationObject()
      Get expanded destination.
    • setDestinationObject

      public void setDestinationObject(Account expandableObject)
    • getDestinationPayment

      public String getDestinationPayment()
      Get ID of expandable destinationPayment object.
    • setDestinationPayment

      public void setDestinationPayment(String id)
    • getDestinationPaymentObject

      public Charge getDestinationPaymentObject()
      Get expanded destinationPayment.
    • setDestinationPaymentObject

      public void setDestinationPaymentObject(Charge expandableObject)
    • getSourceTransaction

      public String getSourceTransaction()
      Get ID of expandable sourceTransaction object.
    • setSourceTransaction

      public void setSourceTransaction(String id)
    • getSourceTransactionObject

      public Charge getSourceTransactionObject()
      Get expanded sourceTransaction.
    • setSourceTransactionObject

      public void setSourceTransactionObject(Charge expandableObject)
    • create

      public static Transfer create(Map<String,Object> params) throws StripeException
      To send funds from your Stripe account to a connected account, you create a new transfer object. Your Stripe balance must be able to cover the transfer amount, or you’ll receive an “Insufficient Funds” error.
      Throws:
      StripeException
    • create

      public static Transfer create(Map<String,Object> params, RequestOptions options) throws StripeException
      To send funds from your Stripe account to a connected account, you create a new transfer object. Your Stripe balance must be able to cover the transfer amount, or you’ll receive an “Insufficient Funds” error.
      Throws:
      StripeException
    • create

      public static Transfer create(TransferCreateParams params) throws StripeException
      To send funds from your Stripe account to a connected account, you create a new transfer object. Your Stripe balance must be able to cover the transfer amount, or you’ll receive an “Insufficient Funds” error.
      Throws:
      StripeException
    • create

      public static Transfer create(TransferCreateParams params, RequestOptions options) throws StripeException
      To send funds from your Stripe account to a connected account, you create a new transfer object. Your Stripe balance must be able to cover the transfer amount, or you’ll receive an “Insufficient Funds” error.
      Throws:
      StripeException
    • list

      public static TransferCollection list(Map<String,Object> params) throws StripeException
      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.
      Throws:
      StripeException
    • list

      public static TransferCollection list(Map<String,Object> params, RequestOptions options) throws StripeException
      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.
      Throws:
      StripeException
    • list

      public static TransferCollection list(TransferListParams params) throws StripeException
      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.
      Throws:
      StripeException
    • list

      public static TransferCollection list(TransferListParams params, RequestOptions options) throws StripeException
      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.
      Throws:
      StripeException
    • retrieve

      public static Transfer retrieve(String transfer) throws StripeException
      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.
      Throws:
      StripeException
    • retrieve

      public static Transfer retrieve(String transfer, RequestOptions options) throws StripeException
      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.
      Throws:
      StripeException
    • retrieve

      public static Transfer retrieve(String transfer, Map<String,Object> params, RequestOptions options) throws StripeException
      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.
      Throws:
      StripeException
    • retrieve

      public static Transfer retrieve(String transfer, TransferRetrieveParams params, RequestOptions options) throws StripeException
      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.
      Throws:
      StripeException
    • update

      public Transfer update(Map<String,Object> params) throws StripeException
      Updates the specified transfer by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

      This request accepts only metadata as an argument.

      Specified by:
      update in interface MetadataStore<Transfer>
      Throws:
      StripeException
    • update

      public Transfer update(Map<String,Object> params, RequestOptions options) throws StripeException
      Updates the specified transfer by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

      This request accepts only metadata as an argument.

      Specified by:
      update in interface MetadataStore<Transfer>
      Throws:
      StripeException
    • update

      public Transfer update(TransferUpdateParams params) throws StripeException
      Updates the specified transfer by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

      This request accepts only metadata as an argument.

      Throws:
      StripeException
    • update

      public Transfer update(TransferUpdateParams params, RequestOptions options) throws StripeException
      Updates the specified transfer by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

      This request accepts only metadata as an argument.

      Throws:
      StripeException
    • setResponseGetter

      public void setResponseGetter(StripeResponseGetter responseGetter)
      Description copied from interface: StripeActiveObject
      Method is used by the containing object or StripeResponseGetter implementations to set the StripeResponseGetter instance used to make further requests.
      Specified by:
      setResponseGetter in interface StripeActiveObject
      Overrides:
      setResponseGetter in class ApiResource
      Parameters:
      responseGetter - the StripeResponseGetter instance to use for making further requests.
    • getAmount

      public Long getAmount()
      Amount in cents (or local equivalent) to be transferred.
    • getAmountReversed

      public Long getAmountReversed()
      Amount in cents (or local equivalent) reversed (can be less than the amount attribute on the transfer if a partial reversal was issued).
    • getCreated

      public Long getCreated()
      Time that this record of the transfer was first created.
    • getCurrency

      public String getCurrency()
      Three-letter ISO currency code, in lowercase. Must be a supported currency.
    • getDescription

      public String getDescription()
      An arbitrary string attached to the object. Often useful for displaying to users.
    • getLivemode

      public Boolean getLivemode()
      Has the value true if the object exists in live mode or the value false if the object exists in test mode.
    • getObject

      public String getObject()
      String representing the object's type. Objects of the same type share the same value.

      Equal to transfer.

    • getReversals

      public TransferReversalCollection getReversals()
      A list of reversals that have been applied to the transfer.
    • getReversed

      public Boolean getReversed()
      Whether the transfer has been fully reversed. If the transfer is only partially reversed, this attribute will still be false.
    • getSourceType

      public String getSourceType()
      The source balance this transfer came from. One of card, fpx, or bank_account.
    • getTransferGroup

      public String getTransferGroup()
      A string that identifies this transaction as part of a group. See the Connect documentation for details.
    • setAmount

      public void setAmount(Long amount)
      Amount in cents (or local equivalent) to be transferred.
    • setAmountReversed

      public void setAmountReversed(Long amountReversed)
      Amount in cents (or local equivalent) reversed (can be less than the amount attribute on the transfer if a partial reversal was issued).
    • setCreated

      public void setCreated(Long created)
      Time that this record of the transfer was first created.
    • setCurrency

      public void setCurrency(String currency)
      Three-letter ISO currency code, in lowercase. Must be a supported currency.
    • setDescription

      public void setDescription(String description)
      An arbitrary string attached to the object. Often useful for displaying to users.
    • setId

      public void setId(String id)
      Unique identifier for the object.
    • setLivemode

      public void setLivemode(Boolean livemode)
      Has the value true if the object exists in live mode or the value false if the object exists in test mode.
    • setMetadata

      public void setMetadata(Map<String,String> 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.
    • setObject

      public void setObject(String object)
      String representing the object's type. Objects of the same type share the same value.

      Equal to transfer.

    • setReversals

      public void setReversals(TransferReversalCollection reversals)
      A list of reversals that have been applied to the transfer.
    • setReversed

      public void setReversed(Boolean reversed)
      Whether the transfer has been fully reversed. If the transfer is only partially reversed, this attribute will still be false.
    • setSourceType

      public void setSourceType(String sourceType)
      The source balance this transfer came from. One of card, fpx, or bank_account.
    • setTransferGroup

      public void setTransferGroup(String transferGroup)
      A string that identifies this transaction as part of a group. See the Connect documentation for details.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getId

      public String getId()
      Unique identifier for the object.
      Specified by:
      getId in interface HasId
    • getMetadata

      public Map<String,String> getMetadata()
      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.
      Specified by:
      getMetadata in interface MetadataStore<Transfer>