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

# Google Wallet 身份证件验证 API

> 借助 Didit，将 Google Wallet ID 身份验证集成到您的应用中。查看国家/地区覆盖范围、认证步骤、结果与定价。

请从您的后端使用应用 API 密钥发起 Google Wallet ID 验证。
您无需工作流或 `workflow_id`。
发起响应描述的是下一步认证操作，并不表示身份已通过验证。

## 覆盖范围与激活

| 属性 | 值 |
| - | - |
| 钱包 | Google Wallet ID |
| 钱包 ID | `google_wallet` |
| 国家/地区 | ![](https://didit-public-assets.s3.eu-west-1.amazonaws.com/flags/us.svg)美国、![](https://didit-public-assets.s3.eu-west-1.amazonaws.com/flags/gb.svg)英国、![](https://didit-public-assets.s3.eu-west-1.amazonaws.com/flags/br.svg)巴西、![](https://didit-public-assets.s3.eu-west-1.amazonaws.com/flags/sg.svg)新加坡、![](https://didit-public-assets.s3.eu-west-1.amazonaws.com/flags/tw.svg)台湾 |
| 生产环境钱包激活 | ✅ 可用 |
| 公布的钱包价格 | 每次完成验证收费 \$0.20 |

钱包激活与 API 部署及您的应用资格相互独立。
即使文档中列出了某个 endpoint，标记为“即将推出”的钱包也不会被激活。
如需了解当前公布的费率，请参阅[数字 ID 钱包定价](https://docs.didit.me/zh/getting-started/pricing.md#数字身份钱包定价)。

## 用户需要做什么

您的页面或应用直接向 Google Wallet 发起请求：没有重定向，也没有 Didit 托管页面。
在用户操作（用户手势）触发时，将 `next_action.digital_credentials.request` 传给 `navigator.credentials.get({digital: request})`，并且在您发起时所用的 `origin` 上执行；或将其作为 `GetDigitalCredentialOption` 传给 Android Credential Manager。
然后将钱包返回的内容发送至[提交钱包响应](https://docs.didit.me/zh/standalone-apis/digital-id-wallet-response.md)。
当钱包位于其他设备上时，浏览器会提供其自身的二维码。

## 接收结果

请按照[数字 ID 钱包 API 指南](https://docs.didit.me/zh/standalone-apis/digital-id-wallets.md)跟踪验证进度并获取结果。
只有已完成且已验证的结果，才能作为钱包已验证该人员身份的证明。
不同钱包返回的身份属性各不相同；请勿假设地址、肖像或所有请求的属性都会返回。

## 相关内容

* [数字 ID 钱包 API](https://docs.didit.me/zh/standalone-apis/digital-id-wallets.md)
* [钱包覆盖范围与属性](https://docs.didit.me/zh/core-technology/id-verification/digital-id-wallets.md)
* [定价](https://docs.didit.me/zh/getting-started/pricing.md#数字身份钱包定价)


## OpenAPI

````yaml zh/openapi-25.json POST /v3/id-verification/wallets/google-wallet/
openapi: 3.0.0
info:
  version: 3.0.0
  title: Didit Verification API
  description: 身份证件验证 API。使用 x-api-key 请求头进行身份验证。
servers:
  - url: https://verification.didit.me
security: []
tags: []
paths:
  /v3/id-verification/wallets/google-wallet/:
    post:
      tags:
        - Digital ID wallets
      summary: 开始 Google Wallet 验证
      description: >-
        在无需任何工作流的情况下启动 Google Wallet 登录（Google
        Wallet（身份证件凭证）及美国各州签发机构（移动驾照）；USA、GBR、BRA、SGP、TWN）。仅在身份验证成功时计费一次。响应包含
        next_action.type=request_digital_credential 以及 Didit
        为您的应用签名的请求，该请求仅可从来源使用。在用户手势触发时，将 next_action.digital_credentials.request
        传递给 navigator.credentials.get({digital: ...})（或作为
        GetDigitalCredentialOption requestJson 传递给 Android Credential
        Manager），然后将钱包返回的内容 POST 到
        /v3/id-verification/wallets/verifications/{request_id}/response/。当钱包位于其他设备上时，浏览器会提供其自带的二维码。沙盒应用将获得确定性模拟（simulated:
        true），绝不会联系服务商。
      operationId: start_google_wallet_wallet_verification
      parameters:
        - in: header
          name: Idempotency-Key
          schema:
            type: string
          description: >-
            可选的重试安全密钥（最多 255
            个字符）。使用相同的密钥、钱包和请求体进行重试将返回原始验证结果，而不会发起第二次登录；若将相同密钥用于其他钱包或请求体，则返回 409
            idempotency_key_reused。
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/DigitalIdWalletApiGoogleWalletWalletVerificationStartRequest
            example:
              country: USA
              vendor_data: your-customer-reference
              metadata:
                reference: example
              origin: https://app.example.com
          application/x-www-form-urlencoded:
            schema:
              $ref: >-
                #/components/schemas/DigitalIdWalletApiGoogleWalletWalletVerificationStartRequest
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/DigitalIdWalletApiGoogleWalletWalletVerificationStartRequest
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/DigitalIdWalletApiWalletVerificationResponse
              example:
                request_id: 00000000-0000-4000-8000-000000000001
                wallet_verification:
                  wallet:
                    id: google_wallet
                    name: Google Wallet
                    issuing_authority: >-
                      Google Wallet (ID pass) and US state issuers (mobile
                      driving licence)
                  country: USA
                  status: Not Finished
                  outcome: pending
                  error: null
                  interaction: digital_credentials
                  simulated: false
                  expires_at: '2026-01-01T10:10:00Z'
                  next_action:
                    type: request_digital_credential
                    digital_credentials:
                      protocol: openid4vp-v1-signed
                      request:
                        requests:
                          - protocol: openid4vp-v1-signed
                            data:
                              request: <compact JWS signed by Didit>
                  identity: null
                  attributes: null
                  level_of_assurance: null
                  verified_at: null
                  signature_valid: null
                  credential_type: person_identification
                vendor_data: your-customer-reference
                metadata:
                  reference: example
                created_at: '2026-01-01T10:00:00Z'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/DigitalIdWalletApiWalletVerificationStartBadRequest
          description: >-
            字段验证错误（{field: [messages]}），或错误
            return_url_invalid、return_url_not_allowed、origin_invalid、origin_not_allowed、invalid_personal_code、invalid_phone_number
            或 idempotency_key_invalid。
        '403':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/DigitalIdWalletApiWalletVerificationStartForbidden
          description: >-
            缺少凭据（{detail}），或出现 wallet_unavailable、insufficient_credits 或
            contract_rate_missing 错误。
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DigitalIdWalletApiWalletVerificationError'
          description: >-
            错误 idempotency_key_reused 或 idempotency_key_in_progress（附带
            Retry-After）。
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DigitalIdWalletApiWalletVerificationError'
          description: 错误 wallet_provider_unavailable：提供商无法启动；未创建任何内容。
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DigitalIdWalletApiWalletVerificationError'
          description: 错误 wallet_not_configured：此环境无法访问该钱包。
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl --request POST \
              --url https://verification.didit.me/v3/id-verification/wallets/google-wallet/ \
              --header 'x-api-key: YOUR_API_KEY' \
              --header 'Idempotency-Key: your-unique-attempt-key' \
              --header 'Content-Type: application/json' \
              --data '{
              "country": "USA",
              "vendor_data": "your-customer-reference",
              "metadata": {
                "reference": "example"
              },
              "origin": "https://app.example.com"
            }'
components:
  schemas:
    DigitalIdWalletApiGoogleWalletWalletVerificationStartRequest:
      type: object
      description: 启动 Google Wallet 验证（USA、GBR、BRA、SGP、TWN）。
      properties:
        vendor_data:
          type: string
          nullable: true
          description: 您为此验证指定的自身参考编号（例如您的用户 ID）。在结果和 Webhook 中返回。
        metadata:
          type: object
          additionalProperties: {}
          nullable: true
          description: 与验证一同存储并在结果和 Webhook 中返回的可选 JSON 对象。
        sandbox_scenario:
          type: string
          minLength: 1
          description: >-
            仅限沙盒应用：模拟结果，可为 'wallet_cancelled'、'wallet_timeout' 或
            'wallet_provider_error'；任何其他场景（或无场景）均通过验证。在生产环境应用上会被拒绝。完整目录可在 GET
            /v1/sandbox/scenarios/ 获取。
        country:
          allOf:
            - $ref: >-
                #/components/schemas/DigitalIdWalletApiGoogleWalletWalletVerificationStartCountryEnum
          description: |-
            Google Wallet 身份的 ISO 3166-1 alpha-3 国家/地区。

            * `USA` - USA
            * `GBR` - GBR
            * `BRA` - BRA
            * `SGP` - SGP
            * `TWN` - TWN
        origin:
          type: string
          minLength: 1
          description: >-
            您的页面或应用向钱包发起请求的来源位置：页面的 https 源（其 host 必须在应用的 allowed_return_hosts
            中，或是其白标域名），例如 https://app.example.com，或者
            android:apk-key-hash:<您应用签名证书的 base64 SHA-256，无填充>。钱包会拒绝来自其他任何位置的请求。
          maxLength: 256
      required:
        - country
        - origin
    DigitalIdWalletApiWalletVerificationResponse:
      type: object
      description: 单次独立钱包验证，正如每个钱包 endpoint 返回的结果一样。
      properties:
        request_id:
          type: string
          format: uuid
        wallet_verification:
          $ref: '#/components/schemas/DigitalIdWalletApiWalletVerificationResult'
        vendor_data:
          type: string
          nullable: true
        metadata:
          type: object
          additionalProperties: {}
          nullable: true
          description: 启动时发送的元数据对象，或 null。
        created_at:
          type: string
          format: date-time
      required:
        - created_at
        - metadata
        - request_id
        - vendor_data
        - wallet_verification
    DigitalIdWalletApiWalletVerificationStartBadRequest:
      oneOf:
        - $ref: '#/components/schemas/DigitalIdWalletApiWalletVerificationError'
        - $ref: '#/components/schemas/DigitalIdWalletApiWalletVerificationFieldErrors'
    DigitalIdWalletApiWalletVerificationStartForbidden:
      oneOf:
        - $ref: >-
            #/components/schemas/DigitalIdWalletApiClientCredentialsForbiddenErrorMessage
        - $ref: '#/components/schemas/DigitalIdWalletApiWalletVerificationError'
    DigitalIdWalletApiWalletVerificationError:
      type: object
      properties:
        error:
          type: string
          description: 稳定的机器可读代码，例如 wallet_unavailable。
        detail:
          type: string
      required:
        - detail
        - error
    DigitalIdWalletApiGoogleWalletWalletVerificationStartCountryEnum:
      enum:
        - USA
        - GBR
        - BRA
        - SGP
        - TWN
      type: string
      description: |-
        * `USA` - USA
        * `GBR` - GBR
        * `BRA` - BRA
        * `SGP` - SGP
        * `TWN` - TWN
    DigitalIdWalletApiWalletVerificationResult:
      type: object
      properties:
        wallet:
          allOf:
            - $ref: '#/components/schemas/DigitalIdWalletApiWallet'
          readOnly: true
        country:
          type: string
        status:
          type: string
          description: 待处理时为未完成，随后为已通过（已核验）或已拒绝。
        outcome:
          $ref: >-
            #/components/schemas/DigitalIdWalletApiWalletVerificationResultOutcomeEnum
        error:
          type: string
          nullable: true
          readOnly: true
        interaction:
          allOf:
            - $ref: '#/components/schemas/DigitalIdWalletApiInteractionEnum'
          readOnly: true
        simulated:
          type: boolean
          readOnly: true
        expires_at:
          type: string
          format: date-time
        next_action:
          allOf:
            - $ref: '#/components/schemas/DigitalIdWalletApiWalletNextAction'
          nullable: true
          readOnly: true
        identity:
          allOf:
            - $ref: '#/components/schemas/DigitalIdWalletApiWalletIdentity'
          nullable: true
          readOnly: true
        attributes:
          type: object
          additionalProperties: {}
          nullable: true
          readOnly: true
        level_of_assurance:
          type: string
          nullable: true
        verified_at:
          type: string
          format: date-time
          nullable: true
        signature_valid:
          type: boolean
          nullable: true
          description: 凭证签名验证通过后为 true；模拟凭证为 null。
        credential_type:
          type: string
          nullable: true
      required:
        - attributes
        - country
        - credential_type
        - error
        - expires_at
        - identity
        - interaction
        - level_of_assurance
        - next_action
        - outcome
        - signature_valid
        - simulated
        - status
        - verified_at
        - wallet
    DigitalIdWalletApiWalletVerificationFieldErrors:
      type: object
      description: 请求验证错误：每个被拒绝的字段及其消息。
      additionalProperties:
        type: array
        items:
          type: string
    DigitalIdWalletApiClientCredentialsForbiddenErrorMessage:
      type: object
      properties:
        detail:
          type: string
          default: Forbidden - User doesn't have permission
    DigitalIdWalletApiWallet:
      type: object
      properties:
        id:
          type: string
          description: 钱包的目录 ID，例如 bankid_se。
        name:
          type: string
        issuing_authority:
          type: string
          nullable: true
      required:
        - id
        - issuing_authority
        - name
    DigitalIdWalletApiWalletVerificationResultOutcomeEnum:
      enum:
        - pending
        - verified
        - cancelled
        - timeout
        - failed
      type: string
      description: |-
        * `pending` - 待处理
        * `verified` - 已验证
        * `cancelled` - 用户已取消
        * `timeout` - 已超时
        * `failed` - 已失败
    DigitalIdWalletApiInteractionEnum:
      enum:
        - redirect
        - in_app
        - digital_credentials
      type: string
      description: |-
        * `redirect` - 重定向
        * `in_app` - 应用内
        * `digital_credentials` - 数字凭证
    DigitalIdWalletApiWalletNextAction:
      type: object
      properties:
        type:
          allOf:
            - $ref: '#/components/schemas/DigitalIdWalletApiWalletNextActionTypeEnum'
          description: >-
            redirect：将用户浏览器重定向至 url。confirm_in_app：向用户显示
            verification_code，用户核对该验证码与其钱包应用中的代码一致后在应用内确认；随后进行轮询。request_digital_credential：在您最初发起流程的源上通过用户手势调用
            digital_credentials.request 请求钱包，然后将返回的内容发送至 POST
            .../verifications/{request_id}/response/。


            * `redirect` - redirect

            * `confirm_in_app` - confirm_in_app

            * `request_digital_credential` - request_digital_credential
        url:
          type: string
          format: uri
          description: 仅限 redirect：用户使用钱包登录的页面。
        digital_credentials:
          allOf:
            - $ref: >-
                #/components/schemas/DigitalIdWalletApiWalletDigitalCredentialsRequest
          description: 仅限 request_digital_credential：传递给钱包的请求内容。
        verification_code:
          type: string
          description: 仅限 confirm_in_app：钱包应用上同步显示的 4 位比对码。
        poll_interval_seconds:
          type: integer
          description: >-
            仅限 confirm_in_app：调用 POST .../verifications/{request_id}/poll/
            以获取即时反馈的频率。Didit 还会在后台轮询待处理的登录，因此即使您不进行轮询，Webhook 也会报告结果。
      required:
        - type
    DigitalIdWalletApiWalletIdentity:
      type: object
      properties:
        full_name:
          type: string
          nullable: true
        first_name:
          type: string
          nullable: true
        last_name:
          type: string
          nullable: true
        date_of_birth:
          type: string
          format: date
          nullable: true
        nationality:
          type: string
          nullable: true
          description: ISO3 国籍，仅在钱包明确声明时提供（绝不进行推断）。
        issuing_state:
          type: string
          description: 签发该身份的方案所属的 ISO3 国家/地区。
      required:
        - date_of_birth
        - first_name
        - full_name
        - issuing_state
        - last_name
        - nationality
    DigitalIdWalletApiWalletNextActionTypeEnum:
      enum:
        - redirect
        - confirm_in_app
        - request_digital_credential
      type: string
      description: |-
        * `redirect` - 重定向
        * `confirm_in_app` - 应用内确认
        * `request_digital_credential` - 请求数字凭证
    DigitalIdWalletApiWalletDigitalCredentialsRequest:
      type: object
      properties:
        protocol:
          type: string
          description: openid4vp-v1-signed。
        request:
          type: object
          additionalProperties: {}
          description: >-
            原样传递：在浏览器中为 navigator.credentials.get({digital: request})，或在 Android
            上作为 GetDigitalCredentialOption 的 requestJson 传入
            JSON.stringify(request)。由 Didit 为您的应用签名。
      required:
        - protocol
        - request
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        您的应用 API 密钥，可在 Business Console 的“开发者 -> API
        密钥”中获取。主密钥拥有完整访问权限。指定名称的密钥可设置作用域：针对每个资源设为无权限、只读或读写，限定于特定工作流或已通过的会话、限定于
        IP 地址列表，以及设置到期日期。401 表示密钥错误、已撤销或已过期；403 表示未发送密钥、密钥无权访问该资源或操作，或请求来自其 IP
        列表之外的地址；在会话路由上返回 404 表示该会话不在该密钥允许的工作流或状态范围内。没有媒体访问权限的密钥获取到的图片、视频和 PDF
        URL 将为 null；没有会话写入权限的密钥获取到的会话链接和 token 将为 null。请参阅
        https://docs.didit.me/console/api-keys。
    BearerAuth:
      type: http
      scheme: bearer
      description: 该应用的客户端凭证访问 token。

````

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