# Order Cancellation

## What it does

When a buyer or seller cancels an order on eBay before any shipment, this flow closes the matching NetSuite Sales Order. This releases the inventory reservation and any applied Customer Deposit back to available stock and credit. IDC handles the close carefully: if the order has already been partially shipped or billed, it flags it as ambiguous for your team to review instead of closing it automatically.

## Direction

**eBay → NetSuite**

## When it runs

This flow runs on a schedule you set. Configure when it runs in [Triggers](/idc/idc-core/apps/triggers.md). For most setups, schedule this flow to run every hour. See [Configure a Flow](/idc/idc-core/apps/configure-flow.md) for a step-by-step walkthrough.

## Settings

| Setting                               | What it does                                                                                                                                                                                           |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Initial Lookback (days)               | On the first sync, how many days back to pull cancelled orders (default: 30 days).                                                                                                                     |
| Sync Overlap (hours)                  | Hours to re-scan before the last sync to catch recent cancellations (default: 24 hours).                                                                                                               |
| Auto-close unfulfilled Sales Orders   | When ON (recommended), Sales Orders with nothing shipped are closed automatically, releasing inventory. An applied deposit does not block closing—Flow 3 (refund import) handles refunds separately.   |
| Create ops task for ambiguous cancels | When ON, partially-fulfilled or already-billed cancellations create a NetSuite task for manual review instead of closing automatically. Default is OFF; enable if you want visibility into edge cases. |
| Ops Task Assignee                     | The employee to assign review tasks to if ambiguous cancels are detected.                                                                                                                              |

## Use cases

* **Automatic order cleanup:** Enable "Auto-close unfulfilled Sales Orders" to automatically release inventory and deposits from cancelled orders. This keeps your demand plan accurate.
* **Manual review workflow:** If you want to review ambiguous cancellations (e.g. partial shipments) before closing, enable "Create ops task for ambiguous cancels" and assign it to your ops manager.

## Common issues

| Symptom                            | What to try                                                                                                                                                                                                                        |
| ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Cancelled orders not closing       | Verify the Sales Order is in "Pending Fulfillment" status and nothing has shipped. Check the [activity log](/idc/idc-core/logs.md) for details. If "Auto-close unfulfilled Sales Orders" is OFF, orders won't be closed—enable it. |
| Ambiguous cancels blocking closure | If the order has shipped even one line or been billed, IDC treats it as ambiguous and won't auto-close. Enable "Create ops task for ambiguous cancels" to get notified for review.                                                 |
| Deposits not being released        | If a Customer Deposit is applied to the order, closing the Sales Order doesn't automatically reverse the deposit. The refund flow handles refunds separately. Check that the Refund Import flow is running.                        |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.in8sync.com/idc/ebay/flows/order-cancellation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
