# 微信小程序获取openid

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /【接口根地址(支付FM用户中心查看）】/jscode2session:
    get:
      summary: 微信小程序获取openid
      deprecated: false
      description: ''
      tags:
        - 支付FM
      parameters:
        - name: orderId
          in: query
          description: 支付FM订单号，H5拉起小程序时候会传入
          required: false
          example: '574623147236524032'
          schema:
            type: string
        - name: code
          in: query
          description: >-
            wx.login获取的凭证，https://developers.weixin.qq.com/miniprogram/dev/api/open-api/login/wx.login.html
          required: false
          example: 0c3uqYGa1Tt3uK0OtrIa13C7Ap1uqYGC
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  msg:
                    type: string
                  code:
                    type: integer
                  timestamp:
                    type: integer
                  data:
                    type: object
                    properties:
                      session_key:
                        type: string
                      openid:
                        type: string
                        description: openid
                    required:
                      - session_key
                      - openid
                    x-apifox-orders:
                      - session_key
                      - openid
                required:
                  - success
                  - msg
                  - code
                  - timestamp
                  - data
                x-apifox-orders:
                  - success
                  - msg
                  - code
                  - timestamp
                  - data
              example:
                success: true
                msg: success
                code: 200
                timestamp: 1761012918283
                data:
                  session_key: kB1uyZyG5k7k8d3G1BfWcQ==
                  openid: oFyk-16rQLFkjFqU90pFZBB4Wu9I
          headers: {}
          x-apifox-name: 成功
      security: []
      x-apifox-folder: 支付FM
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/6722236/apis/api-363986056-run
components:
  schemas: {}
  securitySchemes: {}
servers: []
security: []

```
