Skip to content
Get started

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.

ParametersExpand Collapse
params EmbedLinkedBankAccountNewParams
AccountID param.Field[string]

Body param: The unique identifier of the Straddle account to associate this bank account with.

formatuuid

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.

minLength9
maxLength9
Description param.Field[string]optional

Body param: Optional description for the bank account.

Metadata param.Field[map[string, string]]optional

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.

PlatformID param.Field[string]optional

Body param: The unique identifier of the Straddle Platform to associate this bank account with.

formatuuid
Purposes param.Field[[]string]optional

Body param: The purposes for the linked bank account.

const EmbedLinkedBankAccountNewParamsPurposeCharges EmbedLinkedBankAccountNewParamsPurpose = "charges"
const EmbedLinkedBankAccountNewParamsPurposePayouts EmbedLinkedBankAccountNewParamsPurpose = "payouts"
const EmbedLinkedBankAccountNewParamsPurposeBilling EmbedLinkedBankAccountNewParamsPurpose = "billing"
CorrelationID param.Field[string]optional

Header param: Optional client generated identifier to trace and debug a series of requests.

IdempotencyKey param.Field[string]optional

Header param: Optional client generated value to use for idempotent requests.

maxLength40
minLength10
RequestID param.Field[string]optional

Header param: Optional client generated identifier to trace and debug a request.

ReturnsExpand Collapse
type LinkedBankAccountV1 struct{…}
Data LinkedBankAccountV1Data
ID string

Unique identifier for the linked bank account.

formatuuid
AccountID string

The unique identifier of the Straddle account related to this bank account.

formatuuid
BankAccount LinkedBankAccountV1DataBankAccount
AccountHolder string
AccountMask string
InstitutionName string
RoutingNumber string
CreatedAt Time

Timestamp of when the bank account object was created.

formatdate-time
Purposes []string

The purposes for the linked bank account.

One of the following:
const LinkedBankAccountV1DataPurposeCharges LinkedBankAccountV1DataPurpose = "charges"
const LinkedBankAccountV1DataPurposePayouts LinkedBankAccountV1DataPurpose = "payouts"
const LinkedBankAccountV1DataPurposeBilling LinkedBankAccountV1DataPurpose = "billing"
Status string

The current status of the linked bank account.

One of the following:
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.

One of the following:
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.

UpdatedAt Time

Timestamp of the most recent update to the linked bank account.

formatdate-time
Description stringoptional

Optional description for the bank account.

Metadata map[string, string]optional

Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the linked bank account in a structured format.

PlatformID stringoptional

The unique identifier of the Straddle Platform relatd to this bank account.

formatuuid

Metadata about the API request, including an identifier and timestamp.

APIRequestID string

Unique identifier for this API request, useful for troubleshooting.

formatuuid
APIRequestTimestamp Time

Timestamp for this API request, useful for troubleshooting.

formatdate-time
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.
One of the following:
const LinkedBankAccountV1ResponseTypeObject LinkedBankAccountV1ResponseType = "object"
const LinkedBankAccountV1ResponseTypeArray LinkedBankAccountV1ResponseType = "array"
const LinkedBankAccountV1ResponseTypeError LinkedBankAccountV1ResponseType = "error"
const LinkedBankAccountV1ResponseTypeNone LinkedBankAccountV1ResponseType = "none"

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"
}