# Update Ethoca enrollment status

> Withdraw an Ethoca application, request service disablement, or resubmit a failed enrollment.

```yaml
openapi: 3.1.0
x-onerway-docs-version: v2
x-onerway-spec-key: payments/versions/v2/ethoca/update-ethoca-enrollment-status
info:
  title: Update Ethoca enrollment status
  version: v2
  description: Withdraw an Ethoca application, request service disablement, or
    resubmit a failed enrollment.
servers:
  - url: https://sandbox-payment-api.onerway.com
    description: sandbox
  - url: https://payment-api.onerway.com
    description: production
paths:
  /ethoca/agency-cw/enrollment/transition:
    post:
      summary: Update Ethoca enrollment status
      description: Withdraw an Ethoca application, request service disablement, or
        resubmit a failed enrollment.
      parameters:
        - name: ApiKey
          in: header
          required: true
          description: API key for the merchant account. Send it in the `ApiKey` request
            header. See
            [Authentication](/payments/versions/v2/get-started/authentication).
          schema:
            type: string
            description: API key for the merchant account. Send it in the `ApiKey` request
              header. See
              [Authentication](/payments/versions/v2/get-started/authentication).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                merchantNo:
                  type: string
                  description: Merchant number assigned by Onerway. It limits the transition to
                    applications under one merchant account.
                id:
                  type: string
                  description: Enrollment application ID identifying the Ethoca service
                    application to transition.
                billDesc:
                  type: string
                  description: Merchant billing descriptor. Provide it when resubmitting or
                    supplementing application information.
                resellerSubMerchantId:
                  type: string
                  description: Sub-merchant identifier assigned by the agency operator.
                  x-onerway-condition:
                    - Provide this field when an agency operator transitions a
                      sub-merchant application.
                enrollmentStatus:
                  type: string
                  description: Expected current enrollment status. If provided, it must match the
                    current status of the application. If omitted, Onerway uses
                    the current status stored for the application. The event
                    determines the next 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: Only the state and event combinations described in `enrollmentEvent` are
                        supported. Merchant transitions are unavailable while
                        the status is `ENROLLING` or `DISENROLLING`.
                    - kind: rule
                      text: When submitting from `PENDING_SUBMISSION` or `ENROLLMENT_FAILED`, the
                        application must contain `billDesc`.
                enrollmentEvent:
                  type: string
                  description: Enrollment status transition event, expressing the action requested
                    by this call.
                  enum:
                    - MERCHANT_SUBMIT
                    - MERCHANT_WITHDRAW
                  x-enum-descriptions:
                    MERCHANT_SUBMIT: Submit an enrollment application from `PENDING_SUBMISSION`,
                      `ENROLLMENT_FAILED`, or `DISENROLLED`; the next status is
                      `SUBMITTED_AND_PENDING_ENROLLMENT`. From `ENROLLED`,
                      submit a request to close the service; the next status is
                      `SUBMITTED_AND_PENDING_DISENROLLMENT`.
                    MERCHANT_WITHDRAW: Withdraw an enrollment request from
                      `SUBMITTED_AND_PENDING_ENROLLMENT`, returning it to
                      `PENDING_SUBMISSION`; or withdraw a closure request from
                      `SUBMITTED_AND_PENDING_DISENROLLMENT`, returning it to
                      `ENROLLED`.
                notes:
                  type: string
                  description: Status transition note for the requested action, including
                    withdrawal reasons, resubmission explanations, or
                    supplementary material descriptions.
              required:
                - merchantNo
                - id
                - enrollmentEvent
            examples:
              update-ethoca-enrollment-status:
                summary: Update Ethoca enrollment status
                value:
                  merchantNo: replace_with_merchant_no
                  id: replace_with_enrollment_id
                  enrollmentStatus: ENROLLMENT_FAILED
                  enrollmentEvent: MERCHANT_SUBMIT
                  billDesc: EXAMPLE STORE US
                  notes: Updated application details
      responses:
        "200":
          description: Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  respCode:
                    type: string
                    description: "`20000` means the transition request was processed successfully.
                      Other values are error codes. See [Response
                      codes](/payments/versions/v2/api-reference/response-codes\
                      )."
                  respMsg:
                    type: string
                    description: Human-readable message for the response code.
                  data:
                    type: object
                    properties:
                      success:
                        type: boolean
                        description: Whether this status transition request was accepted and executed.
                          `true` means the transition action took effect, but it
                          does not represent the final Ethoca service enrollment
                          or disablement result. Confirm the latest status
                          through [Query Ethoca
                          enrollments](/payments/versions/v2/api-reference/endpoints/query-ethoca-enrollments)
                          or the [Ethoca enrollment status
                          webhook](/payments/versions/v2/api-reference/webhooks/ethoca-enrollment-changed).
                      sign:
                        type: string
                        description: Response signature string for verifying response integrity.
                    description: Business data object indicating whether this status transition
                      request was accepted and executed by the system.
      security:
        - apiKeyAuth:
            []
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: ApiKey
```
