Skip to content
Get started

Retrieve an unmasked paykey token

client.Paykeys.Reveal(ctx, id, query) (*PaykeyRevealResponse, error)
GET/v1/paykeys/{id}/reveal

Retrieves the details of a paykey that has previously been created. Supply the unique paykey ID that was returned from your previous request, and Straddle will return the corresponding paykey information including the unmasked token.

ParametersExpand Collapse
id string
query PaykeyRevealParams
CorrelationID param.Field[string]optional

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

RequestID param.Field[string]optional

Optional client generated identifier to trace and debug a request.

StraddleAccountID param.Field[string]optional

For use by platforms to specify an account id and set scope of a request.

formatuuid
ReturnsExpand Collapse
type PaykeyRevealResponse struct{…}
Data PaykeyRevealResponseData
ID string

Unique identifier for the paykey.

formatuuid
Config PaykeyRevealResponseDataConfig
ProcessingMethod stringoptional
One of the following:
const PaykeyRevealResponseDataConfigProcessingMethodInline PaykeyRevealResponseDataConfigProcessingMethod = "inline"
const PaykeyRevealResponseDataConfigProcessingMethodBackground PaykeyRevealResponseDataConfigProcessingMethod = "background"
const PaykeyRevealResponseDataConfigProcessingMethodSkip PaykeyRevealResponseDataConfigProcessingMethod = "skip"
SandboxOutcome stringoptional
One of the following:
const PaykeyRevealResponseDataConfigSandboxOutcomeStandard PaykeyRevealResponseDataConfigSandboxOutcome = "standard"
const PaykeyRevealResponseDataConfigSandboxOutcomeActive PaykeyRevealResponseDataConfigSandboxOutcome = "active"
const PaykeyRevealResponseDataConfigSandboxOutcomeRejected PaykeyRevealResponseDataConfigSandboxOutcome = "rejected"
const PaykeyRevealResponseDataConfigSandboxOutcomeReview PaykeyRevealResponseDataConfigSandboxOutcome = "review"
CreatedAt Time

Timestamp of when the paykey was created.

formatdate-time
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
One of the following:
const PaykeyRevealResponseDataSourceBankAccount PaykeyRevealResponseDataSource = "bank_account"
const PaykeyRevealResponseDataSourceStraddle PaykeyRevealResponseDataSource = "straddle"
const PaykeyRevealResponseDataSourceMx PaykeyRevealResponseDataSource = "mx"
const PaykeyRevealResponseDataSourcePlaid PaykeyRevealResponseDataSource = "plaid"
const PaykeyRevealResponseDataSourceTan PaykeyRevealResponseDataSource = "tan"
const PaykeyRevealResponseDataSourceQuiltt PaykeyRevealResponseDataSource = "quiltt"
Status string
One of the following:
const PaykeyRevealResponseDataStatusPending PaykeyRevealResponseDataStatus = "pending"
const PaykeyRevealResponseDataStatusActive PaykeyRevealResponseDataStatus = "active"
const PaykeyRevealResponseDataStatusInactive PaykeyRevealResponseDataStatus = "inactive"
const PaykeyRevealResponseDataStatusRejected PaykeyRevealResponseDataStatus = "rejected"
const PaykeyRevealResponseDataStatusReview PaykeyRevealResponseDataStatus = "review"
const PaykeyRevealResponseDataStatusBlocked PaykeyRevealResponseDataStatus = "blocked"
UpdatedAt Time

Timestamp of the most recent update to the paykey.

formatdate-time
Balance PaykeyRevealResponseDataBalanceoptional
Status string
One of the following:
const PaykeyRevealResponseDataBalanceStatusPending PaykeyRevealResponseDataBalanceStatus = "pending"
const PaykeyRevealResponseDataBalanceStatusCompleted PaykeyRevealResponseDataBalanceStatus = "completed"
const PaykeyRevealResponseDataBalanceStatusFailed PaykeyRevealResponseDataBalanceStatus = "failed"
AccountBalance int64optional

Account Balance when last retrieved

formatint32
UpdatedAt Timeoptional

Last time account balance was updated.

formatdate-time
BankData PaykeyRevealResponseDataBankDataoptional
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
One of the following:
const PaykeyRevealResponseDataBankDataAccountTypeChecking PaykeyRevealResponseDataBankDataAccountType = "checking"
const PaykeyRevealResponseDataBankDataAccountTypeSavings PaykeyRevealResponseDataBankDataAccountType = "savings"
RoutingNumber string

The routing number of the bank account.

minLength9
maxLength9
CustomerID stringoptional

Unique identifier of the related customer object.

formatuuid
ExpiresAt Timeoptional

Expiration date and time of the paykey, if applicable.

formatdate-time
ExternalID stringoptional

Unique identifier for the paykey in your database, used for cross-referencing between Straddle and your systems.

InstitutionName stringoptional

Name of the financial institution.

Metadata map[string, string]optional

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

StatusDetails PaykeyRevealResponseDataStatusDetailsoptional
ChangedAt Time

The time the status change occurred.

formatdate-time
Message string

A human-readable description of the current status.

Reason string
One of the following:
const PaykeyRevealResponseDataStatusDetailsReasonInsufficientFunds PaykeyRevealResponseDataStatusDetailsReason = "insufficient_funds"
const PaykeyRevealResponseDataStatusDetailsReasonClosedBankAccount PaykeyRevealResponseDataStatusDetailsReason = "closed_bank_account"
const PaykeyRevealResponseDataStatusDetailsReasonInvalidBankAccount PaykeyRevealResponseDataStatusDetailsReason = "invalid_bank_account"
const PaykeyRevealResponseDataStatusDetailsReasonInvalidRouting PaykeyRevealResponseDataStatusDetailsReason = "invalid_routing"
const PaykeyRevealResponseDataStatusDetailsReasonDisputed PaykeyRevealResponseDataStatusDetailsReason = "disputed"
const PaykeyRevealResponseDataStatusDetailsReasonPaymentStopped PaykeyRevealResponseDataStatusDetailsReason = "payment_stopped"
const PaykeyRevealResponseDataStatusDetailsReasonOwnerDeceased PaykeyRevealResponseDataStatusDetailsReason = "owner_deceased"
const PaykeyRevealResponseDataStatusDetailsReasonFrozenBankAccount PaykeyRevealResponseDataStatusDetailsReason = "frozen_bank_account"
const PaykeyRevealResponseDataStatusDetailsReasonRiskReview PaykeyRevealResponseDataStatusDetailsReason = "risk_review"
const PaykeyRevealResponseDataStatusDetailsReasonFraudulent PaykeyRevealResponseDataStatusDetailsReason = "fraudulent"
const PaykeyRevealResponseDataStatusDetailsReasonDuplicateEntry PaykeyRevealResponseDataStatusDetailsReason = "duplicate_entry"
const PaykeyRevealResponseDataStatusDetailsReasonInvalidPaykey PaykeyRevealResponseDataStatusDetailsReason = "invalid_paykey"
const PaykeyRevealResponseDataStatusDetailsReasonPaymentBlocked PaykeyRevealResponseDataStatusDetailsReason = "payment_blocked"
const PaykeyRevealResponseDataStatusDetailsReasonAmountTooLarge PaykeyRevealResponseDataStatusDetailsReason = "amount_too_large"
const PaykeyRevealResponseDataStatusDetailsReasonTooManyAttempts PaykeyRevealResponseDataStatusDetailsReason = "too_many_attempts"
const PaykeyRevealResponseDataStatusDetailsReasonInternalSystemError PaykeyRevealResponseDataStatusDetailsReason = "internal_system_error"
const PaykeyRevealResponseDataStatusDetailsReasonUserRequest PaykeyRevealResponseDataStatusDetailsReason = "user_request"
const PaykeyRevealResponseDataStatusDetailsReasonOk PaykeyRevealResponseDataStatusDetailsReason = "ok"
const PaykeyRevealResponseDataStatusDetailsReasonOtherNetworkReturn PaykeyRevealResponseDataStatusDetailsReason = "other_network_return"
const PaykeyRevealResponseDataStatusDetailsReasonPayoutRefused PaykeyRevealResponseDataStatusDetailsReason = "payout_refused"
const PaykeyRevealResponseDataStatusDetailsReasonCancelRequest PaykeyRevealResponseDataStatusDetailsReason = "cancel_request"
const PaykeyRevealResponseDataStatusDetailsReasonFailedVerification PaykeyRevealResponseDataStatusDetailsReason = "failed_verification"
const PaykeyRevealResponseDataStatusDetailsReasonRequireReview PaykeyRevealResponseDataStatusDetailsReason = "require_review"
const PaykeyRevealResponseDataStatusDetailsReasonBlockedBySystem PaykeyRevealResponseDataStatusDetailsReason = "blocked_by_system"
const PaykeyRevealResponseDataStatusDetailsReasonWatchtowerReview PaykeyRevealResponseDataStatusDetailsReason = "watchtower_review"
const PaykeyRevealResponseDataStatusDetailsReasonValidating PaykeyRevealResponseDataStatusDetailsReason = "validating"
const PaykeyRevealResponseDataStatusDetailsReasonAutoHold PaykeyRevealResponseDataStatusDetailsReason = "auto_hold"
Source string
One of the following:
const PaykeyRevealResponseDataStatusDetailsSourceWatchtower PaykeyRevealResponseDataStatusDetailsSource = "watchtower"
const PaykeyRevealResponseDataStatusDetailsSourceBankDecline PaykeyRevealResponseDataStatusDetailsSource = "bank_decline"
const PaykeyRevealResponseDataStatusDetailsSourceCustomerDispute PaykeyRevealResponseDataStatusDetailsSource = "customer_dispute"
const PaykeyRevealResponseDataStatusDetailsSourceUserAction PaykeyRevealResponseDataStatusDetailsSource = "user_action"
const PaykeyRevealResponseDataStatusDetailsSourceSystem PaykeyRevealResponseDataStatusDetailsSource = "system"
Code stringoptional

The status code if applicable.

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 PaykeyRevealResponseResponseType

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 PaykeyRevealResponseResponseTypeObject PaykeyRevealResponseResponseType = "object"
const PaykeyRevealResponseResponseTypeArray PaykeyRevealResponseResponseType = "array"
const PaykeyRevealResponseResponseTypeError PaykeyRevealResponseResponseType = "error"
const PaykeyRevealResponseResponseTypeNone PaykeyRevealResponseResponseType = "none"

Retrieve an unmasked paykey token

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.Paykeys.Reveal(
    context.TODO(),
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    straddle.PaykeyRevealParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Data)
}
{
  "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"
}
Returns Examples
{
  "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"
}