> 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/order/order-cancellation.md).

# Order Cancellation

Provides an order cancellation feature for products a customer has ordered. Through this feature, customers can cancel some or all of their ordered products, and select the cancellation reason and quantity. Depending on the claim's responsible party, additional payment or a refund is processed, coupons are restored, and stock is restored by the quantity of the cancelled products. In addition, a cancellation completion notification email and message are sent.

***

## Key Features

* **Order Product Cancellation**
  * Checks which ordered products are eligible for cancellation, and allows selecting the products and quantities to cancel.
* **Cancellation Reason Selection**
  * The cancellation reason can be selected based on the claim's responsible party.
* **Additional Payment or Refund Processing**
  * Payment or refund is processed according to the responsible party and the delivery fee policy.
* **Coupon Restoration and Stock Restoration**
  * If a coupon was applied to the cancelled product, it is restored, and stock is restored by the quantity of the cancelled product.
* **Notification Email and Message**
  * When cancellation is complete, a notification email and message are sent to the customer.

## Process Definition

<figure><img src="https://2999922013-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXTxKSWMmuxEkop1pvuwe%2Fuploads%2FgcJ1LIiYBUROwhmglxr5%2F%E1%84%8C%E1%85%AE%E1%84%86%E1%85%AE%E1%86%AB%20%E1%84%8E%E1%85%B1%E1%84%89%E1%85%A9.png?alt=media&#x26;token=c981a27d-59cc-402a-a2b2-2f4aea7cdb0e" alt=""><figcaption></figcaption></figure>

{% stepper %}
{% step %}

### Order Cancellation Target Lookup

Users can cancel an order via the order list or order detail page. Only products eligible for cancellation among the ordered products are retrieved and displayed in the order cancellation popup.
{% endstep %}

{% step %}

### Claim Cost Calculation Lookup

\[Claim Common] After selecting the cancellation product and quantity, and then selecting the cancellation reason in the next step, the payment or refund cost is retrieved based on the claim's responsible party and the initial delivery fee charge policy.
{% endstep %}

{% step %}

### Order Cancellation

Processes the cancellation of the selected order product.
{% endstep %}

{% step %}

### Gifting Order Cancellation

A batch program cancels gifting orders whose acceptance deadline has expired.
{% endstep %}
{% endstepper %}

## API Function List

<table><thead><tr><th width="110.3333740234375">API</th><th width="360.1112060546875">Description</th><th width="92.4444580078125">Server</th><th width="89.111083984375">Method</th><th>Remarks</th></tr></thead><tbody><tr><td>Order Cancellation Target Lookup(FO)</td><td>Retrieves the products eligible for cancellation among the ordered products.<br>Retrieves the cancellation reason major and mid-level categories.</td><td>Order</td><td>POST</td><td><p><a href="http://api.x2bee.com/content?msa=order&#x26;depth=%EC%A3%BC%EB%AC%B8%EC%B7%A8%EC%86%8C&#x26;path=getOrderCancelPopupInfoFO">🔗View API ></a></p><p>Calls the common code lookup API (/api/common/v1/common/getGrpCdList)</p></td></tr><tr><td>Order Cancellation(FO)</td><td>Creates order cancellation data and processes the refund/payment that arises based on the reason. Coupon restoration or stock restoration is performed, and an order cancellation notification is sent to the customer.</td><td>Order</td><td>POST</td><td><p><a href="http://api.x2bee.com/content?msa=order&#x26;depth=%EC%A3%BC%EB%AC%B8%EC%B7%A8%EC%86%8C&#x26;path=cancelOrderFO">🔗View API ></a></p><p>Calls the member employee discount limit update API (v1/staff/dcLimIncDec)</p><p>Calls the product stock update API (v1/order/stockUpdate)</p><p>Calls the common email sending API (/api/common/interface/bizmessage/sendmail)</p><p>Calls the common message sending API (/api/common/v1/common/sendMessageList)</p></td></tr><tr><td>Claim Cost Calculation Lookup(FO)</td><td>Retrieves the additional cost, benefit information, and additional payment or pending refund information that arise upon order cancellation.</td><td>Order</td><td>POST</td><td><a href="http://api.x2bee.com/content?msa=order&#x26;depth=%ED%81%B4%EB%A0%88%EC%9E%84%EA%B3%B5%ED%86%B5&#x26;path=calculateFO">🔗View API ></a></td></tr></tbody></table>

## Terminology

<table><thead><tr><th width="124">Term</th><th>Description</th><th data-hidden></th></tr></thead><tbody><tr><td>Responsible Party</td><td>The cause of responsibility that gave rise to the claim</td><td></td></tr><tr><td>Coupon Restoration</td><td>A feature that reissues a coupon used at the time of order</td><td></td></tr><tr><td>Stock Restoration</td><td>A feature that restores a product's stock, deducted at the time of order, back to its state before the deduction</td><td></td></tr></tbody></table>

## Other Notes

* Order cancellations can be submitted concurrently only within the same delivery group.
* Partial cancellation is only possible for orders that support partial payment cancellation.
* The order history status codes and order history classification codes eligible for order cancellation are managed via a common code.
  * ST007 (FO System Claim-Processable Status) reference value 1 = order history status code
  * ST007 (FO System Claim-Processable Status) reference value 2 = order history classification code
* When cancellation is processed after the delivery-instructed status, the delivery-instructed quantity is updated.
* For employee orders, the discount limit amount is updated.
* A coupon is restored only when all products to which it was applied have been cancelled.
* The gift acceptance deadline days are managed via a common code.
  * ST006 (Claimable Days) code 30, reference value 1

##
