github.com/stripe/stripe-go/v76@v76.25.0/balance.go (about) 1 // 2 // 3 // File generated from our OpenAPI spec 4 // 5 // 6 7 package stripe 8 9 // BalanceSourceType is the list of allowed values for the balance amount's source_type field keys. 10 type BalanceSourceType string 11 12 // List of values that BalanceSourceType can take. 13 const ( 14 BalanceSourceTypeBankAccount BalanceSourceType = "bank_account" 15 BalanceSourceTypeCard BalanceSourceType = "card" 16 BalanceSourceTypeFPX BalanceSourceType = "fpx" 17 ) 18 19 // Retrieves the current account balance, based on the authentication that was used to make the request. 20 // 21 // For a sample request, see [Accounting for negative balances](https://stripe.com/docs/connect/account-balances#accounting-for-negative-balances). 22 type BalanceParams struct { 23 Params `form:"*"` 24 // Specifies which fields in the response should be expanded. 25 Expand []*string `form:"expand"` 26 } 27 28 // AddExpand appends a new field to expand. 29 func (p *BalanceParams) AddExpand(f string) { 30 p.Expand = append(p.Expand, &f) 31 } 32 33 // Available funds that you can transfer or pay out automatically by Stripe or explicitly through the [Transfers API](https://stripe.com/docs/api#transfers) or [Payouts API](https://stripe.com/docs/api#payouts). You can find the available balance for each currency and payment type in the `source_types` property. 34 type Amount struct { 35 // Balance amount. 36 Amount int64 `json:"amount"` 37 // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). 38 Currency Currency `json:"currency"` 39 SourceTypes map[BalanceSourceType]int64 `json:"source_types"` 40 } 41 type BalanceIssuing struct { 42 // Funds that are available for use. 43 Available []*Amount `json:"available"` 44 } 45 46 // This is an object representing your Stripe balance. You can retrieve it to see 47 // the balance currently on your Stripe account. 48 // 49 // You can also retrieve the balance history, which contains a list of 50 // [transactions](https://stripe.com/docs/reporting/balance-transaction-types) that contributed to the balance 51 // (charges, payouts, and so forth). 52 // 53 // The available and pending amounts for each currency are broken down further by 54 // payment source types. 55 // 56 // Related guide: [Understanding Connect account balances](https://stripe.com/docs/connect/account-balances) 57 type Balance struct { 58 APIResource 59 // Available funds that you can transfer or pay out automatically by Stripe or explicitly through the [Transfers API](https://stripe.com/docs/api#transfers) or [Payouts API](https://stripe.com/docs/api#payouts). You can find the available balance for each currency and payment type in the `source_types` property. 60 Available []*Amount `json:"available"` 61 // Funds held due to negative balances on connected Custom accounts. You can find the connect reserve balance for each currency and payment type in the `source_types` property. 62 ConnectReserved []*Amount `json:"connect_reserved"` 63 // Funds that you can pay out using Instant Payouts. 64 InstantAvailable []*Amount `json:"instant_available"` 65 Issuing *BalanceIssuing `json:"issuing"` 66 // Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. 67 Livemode bool `json:"livemode"` 68 // String representing the object's type. Objects of the same type share the same value. 69 Object string `json:"object"` 70 // Funds that aren't available in the balance yet. You can find the pending balance for each currency and each payment type in the `source_types` property. 71 Pending []*Amount `json:"pending"` 72 }