# 匹配入金

> 匹配入金交易。

```yaml
openapi: 3.1.0
x-onerway-docs-version: original
x-onerway-spec-key: embedded-finance/deposits/match-deposit
info:
  title: 匹配入金
  version: original
  description: 匹配入金交易。
servers:
  - url: https://sandbox-baas.onerway.com/embedded-finance
    description: sandbox
  - url: https://baas.onerway.com
    description: production
paths:
  /api/v2/deposit/match:
    post:
      summary: 匹配入金
      description: 匹配入金交易。
      parameters:
        - name: apiKey
          in: header
          required: true
          description: 用于访问嵌入式金融 API 的 API key。
          schema:
            type: string
            description: 用于访问嵌入式金融 API 的 API key。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                userId:
                  type: integer
                  description: 入金所属用户的 ID。
                rechargeId:
                  type: integer
                  description: 待匹配入金的充值 ID。
                sourceOrderNo:
                  type: string
                  description: 商户订单号。
                  x-onerway-constraints:
                    - kind: range
                      max: 64
                      unit: 字符
              required:
                - userId
                - rechargeId
            examples:
              default:
                summary: 匹配入金
                value:
                  userId: 12345678
                  rechargeId: 2098358000329
                  sourceOrderNo: example_order_001
      responses:
        "200":
          description: 风控通过，等待匹配结果通知
          content:
            application/json:
              schema:
                type: object
                properties:
                  respCode:
                    type: string
                    description: Onerway 返回的响应码；`20000` 表示请求成功。
                  respMsg:
                    type: string
                    description: 响应码对应的可读消息。
                  data:
                    type: object
                    properties:
                      merchantNo:
                        type: string
                        description: 该请求所属的商户号。
                      userId:
                        type: integer
                        description: 入金所属用户的 ID。
                      status:
                        type: string
                        description: 入金匹配的风控状态。
                        enum:
                          - S
                          - P
                        x-enum-descriptions:
                          S: 风控通过。匹配入金的结果将通过[匹配入金结果](/zh/embedded-finance/api-reference/webhooks/match-deposit-result)
                            Webhook 通知。
                          P: 风控未通过，已进入合规处理流程；匹配入金结果尚未确定。合规审核通过或拒绝后，结果将通过[匹配入金结果](/zh/embedded-finance/api-reference/webhooks/match-deposit-result)
                            Webhook 通知。如需补充资料，将收到[匹配入金 RFI
                            通知](/zh/embedded-finance/api-reference/webhooks/match-deposit-rfi)
                            Webhook，并需调用[匹配入金 RFI
                            补充材料](/zh/embedded-finance/api-reference/endpoints/submit-deposit-rfi-response)接口响应。
                    description: 请求成功后返回的入金匹配状态。
              examples:
                waiting:
                  summary: 风控通过，等待匹配结果通知
                  value:
                    respCode: "20000"
                    respMsg: Success
                    data:
                      merchantNo: 800***
                      userId: 12345678
                      status: S
      security:
        - apiKeyAuth:
            []
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: apiKey
```
