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.



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

def amount
  @amount
end

#available_onObject (readonly)

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



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

def available_on
  @available_on
end

#createdObject (readonly)

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



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

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



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

def currency
  @currency
end

#descriptionObject (readonly)

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



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

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



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

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.



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

def fee
  @fee
end

#fee_detailsObject (readonly)

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



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

def fee_details
  @fee_details
end

#idObject (readonly)

Unique identifier for the object.



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

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`



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

def net
  @net
end

#objectObject (readonly)

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



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

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.



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

def reporting_category
  @reporting_category
end

#sourceObject (readonly)

This transaction relates to the Stripe object.



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

def source
  @source
end

#statusObject (readonly)

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



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

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.



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

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.



132
133
134
135
136
137
138
139
# File 'lib/stripe/resources/balance_transaction.rb', line 132

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