github.com/stripe/stripe-go/v76@v76.25.0/treasury_outboundtransfer.go (about) 1 // 2 // 3 // File generated from our OpenAPI spec 4 // 5 // 6 7 package stripe 8 9 // The type of the payment method used in the OutboundTransfer. 10 type TreasuryOutboundTransferDestinationPaymentMethodDetailsType string 11 12 // List of values that TreasuryOutboundTransferDestinationPaymentMethodDetailsType can take 13 const ( 14 TreasuryOutboundTransferDestinationPaymentMethodDetailsTypeUSBankAccount TreasuryOutboundTransferDestinationPaymentMethodDetailsType = "us_bank_account" 15 ) 16 17 // Account holder type: individual or company. 18 type TreasuryOutboundTransferDestinationPaymentMethodDetailsUSBankAccountAccountHolderType string 19 20 // List of values that TreasuryOutboundTransferDestinationPaymentMethodDetailsUSBankAccountAccountHolderType can take 21 const ( 22 TreasuryOutboundTransferDestinationPaymentMethodDetailsUSBankAccountAccountHolderTypeCompany TreasuryOutboundTransferDestinationPaymentMethodDetailsUSBankAccountAccountHolderType = "company" 23 TreasuryOutboundTransferDestinationPaymentMethodDetailsUSBankAccountAccountHolderTypeIndividual TreasuryOutboundTransferDestinationPaymentMethodDetailsUSBankAccountAccountHolderType = "individual" 24 ) 25 26 // Account type: checkings or savings. Defaults to checking if omitted. 27 type TreasuryOutboundTransferDestinationPaymentMethodDetailsUSBankAccountAccountType string 28 29 // List of values that TreasuryOutboundTransferDestinationPaymentMethodDetailsUSBankAccountAccountType can take 30 const ( 31 TreasuryOutboundTransferDestinationPaymentMethodDetailsUSBankAccountAccountTypeChecking TreasuryOutboundTransferDestinationPaymentMethodDetailsUSBankAccountAccountType = "checking" 32 TreasuryOutboundTransferDestinationPaymentMethodDetailsUSBankAccountAccountTypeSavings TreasuryOutboundTransferDestinationPaymentMethodDetailsUSBankAccountAccountType = "savings" 33 ) 34 35 // The network rails used. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. 36 type TreasuryOutboundTransferDestinationPaymentMethodDetailsUSBankAccountNetwork string 37 38 // List of values that TreasuryOutboundTransferDestinationPaymentMethodDetailsUSBankAccountNetwork can take 39 const ( 40 TreasuryOutboundTransferDestinationPaymentMethodDetailsUSBankAccountNetworkACH TreasuryOutboundTransferDestinationPaymentMethodDetailsUSBankAccountNetwork = "ach" 41 TreasuryOutboundTransferDestinationPaymentMethodDetailsUSBankAccountNetworkUSDomesticWire TreasuryOutboundTransferDestinationPaymentMethodDetailsUSBankAccountNetwork = "us_domestic_wire" 42 ) 43 44 // Reason for the return. 45 type TreasuryOutboundTransferReturnedDetailsCode string 46 47 // List of values that TreasuryOutboundTransferReturnedDetailsCode can take 48 const ( 49 TreasuryOutboundTransferReturnedDetailsCodeAccountClosed TreasuryOutboundTransferReturnedDetailsCode = "account_closed" 50 TreasuryOutboundTransferReturnedDetailsCodeAccountFrozen TreasuryOutboundTransferReturnedDetailsCode = "account_frozen" 51 TreasuryOutboundTransferReturnedDetailsCodeBankAccountRestricted TreasuryOutboundTransferReturnedDetailsCode = "bank_account_restricted" 52 TreasuryOutboundTransferReturnedDetailsCodeBankOwnershipChanged TreasuryOutboundTransferReturnedDetailsCode = "bank_ownership_changed" 53 TreasuryOutboundTransferReturnedDetailsCodeDeclined TreasuryOutboundTransferReturnedDetailsCode = "declined" 54 TreasuryOutboundTransferReturnedDetailsCodeIncorrectAccountHolderName TreasuryOutboundTransferReturnedDetailsCode = "incorrect_account_holder_name" 55 TreasuryOutboundTransferReturnedDetailsCodeInvalidAccountNumber TreasuryOutboundTransferReturnedDetailsCode = "invalid_account_number" 56 TreasuryOutboundTransferReturnedDetailsCodeInvalidCurrency TreasuryOutboundTransferReturnedDetailsCode = "invalid_currency" 57 TreasuryOutboundTransferReturnedDetailsCodeNoAccount TreasuryOutboundTransferReturnedDetailsCode = "no_account" 58 TreasuryOutboundTransferReturnedDetailsCodeOther TreasuryOutboundTransferReturnedDetailsCode = "other" 59 ) 60 61 // Current status of the OutboundTransfer: `processing`, `failed`, `canceled`, `posted`, `returned`. An OutboundTransfer is `processing` if it has been created and is pending. The status changes to `posted` once the OutboundTransfer has been "confirmed" and funds have left the account, or to `failed` or `canceled`. If an OutboundTransfer fails to arrive at its destination, its status will change to `returned`. 62 type TreasuryOutboundTransferStatus string 63 64 // List of values that TreasuryOutboundTransferStatus can take 65 const ( 66 TreasuryOutboundTransferStatusCanceled TreasuryOutboundTransferStatus = "canceled" 67 TreasuryOutboundTransferStatusFailed TreasuryOutboundTransferStatus = "failed" 68 TreasuryOutboundTransferStatusPosted TreasuryOutboundTransferStatus = "posted" 69 TreasuryOutboundTransferStatusProcessing TreasuryOutboundTransferStatus = "processing" 70 TreasuryOutboundTransferStatusReturned TreasuryOutboundTransferStatus = "returned" 71 ) 72 73 // Returns a list of OutboundTransfers sent from the specified FinancialAccount. 74 type TreasuryOutboundTransferListParams struct { 75 ListParams `form:"*"` 76 // Specifies which fields in the response should be expanded. 77 Expand []*string `form:"expand"` 78 // Returns objects associated with this FinancialAccount. 79 FinancialAccount *string `form:"financial_account"` 80 // Only return OutboundTransfers that have the given status: `processing`, `canceled`, `failed`, `posted`, or `returned`. 81 Status *string `form:"status"` 82 } 83 84 // AddExpand appends a new field to expand. 85 func (p *TreasuryOutboundTransferListParams) AddExpand(f string) { 86 p.Expand = append(p.Expand, &f) 87 } 88 89 // Optional fields for `us_bank_account`. 90 type TreasuryOutboundTransferDestinationPaymentMethodOptionsUSBankAccountParams struct { 91 // Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. 92 Network *string `form:"network"` 93 } 94 95 // Hash describing payment method configuration details. 96 type TreasuryOutboundTransferDestinationPaymentMethodOptionsParams struct { 97 // Optional fields for `us_bank_account`. 98 USBankAccount *TreasuryOutboundTransferDestinationPaymentMethodOptionsUSBankAccountParams `form:"us_bank_account"` 99 } 100 101 // Creates an OutboundTransfer. 102 type TreasuryOutboundTransferParams struct { 103 Params `form:"*"` 104 // Amount (in cents) to be transferred. 105 Amount *int64 `form:"amount"` 106 // 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). 107 Currency *string `form:"currency"` 108 // An arbitrary string attached to the object. Often useful for displaying to users. 109 Description *string `form:"description"` 110 // The PaymentMethod to use as the payment instrument for the OutboundTransfer. 111 DestinationPaymentMethod *string `form:"destination_payment_method"` 112 // Hash describing payment method configuration details. 113 DestinationPaymentMethodOptions *TreasuryOutboundTransferDestinationPaymentMethodOptionsParams `form:"destination_payment_method_options"` 114 // Specifies which fields in the response should be expanded. 115 Expand []*string `form:"expand"` 116 // The FinancialAccount to pull funds from. 117 FinancialAccount *string `form:"financial_account"` 118 // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. 119 Metadata map[string]string `form:"metadata"` 120 // Statement descriptor to be shown on the receiving end of an OutboundTransfer. Maximum 10 characters for `ach` transfers or 140 characters for `us_domestic_wire` transfers. The default value is "transfer". 121 StatementDescriptor *string `form:"statement_descriptor"` 122 } 123 124 // AddExpand appends a new field to expand. 125 func (p *TreasuryOutboundTransferParams) AddExpand(f string) { 126 p.Expand = append(p.Expand, &f) 127 } 128 129 // AddMetadata adds a new key-value pair to the Metadata. 130 func (p *TreasuryOutboundTransferParams) AddMetadata(key string, value string) { 131 if p.Metadata == nil { 132 p.Metadata = make(map[string]string) 133 } 134 135 p.Metadata[key] = value 136 } 137 138 // An OutboundTransfer can be canceled if the funds have not yet been paid out. 139 type TreasuryOutboundTransferCancelParams struct { 140 Params `form:"*"` 141 // Specifies which fields in the response should be expanded. 142 Expand []*string `form:"expand"` 143 } 144 145 // AddExpand appends a new field to expand. 146 func (p *TreasuryOutboundTransferCancelParams) AddExpand(f string) { 147 p.Expand = append(p.Expand, &f) 148 } 149 150 type TreasuryOutboundTransferDestinationPaymentMethodDetailsBillingDetails struct { 151 Address *Address `json:"address"` 152 // Email address. 153 Email string `json:"email"` 154 // Full name. 155 Name string `json:"name"` 156 } 157 type TreasuryOutboundTransferDestinationPaymentMethodDetailsUSBankAccount struct { 158 // Account holder type: individual or company. 159 AccountHolderType TreasuryOutboundTransferDestinationPaymentMethodDetailsUSBankAccountAccountHolderType `json:"account_holder_type"` 160 // Account type: checkings or savings. Defaults to checking if omitted. 161 AccountType TreasuryOutboundTransferDestinationPaymentMethodDetailsUSBankAccountAccountType `json:"account_type"` 162 // Name of the bank associated with the bank account. 163 BankName string `json:"bank_name"` 164 // Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. 165 Fingerprint string `json:"fingerprint"` 166 // Last four digits of the bank account number. 167 Last4 string `json:"last4"` 168 // ID of the mandate used to make this payment. 169 Mandate *Mandate `json:"mandate"` 170 // The network rails used. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. 171 Network TreasuryOutboundTransferDestinationPaymentMethodDetailsUSBankAccountNetwork `json:"network"` 172 // Routing number of the bank account. 173 RoutingNumber string `json:"routing_number"` 174 } 175 type TreasuryOutboundTransferDestinationPaymentMethodDetails struct { 176 BillingDetails *TreasuryOutboundTransferDestinationPaymentMethodDetailsBillingDetails `json:"billing_details"` 177 // The type of the payment method used in the OutboundTransfer. 178 Type TreasuryOutboundTransferDestinationPaymentMethodDetailsType `json:"type"` 179 USBankAccount *TreasuryOutboundTransferDestinationPaymentMethodDetailsUSBankAccount `json:"us_bank_account"` 180 } 181 182 // Details about a returned OutboundTransfer. Only set when the status is `returned`. 183 type TreasuryOutboundTransferReturnedDetails struct { 184 // Reason for the return. 185 Code TreasuryOutboundTransferReturnedDetailsCode `json:"code"` 186 // The Transaction associated with this object. 187 Transaction *TreasuryTransaction `json:"transaction"` 188 } 189 type TreasuryOutboundTransferStatusTransitions struct { 190 // Timestamp describing when an OutboundTransfer changed status to `canceled` 191 CanceledAt int64 `json:"canceled_at"` 192 // Timestamp describing when an OutboundTransfer changed status to `failed` 193 FailedAt int64 `json:"failed_at"` 194 // Timestamp describing when an OutboundTransfer changed status to `posted` 195 PostedAt int64 `json:"posted_at"` 196 // Timestamp describing when an OutboundTransfer changed status to `returned` 197 ReturnedAt int64 `json:"returned_at"` 198 } 199 200 // 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. 201 // 202 // Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects. 203 type TreasuryOutboundTransfer struct { 204 APIResource 205 // Amount (in cents) transferred. 206 Amount int64 `json:"amount"` 207 // Returns `true` if the object can be canceled, and `false` otherwise. 208 Cancelable bool `json:"cancelable"` 209 // Time at which the object was created. Measured in seconds since the Unix epoch. 210 Created int64 `json:"created"` 211 // 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). 212 Currency Currency `json:"currency"` 213 // An arbitrary string attached to the object. Often useful for displaying to users. 214 Description string `json:"description"` 215 // The PaymentMethod used as the payment instrument for an OutboundTransfer. 216 DestinationPaymentMethod string `json:"destination_payment_method"` 217 DestinationPaymentMethodDetails *TreasuryOutboundTransferDestinationPaymentMethodDetails `json:"destination_payment_method_details"` 218 // The date when funds are expected to arrive in the destination account. 219 ExpectedArrivalDate int64 `json:"expected_arrival_date"` 220 // The FinancialAccount that funds were pulled from. 221 FinancialAccount string `json:"financial_account"` 222 // A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. 223 HostedRegulatoryReceiptURL string `json:"hosted_regulatory_receipt_url"` 224 // Unique identifier for the object. 225 ID string `json:"id"` 226 // Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. 227 Livemode bool `json:"livemode"` 228 // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. 229 Metadata map[string]string `json:"metadata"` 230 // String representing the object's type. Objects of the same type share the same value. 231 Object string `json:"object"` 232 // Details about a returned OutboundTransfer. Only set when the status is `returned`. 233 ReturnedDetails *TreasuryOutboundTransferReturnedDetails `json:"returned_details"` 234 // Information about the OutboundTransfer to be sent to the recipient account. 235 StatementDescriptor string `json:"statement_descriptor"` 236 // Current status of the OutboundTransfer: `processing`, `failed`, `canceled`, `posted`, `returned`. An OutboundTransfer is `processing` if it has been created and is pending. The status changes to `posted` once the OutboundTransfer has been "confirmed" and funds have left the account, or to `failed` or `canceled`. If an OutboundTransfer fails to arrive at its destination, its status will change to `returned`. 237 Status TreasuryOutboundTransferStatus `json:"status"` 238 StatusTransitions *TreasuryOutboundTransferStatusTransitions `json:"status_transitions"` 239 // The Transaction associated with this object. 240 Transaction *TreasuryTransaction `json:"transaction"` 241 } 242 243 // TreasuryOutboundTransferList is a list of OutboundTransfers as retrieved from a list endpoint. 244 type TreasuryOutboundTransferList struct { 245 APIResource 246 ListMeta 247 Data []*TreasuryOutboundTransfer `json:"data"` 248 }