## Create a paykey from a Quiltt token `client.Bridge.Link.NewPaykey(ctx, params) (*BridgeLinkNewPaykeyResponse, error)` **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 BridgeLinkNewPaykeyParams` - `CustomerID param.Field[string]` Body param: Unique identifier of the related customer object. - `QuilttToken param.Field[string]` Body param: Quiltt processor token generated by your application for use with the Straddle API. - `Config param.Field[BridgeLinkNewPaykeyParamsConfig]` Body param - `ProcessingMethod string` - `const BridgeLinkNewPaykeyParamsConfigProcessingMethodInline BridgeLinkNewPaykeyParamsConfigProcessingMethod = "inline"` - `const BridgeLinkNewPaykeyParamsConfigProcessingMethodBackground BridgeLinkNewPaykeyParamsConfigProcessingMethod = "background"` - `const BridgeLinkNewPaykeyParamsConfigProcessingMethodSkip BridgeLinkNewPaykeyParamsConfigProcessingMethod = "skip"` - `SandboxOutcome string` - `const BridgeLinkNewPaykeyParamsConfigSandboxOutcomeStandard BridgeLinkNewPaykeyParamsConfigSandboxOutcome = "standard"` - `const BridgeLinkNewPaykeyParamsConfigSandboxOutcomeActive BridgeLinkNewPaykeyParamsConfigSandboxOutcome = "active"` - `const BridgeLinkNewPaykeyParamsConfigSandboxOutcomeRejected BridgeLinkNewPaykeyParamsConfigSandboxOutcome = "rejected"` - `const BridgeLinkNewPaykeyParamsConfigSandboxOutcomeReview BridgeLinkNewPaykeyParamsConfigSandboxOutcome = "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 BridgeLinkNewPaykeyResponse struct{…}` - `Data BridgeLinkNewPaykeyResponseData` - `ID string` Unique identifier for the paykey. - `Config BridgeLinkNewPaykeyResponseDataConfig` - `ProcessingMethod string` - `const BridgeLinkNewPaykeyResponseDataConfigProcessingMethodInline BridgeLinkNewPaykeyResponseDataConfigProcessingMethod = "inline"` - `const BridgeLinkNewPaykeyResponseDataConfigProcessingMethodBackground BridgeLinkNewPaykeyResponseDataConfigProcessingMethod = "background"` - `const BridgeLinkNewPaykeyResponseDataConfigProcessingMethodSkip BridgeLinkNewPaykeyResponseDataConfigProcessingMethod = "skip"` - `SandboxOutcome string` - `const BridgeLinkNewPaykeyResponseDataConfigSandboxOutcomeStandard BridgeLinkNewPaykeyResponseDataConfigSandboxOutcome = "standard"` - `const BridgeLinkNewPaykeyResponseDataConfigSandboxOutcomeActive BridgeLinkNewPaykeyResponseDataConfigSandboxOutcome = "active"` - `const BridgeLinkNewPaykeyResponseDataConfigSandboxOutcomeRejected BridgeLinkNewPaykeyResponseDataConfigSandboxOutcome = "rejected"` - `const BridgeLinkNewPaykeyResponseDataConfigSandboxOutcomeReview BridgeLinkNewPaykeyResponseDataConfigSandboxOutcome = "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 BridgeLinkNewPaykeyResponseDataSourceBankAccount BridgeLinkNewPaykeyResponseDataSource = "bank_account"` - `const BridgeLinkNewPaykeyResponseDataSourceStraddle BridgeLinkNewPaykeyResponseDataSource = "straddle"` - `const BridgeLinkNewPaykeyResponseDataSourceMx BridgeLinkNewPaykeyResponseDataSource = "mx"` - `const BridgeLinkNewPaykeyResponseDataSourcePlaid BridgeLinkNewPaykeyResponseDataSource = "plaid"` - `const BridgeLinkNewPaykeyResponseDataSourceTan BridgeLinkNewPaykeyResponseDataSource = "tan"` - `const BridgeLinkNewPaykeyResponseDataSourceQuiltt BridgeLinkNewPaykeyResponseDataSource = "quiltt"` - `Status string` - `const BridgeLinkNewPaykeyResponseDataStatusPending BridgeLinkNewPaykeyResponseDataStatus = "pending"` - `const BridgeLinkNewPaykeyResponseDataStatusActive BridgeLinkNewPaykeyResponseDataStatus = "active"` - `const BridgeLinkNewPaykeyResponseDataStatusInactive BridgeLinkNewPaykeyResponseDataStatus = "inactive"` - `const BridgeLinkNewPaykeyResponseDataStatusRejected BridgeLinkNewPaykeyResponseDataStatus = "rejected"` - `const BridgeLinkNewPaykeyResponseDataStatusReview BridgeLinkNewPaykeyResponseDataStatus = "review"` - `const BridgeLinkNewPaykeyResponseDataStatusBlocked BridgeLinkNewPaykeyResponseDataStatus = "blocked"` - `UpdatedAt Time` Timestamp of the most recent update to the paykey. - `Balance BridgeLinkNewPaykeyResponseDataBalance` - `Status string` - `const BridgeLinkNewPaykeyResponseDataBalanceStatusPending BridgeLinkNewPaykeyResponseDataBalanceStatus = "pending"` - `const BridgeLinkNewPaykeyResponseDataBalanceStatusCompleted BridgeLinkNewPaykeyResponseDataBalanceStatus = "completed"` - `const BridgeLinkNewPaykeyResponseDataBalanceStatusFailed BridgeLinkNewPaykeyResponseDataBalanceStatus = "failed"` - `AccountBalance int64` Account Balance when last retrieved - `UpdatedAt Time` Last time account balance was updated. - `BankData BridgeLinkNewPaykeyResponseDataBankData` - `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 BridgeLinkNewPaykeyResponseDataBankDataAccountTypeChecking BridgeLinkNewPaykeyResponseDataBankDataAccountType = "checking"` - `const BridgeLinkNewPaykeyResponseDataBankDataAccountTypeSavings BridgeLinkNewPaykeyResponseDataBankDataAccountType = "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 BridgeLinkNewPaykeyResponseDataStatusDetails` - `ChangedAt Time` The time the status change occurred. - `Message string` A human-readable description of the current status. - `Reason string` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsReasonInsufficientFunds BridgeLinkNewPaykeyResponseDataStatusDetailsReason = "insufficient_funds"` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsReasonClosedBankAccount BridgeLinkNewPaykeyResponseDataStatusDetailsReason = "closed_bank_account"` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsReasonInvalidBankAccount BridgeLinkNewPaykeyResponseDataStatusDetailsReason = "invalid_bank_account"` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsReasonInvalidRouting BridgeLinkNewPaykeyResponseDataStatusDetailsReason = "invalid_routing"` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsReasonDisputed BridgeLinkNewPaykeyResponseDataStatusDetailsReason = "disputed"` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsReasonPaymentStopped BridgeLinkNewPaykeyResponseDataStatusDetailsReason = "payment_stopped"` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsReasonOwnerDeceased BridgeLinkNewPaykeyResponseDataStatusDetailsReason = "owner_deceased"` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsReasonFrozenBankAccount BridgeLinkNewPaykeyResponseDataStatusDetailsReason = "frozen_bank_account"` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsReasonRiskReview BridgeLinkNewPaykeyResponseDataStatusDetailsReason = "risk_review"` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsReasonFraudulent BridgeLinkNewPaykeyResponseDataStatusDetailsReason = "fraudulent"` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsReasonDuplicateEntry BridgeLinkNewPaykeyResponseDataStatusDetailsReason = "duplicate_entry"` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsReasonInvalidPaykey BridgeLinkNewPaykeyResponseDataStatusDetailsReason = "invalid_paykey"` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsReasonPaymentBlocked BridgeLinkNewPaykeyResponseDataStatusDetailsReason = "payment_blocked"` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsReasonAmountTooLarge BridgeLinkNewPaykeyResponseDataStatusDetailsReason = "amount_too_large"` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsReasonTooManyAttempts BridgeLinkNewPaykeyResponseDataStatusDetailsReason = "too_many_attempts"` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsReasonInternalSystemError BridgeLinkNewPaykeyResponseDataStatusDetailsReason = "internal_system_error"` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsReasonUserRequest BridgeLinkNewPaykeyResponseDataStatusDetailsReason = "user_request"` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsReasonOk BridgeLinkNewPaykeyResponseDataStatusDetailsReason = "ok"` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsReasonOtherNetworkReturn BridgeLinkNewPaykeyResponseDataStatusDetailsReason = "other_network_return"` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsReasonPayoutRefused BridgeLinkNewPaykeyResponseDataStatusDetailsReason = "payout_refused"` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsReasonCancelRequest BridgeLinkNewPaykeyResponseDataStatusDetailsReason = "cancel_request"` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsReasonFailedVerification BridgeLinkNewPaykeyResponseDataStatusDetailsReason = "failed_verification"` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsReasonRequireReview BridgeLinkNewPaykeyResponseDataStatusDetailsReason = "require_review"` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsReasonBlockedBySystem BridgeLinkNewPaykeyResponseDataStatusDetailsReason = "blocked_by_system"` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsReasonWatchtowerReview BridgeLinkNewPaykeyResponseDataStatusDetailsReason = "watchtower_review"` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsReasonValidating BridgeLinkNewPaykeyResponseDataStatusDetailsReason = "validating"` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsReasonAutoHold BridgeLinkNewPaykeyResponseDataStatusDetailsReason = "auto_hold"` - `Source string` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsSourceWatchtower BridgeLinkNewPaykeyResponseDataStatusDetailsSource = "watchtower"` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsSourceBankDecline BridgeLinkNewPaykeyResponseDataStatusDetailsSource = "bank_decline"` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsSourceCustomerDispute BridgeLinkNewPaykeyResponseDataStatusDetailsSource = "customer_dispute"` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsSourceUserAction BridgeLinkNewPaykeyResponseDataStatusDetailsSource = "user_action"` - `const BridgeLinkNewPaykeyResponseDataStatusDetailsSourceSystem BridgeLinkNewPaykeyResponseDataStatusDetailsSource = "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 BridgeLinkNewPaykeyResponseResponseType` 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 BridgeLinkNewPaykeyResponseResponseTypeObject BridgeLinkNewPaykeyResponseResponseType = "object"` - `const BridgeLinkNewPaykeyResponseResponseTypeArray BridgeLinkNewPaykeyResponseResponseType = "array"` - `const BridgeLinkNewPaykeyResponseResponseTypeError BridgeLinkNewPaykeyResponseResponseType = "error"` - `const BridgeLinkNewPaykeyResponseResponseTypeNone BridgeLinkNewPaykeyResponseResponseType = "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.NewPaykey(context.TODO(), straddle.BridgeLinkNewPaykeyParams{ CustomerID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", QuilttToken: "quiltt_token", }) 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" } ```