# Link ## Bridge a bank account `client.bridge.link.bankAccount(LinkBankAccountParamsparams, RequestOptionsoptions?): PaykeyV1` **post** `/v1/bridge/bank_account` Use Bridge to create a new paykey using a bank routing and account number as the source. This endpoint allows you to create a secure payment token linked to a specific bank account. ### Parameters - `params: LinkBankAccountParams` - `account_number: string` Body param: The bank account number. - `account_type: "checking" | "savings"` Body param - `"checking"` - `"savings"` - `customer_id: string` Body param: Unique identifier of the related customer object. - `routing_number: string` Body param: The routing number of the bank account. - `config?: Config` Body param - `processing_method?: "inline" | "background" | "skip"` - `"inline"` - `"background"` - `"skip"` - `sandbox_outcome?: "standard" | "active" | "rejected" | "review"` - `"standard"` - `"active"` - `"rejected"` - `"review"` - `external_id?: string | null` Body param: Unique identifier for the paykey in your database, used for cross-referencing between Straddle and your systems. - `metadata?: Record | null` Body param: Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the paykey in a structured format. - `correlationID?: string` Header param: Optional client generated identifier to trace and debug a series of requests. - `idempotencyKey?: string` Header param: Optional client generated value to use for idempotent requests. - `requestID?: string` Header param: Optional client generated identifier to trace and debug a request. - `straddleAccountID?: string` Header param: For use by platforms to specify an account id and set scope of a request. ### Returns - `PaykeyV1` - `data: Data` - `id: string` Unique identifier for the paykey. - `config: Config` - `processing_method?: "inline" | "background" | "skip"` - `"inline"` - `"background"` - `"skip"` - `sandbox_outcome?: "standard" | "active" | "rejected" | "review"` - `"standard"` - `"active"` - `"rejected"` - `"review"` - `created_at: string` Timestamp of when the paykey was created. - `label: string` Human-readable label used to represent this paykey in a UI. - `paykey: string` The tokenized paykey value. This value is used to create payments and should be stored securely. - `source: "bank_account" | "straddle" | "mx" | 3 more` - `"bank_account"` - `"straddle"` - `"mx"` - `"plaid"` - `"tan"` - `"quiltt"` - `status: "pending" | "active" | "inactive" | 3 more` - `"pending"` - `"active"` - `"inactive"` - `"rejected"` - `"review"` - `"blocked"` - `updated_at: string` Timestamp of the most recent update to the paykey. - `balance?: Balance` - `status: "pending" | "completed" | "failed"` - `"pending"` - `"completed"` - `"failed"` - `account_balance?: number | null` Account Balance when last retrieved - `updated_at?: string | null` Last time account balance was updated. - `bank_data?: BankData` - `account_number: string` Bank account number. This value is masked by default for security reasons. Use the /unmask endpoint to access the unmasked value. - `account_type: "checking" | "savings"` - `"checking"` - `"savings"` - `routing_number: string` The routing number of the bank account. - `customer_id?: string | null` Unique identifier of the related customer object. - `expires_at?: string | null` Expiration date and time of the paykey, if applicable. - `external_id?: string | null` Unique identifier for the paykey in your database, used for cross-referencing between Straddle and your systems. - `institution_name?: string | null` Name of the financial institution. - `metadata?: Record | null` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the paykey in a structured format. - `status_details?: StatusDetails` - `changed_at: string` The time the status change occurred. - `message: string` A human-readable description of the current status. - `reason: "insufficient_funds" | "closed_bank_account" | "invalid_bank_account" | 24 more` - `"insufficient_funds"` - `"closed_bank_account"` - `"invalid_bank_account"` - `"invalid_routing"` - `"disputed"` - `"payment_stopped"` - `"owner_deceased"` - `"frozen_bank_account"` - `"risk_review"` - `"fraudulent"` - `"duplicate_entry"` - `"invalid_paykey"` - `"payment_blocked"` - `"amount_too_large"` - `"too_many_attempts"` - `"internal_system_error"` - `"user_request"` - `"ok"` - `"other_network_return"` - `"payout_refused"` - `"cancel_request"` - `"failed_verification"` - `"require_review"` - `"blocked_by_system"` - `"watchtower_review"` - `"validating"` - `"auto_hold"` - `source: "watchtower" | "bank_decline" | "customer_dispute" | 2 more` - `"watchtower"` - `"bank_decline"` - `"customer_dispute"` - `"user_action"` - `"system"` - `code?: string | null` The status code if applicable. - `unblock_eligible?: boolean | null` Indicates whether this paykey is eligible for client-initiated unblocking. Only present for blocked paykeys. True when blocked due to R29 returns and not previously unblocked, false otherwise. Null when paykey is not blocked. - `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: string` 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 ```typescript import Straddle from '@straddlecom/straddle'; const client = new Straddle({ apiKey: process.env['STRADDLE_API_KEY'], // This is the default and can be omitted }); const paykeyV1 = await client.bridge.link.bankAccount({ account_number: 'account_number', account_type: 'checking', customer_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', routing_number: 'xxxxxxxxx', }); console.log(paykeyV1.data); ``` #### Response ```json { "data": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "config": { "processing_method": "inline", "sandbox_outcome": "standard" }, "created_at": "2019-12-27T18:11:19.117Z", "label": "label", "paykey": "paykey", "source": "bank_account", "status": "pending", "updated_at": "2019-12-27T18:11:19.117Z", "balance": { "status": "pending", "account_balance": 0, "updated_at": "2019-12-27T18:11:19.117Z" }, "bank_data": { "account_number": "****1234", "account_type": "checking", "routing_number": "021000021" }, "customer_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "expires_at": "2019-12-27T18:11:19.117Z", "external_id": "external_id", "institution_name": "Bank of America", "metadata": { "foo": "string" }, "status_details": { "changed_at": "2019-12-27T18:11:19.117Z", "message": "Bank account sucesfully validated", "reason": "insufficient_funds", "source": "watchtower", "code": "code" }, "unblock_eligible": true }, "meta": { "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "api_request_timestamp": "2019-12-27T18:11:19.117Z" }, "response_type": "object" } ``` ## Bridge a Plaid token `client.bridge.link.plaid(LinkPlaidParamsparams, RequestOptionsoptions?): PaykeyV1` **post** `/v1/bridge/plaid` Use Bridge to create a new paykey using a Plaid token as the source. This endpoint allows you to create a secure payment token linked to a bank account authenticated through Plaid. ### Parameters - `params: LinkPlaidParams` - `customer_id: string` Body param: Unique identifier of the related customer object. - `plaid_token: string` Body param: Plaid processor token generated by your application for use with the Straddle API. - `config?: Config` Body param - `processing_method?: "inline" | "background" | "skip"` - `"inline"` - `"background"` - `"skip"` - `sandbox_outcome?: "standard" | "active" | "rejected" | "review"` - `"standard"` - `"active"` - `"rejected"` - `"review"` - `external_id?: string | null` Body param: Unique identifier for the paykey in your database, used for cross-referencing between Straddle and your systems. - `metadata?: Record | null` Body param: Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the paykey in a structured format. - `correlationID?: string` Header param: Optional client generated identifier to trace and debug a series of requests. - `idempotencyKey?: string` Header param: Optional client generated value to use for idempotent requests. - `requestID?: string` Header param: Optional client generated identifier to trace and debug a request. - `straddleAccountID?: string` Header param: For use by platforms to specify an account id and set scope of a request. ### Returns - `PaykeyV1` - `data: Data` - `id: string` Unique identifier for the paykey. - `config: Config` - `processing_method?: "inline" | "background" | "skip"` - `"inline"` - `"background"` - `"skip"` - `sandbox_outcome?: "standard" | "active" | "rejected" | "review"` - `"standard"` - `"active"` - `"rejected"` - `"review"` - `created_at: string` Timestamp of when the paykey was created. - `label: string` Human-readable label used to represent this paykey in a UI. - `paykey: string` The tokenized paykey value. This value is used to create payments and should be stored securely. - `source: "bank_account" | "straddle" | "mx" | 3 more` - `"bank_account"` - `"straddle"` - `"mx"` - `"plaid"` - `"tan"` - `"quiltt"` - `status: "pending" | "active" | "inactive" | 3 more` - `"pending"` - `"active"` - `"inactive"` - `"rejected"` - `"review"` - `"blocked"` - `updated_at: string` Timestamp of the most recent update to the paykey. - `balance?: Balance` - `status: "pending" | "completed" | "failed"` - `"pending"` - `"completed"` - `"failed"` - `account_balance?: number | null` Account Balance when last retrieved - `updated_at?: string | null` Last time account balance was updated. - `bank_data?: BankData` - `account_number: string` Bank account number. This value is masked by default for security reasons. Use the /unmask endpoint to access the unmasked value. - `account_type: "checking" | "savings"` - `"checking"` - `"savings"` - `routing_number: string` The routing number of the bank account. - `customer_id?: string | null` Unique identifier of the related customer object. - `expires_at?: string | null` Expiration date and time of the paykey, if applicable. - `external_id?: string | null` Unique identifier for the paykey in your database, used for cross-referencing between Straddle and your systems. - `institution_name?: string | null` Name of the financial institution. - `metadata?: Record | null` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the paykey in a structured format. - `status_details?: StatusDetails` - `changed_at: string` The time the status change occurred. - `message: string` A human-readable description of the current status. - `reason: "insufficient_funds" | "closed_bank_account" | "invalid_bank_account" | 24 more` - `"insufficient_funds"` - `"closed_bank_account"` - `"invalid_bank_account"` - `"invalid_routing"` - `"disputed"` - `"payment_stopped"` - `"owner_deceased"` - `"frozen_bank_account"` - `"risk_review"` - `"fraudulent"` - `"duplicate_entry"` - `"invalid_paykey"` - `"payment_blocked"` - `"amount_too_large"` - `"too_many_attempts"` - `"internal_system_error"` - `"user_request"` - `"ok"` - `"other_network_return"` - `"payout_refused"` - `"cancel_request"` - `"failed_verification"` - `"require_review"` - `"blocked_by_system"` - `"watchtower_review"` - `"validating"` - `"auto_hold"` - `source: "watchtower" | "bank_decline" | "customer_dispute" | 2 more` - `"watchtower"` - `"bank_decline"` - `"customer_dispute"` - `"user_action"` - `"system"` - `code?: string | null` The status code if applicable. - `unblock_eligible?: boolean | null` Indicates whether this paykey is eligible for client-initiated unblocking. Only present for blocked paykeys. True when blocked due to R29 returns and not previously unblocked, false otherwise. Null when paykey is not blocked. - `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: string` 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 ```typescript import Straddle from '@straddlecom/straddle'; const client = new Straddle({ apiKey: process.env['STRADDLE_API_KEY'], // This is the default and can be omitted }); const paykeyV1 = await client.bridge.link.plaid({ customer_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', plaid_token: 'plaid_token', }); console.log(paykeyV1.data); ``` #### Response ```json { "data": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "config": { "processing_method": "inline", "sandbox_outcome": "standard" }, "created_at": "2019-12-27T18:11:19.117Z", "label": "label", "paykey": "paykey", "source": "bank_account", "status": "pending", "updated_at": "2019-12-27T18:11:19.117Z", "balance": { "status": "pending", "account_balance": 0, "updated_at": "2019-12-27T18:11:19.117Z" }, "bank_data": { "account_number": "****1234", "account_type": "checking", "routing_number": "021000021" }, "customer_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "expires_at": "2019-12-27T18:11:19.117Z", "external_id": "external_id", "institution_name": "Bank of America", "metadata": { "foo": "string" }, "status_details": { "changed_at": "2019-12-27T18:11:19.117Z", "message": "Bank account sucesfully validated", "reason": "insufficient_funds", "source": "watchtower", "code": "code" }, "unblock_eligible": true }, "meta": { "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "api_request_timestamp": "2019-12-27T18:11:19.117Z" }, "response_type": "object" } ``` ## Create Tan `client.bridge.link.createTan(LinkCreateTanParamsparams, RequestOptionsoptions?): LinkCreateTanResponse` **post** `/v1/bridge/tan` ### Parameters - `params: LinkCreateTanParams` - `account_type: "checking" | "savings"` Body param - `"checking"` - `"savings"` - `customer_id: string` Body param: Unique identifier of the related customer object. - `routing_number: string` Body param: Bank routing number. - `tan: string` Body param: Tokenized account number. - `config?: Config` Body param - `processing_method?: "inline" | "background" | "skip"` - `"inline"` - `"background"` - `"skip"` - `sandbox_outcome?: "standard" | "active" | "rejected" | "review"` - `"standard"` - `"active"` - `"rejected"` - `"review"` - `external_id?: string | null` Body param: Unique identifier for the paykey in your database, used for cross-referencing between Straddle and your systems. - `metadata?: Record | null` Body param: Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the paykey in a structured format. - `correlationID?: string` Header param: Optional client generated identifier to trace and debug a series of requests. - `idempotencyKey?: string` Header param: Optional client generated value to use for idempotent requests. - `requestID?: string` Header param: Optional client generated identifier to trace and debug a request. - `straddleAccountID?: string` Header param: For use by platforms to specify an account id and set scope of a request. ### Returns - `LinkCreateTanResponse` - `data: Data` - `id: string` Unique identifier for the paykey. - `config: Config` - `processing_method?: "inline" | "background" | "skip"` - `"inline"` - `"background"` - `"skip"` - `sandbox_outcome?: "standard" | "active" | "rejected" | "review"` - `"standard"` - `"active"` - `"rejected"` - `"review"` - `created_at: string` Timestamp of when the paykey was created. - `label: string` Human-readable label that combines the bank name and masked account number to help easility represent this paykey in a UI - `paykey: string` The tokenized paykey value. This token is used to create payments and should be stored securely. - `source: "bank_account" | "straddle" | "mx" | 3 more` - `"bank_account"` - `"straddle"` - `"mx"` - `"plaid"` - `"tan"` - `"quiltt"` - `status: "pending" | "active" | "inactive" | 3 more` - `"pending"` - `"active"` - `"inactive"` - `"rejected"` - `"review"` - `"blocked"` - `updated_at: string` Timestamp of the most recent update to the paykey. - `balance?: Balance` - `status: "pending" | "completed" | "failed"` - `"pending"` - `"completed"` - `"failed"` - `account_balance?: number | null` Account Balance when last retrieved - `updated_at?: string | null` Last time account balance was updated. - `bank_data?: BankData` - `account_number: string` Bank account number. This value is masked by default for security reasons. Use the /unmask endpoint to access the unmasked value. - `account_type: "checking" | "savings"` - `"checking"` - `"savings"` - `routing_number: string` The routing number of the bank account. - `customer_id?: string | null` Unique identifier of the related customer object. - `expires_at?: string | null` Expiration date and time of the paykey, if applicable. - `external_id?: string | null` Unique identifier for the paykey in your database, used for cross-referencing between Straddle and your systems. - `institution_name?: string | null` Name of the financial institution. - `metadata?: Record | null` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the paykey in a structured format. - `status_details?: StatusDetails` - `changed_at: string` The time the status change occurred. - `message: string` A human-readable description of the current status. - `reason: "insufficient_funds" | "closed_bank_account" | "invalid_bank_account" | 24 more` - `"insufficient_funds"` - `"closed_bank_account"` - `"invalid_bank_account"` - `"invalid_routing"` - `"disputed"` - `"payment_stopped"` - `"owner_deceased"` - `"frozen_bank_account"` - `"risk_review"` - `"fraudulent"` - `"duplicate_entry"` - `"invalid_paykey"` - `"payment_blocked"` - `"amount_too_large"` - `"too_many_attempts"` - `"internal_system_error"` - `"user_request"` - `"ok"` - `"other_network_return"` - `"payout_refused"` - `"cancel_request"` - `"failed_verification"` - `"require_review"` - `"blocked_by_system"` - `"watchtower_review"` - `"validating"` - `"auto_hold"` - `source: "watchtower" | "bank_decline" | "customer_dispute" | 2 more` - `"watchtower"` - `"bank_decline"` - `"customer_dispute"` - `"user_action"` - `"system"` - `code?: string | null` The status code if applicable. - `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: string` 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 ```typescript import Straddle from '@straddlecom/straddle'; const client = new Straddle({ apiKey: process.env['STRADDLE_API_KEY'], // This is the default and can be omitted }); const response = await client.bridge.link.createTan({ account_type: 'checking', customer_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', routing_number: 'routing_number', tan: 'tan', }); console.log(response.data); ``` #### Response ```json { "data": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "config": { "processing_method": "inline", "sandbox_outcome": "standard" }, "created_at": "2019-12-27T18:11:19.117Z", "label": "Bank of America ****1234", "paykey": "paykey", "source": "straddle", "status": "pending", "updated_at": "2019-12-27T18:11:19.117Z", "balance": { "status": "pending", "account_balance": 0, "updated_at": "2019-12-27T18:11:19.117Z" }, "bank_data": { "account_number": "****1234", "account_type": "checking", "routing_number": "021000021" }, "customer_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "expires_at": "2019-12-27T18:11:19.117Z", "external_id": "external_id", "institution_name": "Bank of America", "metadata": { "foo": "string" }, "status_details": { "changed_at": "2019-12-27T18:11:19.117Z", "message": "Bank account sucesfully validated", "reason": "insufficient_funds", "source": "watchtower", "code": "code" } }, "meta": { "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "api_request_timestamp": "2019-12-27T18:11:19.117Z" }, "response_type": "object" } ``` ## Create a paykey from a Quiltt token `client.bridge.link.createPaykey(LinkCreatePaykeyParamsparams, RequestOptionsoptions?): LinkCreatePaykeyResponse` **post** `/v1/bridge/quiltt` Creates a new paykey using a Quiltt token as the source. This endpoint allows you to create a secure payment token linked to a bank account authenticated through Quiltt. ### Parameters - `params: LinkCreatePaykeyParams` - `customer_id: string` Body param: Unique identifier of the related customer object. - `quiltt_token: string` Body param: Quiltt processor token generated by your application for use with the Straddle API. - `config?: Config` Body param - `processing_method?: "inline" | "background" | "skip"` - `"inline"` - `"background"` - `"skip"` - `sandbox_outcome?: "standard" | "active" | "rejected" | "review"` - `"standard"` - `"active"` - `"rejected"` - `"review"` - `external_id?: string | null` Body param: Unique identifier for the paykey in your database, used for cross-referencing between Straddle and your systems. - `metadata?: Record | null` Body param: Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the paykey in a structured format. - `correlationID?: string` Header param: Optional client generated identifier to trace and debug a series of requests. - `idempotencyKey?: string` Header param: Optional client generated value to use for idempotent requests. - `requestID?: string` Header param: Optional client generated identifier to trace and debug a request. - `straddleAccountID?: string` Header param: For use by platforms to specify an account id and set scope of a request. ### Returns - `LinkCreatePaykeyResponse` - `data: Data` - `id: string` Unique identifier for the paykey. - `config: Config` - `processing_method?: "inline" | "background" | "skip"` - `"inline"` - `"background"` - `"skip"` - `sandbox_outcome?: "standard" | "active" | "rejected" | "review"` - `"standard"` - `"active"` - `"rejected"` - `"review"` - `created_at: string` Timestamp of when the paykey was created. - `label: string` Human-readable label that combines the bank name and masked account number to help easility represent this paykey in a UI - `paykey: string` The tokenized paykey value. This token is used to create payments and should be stored securely. - `source: "bank_account" | "straddle" | "mx" | 3 more` - `"bank_account"` - `"straddle"` - `"mx"` - `"plaid"` - `"tan"` - `"quiltt"` - `status: "pending" | "active" | "inactive" | 3 more` - `"pending"` - `"active"` - `"inactive"` - `"rejected"` - `"review"` - `"blocked"` - `updated_at: string` Timestamp of the most recent update to the paykey. - `balance?: Balance` - `status: "pending" | "completed" | "failed"` - `"pending"` - `"completed"` - `"failed"` - `account_balance?: number | null` Account Balance when last retrieved - `updated_at?: string | null` Last time account balance was updated. - `bank_data?: BankData` - `account_number: string` Bank account number. This value is masked by default for security reasons. Use the /unmask endpoint to access the unmasked value. - `account_type: "checking" | "savings"` - `"checking"` - `"savings"` - `routing_number: string` The routing number of the bank account. - `customer_id?: string | null` Unique identifier of the related customer object. - `expires_at?: string | null` Expiration date and time of the paykey, if applicable. - `external_id?: string | null` Unique identifier for the paykey in your database, used for cross-referencing between Straddle and your systems. - `institution_name?: string | null` Name of the financial institution. - `metadata?: Record | null` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the paykey in a structured format. - `status_details?: StatusDetails` - `changed_at: string` The time the status change occurred. - `message: string` A human-readable description of the current status. - `reason: "insufficient_funds" | "closed_bank_account" | "invalid_bank_account" | 24 more` - `"insufficient_funds"` - `"closed_bank_account"` - `"invalid_bank_account"` - `"invalid_routing"` - `"disputed"` - `"payment_stopped"` - `"owner_deceased"` - `"frozen_bank_account"` - `"risk_review"` - `"fraudulent"` - `"duplicate_entry"` - `"invalid_paykey"` - `"payment_blocked"` - `"amount_too_large"` - `"too_many_attempts"` - `"internal_system_error"` - `"user_request"` - `"ok"` - `"other_network_return"` - `"payout_refused"` - `"cancel_request"` - `"failed_verification"` - `"require_review"` - `"blocked_by_system"` - `"watchtower_review"` - `"validating"` - `"auto_hold"` - `source: "watchtower" | "bank_decline" | "customer_dispute" | 2 more` - `"watchtower"` - `"bank_decline"` - `"customer_dispute"` - `"user_action"` - `"system"` - `code?: string | null` The status code if applicable. - `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: string` 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 ```typescript import Straddle from '@straddlecom/straddle'; const client = new Straddle({ apiKey: process.env['STRADDLE_API_KEY'], // This is the default and can be omitted }); const response = await client.bridge.link.createPaykey({ customer_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', quiltt_token: 'quiltt_token', }); console.log(response.data); ``` #### Response ```json { "data": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "config": { "processing_method": "inline", "sandbox_outcome": "standard" }, "created_at": "2019-12-27T18:11:19.117Z", "label": "Bank of America ****1234", "paykey": "paykey", "source": "straddle", "status": "pending", "updated_at": "2019-12-27T18:11:19.117Z", "balance": { "status": "pending", "account_balance": 0, "updated_at": "2019-12-27T18:11:19.117Z" }, "bank_data": { "account_number": "****1234", "account_type": "checking", "routing_number": "021000021" }, "customer_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "expires_at": "2019-12-27T18:11:19.117Z", "external_id": "external_id", "institution_name": "Bank of America", "metadata": { "foo": "string" }, "status_details": { "changed_at": "2019-12-27T18:11:19.117Z", "message": "Bank account sucesfully validated", "reason": "insufficient_funds", "source": "watchtower", "code": "code" } }, "meta": { "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "api_request_timestamp": "2019-12-27T18:11:19.117Z" }, "response_type": "object" } ``` ## Domain Types ### Link Create Tan Response - `LinkCreateTanResponse` - `data: Data` - `id: string` Unique identifier for the paykey. - `config: Config` - `processing_method?: "inline" | "background" | "skip"` - `"inline"` - `"background"` - `"skip"` - `sandbox_outcome?: "standard" | "active" | "rejected" | "review"` - `"standard"` - `"active"` - `"rejected"` - `"review"` - `created_at: string` Timestamp of when the paykey was created. - `label: string` Human-readable label that combines the bank name and masked account number to help easility represent this paykey in a UI - `paykey: string` The tokenized paykey value. This token is used to create payments and should be stored securely. - `source: "bank_account" | "straddle" | "mx" | 3 more` - `"bank_account"` - `"straddle"` - `"mx"` - `"plaid"` - `"tan"` - `"quiltt"` - `status: "pending" | "active" | "inactive" | 3 more` - `"pending"` - `"active"` - `"inactive"` - `"rejected"` - `"review"` - `"blocked"` - `updated_at: string` Timestamp of the most recent update to the paykey. - `balance?: Balance` - `status: "pending" | "completed" | "failed"` - `"pending"` - `"completed"` - `"failed"` - `account_balance?: number | null` Account Balance when last retrieved - `updated_at?: string | null` Last time account balance was updated. - `bank_data?: BankData` - `account_number: string` Bank account number. This value is masked by default for security reasons. Use the /unmask endpoint to access the unmasked value. - `account_type: "checking" | "savings"` - `"checking"` - `"savings"` - `routing_number: string` The routing number of the bank account. - `customer_id?: string | null` Unique identifier of the related customer object. - `expires_at?: string | null` Expiration date and time of the paykey, if applicable. - `external_id?: string | null` Unique identifier for the paykey in your database, used for cross-referencing between Straddle and your systems. - `institution_name?: string | null` Name of the financial institution. - `metadata?: Record | null` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the paykey in a structured format. - `status_details?: StatusDetails` - `changed_at: string` The time the status change occurred. - `message: string` A human-readable description of the current status. - `reason: "insufficient_funds" | "closed_bank_account" | "invalid_bank_account" | 24 more` - `"insufficient_funds"` - `"closed_bank_account"` - `"invalid_bank_account"` - `"invalid_routing"` - `"disputed"` - `"payment_stopped"` - `"owner_deceased"` - `"frozen_bank_account"` - `"risk_review"` - `"fraudulent"` - `"duplicate_entry"` - `"invalid_paykey"` - `"payment_blocked"` - `"amount_too_large"` - `"too_many_attempts"` - `"internal_system_error"` - `"user_request"` - `"ok"` - `"other_network_return"` - `"payout_refused"` - `"cancel_request"` - `"failed_verification"` - `"require_review"` - `"blocked_by_system"` - `"watchtower_review"` - `"validating"` - `"auto_hold"` - `source: "watchtower" | "bank_decline" | "customer_dispute" | 2 more` - `"watchtower"` - `"bank_decline"` - `"customer_dispute"` - `"user_action"` - `"system"` - `code?: string | null` The status code if applicable. - `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: string` 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"` ### Link Create Paykey Response - `LinkCreatePaykeyResponse` - `data: Data` - `id: string` Unique identifier for the paykey. - `config: Config` - `processing_method?: "inline" | "background" | "skip"` - `"inline"` - `"background"` - `"skip"` - `sandbox_outcome?: "standard" | "active" | "rejected" | "review"` - `"standard"` - `"active"` - `"rejected"` - `"review"` - `created_at: string` Timestamp of when the paykey was created. - `label: string` Human-readable label that combines the bank name and masked account number to help easility represent this paykey in a UI - `paykey: string` The tokenized paykey value. This token is used to create payments and should be stored securely. - `source: "bank_account" | "straddle" | "mx" | 3 more` - `"bank_account"` - `"straddle"` - `"mx"` - `"plaid"` - `"tan"` - `"quiltt"` - `status: "pending" | "active" | "inactive" | 3 more` - `"pending"` - `"active"` - `"inactive"` - `"rejected"` - `"review"` - `"blocked"` - `updated_at: string` Timestamp of the most recent update to the paykey. - `balance?: Balance` - `status: "pending" | "completed" | "failed"` - `"pending"` - `"completed"` - `"failed"` - `account_balance?: number | null` Account Balance when last retrieved - `updated_at?: string | null` Last time account balance was updated. - `bank_data?: BankData` - `account_number: string` Bank account number. This value is masked by default for security reasons. Use the /unmask endpoint to access the unmasked value. - `account_type: "checking" | "savings"` - `"checking"` - `"savings"` - `routing_number: string` The routing number of the bank account. - `customer_id?: string | null` Unique identifier of the related customer object. - `expires_at?: string | null` Expiration date and time of the paykey, if applicable. - `external_id?: string | null` Unique identifier for the paykey in your database, used for cross-referencing between Straddle and your systems. - `institution_name?: string | null` Name of the financial institution. - `metadata?: Record | null` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the paykey in a structured format. - `status_details?: StatusDetails` - `changed_at: string` The time the status change occurred. - `message: string` A human-readable description of the current status. - `reason: "insufficient_funds" | "closed_bank_account" | "invalid_bank_account" | 24 more` - `"insufficient_funds"` - `"closed_bank_account"` - `"invalid_bank_account"` - `"invalid_routing"` - `"disputed"` - `"payment_stopped"` - `"owner_deceased"` - `"frozen_bank_account"` - `"risk_review"` - `"fraudulent"` - `"duplicate_entry"` - `"invalid_paykey"` - `"payment_blocked"` - `"amount_too_large"` - `"too_many_attempts"` - `"internal_system_error"` - `"user_request"` - `"ok"` - `"other_network_return"` - `"payout_refused"` - `"cancel_request"` - `"failed_verification"` - `"require_review"` - `"blocked_by_system"` - `"watchtower_review"` - `"validating"` - `"auto_hold"` - `source: "watchtower" | "bank_decline" | "customer_dispute" | 2 more` - `"watchtower"` - `"bank_decline"` - `"customer_dispute"` - `"user_action"` - `"system"` - `code?: string | null` The status code if applicable. - `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: string` 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"`