WeChat User Information API

User identity (UnionID) lookups.

Operations 1

GET /wxa/getpaidunionid auth.getPaidUnionId #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/wechat-user-information-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

wechat-user-information-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: WeChat Mini Program Server API (subset) Access Token User Information API
  description: 'Subset OpenAPI description for the WeChat (Weixin) Mini Programs server-side

    API hosted at `api.weixin.qq.com`. Covers the foundational endpoints needed

    to bootstrap a Mini Program backend: exchanging a temporary login code for

    a session via `auth.code2Session`, minting an application access token via

    `auth.getAccessToken`, and retrieving a paid-only UnionID via

    `auth.getPaidUnionId`.


    Authentication for these foundational endpoints is keyed on the Mini

    Program''s AppID and AppSecret, passed as query parameters. Subsequent

    business APIs (template messages, content moderation, analytics, QR codes,

    logistics, etc.) require the `access_token` obtained from

    `auth.getAccessToken`.

    '
  version: 1.0.0
  contact:
    name: WeChat Developer Community
    url: https://developers.weixin.qq.com/community/
  license:
    name: Proprietary
servers:
- url: https://api.weixin.qq.com
  description: WeChat production API
tags:
- name: User Information
  description: User identity (UnionID) lookups.
paths:
  /wxa/getpaidunionid:
    get:
      tags:
      - User Information
      summary: auth.getPaidUnionId
      description: 'Retrieve a user''s UnionID after they have completed a WeChat Pay

        transaction in the Mini Program. Requires either `openid` plus

        `transaction_id`, or `openid` plus `mch_id` and `out_trade_no`.

        '
      operationId: getPaidUnionId
      parameters:
      - in: query
        name: access_token
        required: true
        schema:
          type: string
        description: Application access token from `auth.getAccessToken`.
      - in: query
        name: openid
        required: true
        schema:
          type: string
        description: The user's openid in the Mini Program.
      - in: query
        name: transaction_id
        schema:
          type: string
        description: WeChat Pay transaction id (optional if `mch_id` + `out_trade_no` are supplied).
      - in: query
        name: mch_id
        schema:
          type: string
        description: WeChat Pay merchant id (used with `out_trade_no`).
      - in: query
        name: out_trade_no
        schema:
          type: string
        description: Merchant-side order number (used with `mch_id`).
      responses:
        '200':
          description: Paid UnionID result.
          content:
            application/json:
              schema:
                oneOf:
                - type: object
                  properties:
                    unionid:
                      type: string
                      description: Cross-application UnionID for the paying user.
                    errcode:
                      type: integer
                    errmsg:
                      type: string
                - $ref: '#/components/schemas/WeChatError'
components:
  schemas:
    WeChatError:
      type: object
      description: Standard WeChat API error envelope.
      properties:
        errcode:
          type: integer
          description: Numeric WeChat error code; `0` indicates success.
        errmsg:
          type: string
          description: Human-readable error message.
externalDocs:
  description: WeChat Mini Program Server API
  url: https://developers.weixin.qq.com/miniprogram/en/dev/api-backend/