> For the complete documentation index, see [llms.txt](https://docs.hotwax.co/documents/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hotwax.co/documents/learn-shopify/shopify-integration/order-cancellation/complete-order-cancellation.md).

# Complete Order Cancellation

**Order Cancellation In Shopify And Updated In HotWax Commerce**

To sync cancellation updates from Shopify to HotWax Commerce, there are two options available: webhooks and batch jobs. By subscribing to the 'Canceled Order' webhook, customers can cancel orders in real-time. However, it should be noted that Shopify webhooks may not always be reliable. Therefore, it is recommended to schedule the 'Canceled Order' Job which imports all updates through a series of steps.

* Import Canceled Orders- When HotWax Commerce wants to check for canceled orders on Shopify, it uses an [API request ](https://shopify.dev/docs/api/admin-rest/2023-04/resources/order#get-orders?status=any)through the 'Canceled Order' job. This job looks at the 'cancelled\_at' field for orders on Shopify and compares it to the job's last run time. If the 'cancelled\_at' time is later than the job's last run time, the job downloads all canceled orders from Shopify in batches of 100 to avoid exceeding Shopify's API limit.
* Processing in HotWax Commerce- Once all canceled orders are downloaded, HotWax Commerce processes the file to check the order IDs of the canceled orders and marks them as canceled in the system.

{% hint style="info" %}
The recommended frequency for this job is every 30 minutes, however, it can be adjusted to a different time interval using the Job Manager App.
{% endhint %}

<figure><img src="/files/CIzw0v3oObY1iappCfMy" alt=""><figcaption><p><em>Fig. 1: Configuration in Job Manager app to download canceled orders in HotWax Commerce</em></p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.hotwax.co/documents/learn-shopify/shopify-integration/order-cancellation/complete-order-cancellation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
