## Create Tan `client.Bridge.Link.NewTan(ctx, params) (*BridgeLinkNewTanResponse, error)` **post** `/v1/bridge/tan` ### Parameters - `params BridgeLinkNewTanParams` - `AccountType param.Field[BridgeLinkNewTanParamsAccountType]` Body param - `const BridgeLinkNewTanParamsAccountTypeChecking BridgeLinkNewTanParamsAccountType = "checking"` - `const BridgeLinkNewTanParamsAccountTypeSavings BridgeLinkNewTanParamsAccountType = "savings"` - `CustomerID param.Field[string]` Body param: Unique identifier of the related customer object. - `RoutingNumber param.Field[string]` Body param: Bank routing number. - `Tan param.Field[string]` Body param: Tokenized account number. - `Config param.Field[BridgeLinkNewTanParamsConfig]` Body param - `ProcessingMethod string` - `const BridgeLinkNewTanParamsConfigProcessingMethodInline BridgeLinkNewTanParamsConfigProcessingMethod = "inline"` - `const BridgeLinkNewTanParamsConfigProcessingMethodBackground BridgeLinkNewTanParamsConfigProcessingMethod = "background"` - `const BridgeLinkNewTanParamsConfigProcessingMethodSkip BridgeLinkNewTanParamsConfigProcessingMethod = "skip"` - `SandboxOutcome string` - `const BridgeLinkNewTanParamsConfigSandboxOutcomeStandard BridgeLinkNewTanParamsConfigSandboxOutcome = "standard"` - `const BridgeLinkNewTanParamsConfigSandboxOutcomeActive BridgeLinkNewTanParamsConfigSandboxOutcome = "active"` - `const BridgeLinkNewTanParamsConfigSandboxOutcomeRejected BridgeLinkNewTanParamsConfigSandboxOutcome = "rejected"` - `const BridgeLinkNewTanParamsConfigSandboxOutcomeReview BridgeLinkNewTanParamsConfigSandboxOutcome = "review"` - `ExternalID param.Field[string]` Body param: Unique identifier for the paykey in your database, used for cross-referencing between Straddle and your systems. - `Metadata param.Field[map[string, string]]` Body param: Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the paykey 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. - `StraddleAccountID param.Field[string]` Header param: For use by platforms to specify an account id and set scope of a request. ### Returns - `type BridgeLinkNewTanResponse struct{…}` - `Data BridgeLinkNewTanResponseData` - `ID string` Unique identifier for the paykey. - `Config BridgeLinkNewTanResponseDataConfig` - `ProcessingMethod string` - `const BridgeLinkNewTanResponseDataConfigProcessingMethodInline BridgeLinkNewTanResponseDataConfigProcessingMethod = "inline"` - `const BridgeLinkNewTanResponseDataConfigProcessingMethodBackground BridgeLinkNewTanResponseDataConfigProcessingMethod = "background"` - `const BridgeLinkNewTanResponseDataConfigProcessingMethodSkip BridgeLinkNewTanResponseDataConfigProcessingMethod = "skip"` - `SandboxOutcome string` - `const BridgeLinkNewTanResponseDataConfigSandboxOutcomeStandard BridgeLinkNewTanResponseDataConfigSandboxOutcome = "standard"` - `const BridgeLinkNewTanResponseDataConfigSandboxOutcomeActive BridgeLinkNewTanResponseDataConfigSandboxOutcome = "active"` - `const BridgeLinkNewTanResponseDataConfigSandboxOutcomeRejected BridgeLinkNewTanResponseDataConfigSandboxOutcome = "rejected"` - `const BridgeLinkNewTanResponseDataConfigSandboxOutcomeReview BridgeLinkNewTanResponseDataConfigSandboxOutcome = "review"` - `CreatedAt Time` 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 string` - `const BridgeLinkNewTanResponseDataSourceBankAccount BridgeLinkNewTanResponseDataSource = "bank_account"` - `const BridgeLinkNewTanResponseDataSourceStraddle BridgeLinkNewTanResponseDataSource = "straddle"` - `const BridgeLinkNewTanResponseDataSourceMx BridgeLinkNewTanResponseDataSource = "mx"` - `const BridgeLinkNewTanResponseDataSourcePlaid BridgeLinkNewTanResponseDataSource = "plaid"` - `const BridgeLinkNewTanResponseDataSourceTan BridgeLinkNewTanResponseDataSource = "tan"` - `const BridgeLinkNewTanResponseDataSourceQuiltt BridgeLinkNewTanResponseDataSource = "quiltt"` - `Status string` - `const BridgeLinkNewTanResponseDataStatusPending BridgeLinkNewTanResponseDataStatus = "pending"` - `const BridgeLinkNewTanResponseDataStatusActive BridgeLinkNewTanResponseDataStatus = "active"` - `const BridgeLinkNewTanResponseDataStatusInactive BridgeLinkNewTanResponseDataStatus = "inactive"` - `const BridgeLinkNewTanResponseDataStatusRejected BridgeLinkNewTanResponseDataStatus = "rejected"` - `const BridgeLinkNewTanResponseDataStatusReview BridgeLinkNewTanResponseDataStatus = "review"` - `const BridgeLinkNewTanResponseDataStatusBlocked BridgeLinkNewTanResponseDataStatus = "blocked"` - `UpdatedAt Time` Timestamp of the most recent update to the paykey. - `Balance BridgeLinkNewTanResponseDataBalance` - `Status string` - `const BridgeLinkNewTanResponseDataBalanceStatusPending BridgeLinkNewTanResponseDataBalanceStatus = "pending"` - `const BridgeLinkNewTanResponseDataBalanceStatusCompleted BridgeLinkNewTanResponseDataBalanceStatus = "completed"` - `const BridgeLinkNewTanResponseDataBalanceStatusFailed BridgeLinkNewTanResponseDataBalanceStatus = "failed"` - `AccountBalance int64` Account Balance when last retrieved - `UpdatedAt Time` Last time account balance was updated. - `BankData BridgeLinkNewTanResponseDataBankData` - `AccountNumber string` Bank account number. This value is masked by default for security reasons. Use the /unmask endpoint to access the unmasked value. - `AccountType string` - `const BridgeLinkNewTanResponseDataBankDataAccountTypeChecking BridgeLinkNewTanResponseDataBankDataAccountType = "checking"` - `const BridgeLinkNewTanResponseDataBankDataAccountTypeSavings BridgeLinkNewTanResponseDataBankDataAccountType = "savings"` - `RoutingNumber string` The routing number of the bank account. - `CustomerID string` Unique identifier of the related customer object. - `ExpiresAt Time` Expiration date and time of the paykey, if applicable. - `ExternalID string` Unique identifier for the paykey in your database, used for cross-referencing between Straddle and your systems. - `InstitutionName string` Name of the financial institution. - `Metadata map[string, string]` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the paykey in a structured format. - `StatusDetails BridgeLinkNewTanResponseDataStatusDetails` - `ChangedAt Time` The time the status change occurred. - `Message string` A human-readable description of the current status. - `Reason string` - `const BridgeLinkNewTanResponseDataStatusDetailsReasonInsufficientFunds BridgeLinkNewTanResponseDataStatusDetailsReason = "insufficient_funds"` - `const BridgeLinkNewTanResponseDataStatusDetailsReasonClosedBankAccount BridgeLinkNewTanResponseDataStatusDetailsReason = "closed_bank_account"` - `const BridgeLinkNewTanResponseDataStatusDetailsReasonInvalidBankAccount BridgeLinkNewTanResponseDataStatusDetailsReason = "invalid_bank_account"` - `const BridgeLinkNewTanResponseDataStatusDetailsReasonInvalidRouting BridgeLinkNewTanResponseDataStatusDetailsReason = "invalid_routing"` - `const BridgeLinkNewTanResponseDataStatusDetailsReasonDisputed BridgeLinkNewTanResponseDataStatusDetailsReason = "disputed"` - `const BridgeLinkNewTanResponseDataStatusDetailsReasonPaymentStopped BridgeLinkNewTanResponseDataStatusDetailsReason = "payment_stopped"` - `const BridgeLinkNewTanResponseDataStatusDetailsReasonOwnerDeceased BridgeLinkNewTanResponseDataStatusDetailsReason = "owner_deceased"` - `const BridgeLinkNewTanResponseDataStatusDetailsReasonFrozenBankAccount BridgeLinkNewTanResponseDataStatusDetailsReason = "frozen_bank_account"` - `const BridgeLinkNewTanResponseDataStatusDetailsReasonRiskReview BridgeLinkNewTanResponseDataStatusDetailsReason = "risk_review"` - `const BridgeLinkNewTanResponseDataStatusDetailsReasonFraudulent BridgeLinkNewTanResponseDataStatusDetailsReason = "fraudulent"` - `const BridgeLinkNewTanResponseDataStatusDetailsReasonDuplicateEntry BridgeLinkNewTanResponseDataStatusDetailsReason = "duplicate_entry"` - `const BridgeLinkNewTanResponseDataStatusDetailsReasonInvalidPaykey BridgeLinkNewTanResponseDataStatusDetailsReason = "invalid_paykey"` - `const BridgeLinkNewTanResponseDataStatusDetailsReasonPaymentBlocked BridgeLinkNewTanResponseDataStatusDetailsReason = "payment_blocked"` - `const BridgeLinkNewTanResponseDataStatusDetailsReasonAmountTooLarge BridgeLinkNewTanResponseDataStatusDetailsReason = "amount_too_large"` - `const BridgeLinkNewTanResponseDataStatusDetailsReasonTooManyAttempts BridgeLinkNewTanResponseDataStatusDetailsReason = "too_many_attempts"` - `const BridgeLinkNewTanResponseDataStatusDetailsReasonInternalSystemError BridgeLinkNewTanResponseDataStatusDetailsReason = "internal_system_error"` - `const BridgeLinkNewTanResponseDataStatusDetailsReasonUserRequest BridgeLinkNewTanResponseDataStatusDetailsReason = "user_request"` - `const BridgeLinkNewTanResponseDataStatusDetailsReasonOk BridgeLinkNewTanResponseDataStatusDetailsReason = "ok"` - `const BridgeLinkNewTanResponseDataStatusDetailsReasonOtherNetworkReturn BridgeLinkNewTanResponseDataStatusDetailsReason = "other_network_return"` - `const BridgeLinkNewTanResponseDataStatusDetailsReasonPayoutRefused BridgeLinkNewTanResponseDataStatusDetailsReason = "payout_refused"` - `const BridgeLinkNewTanResponseDataStatusDetailsReasonCancelRequest BridgeLinkNewTanResponseDataStatusDetailsReason = "cancel_request"` - `const BridgeLinkNewTanResponseDataStatusDetailsReasonFailedVerification BridgeLinkNewTanResponseDataStatusDetailsReason = "failed_verification"` - `const BridgeLinkNewTanResponseDataStatusDetailsReasonRequireReview BridgeLinkNewTanResponseDataStatusDetailsReason = "require_review"` - `const BridgeLinkNewTanResponseDataStatusDetailsReasonBlockedBySystem BridgeLinkNewTanResponseDataStatusDetailsReason = "blocked_by_system"` - `const BridgeLinkNewTanResponseDataStatusDetailsReasonWatchtowerReview BridgeLinkNewTanResponseDataStatusDetailsReason = "watchtower_review"` - `const BridgeLinkNewTanResponseDataStatusDetailsReasonValidating BridgeLinkNewTanResponseDataStatusDetailsReason = "validating"` - `const BridgeLinkNewTanResponseDataStatusDetailsReasonAutoHold BridgeLinkNewTanResponseDataStatusDetailsReason = "auto_hold"` - `Source string` - `const BridgeLinkNewTanResponseDataStatusDetailsSourceWatchtower BridgeLinkNewTanResponseDataStatusDetailsSource = "watchtower"` - `const BridgeLinkNewTanResponseDataStatusDetailsSourceBankDecline BridgeLinkNewTanResponseDataStatusDetailsSource = "bank_decline"` - `const BridgeLinkNewTanResponseDataStatusDetailsSourceCustomerDispute BridgeLinkNewTanResponseDataStatusDetailsSource = "customer_dispute"` - `const BridgeLinkNewTanResponseDataStatusDetailsSourceUserAction BridgeLinkNewTanResponseDataStatusDetailsSource = "user_action"` - `const BridgeLinkNewTanResponseDataStatusDetailsSourceSystem BridgeLinkNewTanResponseDataStatusDetailsSource = "system"` - `Code string` The status code if applicable. - `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 BridgeLinkNewTanResponseResponseType` 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 BridgeLinkNewTanResponseResponseTypeObject BridgeLinkNewTanResponseResponseType = "object"` - `const BridgeLinkNewTanResponseResponseTypeArray BridgeLinkNewTanResponseResponseType = "array"` - `const BridgeLinkNewTanResponseResponseTypeError BridgeLinkNewTanResponseResponseType = "error"` - `const BridgeLinkNewTanResponseResponseTypeNone BridgeLinkNewTanResponseResponseType = "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"), ) response, err := client.Bridge.Link.NewTan(context.TODO(), straddle.BridgeLinkNewTanParams{ AccountType: straddle.BridgeLinkNewTanParamsAccountTypeChecking, CustomerID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", RoutingNumber: "routing_number", Tan: "tan", }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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" } ```