Customers with certain payments enabled have a cash balance, representing funds that were paid by the customer to a merchant, but have not yet been allocated to a payment. Cash Balance Transactions represent when funds are moved into or out of this balance. This includes funding by the customer, allocation to payments, and refunds to the customer.
Attributes
- idstring
Unique identifier for the object.
- objectstring
String representing the object’s type. Objects of the same type share the same value.
- adjusted_
for_ overdraftnullable object If this is a
type=adjusted_
transaction, contains information about what caused the overdraft, which triggered this transaction.for_ overdraft - applied_
to_ paymentnullable object If this is a
type=applied_
transaction, contains information about how funds were applied.to_ payment - createdtimestamp
Time at which the object was created. Measured in seconds since the Unix epoch.
- currencystring
Three-letter ISO currency code, in lowercase. Must be a supported currency.
- customerstringExpandable
The customer whose available cash balance changed as a result of this transaction.
- ending_
balanceinteger The total available cash balance for the specified currency after this transaction was applied. Represented in the smallest currency unit.
- fundednullable object
If this is a
type=funded
transaction, contains information about the funding. - livemodeboolean
Has the value
true
if the object exists in live mode or the valuefalse
if the object exists in test mode. - net_
amountinteger The amount by which the cash balance changed, represented in the smallest currency unit. A positive value represents funds being added to the cash balance, a negative value represents funds being removed from the cash balance.
- refunded_
from_ paymentnullable object If this is a
type=refunded_
transaction, contains information about the source of the refund.from_ payment - transferred_
to_ balancenullable object If this is a
type=transferred_
transaction, contains the balance transaction linked to the transfer.to_ balance - typeenum
The type of the cash balance transaction. New types may be added in future. See Customer Balance to learn more about these types.
Possible enum valuesadjusted_
for_ overdraft A cash balance transaction type:
adjusted_
for_ overdraft applied_
to_ payment A cash balance transaction type:
applied_
to_ payment funded
A cash balance transaction type:
funded
funding_
reversed A cash balance transaction type:
funding_
reversed refunded_
from_ payment A cash balance transaction type:
refunded_
from_ payment return_
canceled A cash balance transaction type:
return_
canceled return_
initiated A cash balance transaction type:
return_
initiated transferred_
to_ balance A cash balance transaction type:
transferred_
to_ balance unapplied_
from_ payment A cash balance transaction type:
unapplied_
from_ payment - unapplied_
from_ paymentnullable object If this is a
type=unapplied_
transaction, contains information about how funds were unapplied.from_ payment
{ "id": "ccsbtxn_1Na16B2eZvKYlo2CUhyw3dsF", "object": "customer_cash_balance_transaction", "created": 1690829143, "currency": "eur", "customer": "cus_9s6XKzkNRiz8i3", "ending_balance": 10000, "funded": { "bank_transfer": { "eu_bank_transfer": { "bic": "BANKDEAAXXX", "iban_last4": "7089", "sender_name": "Sample Business GmbH" }, "reference": "Payment for Invoice 28278FC-155", "type": "eu_bank_transfer" } }, "livemode": false, "net_amount": 5000, "type": "funded"}
Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new funding instructions will be created. If funding instructions have already been created for a given customer, the same funding instructions will be retrieved. In other words, we will return the same funding instructions each time.
Parameters
- bank_
transferobjectRequired Additional parameters for
bank_
funding typestransfer - currencyenumRequired
Three-letter ISO currency code, in lowercase. Must be a supported currency.
- funding_
typeenumRequired The
funding_
to get the instructions for.type Possible enum valuesbank_
transfer Use a bank_transfer hash to define the bank transfer type
Returns
Returns funding instructions for a customer cash balance
{ "object": "funding_instructions", "bank_transfer": { "country": "DE", "financial_addresses": [ { "iban": { "account_holder_address": { "city": "Dublin", "country": "IE", "line1": "Some address", "line2": null, "postal_code": "D01H104", "state": "Dublin 1" }, "account_holder_name": "Merchant name", "bank_address": { "city": "Dublin", "country": "IE", "line1": "1 North Wall Quay", "line2": null, "postal_code": "D01 T8Y1", "state": "Dublin" }, "bic": "SOGEDEFFXXX", "country": "DE", "iban": "DE006847740991234567890" }, "supported_networks": [ "sepa", "swift" ], "type": "iban" } ], "type": "eu_bank_transfer" }, "currency": "eur", "funding_type": "bank_transfer", "livemode": false}
Retrieves a specific cash balance transaction, which updated the customer’s cash balance.
Parameters
No parameters.
Returns
Returns a cash balance transaction object if a valid identifier was provided.
{ "id": "ccsbtxn_1Na16B2eZvKYlo2CUhyw3dsF", "object": "customer_cash_balance_transaction", "created": 1690829143, "currency": "eur", "customer": "cus_9s6XKzkNRiz8i3", "ending_balance": 10000, "funded": { "bank_transfer": { "eu_bank_transfer": { "bic": "BANKDEAAXXX", "iban_last4": "7089", "sender_name": "Sample Business GmbH" }, "reference": "Payment for Invoice 28278FC-155", "type": "eu_bank_transfer" } }, "livemode": false, "net_amount": 5000, "type": "funded"}
Returns a list of transactions that modified the customer’s cash balance.
Parameters
No parameters.
More parameters
- ending_
beforestring - limitinteger
- starting_
afterstring
Returns
A dictionary with a data
property that contains an array of up to limit
cash balance transactions, starting after item starting_
. Each entry in the array is a separate cash balance transaction object. If no more items are available, the resulting array will be empty.
{ "object": "list", "url": "/v1/customers/cus_9s6XKzkNRiz8i3/cash_balance_transactions", "has_more": false, "data": [ { "id": "ccsbtxn_1Na16B2eZvKYlo2CUhyw3dsF", "object": "customer_cash_balance_transaction", "created": 1690829143, "currency": "eur", "customer": "cus_9s6XKzkNRiz8i3", "ending_balance": 10000, "funded": { "bank_transfer": { "eu_bank_transfer": { "bic": "BANKDEAAXXX", "iban_last4": "7089", "sender_name": "Sample Business GmbH" }, "reference": "Payment for Invoice 28278FC-155", "type": "eu_bank_transfer" } }, "livemode": false, "net_amount": 5000, "type": "funded" } ]}