## Update a linked bank account `client.Embed.LinkedBankAccounts.Update(ctx, linkedBankAccountID, params) (*LinkedBankAccountV1, error)` **put** `/v1/linked_bank_accounts/{linked_bank_account_id}` Updates an existing linked bank account's information. This can be used to update account details during onboarding or to update metadata associated with the linked account. The linked bank account must be in 'created' or 'onboarding' status. ### Parameters - `linkedBankAccountID string` - `params EmbedLinkedBankAccountUpdateParams` - `BankAccount param.Field[EmbedLinkedBankAccountUpdateParamsBankAccount]` Body param - `AccountHolder string` The name of the account holder as it appears on the bank account. Typically, this is the legal name of the business associated with the account. - `AccountNumber string` The bank account number. - `RoutingNumber string` The routing number of the bank account. - `Metadata param.Field[map[string, string]]` Body param: Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the linked bank account in a structured format. - `CorrelationID param.Field[string]` Header param: Optional client generated identifier to trace and debug a series of requests. - `IdempotencyKey param.Field[string]` Header param: Optional client generated value to use for idempotent requests. - `RequestID param.Field[string]` Header param: Optional client generated identifier to trace and debug a request. ### Returns - `type LinkedBankAccountV1 struct{…}` - `Data LinkedBankAccountV1Data` - `ID string` Unique identifier for the linked bank account. - `AccountID string` The unique identifier of the Straddle account related to this bank account. - `BankAccount LinkedBankAccountV1DataBankAccount` - `AccountHolder string` - `AccountMask string` - `InstitutionName string` - `RoutingNumber string` - `CreatedAt Time` Timestamp of when the bank account object was created. - `Purposes []string` The purposes for the linked bank account. - `const LinkedBankAccountV1DataPurposeCharges LinkedBankAccountV1DataPurpose = "charges"` - `const LinkedBankAccountV1DataPurposePayouts LinkedBankAccountV1DataPurpose = "payouts"` - `const LinkedBankAccountV1DataPurposeBilling LinkedBankAccountV1DataPurpose = "billing"` - `Status string` The current status of the linked bank account. - `const LinkedBankAccountV1DataStatusCreated LinkedBankAccountV1DataStatus = "created"` - `const LinkedBankAccountV1DataStatusOnboarding LinkedBankAccountV1DataStatus = "onboarding"` - `const LinkedBankAccountV1DataStatusActive LinkedBankAccountV1DataStatus = "active"` - `const LinkedBankAccountV1DataStatusRejected LinkedBankAccountV1DataStatus = "rejected"` - `const LinkedBankAccountV1DataStatusInactive LinkedBankAccountV1DataStatus = "inactive"` - `const LinkedBankAccountV1DataStatusCanceled LinkedBankAccountV1DataStatus = "canceled"` - `StatusDetail LinkedBankAccountV1DataStatusDetail` - `Code string` A machine-readable code for the specific status, useful for programmatic handling. - `Message string` A human-readable message describing the current status. - `Reason string` A machine-readable identifier for the specific status, useful for programmatic handling. - `const LinkedBankAccountV1DataStatusDetailReasonUnverified LinkedBankAccountV1DataStatusDetailReason = "unverified"` - `const LinkedBankAccountV1DataStatusDetailReasonInReview LinkedBankAccountV1DataStatusDetailReason = "in_review"` - `const LinkedBankAccountV1DataStatusDetailReasonPending LinkedBankAccountV1DataStatusDetailReason = "pending"` - `const LinkedBankAccountV1DataStatusDetailReasonStuck LinkedBankAccountV1DataStatusDetailReason = "stuck"` - `const LinkedBankAccountV1DataStatusDetailReasonVerified LinkedBankAccountV1DataStatusDetailReason = "verified"` - `const LinkedBankAccountV1DataStatusDetailReasonFailedVerification LinkedBankAccountV1DataStatusDetailReason = "failed_verification"` - `const LinkedBankAccountV1DataStatusDetailReasonDisabled LinkedBankAccountV1DataStatusDetailReason = "disabled"` - `const LinkedBankAccountV1DataStatusDetailReasonNew LinkedBankAccountV1DataStatusDetailReason = "new"` - `Source string` Identifies the origin of the status change (e.g., `watchtower`). This helps in tracking the cause of status updates. - `const LinkedBankAccountV1DataStatusDetailSourceWatchtower LinkedBankAccountV1DataStatusDetailSource = "watchtower"` - `UpdatedAt Time` Timestamp of the most recent update to the linked bank account. - `Description string` Optional description for the bank account. - `Metadata map[string, string]` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the linked bank account in a structured format. - `PlatformID string` The unique identifier of the Straddle Platform relatd to this bank account. - `Meta ResponseMetadata` Metadata about the API request, including an identifier and timestamp. - `APIRequestID string` Unique identifier for this API request, useful for troubleshooting. - `APIRequestTimestamp Time` Timestamp for this API request, useful for troubleshooting. - `ResponseType LinkedBankAccountV1ResponseType` Indicates the structure of the returned content. - "object" means the `data` field contains a single JSON object. - "array" means the `data` field contains an array of objects. - "error" means the `data` field contains an error object with details of the issue. - "none" means no data is returned. - `const LinkedBankAccountV1ResponseTypeObject LinkedBankAccountV1ResponseType = "object"` - `const LinkedBankAccountV1ResponseTypeArray LinkedBankAccountV1ResponseType = "array"` - `const LinkedBankAccountV1ResponseTypeError LinkedBankAccountV1ResponseType = "error"` - `const LinkedBankAccountV1ResponseTypeNone LinkedBankAccountV1ResponseType = "none"` ### Example ```go package main import ( "context" "fmt" "github.com/straddleio/straddle-go" "github.com/straddleio/straddle-go/option" ) func main() { client := straddle.NewClient( option.WithAPIKey("My API Key"), ) linkedBankAccountV1, err := client.Embed.LinkedBankAccounts.Update( context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", straddle.EmbedLinkedBankAccountUpdateParams{ BankAccount: straddle.EmbedLinkedBankAccountUpdateParamsBankAccount{ AccountHolder: "account_holder", AccountNumber: "account_number", RoutingNumber: "xxxxxxxxx", }, }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", linkedBankAccountV1.Data) } ``` #### Response ```json { "data": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "bank_account": { "account_holder": "account_holder", "account_mask": "account_mask", "institution_name": "institution_name", "routing_number": "routing_number" }, "created_at": "2019-12-27T18:11:19.117Z", "purposes": [ "charges" ], "status": "created", "status_detail": { "code": "code", "message": "message", "reason": "unverified", "source": "watchtower" }, "updated_at": "2019-12-27T18:11:19.117Z", "description": "description", "metadata": { "foo": "string" }, "platform_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" }, "meta": { "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "api_request_timestamp": "2019-12-27T18:11:19.117Z" }, "response_type": "object" } ```