> ## Documentation Index
> Fetch the complete documentation index at: https://docs.y.uno/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Test in the sandbox first: base URL https://api-sandbox.y.uno (Test Mode in the Dashboard). Production is https://api.y.uno (Live Mode).
> Every API request needs the public-api-key and private-secret-key headers. Get them in the Dashboard at https://dashboard.y.uno/developers (Developers > Credentials); sandbox and production keys are different.
> Send an X-Idempotency-Key (a UUID) when creating payments, refunds and cancels, so retries do not create duplicates.
> Start with the Quickstart (https://docs.y.uno/docs/quickstart.md) and the agent guide (https://docs.y.uno/agents.md). To search these docs from a coding agent, connect the docs MCP server at https://docs.y.uno/mcp.

# 按 ID 检索已注册支付方式的 PCI 数据

> 检索包含完整卡号的已注册支付方式，仅限 PCI 商户

检索用户已注册的特定支付方式，响应中包含完整卡号。

> [!NOTE]
>
> **检索已注册的支付方式**
>
> 要检索已注册支付方式的信息，您需要提供 `payment_method_id`，即使用[注册支付方式](https://docs.y.uno/zh-hans/reference/payment-methods-direct-workflow/enroll-payment-method-api.md) endpoint 时收到的 `vaulted_token`。

> [!WARNING]
>
> **仅限 PCI 商户**
>
> 此 endpoint 仅适用于通过 PCI 认证的商户。如需启用，请联系您的大客户经理（KAM）。


## OpenAPI

````yaml openapi/zh-hans/payment-methods-direct-workflow/retrieve-enrolled-payment-method-by-id-pci-api.json GET /customers/{customer_id}/payment-methods/{payment_method_id}
openapi: 3.1.0
info:
  title: customer-api
  version: 1.0.2
servers:
  - url: https://api-sandbox.y.uno/v1
    description: Sandbox
  - url: https://api.y.uno/v1
    description: Production (US)
security:
  - sec0: []
    sec1: []
paths:
  /customers/{customer_id}/payment-methods/{payment_method_id}:
    get:
      summary: 按 Id 检索已注册的支付方式 PCI 数据
      operationId: retrieve-enrolled-payment-method-by-id-pci-api
      parameters:
        - name: customer_id
          in: path
          description: >-
            客户的唯一标识符，通过 [Create
            Customer](https://docs.y.uno/zh-hans/reference/customers/create-customer)
            endpoint 创建（UUID，36 个字符）。
          schema:
            type: string
          required: true
        - name: payment_method_id
          in: path
          description: >-
            `payment_method`
            的唯一标识符。该信息是使用[注册支付方式](/zh-hans/reference/payment-methods-direct-workflow/enroll-payment-method-api)注册支付方式时作为
            `vaulted_token` 收到的（UUID，36 个字符）。
          schema:
            type: string
          required: true
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value:
                    idempotency_key: 2ca58c6d-8794-4c8f-a2f6-bba4b7498b74
                    id: 2fd6bf11-2129-4061-9c2a-34e196f89753
                    account_id: 493e9374-510a-4201-9e09-de669d75f256
                    name: VISA ****1111
                    description: VISA ****1111
                    type: CARD
                    category: CARD
                    country: US
                    status: ENROLLED
                    sub_status: null
                    vaulted_token: 7ced7717-f860-4705-a376-58a714953de9
                    action: FORM
                    redirect_url: null
                    created_at: '2024-06-04T12:47:46.992602Z'
                    updated_at: '2024-06-04T12:47:46.992603Z'
                    enrollment:
                      session: ''
                      sdk_required_action: false
                    provider:
                      id: YUNO
                      type: YUNO
                      token: e47299a5-269e-42a1-9be1-9f64e400413a
                      provider_status: null
                    customer_payer:
                      first_name: John
                      last_name: Doe
                      email: john.doe@example.com
                      gender: M
                      date_of_birth: '1990-02-28'
                      document:
                        document_number: '123456789'
                        document_type: SSN
                      phone:
                        number: '5551234567'
                        country_code: '1'
                      billing_address:
                        address_line_1: 123 Main St
                        address_line_2: Apt 4B
                        country: US
                        state: NY
                        city: New York
                        zip_code: '10001'
                    card_data:
                      number: '4111111111111111'
                      iin: '41111111'
                      lfd: '1111'
                      expiration_month: 3
                      expiration_year: 26
                      number_length: 16
                      security_code_length: 3
                      brand: VISA
                      issuer: JPMORGAN CHASE BANK N A
                      issuer_code: null
                      country_code: US
                      category: CREDIT
                      type: CREDIT
                      fingerprint: 55a7fe38-cdc3-45dc-8c5f-820751799c76
                      network_token:
                        network: VISA
                        number: '4895370000004321'
                        status: ACTIVE
                        par: V0010013022182956191212272716
                        network_token_id: DM4MMC1GB000000011cdd1c11c874e27
                        token_data:
                          iin: '489537'
                          lfd: '4321'
                          expiration_month: 9
                          expiration_year: 2030
                        response:
                          code: '00'
                          message: Approved
                    last_successfully_used: null
                    last_successfully_used_at: null
                    verify:
                      vault_on_success: false
                      payment: null
                    preferred: null
                    parent_type: null
                    callback_url: null
              schema:
                type: object
                properties:
                  idempotency_key:
                    type: string
                    example: 2ca58c6d-8794-4c8f-a2f6-bba4b7498b74
                  id:
                    type: string
                    example: 2fd6bf11-2129-4061-9c2a-34e196f89753
                  account_id:
                    type: string
                    example: 493e9374-510a-4201-9e09-de669d75f256
                  name:
                    type: string
                    example: VISA ****1111
                  description:
                    type: string
                    example: VISA ****1111
                  type:
                    type: string
                    example: CARD
                  category:
                    type: string
                    example: CARD
                  country:
                    type: string
                    example: US
                  status:
                    type: string
                    example: ENROLLED
                  sub_status:
                    type: string
                    nullable: true
                    description: 附加状态详情。
                    example: null
                  vaulted_token:
                    type: string
                    example: 7ced7717-f860-4705-a376-58a714953de9
                  action:
                    type: string
                    example: FORM
                  redirect_url:
                    type: string
                    nullable: true
                    description: 重定向工作流中用于将客户重定向到的 URL。
                    example: null
                  created_at:
                    type: string
                    example: '2024-06-04T12:47:46.992602Z'
                  updated_at:
                    type: string
                    example: '2024-06-04T12:47:46.992603Z'
                  enrollment:
                    type: object
                    properties:
                      session:
                        type: string
                        example: ''
                      sdk_required_action:
                        type: boolean
                        example: false
                        default: true
                  provider:
                    type: object
                    properties:
                      id:
                        type: string
                        example: YUNO
                      type:
                        type: string
                        example: YUNO
                      token:
                        type: string
                        example: e47299a5-269e-42a1-9be1-9f64e400413a
                      provider_status:
                        type: string
                        nullable: true
                        description: 服务提供商返回的状态。
                        example: null
                  customer_payer:
                    type: object
                    properties:
                      first_name:
                        type: string
                        example: John
                      last_name:
                        type: string
                        example: Doe
                      email:
                        type: string
                        example: john.doe@example.com
                      gender:
                        type: string
                        example: M
                      date_of_birth:
                        type: string
                        example: '1990-02-28'
                      document:
                        type: object
                        properties:
                          document_number:
                            type: string
                            example: '123456789'
                          document_type:
                            type: string
                            example: SSN
                      phone:
                        type: object
                        properties:
                          number:
                            type: string
                            example: '5551234567'
                          country_code:
                            type: string
                            example: '1'
                      billing_address:
                        type: object
                        properties:
                          address_line_1:
                            type: string
                            example: 123 Main St
                          address_line_2:
                            type: string
                            example: Apt 4B
                          country:
                            type: string
                            example: US
                          state:
                            type: string
                            example: NY
                          city:
                            type: string
                            example: New York
                          zip_code:
                            type: string
                            example: '10001'
                  card_data:
                    type: object
                    properties:
                      number:
                        type: string
                        description: 完整卡号。仅对通过 PCI 认证的商户返回。
                        example: '4111111111111111'
                      iin:
                        type: string
                        example: '41111111'
                      lfd:
                        type: string
                        example: '1111'
                      expiration_month:
                        type: integer
                        example: 3
                        default: 0
                      expiration_year:
                        type: integer
                        example: 26
                        default: 0
                      number_length:
                        type: integer
                        example: 16
                        default: 0
                      security_code_length:
                        type: integer
                        example: 3
                        default: 0
                      security_code_expires_in:
                        type: integer
                        example: 842
                        description: >-
                          已存储的安全码对 PCI 转发代理仍可用的剩余秒数。该时间窗口关闭后返回
                          -1；如果卡不带安全码，则完全省略该字段。仅对启用了 PCI 转发代理的组织返回。
                      brand:
                        type: string
                        example: VISA
                      issuer:
                        type: string
                        example: JPMORGAN CHASE BANK N A
                      issuer_code:
                        type: string
                        nullable: true
                        description: 发卡银行的代码。
                        example: null
                      country_code:
                        type: string
                        nullable: true
                        description: >-
                          卡发卡国家/地区的 ISO 3166-1 alpha-2 国家/地区代码，在卡存入保险库（vault）时通过
                          BIN 查询得出。当没有 BIN 补充数据时为 Null。
                        example: US
                      category:
                        type: string
                        example: CREDIT
                      type:
                        type: string
                        example: CREDIT
                      fingerprint:
                        type: string
                        example: 55a7fe38-cdc3-45dc-8c5f-820751799c76
                      network_token:
                        type: object
                        description: 该卡的网络令牌详细信息。仅当已为该卡配置网络令牌时返回。
                        properties:
                          network:
                            type: string
                            description: 配置该令牌的卡组织。
                            example: VISA
                          number:
                            type: string
                            description: DPAN：由卡组织配置的完整网络令牌号码，从 vault 中读取。仅对通过 PCI 认证的商户返回。
                            example: '4895370000004321'
                          status:
                            type: string
                            description: 网络令牌的状态。
                            example: ACTIVE
                          par:
                            type: string
                            description: 与底层卡关联的支付账户参考（PAR）。
                            example: V0010013022182956191212272716
                          network_token_id:
                            type: string
                            description: 卡组织分配的令牌参考。
                            example: DM4MMC1GB000000011cdd1c11c874e27
                          token_data:
                            type: object
                            properties:
                              iin:
                                type: string
                                example: '489537'
                              lfd:
                                type: string
                                example: '4321'
                              expiration_month:
                                type: integer
                                example: 9
                              expiration_year:
                                type: integer
                                example: 2030
                          response:
                            type: object
                            properties:
                              code:
                                type: string
                                example: '00'
                              message:
                                type: string
                                example: Approved
                  last_successfully_used:
                    type: boolean
                    nullable: true
                    description: 该支付方式是否至少成功使用过一次。
                    example: null
                  last_successfully_used_at:
                    type: string
                    nullable: true
                    description: 最近一次成功使用的时间戳（ISO 8601）。
                    example: null
                  verify:
                    type: object
                    properties:
                      vault_on_success:
                        type: boolean
                        example: false
                        default: true
                      currency:
                        type: string
                        description: 卡验证的货币，与注册支付方式时发送的一致（ISO 4217）。
                      external_subscription:
                        type: object
                        description: >-
                          该支付方式在注册时关联的外部订阅。仅当注册创建时 `verify.vault_on_success` 设置为
                          `true` 且携带了 `external_subscription`
                          对象时返回。没有关联时该键会被省略，因此缺少 `external_subscription`
                          并不能证明该注册没有关联：当无法检索验证支付时，该字段同样会被省略。请检索验证支付以确认。
                        properties:
                          id:
                            type: string
                            description: 您系统中该订阅的标识符。
                          customer_id:
                            type: string
                            description: 您系统中该订阅的客户的标识符。
                      payment:
                        type: object
                        nullable: true
                        description: 与验证关联的支付详情（如适用）。
                        example: null
                  preferred:
                    type: boolean
                    nullable: true
                    description: 是否为客户的首选支付方式。
                    example: null
                  provider_data:
                    type: object
                    description: 来自服务提供商的附加数据
                    properties:
                      raw_request:
                        type: object
                        description: Yuno 发送给服务提供商的请求的混淆副本。仅对列入允许名单的组织返回。
                      raw_response:
                        type: object
                  parent_type:
                    nullable: true
                    description: 父类型。
                  callback_url:
                    nullable: true
                    description: Callback URL。
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Bad Request:
                  value:
                    code: INVALID_REQUEST
                    messages:
                      - Invalid request
                Customer Not Found:
                  value:
                    code: CUSTOMER_NOT_FOUND
                    messages:
                      - Customer not found
                  summary: Customer Not Found
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: INVALID_REQUEST
                  messages:
                    type: array
                    items:
                      type: string
                      example: Invalid request
        '401':
          description: '401'
          content:
            application/json:
              examples:
                Unauthorized:
                  value:
                    code: INVALID_CREDENTIALS
                    messages:
                      - Invalid credentials
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: INVALID_CREDENTIALS
                  messages:
                    type: array
                    items:
                      type: string
                      example: Invalid credentials
        '403':
          description: '403'
          content:
            application/json:
              examples:
                Forbidden:
                  value:
                    code: AUTHORIZATION_REQUIRED
                    messages:
                      - The merchant has no authorization to use this API.
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: AUTHORIZATION_REQUIRED
                  messages:
                    type: array
                    items:
                      type: string
                      example: The merchant has no authorization to use this API.
        '404':
          description: '404'
          content:
            application/json:
              examples:
                Not Found:
                  value:
                    code: PAYMENT_METHOD_NOT_FOUND
                    messages:
                      - Payment method not found
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: PAYMENT_METHOD_NOT_FOUND
                  messages:
                    type: array
                    items:
                      type: string
                      example: Payment method not found
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: public-api-key
      x-default: <Your public-api-key>
    sec1:
      type: apiKey
      in: header
      name: private-secret-key
      x-default: <Your private-secret-key>

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.