# 变更 RDR 申请状态

> 提交 RDR 申请、撤回申请、申请关闭服务，或重新提交开通失败的申请。

```yaml
openapi: 3.1.0
info:
  title: 变更 RDR 申请状态
  version: 1.0.0
  description: 提交 RDR 申请、撤回申请、申请关闭服务，或重新提交开通失败的申请。
paths:
  /rdr/agency-cw/enrollment/transition:
    post:
      summary: 变更 RDR 申请状态
      description: 提交 RDR 申请、撤回申请、申请关闭服务，或重新提交开通失败的申请。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                merchantNo:
                  type: string
                  description: Onerway 分配的商户号；用于限定要变更的申请所属商户账户。
                id:
                  type: string
                  description: 申请单号，用于指定要变更状态的 RDR 服务申请记录。
                bin:
                  type: string
                  description: 收单机构 BIN（Bank Identification Number），用于标识为商户提供收单服务的机构。
                  x-onerway-condition:
                    - 重新提交或补充申请信息时可提供。
                dba:
                  type: string
                  description: 商户对外经营名称（DBA，Doing Business As）。
                  x-onerway-condition:
                    - 重新提交或补充申请信息时可提供。
                caid:
                  type: string
                  description: 商户受理标识（CAID，Card Acceptor ID）。
                  x-onerway-condition:
                    - 重新提交或补充申请信息时可提供。
                mcc:
                  type: string
                  description: 商户类别代码（MCC，Merchant Category Code）。
                  x-onerway-condition:
                    - 重新提交或补充申请信息时可提供。
                arn:
                  type: string
                  description: 收单参考号（ARN，Acquirer Reference Number）。
                  x-onerway-condition:
                    - 重新提交或补充申请信息时可提供。
                resellerSubMerchantId:
                  type: string
                  description: 代理运营商的子商户标识。
                  x-onerway-condition:
                    - 代理运营商变更其子商户申请状态时提供。
                enrollmentStatus:
                  type: string
                  description: 指定要流转到的下一个申请状态；如果不填写，系统将根据 `enrollmentEvent` 自动处理状态流转。
                  enum:
                    - PENDING_SUBMISSION
                    - SUBMITTED_AND_PENDING_ENROLLMENT
                    - ENROLLING
                    - ENROLLED
                    - ENROLLMENT_FAILED
                    - SUBMITTED_AND_PENDING_DISENROLLMENT
                    - DISENROLLING
                    - DISENROLLED
                  x-enum-descriptions:
                    PENDING_SUBMISSION: 待提交：申请已创建，尚未提交审核。
                    SUBMITTED_AND_PENDING_ENROLLMENT: 已提交，等待开通：申请已提交，正在排队等待审核与开通处理。
                    ENROLLING: 开通中：审核通过，正在执行服务开通配置。
                    ENROLLED: 已开通：服务已生效。
                    ENROLLMENT_FAILED: 开通失败：审核未通过或开通受阻，申请未能完成开通；重新提交前应查看审核意见。
                    SUBMITTED_AND_PENDING_DISENROLLMENT: 已提交，等待关闭服务：停用请求已提交，正在等待处理。
                    DISENROLLING: 关闭中：正在执行服务停用。
                    DISENROLLED: 已关闭：服务已停用。
                  x-onerway-constraints:
                    - kind: rule
                      text: 不同当前状态下可执行的状态变更由系统控制。
                enrollmentEvent:
                  type: string
                  description: 申请状态变更事件，用于表达本次变更动作。
                  enum:
                    - MERCHANT_SUBMIT
                    - MERCHANT_WITHDRAW
                    - MERCHANT_RESUBMIT
                  x-enum-descriptions:
                    MERCHANT_SUBMIT: 商户提交申请：将待提交状态的申请正式提交审核。
                    MERCHANT_WITHDRAW: 商户撤回或停用：待审核状态下撤回尚未开通的申请；已开通状态下申请关闭、停用 RDR 服务。
                    MERCHANT_RESUBMIT: 商户重新提交：开通失败或被拒后，参考 `comments` 修正问题后重新发起申请。
                notes:
                  type: string
                  description: 状态变更说明，用于填写撤回原因、重新提交说明或补充材料说明。
                comments:
                  type: string
                  description: 审核意见字段。商户提交变更时留空；补充说明请使用 `notes`。
                  x-onerway-constraints:
                    - kind: rule
                      text: 商户变更申请时请留空；如需补充说明请使用 `notes`。
                sign:
                  type: string
                  description: 请求签名字符串；生成方式详见[请求签名](/zh/payments/get-started/request-signing)。
              required:
                - merchantNo
                - id
                - enrollmentEvent
                - sign
            examples:
              update-rdr-enrollment-status:
                summary: 变更 RDR 申请状态
                value:
                  enrollmentEvent: MERCHANT_RESUBMIT
                  id: replace_with_enrollment_id
                  merchantNo: replace_with_merchant_no
                  notes: Updated RDR application details
                  sign: "{{SIGN}}"
      responses:
        "200":
          description: Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  respCode:
                    type: string
                    description: 响应码；`20000`
                      表示请求处理成功，其余为错误码。完整码表见[响应码](/zh/payments/api-reference/response-codes)。
                  respMsg:
                    type: string
                    description: 响应码对应的可读说明。
                  data:
                    type: object
                    properties:
                      success:
                        type: boolean
                        description: 本次状态变更请求是否被系统受理并执行；`true` 表示变更动作已生效，但不等同于服务最终开通 /
                          关闭结果，最新申请状态仍需通过[查询 RDR
                          申请状态](/zh/payments/api-reference/endpoints/query-rdr-enrollments)或
                          [RDR
                          报备状态通知](/zh/payments/api-reference/webhooks/rdr-enrollment-changed)确认。
                      sign:
                        type: string
                        description: 响应签名字符串，可用于校验响应数据完整性。
                    description: 业务数据对象，包含本次状态变更是否被系统受理 / 处理成功。
```
