# RDR 报备状态通知

> RDR 报备状态变更通知的字段、验签和应答要求。

```yaml
openapi: 3.1.0
x-onerway-docs-version: v2
x-onerway-spec-key: payments/versions/v2/webhooks/rdr-enrollment-changed
info:
  title: RDR 报备状态通知
  version: v2
  description: RDR 报备状态变更通知的字段、验签和应答要求。
webhooks:
  rdr.enrollment.changed:
    post:
      summary: RDR 报备状态通知
      description: RDR 报备状态变更通知的字段、验签和应答要求。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: number
                  description: 申请单号。
                  x-onerway-constraints:
                    - kind: rule
                      text: 该 JSON 数字可能超出 JavaScript 安全整数范围。解析 JSON 时须无损保留完整十进制值，用于验签。
                    - kind: rule
                      text: 同一申请的不同状态变化可携带相同 `id`，不要仅凭该字段对通知去重。
                  x-onerway-signature-participation: included
                merchantNo:
                  type: number
                  description: Onerway 分配的商户号，标识商户账户。
                  x-onerway-signature-participation: included
                preDisputeService:
                  type: string
                  description: 申请对应的服务类型，固定为 `RDR`。
                  enum:
                    - RDR
                  x-enum-descriptions:
                    RDR: RDR（快速争议解决）。
                  x-onerway-signature-participation: included
                bin:
                  type: string
                  description: 收单机构 BIN（Bank Identification Number），用于标识为商户提供收单服务的机构。
                  x-onerway-signature-participation: included
                caid:
                  type: string
                  description: 报备申请中提供的商户受理标识（CAID，Card Acceptor ID）。
                  x-onerway-signature-participation: included
                mcc:
                  type: string
                  description: 报备申请中提供的商户类别代码（MCC，Merchant Category Code）。
                  x-onerway-signature-participation: included
                dba:
                  type: string
                  description: 报备申请中提供的商户对外经营名称（DBA，Doing Business As）。
                  x-onerway-signature-participation: included
                resellerSubMerchantId:
                  type: string
                  description: 代理运营商的子商户标识。
                  x-onerway-signature-participation: included
                arn:
                  type: string
                  description: 报备申请中提供的收单参考号（ARN，Acquirer Reference Number）。
                  x-onerway-signature-participation: included
                fromEnrollmentStatus:
                  type: string
                  description: 本次变更前的申请状态。
                  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-signature-participation: included
                enrollmentStatus:
                  type: string
                  description: 本次变更后的申请状态。
                  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: 不要假定每种申请状态变化都会触发通知。
                  x-onerway-signature-participation: included
                notes:
                  type:
                    - string
                    - "null"
                  description: 申请或状态变更备注。
                  x-onerway-value:
                    nullable: true
                  x-onerway-signature-participation: included
                comments:
                  type: string
                  description: 申请的审核意见。
                  x-onerway-signature-participation: included
                createOpr:
                  type: string
                  description: 创建申请记录的操作人。
                  x-onerway-signature-participation: included
                createTime:
                  type: string
                  description: 申请记录创建时间。
                  x-onerway-constraints:
                    - kind: rule
                      text: 格式为 `yyyy-MM-dd HH:mm:ss`。
                  x-onerway-signature-participation: included
                updateOpr:
                  type: string
                  description: 最近一次更新申请记录的操作人。
                  x-onerway-signature-participation: included
                updateTime:
                  type: string
                  description: 申请记录更新时间。
                  x-onerway-constraints:
                    - kind: rule
                      text: 格式为 `yyyy-MM-dd HH:mm:ss`。
                  x-onerway-signature-participation: included
                sign:
                  type: string
                  description: 通知体中的签名值。使用当前环境的 Webhook 加签密钥（`SECRET`），按
                    [通知验签规则](/zh/payments/versions/v2/get-started/webhook-signatures)校验
                    `x-signature` 签名头。
                  x-onerway-constraints:
                    - kind: rule
                      text: 计算签名时排除 `sign` 字段自身。
                  x-onerway-signature-participation: signature-field
            examples:
              rdr_enrollment_in_progress:
                summary: RDR 开通中
                value:
                  id: 100002
                  merchantNo: 100000
                  preDisputeService: RDR
                  bin: replace_with_bin
                  caid: demo_card_acceptor_id
                  mcc: "5999"
                  dba: EXAMPLE STORE
                  resellerSubMerchantId: demo_sub_merchant_001
                  arn: demo_acquirer_reference_number
                  fromEnrollmentStatus: SUBMITTED_AND_PENDING_ENROLLMENT
                  enrollmentStatus: ENROLLING
                  notes: null
                  comments: Example review approved
                  createOpr: demo_creator
                  createTime: 2026-09-01 10:00:00
                  updateOpr: demo_reviewer
                  updateTime: 2026-09-01 10:10:00
                  sign: replace_with_sha256_signature
                x-onerway-headers:
                  x-signature: v1=replace_with_sha256_signature
                  X-Rh-Signature: v1=replace_with_sha256_signature
                  x-timestamp: "1793707200"
              rdr_enrollment_completed:
                summary: RDR 已开通
                value:
                  id: 100002
                  merchantNo: 100000
                  preDisputeService: RDR
                  bin: replace_with_bin
                  caid: demo_card_acceptor_id
                  mcc: "5999"
                  dba: EXAMPLE STORE
                  resellerSubMerchantId: demo_sub_merchant_001
                  arn: demo_acquirer_reference_number
                  fromEnrollmentStatus: ENROLLING
                  enrollmentStatus: ENROLLED
                  notes: null
                  comments: Example RDR enrollment completed
                  createOpr: demo_creator
                  createTime: 2026-09-01 10:00:00
                  updateOpr: demo_reviewer
                  updateTime: 2026-09-01 10:20:00
                  sign: replace_with_sha256_signature
                x-onerway-headers:
                  x-signature: v1=replace_with_sha256_signature
                  X-Rh-Signature: v1=replace_with_sha256_signature
                  x-timestamp: "1793707200"
      responses:
        "200":
          description: 验签通过并受理通知后，返回 HTTP 200，纯文本响应正文须严格为
            `20000`，不含引号、空白或末尾换行。投递失败或响应正文不匹配时，应用层含首次共尝试最多 6 次，各次尝试之间依次等待
            5、10、20、40、60 秒。IO 异常的传输层重试另行计数，上述次数不代表固定的 HTTP 请求总数。
          content:
            text/plain:
              schema:
                type: string
              examples:
                accepted:
                  summary: 通知已受理
                  value: "20000"
      x-onerway-verification:
        scheme: header-sign
        header: x-signature
        version: v1
        algorithm: sha256
        rule: acquiring-sorted-concat-secret
        reference: /zh/payments/versions/v2/get-started/webhook-signatures
      x-onerway-header-fields:
        - name: x-signature
          schema:
            type: string
            description: 推荐用于验证本通知的签名，包含逗号分隔的一项或多项 `v1=<签名>`。
        - name: X-Rh-Signature
          schema:
            type: string
            description: 为兼容已有接入保留的签名请求头。新接入推荐使用 `x-signature`。
        - name: x-timestamp
          schema:
            type: string
            description: 通知发送时间，使用 Unix 秒级时间戳，不参与签名。
      x-onerway-destination:
        description: 开发者中心 → Webhooks → 代理拒付预警报备
        guide: /zh/payments/versions/v2/online-payments/scenarios/agency-alerts
        links:
          - label: 生产
            href: https://merchant.onerway.com/
          - label: 沙盒
            href: https://sandbox-merchant.onerway.com/develops/webhooks
```
