> For the complete documentation index, see [llms.txt](https://tech.x2bee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tech.x2bee.com/api-guide/api-guides-en/store-front/member/membership-withdrawal.md).

# Membership Withdrawal

Provides the process for enrolled customers to withdraw from the X2BEE shopping mall. Customers access the personal information change page to submit a withdrawal request, and the withdrawal is completed if there are no orders, claims, or 1:1 inquiries in progress.

***

## Key Features

* **Withdrawal Eligibility Check**
  * Checks whether withdrawal is possible by verifying if there are any orders, claims, or 1:1 inquiries currently in progress.
* **Withdrawal Reason Selection**
  * The member selects a reason for withdrawal when requesting to withdraw.
* **Withdrawal Processing**
  * If withdrawal is possible, the member's status is set to withdrawn and their personal information is masked.
  * The member's personal information contained in their order history, claim history, 1:1 inquiries, and product inquiries is also masked.
* **Event Database Processing**
  * After withdrawal processing, a request is sent to the event database to delete the member's information.

## Process Definition

<figure><img src="https://2999922013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXTxKSWMmuxEkop1pvuwe%2Fuploads%2Fnxl2jhr2D3HFSShUeamx%2F%E1%84%92%E1%85%AC%E1%84%8B%E1%85%AF%E1%86%AB%E1%84%90%E1%85%A1%E1%86%AF%E1%84%90%E1%85%AC.png?alt=media&#x26;token=0c14ca9f-d7a5-488d-9203-b9f2f2a0faa7" alt=""><figcaption></figcaption></figure>

{% stepper %}
{% step %}

### Check Withdrawal Eligibility

Members can access the withdrawal page via the personal information edit page. Withdrawal eligibility is checked before withdrawal processing begins.

Withdrawal eligibility check items:

* Whether there are orders in progress
* Whether there are returns/exchanges in progress
* Whether there are 1:1 inquiries in progress
* Whether there is remaining mileage

If the withdrawal eligibility conditions are not met, withdrawal processing cannot proceed.
{% endstep %}

{% step %}

### Select Withdrawal Reason

A reason for withdrawal is selected at the time of withdrawal. Withdrawal reasons are classified into the following three categories.

* Personal information related
* Site usage related
* Service usage related

If no withdrawal reason is selected, withdrawal processing cannot proceed.
{% endstep %}

{% step %}

### Withdrawal Processing

During withdrawal processing, the previously checked withdrawal eligibility is verified once more.

Processing details:

* Personal information (personal details, delivery address information, refund account information) in the member information database is masked.
* The member's personal information contained in product inquiry history, order/claim history, and 1:1 inquiry history is masked via the Product API and Order API.
* A request is sent to delete the member's information in the event DB.
* Once withdrawal processing is complete, an alert talk message and email notifying the customer of completed withdrawal are sent.
  {% endstep %}

{% step %}

### Delete Token

After withdrawal processing is complete, the existing login token is deleted.
{% endstep %}
{% endstepper %}

## API Function List

<table><thead><tr><th width="94.555419921875">API</th><th width="393.3333740234375">Description</th><th width="98">Server</th><th width="89.111083984375">Method</th><th>Remarks</th></tr></thead><tbody><tr><td>Withdrawal Eligibility</td><td><p>Checks whether the logged-in member is eligible to withdraw.</p><ul><li>Get order/delivery claim count: /api/order/v1/member/getOrdClaimCnt</li><li>Get in-progress inquiry count: /api/order/v1/customerservice/getNotCompletedInquiryCount</li></ul></td><td>Member</td><td>POST</td><td><a href="http://api.x2bee.com/content?msa=member&#x26;depth=%ED%9A%8C%EC%9B%90%ED%83%88%ED%87%B4&#x26;path=chkWithdrawalMember">🔗View API></a></td></tr><tr><td>Membership Withdrawal</td><td><p>Provides withdrawal processing when a member requests to withdraw.</p><ul><li>Product Q&#x26;A separate storage processing: /api/goods/v1/qnaWithdraw/updateStopQna</li><li>Event member separate storage restoration: /api/event/v1/common/doSeparate</li><li>Withdrawn/dormant member personal information transfer and masking processing: /api/order/v1/customerservice/withdrawalAndDormantMember</li><li>Withdrawal processing: /api/order/v1/member/withdrawalMemberOrderInfo</li></ul></td><td>Member</td><td>POST</td><td><a href="http://api.x2bee.com/content?msa=member&#x26;depth=%ED%9A%8C%EC%9B%90%ED%83%88%ED%87%B4&#x26;path=withdrawal">🔗View API></a></td></tr></tbody></table>

## Definition of Terms

<table><thead><tr><th width="91.22216796875">Term</th><th width="450.2222900390625">Description</th><th>Remarks</th></tr></thead><tbody><tr><td>Separate Storage</td><td>Under the Personal Information Protection Act, information should in principle be deleted, but in some cases it must be inevitably retained due to other statutory provisions.</td><td>The law regarding separate storage of dormant members as of 9/15 has been abolished</td></tr></tbody></table>

## Other Notes

* After masking the member's personal information in the member database, the withdrawn member's personal information is stored in a separate storage database (a distinct database).
  * Since withdrawn members are prohibited from rejoining for a certain period, this data is kept in the separate storage database (verified via the CI value)
  * The period is checked using the code name of code 10 under ST009 (number of days restricting rejoining after withdrawal), and when a member signs up, the system checks whether the customer's CI exists in the withdrawal information table of the separate storage database
* If withdrawal processing fails midway, the information in the member database and in the separate storage database must be fully rolled back together, so a different transaction configuration is used.
  * @Transactional(value = "chainedTransactionManager", rollbackFor = {Exception.class})
  * chainedTransactionManager: rolls back the separate storage RW DB and the order RW DB together
* If masking processing in the member database fails, the entire data set is rolled back, but if an error occurs while calling the masking processing APIs of other modules (order/product/event), the data is not rolled back; instead, a record is inserted into the reprocessing table so it can be reprocessed later.
* When withdrawal is processed via the reprocessing batch, the failed APIs of other modules are re-executed to mask the personal information in those modules' data.
* Member database masking items:
  * Member basic information (member name, password, phone number, mobile number, address)
  * Member detail information (CI)
  * Member delivery address information (recipient name, address and detailed address, postal code, phone number, mobile number, delivery message information, entrance information, email address)
  * Member refund account information (bank code, refund account number, account holder name)
