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

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.



90
91
92
# File 'lib/stripe/resources/balance_transaction.rb', line 90

def amount
  @amount
end

#available_onObject (readonly)

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



92
93
94
# File 'lib/stripe/resources/balance_transaction.rb', line 92

def available_on
  @available_on
end

#createdObject (readonly)

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



94
95
96
# File 'lib/stripe/resources/balance_transaction.rb', line 94

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).



96
97
98
# File 'lib/stripe/resources/balance_transaction.rb', line 96

def currency
  @currency
end

#descriptionObject (readonly)

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



98
99
100
# File 'lib/stripe/resources/balance_transaction.rb', line 98

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`.



100
101
102
# File 'lib/stripe/resources/balance_transaction.rb', line 100

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.



102
103
104
# File 'lib/stripe/resources/balance_transaction.rb', line 102

def fee
  @fee
end

#fee_detailsObject (readonly)

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



104
105
106
# File 'lib/stripe/resources/balance_transaction.rb', line 104

def fee_details
  @fee_details
end

#idObject (readonly)

Unique identifier for the object.



106
107
108
# File 'lib/stripe/resources/balance_transaction.rb', line 106

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`



108
109
110
# File 'lib/stripe/resources/balance_transaction.rb', line 108

def net
  @net
end

#objectObject (readonly)

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



110
111
112
# File 'lib/stripe/resources/balance_transaction.rb', line 110

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.



112
113
114
# File 'lib/stripe/resources/balance_transaction.rb', line 112

def reporting_category
  @reporting_category
end

#sourceObject (readonly)

This transaction relates to the Stripe object.



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

def source
  @source
end

#statusObject (readonly)

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



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

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`, `stripe_balance_payment_debit`, `stripe_balance_payment_debit_reversal`, `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.



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

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.



123
124
125
126
127
128
129
130
# File 'lib/stripe/resources/balance_transaction.rb', line 123

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