# Query Ethoca enrollments

> Query Ethoca service enrollment records and their current lifecycle status.

```yaml
openapi: 3.1.0
info:
  title: Query Ethoca enrollments
  version: 1.0.0
  description: Query Ethoca service enrollment records and their current lifecycle status.
paths:
  /ethoca/agency-cw/enrollment/page:
    post:
      summary: Query Ethoca enrollments
      description: Query Ethoca service enrollment records and their current lifecycle
        status.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                merchantNo:
                  type: string
                  description: Merchant number assigned by Onerway. It limits the query to one
                    merchant account.
                id:
                  type: string
                  description: Enrollment application ID. Submit it to query one application
                    record precisely.
                preDisputeService:
                  type: string
                  description: Service associated with the enrollment application.
                  enum:
                    - ETHOCA_ALERT
                  x-enum-descriptions:
                    ETHOCA_ALERT: Ethoca alert service.
                  x-onerway-constraints:
                    - kind: values
                      text: Submit `ETHOCA_ALERT` when querying Ethoca enrollments.
                billDesc:
                  type: string
                  description: Merchant billing descriptor used to filter enrollment records.
                resellerSubMerchantId:
                  type: string
                  description: Sub-merchant identifier assigned by the agency operator.
                  x-onerway-condition:
                    - Provide this field when an agency operator queries
                      sub-merchant application records.
                enrollmentStatusList:
                  type: string
                  description: Filter enrollment applications by status.
                  enum:
                    - PENDING_SUBMISSION
                    - SUBMITTED_AND_PENDING_ENROLLMENT
                    - ENROLLING
                    - ENROLLED
                    - ENROLLMENT_FAILED
                    - SUBMITTED_AND_PENDING_DISENROLLMENT
                    - DISENROLLING
                    - DISENROLLED
                  x-enum-descriptions:
                    PENDING_SUBMISSION: Pending submission. The application has been created but has
                      not been submitted for review.
                    SUBMITTED_AND_PENDING_ENROLLMENT: Submitted and pending enrollment. The
                      application has been submitted and is waiting for review
                      and enrollment processing.
                    ENROLLING: Enrolling. The application passed review and alert-service enrollment
                      configuration is in progress.
                    ENROLLED: Enrolled. The service is active and the merchant can receive alerts.
                    ENROLLMENT_FAILED: Enrollment failed. Review failed or enrollment was blocked;
                      check `comments` before resubmitting.
                    SUBMITTED_AND_PENDING_DISENROLLMENT: Submitted and pending disenrollment. A
                      disable-service request has been submitted and is waiting
                      for processing.
                    DISENROLLING: Disenrolling. Service disablement is in progress.
                    DISENROLLED: Disenrolled. The service has been disabled and alerts are no longer
                      received.
                  x-onerway-constraints:
                    - kind: rule
                      text: Specify one or more enrollment statuses. Separate multiple values with
                        commas.
                createTimeStart:
                  type: string
                  description: Start of the application creation time range, in `yyyy-MM-dd
                    HH:mm:ss` format.
                  x-onerway-condition:
                    - Provide this field when filtering by application creation
                      time range.
                createTimeEnd:
                  type: string
                  description: End of the application creation time range, in `yyyy-MM-dd
                    HH:mm:ss` format.
                  x-onerway-condition:
                    - Provide this field when filtering by application creation
                      time range.
                updateTimeStart:
                  type: string
                  description: Start of the application update time range, in `yyyy-MM-dd
                    HH:mm:ss` format.
                  x-onerway-condition:
                    - Provide this field when filtering by update time range.
                updateTimeEnd:
                  type: string
                  description: End of the application update time range, in `yyyy-MM-dd HH:mm:ss`
                    format.
                  x-onerway-condition:
                    - Provide this field when filtering by update time range.
                current:
                  type: string
                  description: Query page number, starting from `1`.
                sign:
                  type: string
                  description: Request signature string. See [Request
                    signing](/payments/get-started/request-signing) for how to
                    generate it.
              required:
                - merchantNo
                - current
                - sign
            examples:
              query-ethoca-enrollments:
                summary: Query Ethoca enrollments
                value:
                  current: "1"
                  enrollmentStatusList: ENROLLED,DISENROLLED
                  merchantNo: replace_with_merchant_no
                  preDisputeService: ETHOCA_ALERT
                  sign: "{{SIGN}}"
      responses:
        "200":
          description: Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  respCode:
                    type: string
                    description: "`20000` means the query request was processed successfully. Other
                      values are error codes. See [Response
                      codes](/payments/api-reference/response-codes)."
                  respMsg:
                    type: string
                    description: Human-readable message for the response code.
                  data:
                    type: object
                    properties:
                      content:
                        type: array
                        description: Ethoca enrollment records matching the query conditions.
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              description: Enrollment application ID.
                            merchantNo:
                              type: string
                              description: Merchant number assigned by Onerway, identifying the merchant
                                account.
                            preDisputeService:
                              type: string
                              description: Service associated with the enrollment application.
                              enum:
                                - ETHOCA_ALERT
                              x-enum-descriptions:
                                ETHOCA_ALERT: Ethoca alert service.
                            billDesc:
                              type: string
                              description: Merchant billing descriptor recorded in the enrollment application,
                                as shown on cardholder statements.
                            resellerSubMerchantId:
                              type:
                                - string
                                - "null"
                              description: Sub-merchant identifier assigned by the agency operator.
                              x-onerway-value:
                                nullable: true
                                when:
                                  en: Has a value for agency sub-merchant enrollment records. Regular merchant
                                    records can return `null`.
                                  zh: 代理运营商子商户申请记录中有值；普通商户申请记录可能为 `null`。
                            enrollmentStatus:
                              type: string
                              description: Current enrollment status across the application lifecycle.
                                `ENROLLED` means the service is active;
                                `ENROLLMENT_FAILED` means the merchant should
                                check `comments`, correct the issue, and
                                resubmit.
                              enum:
                                - PENDING_SUBMISSION
                                - SUBMITTED_AND_PENDING_ENROLLMENT
                                - ENROLLING
                                - ENROLLED
                                - ENROLLMENT_FAILED
                                - SUBMITTED_AND_PENDING_DISENROLLMENT
                                - DISENROLLING
                                - DISENROLLED
                              x-enum-descriptions:
                                PENDING_SUBMISSION: Pending submission. The application has been created but has
                                  not been submitted for review.
                                SUBMITTED_AND_PENDING_ENROLLMENT: Submitted and pending enrollment. The
                                  application has been submitted and is waiting
                                  for review and enrollment processing.
                                ENROLLING: Enrolling. The application passed review and alert-service enrollment
                                  configuration is in progress.
                                ENROLLED: Enrolled. The service is active and the merchant can receive alerts.
                                ENROLLMENT_FAILED: Enrollment failed. Review failed or enrollment was blocked;
                                  check `comments` before resubmitting.
                                SUBMITTED_AND_PENDING_DISENROLLMENT: Submitted and pending disenrollment. A
                                  disable-service request has been submitted and
                                  is waiting for processing.
                                DISENROLLING: Disenrolling. Service disablement is in progress.
                                DISENROLLED: Disenrolled. The service has been disabled and alerts are no longer
                                  received.
                            notes:
                              type:
                                - string
                                - "null"
                              description: Application or status transition note.
                              x-onerway-value:
                                nullable: true
                                when:
                                  en: Has a value when an application or transition note was provided; returns
                                    `null` when omitted.
                                  zh: 申请或变更时填写备注后有值；未填写备注时为 `null`。
                            comments:
                              type:
                                - string
                                - "null"
                              description: Review comments for the enrollment application. When enrollment
                                fails or is rejected, Onerway uses this field to
                                explain the reason so the merchant can correct
                                the issue and resubmit with `MERCHANT_RESUBMIT`.
                              x-onerway-value:
                                nullable: true
                                when:
                                  en: Has a value when review or processing comments exist; may be empty before
                                    comments are produced.
                                  zh: 已有审核或处理意见时有值；尚未产生审核意见时可能为空。
                            createTime:
                              type: string
                              description: Application record creation time in `yyyy-MM-dd HH:mm:ss` format.
                            updateTime:
                              type: string
                              description: Application record update time in `yyyy-MM-dd HH:mm:ss` format.
                            sign:
                              type:
                                - string
                                - "null"
                              description: Record-level signature string.
                              x-onerway-value:
                                nullable: true
                                when:
                                  en: The record-level signature can return `null`.
                                  zh: 该字段可能返回 `null`。
                      current:
                        type: string
                        description: Current returned page number, using 1-based numbering.
                      size:
                        type: number
                        description: Page size. The current page size is fixed at 10 records.
                      totalPages:
                        type: number
                        description: Total number of pages based on the current page size.
                      totalElements:
                        type: number
                        description: Total number of enrollment records matching the query conditions.
                    description: Business data object containing enrollment records and pagination
                      information.
```
