# Refunding Shopify Orders from POS (In-Store)

For merchants offering in-store returns for online orders, DotApparel supports automatic refunds through Apparel21 POS. This process ensures refunds are correctly mapped and processed in Shopify without manual intervention.

{% hint style="info" %}
A `refunds.csv` is required for this functionality. An Apparel21 Consultant can set this up for you for a one-time fee&#x20;
{% endhint %}

### **How to Refund Shopify orders from POS (in-store)** <a href="#how-the-auto-refund-works" id="how-the-auto-refund-works"></a>

1. **Store staff processes the return** in Apparel21 POS using the correct return reason.
2. **A `refunds.csv` file is uploaded to SFTP** at a set frequency (i.e., every 5 mins)
3. **DotApparel receives and processes the refunds in Shopify** when it's eligible for Auto-Refunds

{% hint style="info" %}
Merchants must notify the DotApparel team about wanting the ability to refund via Apparel21 POS (In-store). An Apparel21 Specialist needs to generate the `refunds.csv` file

The `refunds.csv` consists of online orders that were refunded in-store via Apparel21 POS.
{% endhint %}

### **`refunds.csv` File Requirements**

* The `refunds.csv` must only include refund transactions, not exchanges or store credits.
* The file must include the `WEB_ORDER_NUMBER` column for Shopify order mapping.
* Merchants must notify DotApparel if they want to enable POS refunds via Apparel21.
* An Apparel21 Specialist must generate the `refunds.csv` file.

### **Understanding `refunds.csv`**

The `refunds.csv` contains **online orders refunded in-store via Apparel21 POS**. DotApparel uses this file to verify refund eligibility and process the refund in Shopify.

Each record must include:

* **WEB\_ORDER\_NUMBER** – The Shopify Order Number. DotApparel uses this to validate the order in Firestore.
* **RETURN\_REASON** – The Apparel21 return reason code. It must match a pre-configured reason in DotApparel Core.
* **Refund Amount** – If multiple products were refunded in a single transaction, DotApparel will **sum the refund amounts** before processing.

Additionally:

* The **same AP21 payment type (tender) used for web sales** should be applied for refunds (e.g., "Shopify Payment").
* The Apparel21 Consultant will configure POS to surface the correct tender.
* The refund record should meet these conditions:
  * A retail transaction contains a **negative amount** (e.g., -$50), indicating a refund.
  * The original sale was an online (web) purchase.
  * The return (credit) value is correctly recorded.

### **For Web-Based Refunds**

For refunds processed **directly via Apparel21**, DotApparel regularly **downloads updated orders** and checks for returned items. If the return reason matches the pre-configured settings in DotApparel, the system will automatically trigger the refund in Shopify.

### **ℹ️ Merchants using Auto-refunds & Yotpo Loyalty**

If a future merchant is using **both DotApparel Core; Auto-refunds** and **Yotpo Loyalty**, they may require a `refunds.csv` to be sent to two different SFTP destinations.


---

# 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.dotapparel.com.au/core/modules/auto-refunds/refunding-shopify-orders-from-pos-in-store.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.
