## Create a linked bank account `embed.linked_bank_accounts.create(**kwargs) -> LinkedBankAccountV1` **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. ### Parameters - `account_id: String` The unique identifier of the Straddle account to associate this bank account with. - `bank_account: { account_holder, account_number, routing_number}` - `account_holder: 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. - `account_number: String` The bank account number. - `routing_number: String` The routing number of the bank account. - `description: String` Optional description for the bank account. - `metadata: Hash[Symbol, String]` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the linked bank account in a structured format. - `platform_id: String` The unique identifier of the Straddle Platform to associate this bank account with. - `purposes: Array[:charges | :payouts | :billing]` The purposes for the linked bank account. - `:charges` - `:payouts` - `:billing` - `correlation_id: String` - `idempotency_key: String` - `request_id: String` ### Returns - `class LinkedBankAccountV1` - `data: { id, account_id, bank_account, 8 more}` - `id: String` Unique identifier for the linked bank account. - `account_id: String` The unique identifier of the Straddle account related to this bank account. - `bank_account: { account_holder, account_mask, institution_name, routing_number}` - `account_holder: String` - `account_mask: String` - `institution_name: String` - `routing_number: String` - `created_at: Time` Timestamp of when the bank account object was created. - `purposes: Array[:charges | :payouts | :billing]` The purposes for the linked bank account. - `:charges` - `:payouts` - `:billing` - `status: :created | :onboarding | :active | 3 more` The current status of the linked bank account. - `:created` - `:onboarding` - `:active` - `:rejected` - `:inactive` - `:canceled` - `status_detail: { code, message, reason, source}` - `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: :unverified | :in_review | :pending | 5 more` A machine-readable identifier for the specific status, useful for programmatic handling. - `:unverified` - `:in_review` - `:pending` - `:stuck` - `:verified` - `:failed_verification` - `:disabled` - `:new` - `source: :watchtower` Identifies the origin of the status change (e.g., `watchtower`). This helps in tracking the cause of status updates. - `:watchtower` - `updated_at: Time` Timestamp of the most recent update to the linked bank account. - `description: String` Optional description for the bank account. - `metadata: Hash[Symbol, String]` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the linked bank account in a structured format. - `platform_id: 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. - `api_request_id: String` Unique identifier for this API request, useful for troubleshooting. - `api_request_timestamp: Time` Timestamp for this API request, useful for troubleshooting. - `response_type: :object | :array | :error | :none` 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. - `:object` - `:array` - `:error` - `:none` ### Example ```ruby require "straddle" straddle = Straddle::Client.new( api_key: "My API Key", environment: "production" # defaults to "sandbox" ) linked_bank_account_v1 = straddle.embed.linked_bank_accounts.create( account_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", bank_account: {account_holder: "account_holder", account_number: "account_number", routing_number: "xxxxxxxxx"} ) puts(linked_bank_account_v1) ``` #### 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" } ```