github.com/stripe/stripe-go/v76@v76.25.0/treasury_transactionentry.go (about)

     1  //
     2  //
     3  // File generated from our OpenAPI spec
     4  //
     5  //
     6  
     7  package stripe
     8  
     9  // Type of the flow that created the Transaction. Set to the same value as `flow_type`.
    10  type TreasuryTransactionEntryFlowDetailsType string
    11  
    12  // List of values that TreasuryTransactionEntryFlowDetailsType can take
    13  const (
    14  	TreasuryTransactionEntryFlowDetailsTypeCreditReversal       TreasuryTransactionEntryFlowDetailsType = "credit_reversal"
    15  	TreasuryTransactionEntryFlowDetailsTypeDebitReversal        TreasuryTransactionEntryFlowDetailsType = "debit_reversal"
    16  	TreasuryTransactionEntryFlowDetailsTypeInboundTransfer      TreasuryTransactionEntryFlowDetailsType = "inbound_transfer"
    17  	TreasuryTransactionEntryFlowDetailsTypeIssuingAuthorization TreasuryTransactionEntryFlowDetailsType = "issuing_authorization"
    18  	TreasuryTransactionEntryFlowDetailsTypeOther                TreasuryTransactionEntryFlowDetailsType = "other"
    19  	TreasuryTransactionEntryFlowDetailsTypeOutboundPayment      TreasuryTransactionEntryFlowDetailsType = "outbound_payment"
    20  	TreasuryTransactionEntryFlowDetailsTypeOutboundTransfer     TreasuryTransactionEntryFlowDetailsType = "outbound_transfer"
    21  	TreasuryTransactionEntryFlowDetailsTypeReceivedCredit       TreasuryTransactionEntryFlowDetailsType = "received_credit"
    22  	TreasuryTransactionEntryFlowDetailsTypeReceivedDebit        TreasuryTransactionEntryFlowDetailsType = "received_debit"
    23  )
    24  
    25  // Type of the flow associated with the TransactionEntry.
    26  type TreasuryTransactionEntryFlowType string
    27  
    28  // List of values that TreasuryTransactionEntryFlowType can take
    29  const (
    30  	TreasuryTransactionEntryFlowTypeCreditReversal       TreasuryTransactionEntryFlowType = "credit_reversal"
    31  	TreasuryTransactionEntryFlowTypeDebitReversal        TreasuryTransactionEntryFlowType = "debit_reversal"
    32  	TreasuryTransactionEntryFlowTypeInboundTransfer      TreasuryTransactionEntryFlowType = "inbound_transfer"
    33  	TreasuryTransactionEntryFlowTypeIssuingAuthorization TreasuryTransactionEntryFlowType = "issuing_authorization"
    34  	TreasuryTransactionEntryFlowTypeOther                TreasuryTransactionEntryFlowType = "other"
    35  	TreasuryTransactionEntryFlowTypeOutboundPayment      TreasuryTransactionEntryFlowType = "outbound_payment"
    36  	TreasuryTransactionEntryFlowTypeOutboundTransfer     TreasuryTransactionEntryFlowType = "outbound_transfer"
    37  	TreasuryTransactionEntryFlowTypeReceivedCredit       TreasuryTransactionEntryFlowType = "received_credit"
    38  	TreasuryTransactionEntryFlowTypeReceivedDebit        TreasuryTransactionEntryFlowType = "received_debit"
    39  )
    40  
    41  // The specific money movement that generated the TransactionEntry.
    42  type TreasuryTransactionEntryType string
    43  
    44  // List of values that TreasuryTransactionEntryType can take
    45  const (
    46  	TreasuryTransactionEntryTypeCreditReversal               TreasuryTransactionEntryType = "credit_reversal"
    47  	TreasuryTransactionEntryTypeCreditReversalPosting        TreasuryTransactionEntryType = "credit_reversal_posting"
    48  	TreasuryTransactionEntryTypeDebitReversal                TreasuryTransactionEntryType = "debit_reversal"
    49  	TreasuryTransactionEntryTypeInboundTransfer              TreasuryTransactionEntryType = "inbound_transfer"
    50  	TreasuryTransactionEntryTypeInboundTransferReturn        TreasuryTransactionEntryType = "inbound_transfer_return"
    51  	TreasuryTransactionEntryTypeIssuingAuthorizationHold     TreasuryTransactionEntryType = "issuing_authorization_hold"
    52  	TreasuryTransactionEntryTypeIssuingAuthorizationRelease  TreasuryTransactionEntryType = "issuing_authorization_release"
    53  	TreasuryTransactionEntryTypeOther                        TreasuryTransactionEntryType = "other"
    54  	TreasuryTransactionEntryTypeOutboundPayment              TreasuryTransactionEntryType = "outbound_payment"
    55  	TreasuryTransactionEntryTypeOutboundPaymentCancellation  TreasuryTransactionEntryType = "outbound_payment_cancellation"
    56  	TreasuryTransactionEntryTypeOutboundPaymentFailure       TreasuryTransactionEntryType = "outbound_payment_failure"
    57  	TreasuryTransactionEntryTypeOutboundPaymentPosting       TreasuryTransactionEntryType = "outbound_payment_posting"
    58  	TreasuryTransactionEntryTypeOutboundPaymentReturn        TreasuryTransactionEntryType = "outbound_payment_return"
    59  	TreasuryTransactionEntryTypeOutboundTransfer             TreasuryTransactionEntryType = "outbound_transfer"
    60  	TreasuryTransactionEntryTypeOutboundTransferCancellation TreasuryTransactionEntryType = "outbound_transfer_cancellation"
    61  	TreasuryTransactionEntryTypeOutboundTransferFailure      TreasuryTransactionEntryType = "outbound_transfer_failure"
    62  	TreasuryTransactionEntryTypeOutboundTransferPosting      TreasuryTransactionEntryType = "outbound_transfer_posting"
    63  	TreasuryTransactionEntryTypeOutboundTransferReturn       TreasuryTransactionEntryType = "outbound_transfer_return"
    64  	TreasuryTransactionEntryTypeReceivedCredit               TreasuryTransactionEntryType = "received_credit"
    65  	TreasuryTransactionEntryTypeReceivedDebit                TreasuryTransactionEntryType = "received_debit"
    66  )
    67  
    68  // Retrieves a list of TransactionEntry objects.
    69  type TreasuryTransactionEntryListParams struct {
    70  	ListParams `form:"*"`
    71  	// Only return TransactionEntries that were created during the given date interval.
    72  	Created *int64 `form:"created"`
    73  	// Only return TransactionEntries that were created during the given date interval.
    74  	CreatedRange     *RangeQueryParams `form:"created"`
    75  	EffectiveAt      *int64            `form:"effective_at"`
    76  	EffectiveAtRange *RangeQueryParams `form:"effective_at"`
    77  	// Specifies which fields in the response should be expanded.
    78  	Expand []*string `form:"expand"`
    79  	// Returns objects associated with this FinancialAccount.
    80  	FinancialAccount *string `form:"financial_account"`
    81  	// The results are in reverse chronological order by `created` or `effective_at`. The default is `created`.
    82  	OrderBy *string `form:"order_by"`
    83  	// Only return TransactionEntries associated with this Transaction.
    84  	Transaction *string `form:"transaction"`
    85  }
    86  
    87  // AddExpand appends a new field to expand.
    88  func (p *TreasuryTransactionEntryListParams) AddExpand(f string) {
    89  	p.Expand = append(p.Expand, &f)
    90  }
    91  
    92  // Retrieves a TransactionEntry object.
    93  type TreasuryTransactionEntryParams struct {
    94  	Params `form:"*"`
    95  	// Specifies which fields in the response should be expanded.
    96  	Expand []*string `form:"expand"`
    97  }
    98  
    99  // AddExpand appends a new field to expand.
   100  func (p *TreasuryTransactionEntryParams) AddExpand(f string) {
   101  	p.Expand = append(p.Expand, &f)
   102  }
   103  
   104  // Change to a FinancialAccount's balance
   105  type TreasuryTransactionEntryBalanceImpact struct {
   106  	// The change made to funds the user can spend right now.
   107  	Cash int64 `json:"cash"`
   108  	// The change made to funds that are not spendable yet, but will become available at a later time.
   109  	InboundPending int64 `json:"inbound_pending"`
   110  	// The change made to funds in the account, but not spendable because they are being held for pending outbound flows.
   111  	OutboundPending int64 `json:"outbound_pending"`
   112  }
   113  
   114  // Details of the flow associated with the TransactionEntry.
   115  type TreasuryTransactionEntryFlowDetails struct {
   116  	// You can reverse some [ReceivedCredits](https://stripe.com/docs/api#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal.
   117  	CreditReversal *TreasuryCreditReversal `json:"credit_reversal"`
   118  	// You can reverse some [ReceivedDebits](https://stripe.com/docs/api#received_debits) depending on their network and source flow. Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal.
   119  	DebitReversal *TreasuryDebitReversal `json:"debit_reversal"`
   120  	// Use [InboundTransfers](https://stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://stripe.com/docs/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit.
   121  	InboundTransfer *TreasuryInboundTransfer `json:"inbound_transfer"`
   122  	// When an [issued card](https://stripe.com/docs/issuing) is used to make a purchase, an Issuing `Authorization`
   123  	// object is created. [Authorizations](https://stripe.com/docs/issuing/purchases/authorizations) must be approved for the
   124  	// purchase to be completed successfully.
   125  	//
   126  	// Related guide: [Issued card authorizations](https://stripe.com/docs/issuing/purchases/authorizations)
   127  	IssuingAuthorization *IssuingAuthorization `json:"issuing_authorization"`
   128  	// Use OutboundPayments to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/api#outbound_transfers).
   129  	//
   130  	// Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects.
   131  	OutboundPayment *TreasuryOutboundPayment `json:"outbound_payment"`
   132  	// Use OutboundTransfers to transfer funds from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://stripe.com/docs/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account.
   133  	//
   134  	// Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects.
   135  	OutboundTransfer *TreasuryOutboundTransfer `json:"outbound_transfer"`
   136  	// ReceivedCredits represent funds sent to a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount.
   137  	ReceivedCredit *TreasuryReceivedCredit `json:"received_credit"`
   138  	// ReceivedDebits represent funds pulled from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts). These are not initiated from the FinancialAccount.
   139  	ReceivedDebit *TreasuryReceivedDebit `json:"received_debit"`
   140  	// Type of the flow that created the Transaction. Set to the same value as `flow_type`.
   141  	Type TreasuryTransactionEntryFlowDetailsType `json:"type"`
   142  }
   143  
   144  // TransactionEntries represent individual units of money movements within a single [Transaction](https://stripe.com/docs/api#transactions).
   145  type TreasuryTransactionEntry struct {
   146  	APIResource
   147  	// Change to a FinancialAccount's balance
   148  	BalanceImpact *TreasuryTransactionEntryBalanceImpact `json:"balance_impact"`
   149  	// Time at which the object was created. Measured in seconds since the Unix epoch.
   150  	Created int64 `json:"created"`
   151  	// 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).
   152  	Currency Currency `json:"currency"`
   153  	// When the TransactionEntry will impact the FinancialAccount's balance.
   154  	EffectiveAt int64 `json:"effective_at"`
   155  	// The FinancialAccount associated with this object.
   156  	FinancialAccount string `json:"financial_account"`
   157  	// Token of the flow associated with the TransactionEntry.
   158  	Flow string `json:"flow"`
   159  	// Details of the flow associated with the TransactionEntry.
   160  	FlowDetails *TreasuryTransactionEntryFlowDetails `json:"flow_details"`
   161  	// Type of the flow associated with the TransactionEntry.
   162  	FlowType TreasuryTransactionEntryFlowType `json:"flow_type"`
   163  	// Unique identifier for the object.
   164  	ID string `json:"id"`
   165  	// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
   166  	Livemode bool `json:"livemode"`
   167  	// String representing the object's type. Objects of the same type share the same value.
   168  	Object string `json:"object"`
   169  	// The Transaction associated with this object.
   170  	Transaction *TreasuryTransaction `json:"transaction"`
   171  	// The specific money movement that generated the TransactionEntry.
   172  	Type TreasuryTransactionEntryType `json:"type"`
   173  }
   174  
   175  // TreasuryTransactionEntryList is a list of TransactionEntries as retrieved from a list endpoint.
   176  type TreasuryTransactionEntryList struct {
   177  	APIResource
   178  	ListMeta
   179  	Data []*TreasuryTransactionEntry `json:"data"`
   180  }