Class: Stripe::Payout
- Inherits:
-
APIResource
- Object
- StripeObject
- APIResource
- Stripe::Payout
- Extended by:
- APIOperations::Create, APIOperations::List
- Includes:
- APIOperations::Save
- Defined in:
- lib/stripe/resources/payout.rb
Overview
A ‘Payout` object is created when you receive funds from Stripe, or when you initiate a payout to either a bank account or debit card of a [connected Stripe account](stripe.com/docs/connect/bank-debit-card-payouts). You can retrieve individual payouts, and list all payouts. Payouts are made on [varying schedules](stripe.com/docs/connect/manage-payout-schedule), depending on your country and industry.
Related guide: [Receiving payouts](stripe.com/docs/payouts)
Defined Under Namespace
Classes: TraceId
Constant Summary collapse
- OBJECT_NAME =
"payout"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
The amount (in cents (or local equivalent)) that transfers to your bank account or debit card.
-
#application_fee ⇒ Object
readonly
The application fee (if any) for the payout.
-
#application_fee_amount ⇒ Object
readonly
The amount of the application fee (if any) requested for the payout.
-
#arrival_date ⇒ Object
readonly
Date that you can expect the payout to arrive in the bank.
-
#automatic ⇒ Object
readonly
Returns ‘true` if the payout is created by an [automated payout schedule](stripe.com/docs/payouts#payout-schedule) and `false` if it’s [requested manually](stripe.com/docs/payouts#manual-payouts).
-
#balance_transaction ⇒ Object
readonly
ID of the balance transaction that describes the impact of this payout on your account balance.
-
#created ⇒ Object
readonly
Time at which the object was created.
-
#currency ⇒ Object
readonly
Three-letter [ISO currency code](www.iso.org/iso-4217-currency-codes.html), in lowercase.
-
#description ⇒ Object
readonly
An arbitrary string attached to the object.
-
#destination ⇒ Object
readonly
ID of the bank account or card the payout is sent to.
-
#failure_balance_transaction ⇒ Object
readonly
If the payout fails or cancels, this is the ID of the balance transaction that reverses the initial balance transaction and returns the funds from the failed payout back in your balance.
-
#failure_code ⇒ Object
readonly
Error code that provides a reason for a payout failure, if available.
-
#failure_message ⇒ Object
readonly
Message that provides the reason for a payout failure, if available.
-
#id ⇒ Object
readonly
Unique identifier for the object.
-
#livemode ⇒ Object
readonly
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
-
#metadata ⇒ Object
readonly
Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object.
-
#method ⇒ Object
readonly
The method used to send this payout, which can be ‘standard` or `instant`.
-
#object ⇒ Object
readonly
String representing the object’s type.
-
#original_payout ⇒ Object
readonly
If the payout reverses another, this is the ID of the original payout.
-
#reconciliation_status ⇒ Object
readonly
If ‘completed`, you can use the [Balance Transactions API](stripe.com/docs/api/balance_transactions/list#balance_transaction_list-payout) to list all balance transactions that are paid out in this payout.
-
#reversed_by ⇒ Object
readonly
If the payout reverses, this is the ID of the payout that reverses this payout.
-
#source_type ⇒ Object
readonly
The source balance this payout came from, which can be one of the following: ‘card`, `fpx`, or `bank_account`.
-
#statement_descriptor ⇒ Object
readonly
Extra information about a payout that displays on the user’s bank statement.
-
#status ⇒ Object
readonly
Current status of the payout: ‘paid`, `pending`, `in_transit`, `canceled` or `failed`.
-
#trace_id ⇒ Object
readonly
A value that generates from the beneficiary’s bank that allows users to track payouts with their bank.
-
#type ⇒ Object
readonly
Can be ‘bank_account` or `card`.
Attributes inherited from APIResource
Attributes inherited from StripeObject
Class Method Summary collapse
-
.cancel(payout, params = {}, opts = {}) ⇒ Object
You can cancel a previously created payout if its status is pending.
-
.create(params = {}, opts = {}) ⇒ Object
To send funds to your own bank account, create a new payout object.
-
.list(filters = {}, opts = {}) ⇒ Object
Returns a list of existing payouts sent to third-party bank accounts or payouts that Stripe sent to you.
- .object_name ⇒ Object
-
.reverse(payout, params = {}, opts = {}) ⇒ Object
Reverses a payout by debiting the destination bank account.
-
.update(id, params = {}, opts = {}) ⇒ Object
Updates the specified payout by setting the values of the parameters you pass.
Instance Method Summary collapse
-
#cancel(params = {}, opts = {}) ⇒ Object
You can cancel a previously created payout if its status is pending.
-
#reverse(params = {}, opts = {}) ⇒ Object
Reverses a payout by debiting the destination bank account.
Methods included from APIOperations::Create
Methods included from APIOperations::List
Methods included from APIOperations::Save
Methods inherited from APIResource
class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource
Methods included from APIOperations::Request
Methods inherited from StripeObject
#==, #[], #[]=, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values
Constructor Details
This class inherits a constructor from Stripe::StripeObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject
Instance Attribute Details
#amount ⇒ Object (readonly)
The amount (in cents (or local equivalent)) that transfers to your bank account or debit card.
27 28 29 |
# File 'lib/stripe/resources/payout.rb', line 27 def amount @amount end |
#application_fee ⇒ Object (readonly)
The application fee (if any) for the payout. [See the Connect documentation](stripe.com/docs/connect/instant-payouts#monetization-and-fees) for details.
29 30 31 |
# File 'lib/stripe/resources/payout.rb', line 29 def application_fee @application_fee end |
#application_fee_amount ⇒ Object (readonly)
The amount of the application fee (if any) requested for the payout. [See the Connect documentation](stripe.com/docs/connect/instant-payouts#monetization-and-fees) for details.
31 32 33 |
# File 'lib/stripe/resources/payout.rb', line 31 def application_fee_amount @application_fee_amount end |
#arrival_date ⇒ Object (readonly)
Date that you can expect the payout to arrive in the bank. This factors in delays to account for weekends or bank holidays.
33 34 35 |
# File 'lib/stripe/resources/payout.rb', line 33 def arrival_date @arrival_date end |
#automatic ⇒ Object (readonly)
Returns ‘true` if the payout is created by an [automated payout schedule](stripe.com/docs/payouts#payout-schedule) and `false` if it’s [requested manually](stripe.com/docs/payouts#manual-payouts).
35 36 37 |
# File 'lib/stripe/resources/payout.rb', line 35 def automatic @automatic end |
#balance_transaction ⇒ Object (readonly)
ID of the balance transaction that describes the impact of this payout on your account balance.
37 38 39 |
# File 'lib/stripe/resources/payout.rb', line 37 def balance_transaction @balance_transaction end |
#created ⇒ Object (readonly)
Time at which the object was created. Measured in seconds since the Unix epoch.
39 40 41 |
# File 'lib/stripe/resources/payout.rb', line 39 def created @created end |
#currency ⇒ Object (readonly)
Three-letter [ISO currency code](www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](stripe.com/docs/currencies).
41 42 43 |
# File 'lib/stripe/resources/payout.rb', line 41 def currency @currency end |
#description ⇒ Object (readonly)
An arbitrary string attached to the object. Often useful for displaying to users.
43 44 45 |
# File 'lib/stripe/resources/payout.rb', line 43 def description @description end |
#destination ⇒ Object (readonly)
ID of the bank account or card the payout is sent to.
45 46 47 |
# File 'lib/stripe/resources/payout.rb', line 45 def destination @destination end |
#failure_balance_transaction ⇒ Object (readonly)
If the payout fails or cancels, this is the ID of the balance transaction that reverses the initial balance transaction and returns the funds from the failed payout back in your balance.
47 48 49 |
# File 'lib/stripe/resources/payout.rb', line 47 def failure_balance_transaction @failure_balance_transaction end |
#failure_code ⇒ Object (readonly)
Error code that provides a reason for a payout failure, if available. View our [list of failure codes](stripe.com/docs/api#payout_failures).
49 50 51 |
# File 'lib/stripe/resources/payout.rb', line 49 def failure_code @failure_code end |
#failure_message ⇒ Object (readonly)
Message that provides the reason for a payout failure, if available.
51 52 53 |
# File 'lib/stripe/resources/payout.rb', line 51 def @failure_message end |
#id ⇒ Object (readonly)
Unique identifier for the object.
53 54 55 |
# File 'lib/stripe/resources/payout.rb', line 53 def id @id end |
#livemode ⇒ Object (readonly)
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
55 56 57 |
# File 'lib/stripe/resources/payout.rb', line 55 def livemode @livemode end |
#metadata ⇒ Object (readonly)
Set of [key-value pairs](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.
57 58 59 |
# File 'lib/stripe/resources/payout.rb', line 57 def @metadata end |
#method ⇒ Object (readonly)
The method used to send this payout, which can be ‘standard` or `instant`. `instant` is supported for payouts to debit cards and bank accounts in certain countries. Learn more about [bank support for Instant Payouts](stripe.com/docs/payouts/instant-payouts-banks).
59 60 61 |
# File 'lib/stripe/resources/payout.rb', line 59 def method @method end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
61 62 63 |
# File 'lib/stripe/resources/payout.rb', line 61 def object @object end |
#original_payout ⇒ Object (readonly)
If the payout reverses another, this is the ID of the original payout.
63 64 65 |
# File 'lib/stripe/resources/payout.rb', line 63 def original_payout @original_payout end |
#reconciliation_status ⇒ Object (readonly)
If ‘completed`, you can use the [Balance Transactions API](stripe.com/docs/api/balance_transactions/list#balance_transaction_list-payout) to list all balance transactions that are paid out in this payout.
65 66 67 |
# File 'lib/stripe/resources/payout.rb', line 65 def reconciliation_status @reconciliation_status end |
#reversed_by ⇒ Object (readonly)
If the payout reverses, this is the ID of the payout that reverses this payout.
67 68 69 |
# File 'lib/stripe/resources/payout.rb', line 67 def reversed_by @reversed_by end |
#source_type ⇒ Object (readonly)
The source balance this payout came from, which can be one of the following: ‘card`, `fpx`, or `bank_account`.
69 70 71 |
# File 'lib/stripe/resources/payout.rb', line 69 def source_type @source_type end |
#statement_descriptor ⇒ Object (readonly)
Extra information about a payout that displays on the user’s bank statement.
71 72 73 |
# File 'lib/stripe/resources/payout.rb', line 71 def statement_descriptor @statement_descriptor end |
#status ⇒ Object (readonly)
Current status of the payout: ‘paid`, `pending`, `in_transit`, `canceled` or `failed`. A payout is `pending` until it’s submitted to the bank, when it becomes ‘in_transit`. The status changes to `paid` if the transaction succeeds, or to `failed` or `canceled` (within 5 business days). Some payouts that fail might initially show as `paid`, then change to `failed`.
73 74 75 |
# File 'lib/stripe/resources/payout.rb', line 73 def status @status end |
#trace_id ⇒ Object (readonly)
A value that generates from the beneficiary’s bank that allows users to track payouts with their bank. Banks might call this a “reference number” or something similar.
75 76 77 |
# File 'lib/stripe/resources/payout.rb', line 75 def trace_id @trace_id end |
#type ⇒ Object (readonly)
Can be ‘bank_account` or `card`.
77 78 79 |
# File 'lib/stripe/resources/payout.rb', line 77 def type @type end |
Class Method Details
.cancel(payout, params = {}, opts = {}) ⇒ Object
You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can’t cancel automatic Stripe payouts.
90 91 92 93 94 95 96 97 |
# File 'lib/stripe/resources/payout.rb', line 90 def self.cancel(payout, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/payouts/%<payout>s/cancel", { payout: CGI.escape(payout) }), params: params, opts: opts ) end |
.create(params = {}, opts = {}) ⇒ Object
To send funds to your own bank account, create a new payout object. Your [Stripe balance](stripe.com/docs/api#balance) must cover the payout amount. If it doesn’t, you receive an “Insufficient Funds” error.
If your API key is in test mode, money won’t actually be sent, though every other action occurs as if you’re in live mode.
If you create a manual payout on a Stripe account that uses multiple payment source types, you need to specify the source type balance that the payout draws from. The [balance object](stripe.com/docs/api#balance_object) details available and pending amounts by source type.
104 105 106 |
# File 'lib/stripe/resources/payout.rb', line 104 def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/payouts", params: params, opts: opts) end |
.list(filters = {}, opts = {}) ⇒ Object
Returns a list of existing payouts sent to third-party bank accounts or payouts that Stripe sent to you. The payouts return in sorted order, with the most recently created payouts appearing first.
109 110 111 |
# File 'lib/stripe/resources/payout.rb', line 109 def self.list(filters = {}, opts = {}) request_stripe_object(method: :get, path: "/v1/payouts", params: filters, opts: opts) end |
.object_name ⇒ Object
19 20 21 |
# File 'lib/stripe/resources/payout.rb', line 19 def self.object_name "payout" end |
.reverse(payout, params = {}, opts = {}) ⇒ Object
Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is manual and in the pending status, use /v1/payouts/:id/cancel instead.
By requesting a reversal through /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required.
128 129 130 131 132 133 134 135 |
# File 'lib/stripe/resources/payout.rb', line 128 def self.reverse(payout, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/payouts/%<payout>s/reverse", { payout: CGI.escape(payout) }), params: params, opts: opts ) end |
.update(id, params = {}, opts = {}) ⇒ Object
Updates the specified payout by setting the values of the parameters you pass. We don’t change parameters that you don’t provide. This request only accepts the metadata as arguments.
138 139 140 141 142 143 144 145 |
# File 'lib/stripe/resources/payout.rb', line 138 def self.update(id, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/payouts/%<id>s", { id: CGI.escape(id) }), params: params, opts: opts ) end |
Instance Method Details
#cancel(params = {}, opts = {}) ⇒ Object
You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can’t cancel automatic Stripe payouts.
80 81 82 83 84 85 86 87 |
# File 'lib/stripe/resources/payout.rb', line 80 def cancel(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/payouts/%<payout>s/cancel", { payout: CGI.escape(self["id"]) }), params: params, opts: opts ) end |
#reverse(params = {}, opts = {}) ⇒ Object
Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is manual and in the pending status, use /v1/payouts/:id/cancel instead.
By requesting a reversal through /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required.
116 117 118 119 120 121 122 123 |
# File 'lib/stripe/resources/payout.rb', line 116 def reverse(params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/payouts/%<payout>s/reverse", { payout: CGI.escape(self["id"]) }), params: params, opts: opts ) end |