## Lookup a paykey `paykeys.get(id, **kwargs) -> PaykeyV1` **get** `/v1/paykeys/{id}` Retrieves the details of an existing paykey. Supply the unique paykey `id` and Straddle will return the corresponding paykey record , including the `paykey` token value and masked bank account details. ### Parameters - `id: String` - `correlation_id: String` - `request_id: String` - `straddle_account_id: String` ### Returns - `class PaykeyV1` - `data: { id, config, created_at, 14 more}` - `id: String` Unique identifier for the paykey. - `config: { processing_method, sandbox_outcome}` - `processing_method: :inline | :background | :skip` - `:inline` - `:background` - `:skip` - `sandbox_outcome: :standard | :active | :rejected | :review` - `:standard` - `:active` - `:rejected` - `:review` - `created_at: Time` 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: Time` Timestamp of the most recent update to the paykey. - `balance: { status, account_balance, updated_at}` - `status: :pending | :completed | :failed` - `:pending` - `:completed` - `:failed` - `account_balance: Integer` Account Balance when last retrieved - `updated_at: Time` Last time account balance was updated. - `bank_data: { account_number, account_type, routing_number}` - `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` Unique identifier of the related customer object. - `expires_at: Time` Expiration date and time of the paykey, if applicable. - `external_id: String` Unique identifier for the paykey in your database, used for cross-referencing between Straddle and your systems. - `institution_name: String` Name of the financial institution. - `metadata: Hash[Symbol, String]` Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the paykey in a structured format. - `status_details: { changed_at, message, reason, 2 more}` - `changed_at: Time` 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` The status code if applicable. - `unblock_eligible: bool` 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: 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" ) paykey_v1 = straddle.paykeys.get("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") puts(paykey_v1) ``` #### 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" } ```