Create a linked bank account
client.Embed.LinkedBankAccounts.New(ctx, params) (*LinkedBankAccountV1, error)
POST/v1/linked_bank_accounts
Creates a new linked bank account associated with a Straddle account. This endpoint allows you to associate external bank accounts with a Straddle account for various payment operations such as payment deposits, payout withdrawals, and more.
Create a linked bank account
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.New(context.TODO(), straddle.EmbedLinkedBankAccountNewParams{
AccountID: straddle.String("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),
BankAccount: straddle.EmbedLinkedBankAccountNewParamsBankAccount{
AccountHolder: "account_holder",
AccountNumber: "account_number",
RoutingNumber: "xxxxxxxxx",
},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", linkedBankAccountV1.Data)
}
{
"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"
}Returns Examples
{
"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"
}