Class: Stripe::BalanceTransaction

Inherits:
APIResource show all
Extended by:
APIOperations::List
Defined in:
lib/stripe/resources/balance_transaction.rb

Overview

Balance transactions represent funds moving through your Stripe account. Stripe creates them for every type of transaction that enters or leaves your Stripe account balance.

Related guide: [Balance transaction types](stripe.com/docs/reports/balance-transaction-types)

Defined Under Namespace

Classes: FeeDetail, ListParams, RetrieveParams

Constant Summary collapse

OBJECT_NAME =
"balance_transaction"

Constants inherited from StripeObject

StripeObject::RESERVED_FIELD_NAMES

Instance Attribute Summary collapse

Attributes inherited from APIResource

#save_with_parent

Attributes inherited from StripeObject

#last_response

Class Method Summary collapse

Methods included from APIOperations::List

list

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

included

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

#amountObject (readonly)

Gross amount of this transaction (in cents (or local equivalent)). A positive value represents funds charged to another party, and a negative value represents funds sent to another party.



114
115
116
# File 'lib/stripe/resources/balance_transaction.rb', line 114

def amount
  @amount
end

#available_onObject (readonly)

The date that the transaction’s net funds become available in the Stripe balance.



117
118
119
# File 'lib/stripe/resources/balance_transaction.rb', line 117

def available_on
  @available_on
end

#createdObject (readonly)

Time at which the object was created. Measured in seconds since the Unix epoch.



120
121
122
# File 'lib/stripe/resources/balance_transaction.rb', line 120

def created
  @created
end

#currencyObject (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).



123
124
125
# File 'lib/stripe/resources/balance_transaction.rb', line 123

def currency
  @currency
end

#descriptionObject (readonly)

An arbitrary string attached to the object. Often useful for displaying to users.



126
127
128
# File 'lib/stripe/resources/balance_transaction.rb', line 126

def description
  @description
end

#exchange_rateObject (readonly)

If applicable, this transaction uses an exchange rate. If money converts from currency A to currency B, then the ‘amount` in currency A, multipled by the `exchange_rate`, equals the `amount` in currency B. For example, if you charge a customer 10.00 EUR, the PaymentIntent’s ‘amount` is `1000` and `currency` is `eur`. If this converts to 12.34 USD in your Stripe account, the BalanceTransaction’s ‘amount` is `1234`, its `currency` is `usd`, and the `exchange_rate` is `1.234`.



129
130
131
# File 'lib/stripe/resources/balance_transaction.rb', line 129

def exchange_rate
  @exchange_rate
end

#feeObject (readonly)

Fees (in cents (or local equivalent)) paid for this transaction. Represented as a positive integer when assessed.



132
133
134
# File 'lib/stripe/resources/balance_transaction.rb', line 132

def fee
  @fee
end

#fee_detailsObject (readonly)

Detailed breakdown of fees (in cents (or local equivalent)) paid for this transaction.



135
136
137
# File 'lib/stripe/resources/balance_transaction.rb', line 135

def fee_details
  @fee_details
end

#idObject (readonly)

Unique identifier for the object.



138
139
140
# File 'lib/stripe/resources/balance_transaction.rb', line 138

def id
  @id
end

#netObject (readonly)

Net impact to a Stripe balance (in cents (or local equivalent)). A positive value represents incrementing a Stripe balance, and a negative value decrementing a Stripe balance. You can calculate the net impact of a transaction on a balance by ‘amount` - `fee`



141
142
143
# File 'lib/stripe/resources/balance_transaction.rb', line 141

def net
  @net
end

#objectObject (readonly)

String representing the object’s type. Objects of the same type share the same value.



144
145
146
# File 'lib/stripe/resources/balance_transaction.rb', line 144

def object
  @object
end

#reporting_categoryObject (readonly)

Learn more about how [reporting categories](stripe.com/docs/reports/reporting-categories) can help you understand balance transactions from an accounting perspective.



147
148
149
# File 'lib/stripe/resources/balance_transaction.rb', line 147

def reporting_category
  @reporting_category
end

#sourceObject (readonly)

This transaction relates to the Stripe object.



150
151
152
# File 'lib/stripe/resources/balance_transaction.rb', line 150

def source
  @source
end

#statusObject (readonly)

The transaction’s net funds status in the Stripe balance, which are either ‘available` or `pending`.



153
154
155
# File 'lib/stripe/resources/balance_transaction.rb', line 153

def status
  @status
end

#typeObject (readonly)

Transaction type: ‘adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `payout_minimum_balance_hold`, `payout_minimum_balance_release`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Learn more about [balance transaction types and what they represent](stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead.



156
157
158
# File 'lib/stripe/resources/balance_transaction.rb', line 156

def type
  @type
end

Class Method Details

.list(params = {}, opts = {}) ⇒ Object

Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first.

Note that this endpoint was previously called “Balance history” and used the path /v1/balance/history.



161
162
163
164
165
166
167
168
# File 'lib/stripe/resources/balance_transaction.rb', line 161

def self.list(params = {}, opts = {})
  request_stripe_object(
    method: :get,
    path: "/v1/balance_transactions",
    params: params,
    opts: opts
  )
end

.object_nameObject



13
14
15
# File 'lib/stripe/resources/balance_transaction.rb', line 13

def self.object_name
  "balance_transaction"
end