When you refund an order in WooCommerce, Qoblex mirrors that refund for you. You do not create the refund, the return, or the shipment by hand: WooCommerce notifies Qoblex about the order, Qoblex finds the matching sale order, and it records the refund in your accounts, brings restocked goods back into inventory, and marks the order as shipped from the stock Qoblex reserved for it. This article explains what triggers the sync, which direction the data flows, how Qoblex decides whether refunded goods come back into stock, and the exact field mapping Qoblex uses when it turns a WooCommerce refund into a Qoblex refund and a return. It also explains how WooCommerce orders get their Qoblex shipment, which works differently from a store that has its own fulfillment records. After reading it you will know what to expect in Qoblex after a WooCommerce refund, and where to look when one does not appear.
Direction of sync
This sync is one direction only: WooCommerce to Qoblex. Refunds you create in WooCommerce flow into Qoblex. Qoblex does not push refunds or returns back to WooCommerce through this path. WooCommerce has no separate “fulfillment” record the way some stores do. It only tells Qoblex when an order changes. Because of that, both the refund side and the shipment side of this article are driven by WooCommerce order notifications, not by a dedicated refund or fulfillment message.
What triggers the sync
When you connect a store, Qoblex installs WooCommerce webhooks for order created, order updated, order restored, and order deleted. Every one of these notifications makes Qoblex re-read the whole order from your store. Qoblex also re-reads active stores automatically every few minutes, so a refund is still picked up even if a webhook is missed. Each time Qoblex re-reads a WooCommerce order, it checks whether that order carries any refunds. If it does, Qoblex starts the refund and return sync for that order as a separate step. In other words: – Creating a refund in WooCommerce changes the order, which sends an order notification. Qoblex re-reads the order, sees the refund on it, and runs the refund and return sync. – Any later edit to the same order re-reads it again. Refunds that were already brought into Qoblex are skipped, so nothing is duplicated. Qoblex also re-runs the refund and return sync for an order the moment that order becomes ready to ship in Qoblex (when the stock it needs is fully available). This makes sure a refund that arrived before the goods were ready is applied once the order can be fulfilled.
Gating: when the sync runs (and when it waits)
- The store must be connected and the order must already exist in Qoblex. The refund and return sync loads the matching Qoblex sale order first, matching on the WooCommerce order id. If the order has not been imported into Qoblex yet, Qoblex logs that the order was not found and stops. The refund is picked up on a later attempt once the order exists.
- The order must have at least one refund in WooCommerce. If Qoblex re-reads the order and WooCommerce reports no refunds, nothing is created.
- Refunds already recorded are skipped. Qoblex looks for a refund already on the Qoblex order with the same WooCommerce refund id and skips it, and it does the same for returns. Re-delivered notifications therefore never create a second refund or return.
- You cannot refund more than you invoiced. Every refunded product line and every refunded fee or shipping line must correspond to something already invoiced on the Qoblex order. If WooCommerce refunds a line Qoblex has not invoiced, or refunds more than the invoiced amount, the sync for that order stops with an error and the whole batch is rolled back.
- Shipping DZA stores skip this sync. If your company also runs the Shipping DZA integration, Qoblex deliberately skips refund and return processing to avoid conflicts and records a note on the activity feed.
- Old orders do not disturb current stock. If the order was last changed before the date you connected the store and it is already completed, Qoblex applies the return without tracking the inventory movement, so historical activity does not double-count against your current on-hand figures.
How Qoblex matches the record
- Order: matched by the WooCommerce order id against the sale order’s reference in Qoblex.
- Refunded product line: matched to the Qoblex order line whose reference equals the WooCommerce refunded item id. If no matching order line is found, the sync for that order stops with an error.
- Refunded fee or shipping line: matched to the Qoblex extra-charge (landed cost) line whose reference equals the WooCommerce fee or shipping line id.
- Existing refund / return: matched by the WooCommerce refund id. A refund or return already on the order is skipped so it is never processed twice.
Restock versus refund-only
When you refund an order in WooCommerce, WooCommerce lets you tick a Restock refunded items box per line. Qoblex reads that choice from the refund and decides, per line, one of three outcomes: bring the goods back into stock, record a return that does not touch stock, or record no return at all. – Restock (a return that adds stock back): the item comes back into inventory. This happens when both conditions hold: WooCommerce marked the line to restock (its restock quantity is greater than zero, net of anything already returned), and Qoblex can trace that line to a shipment it has already recorded for the order. When both hold, Qoblex creates a return on the order, automatically assigns the batches or serial numbers being brought back, and authorizes the return so the stock is added back at the shipment’s location. Qoblex never restocks more than the quantity that was actually shipped and not already returned. – Return without restock (a cancellation): if WooCommerce marked the line to restock but Qoblex has no shipment it can trace that line to, Qoblex still records a return on the order, but as a non-restock cancellation. The return line is created with no shipment and no location, and it does not add any stock back. This is the case for a line that was refunded-with-restock in WooCommerce but that Qoblex never shipped. – No return line at all: if WooCommerce did not mark the line to restock (its restock quantity is zero), Qoblex creates no return line for it. Only the refunded money is recorded. In every case the refunded amount itself is recorded by the accounting step, so a customer’s refund is reflected in Qoblex regardless of the restock choice.
How the sync runs
For an order that has refunds, Qoblex works through the following: 1. Load the order from WooCommerce and load the matching Qoblex sale order with its invoices, shipments, returns, and existing refunds. 2. Build the refund from the WooCommerce refunds (product lines, fee lines, shipping lines, and any leftover adjustment). 3. Build the return for the lines WooCommerce marked to restock (traceable lines restock; restock-marked lines with no shipment become cancellations). 4. Decide on inventory tracking so returns dated before your store connection date do not distort current stock. 5. Apply the returns: assign their batches or serials automatically, and authorize them so restock lines add stock back at the shipment’s location. 6. Record the refund in accounting. Failures behave differently depending on where they happen: – If a refund line cannot be matched or refunds more than was invoiced while Qoblex is building the refund and return, the run stops, its changes are rolled back, and a warning describing the problem is written to your activity feed. – If creating, batch-assigning, or authorizing a return fails, Qoblex rolls back the return and refund work for that order and logs the failure internally, without writing an activity-feed warning. – If the accounting refund step fails, Qoblex logs the failure and stops applying the rest of the refunds; it does not raise an error or write an activity-feed warning for this case.
Refund field mapping (WooCommerce to Qoblex)
Qoblex converts a WooCommerce refund into a Qoblex refund. A refund carries product lines (the items being refunded) and custom lines (amounts that are not products, such as fees, shipping, or a leftover adjustment). Refund header | Qoblex field | WooCommerce field | Notes / transform | | — | — | — | | Reference | Refund id | The WooCommerce refund id, stored so the refund is matched and not duplicated. | | Status | (fixed) | Always created as Authorized. | Refund product line (a refunded item) Product lines are the WooCommerce refund line items whose quantity is not zero. Each is matched to the Qoblex order line by the WooCommerce refunded item id; if the line cannot be matched, or its quantity would exceed what was invoiced, the sync for that order stops. | Order item | (matched) | Matched to the Qoblex order line whose reference equals the WooCommerce refunded item id. Unmatched lines stop the sync. | | Quantity | Refund line quantity | Recorded as the refunded quantity (WooCommerce reports it as a negative number). | | Reference | Refund line id | The WooCommerce refund line id. | Refund fee line (a refunded fee) | Name | Fee line name | Used as the line description. | | Price | Fee line total | The refunded fee amount from the order’s fee line. | | Quantity | (fixed) | Always 1. | | Tax class | (from the matched charge) | Taken from the Qoblex extra-charge (landed cost) line the fee is matched to. | | Reference | Refund fee line id | The WooCommerce refund fee line id. | Refund shipping line (a refunded shipping charge) | Name | Shipping line method_title | The shipping method name, used as the line description. | | Price | Shipping line total | The refunded shipping amount from the order’s shipping line. | | Tax class | (from the matched charge) | Taken from the Qoblex extra-charge (landed cost) line the shipping charge is matched to. | | Reference | Refund shipping line id | The WooCommerce refund shipping line id. | Zero-quantity adjustment line (a refunded amount with no quantity) When WooCommerce refunds money against a product line without refunding a unit (quantity zero), Qoblex records it as a custom line rather than a stock movement. | Name | (derived) | The product name followed by ” – Adjustment”. | | Price | Order line total | The refunded amount from the matching order line. | | Tax class | (from the matched order line) | Taken from the tax class on the matched Qoblex order line. | Leftover adjustment line After totalling the lines above, Qoblex compares them to the total refund amount WooCommerce reports. If the mapped lines add up to more than the refund total (beyond a small rounding tolerance), Qoblex adds one more custom line named “Adjustment” that subtracts the difference, using a zero-rate tax class, so the recorded refund matches the WooCommerce total.
How WooCommerce orders get their Qoblex shipment
WooCommerce does not track shipments, carriers, or tracking numbers the way a dedicated shipping tool does, so Qoblex does not copy a shipment from WooCommerce. Instead, when a synced WooCommerce order reaches the point where it should be shipped (its Qoblex status is closed and the stock it needs has been reserved), Qoblex builds the shipment itself from the stock it allocated: – Qoblex groups the reserved stock by location and creates one dispatched shipment per location for the quantities it can ship. – The shipment is created and dispatched automatically, so your inventory reflects the goods leaving your warehouse. – Because the shipment is built from Qoblex’s own allocation and not from a WooCommerce record, it carries no carrier or tracking number on this path. This is why the restock decision above depends on a shipment existing: a refund can only bring goods back into stock for a line that Qoblex has already shipped. Shipment (built from allocated stock) | Qoblex field | Source | Notes / transform | | Location | Allocation location | One shipment per location that holds reserved stock for the order. | | Line item quantities | Allocated quantity | The reserved quantity per line, capped at the ordered quantity. | | Status | (fixed) | Dispatched and marked completed. | | Shipment date | (fixed) | Set to the date and time the shipment is created. | | Carrier / tracking | (none) | Not set on this path. |
What you will see in Qoblex
- After a WooCommerce refund that restocks shipped items: a return appears on the order, and the returned quantity comes back into stock at the shipment’s location, with its batches or serials assigned automatically. This happens only for lines that were shipped and marked to restock.
- After a WooCommerce refund that restocks items Qoblex never shipped: a return still appears on the order, but as a cancellation. It records the return without adding any stock back, because there is no shipment to bring the goods back from.
- After a WooCommerce refund without restock: no return line is created for that line, and the refund is recorded against the order without changing stock.
- After any refund: the refund is recorded against the order in your accounts as authorized, including any refunded fees, shipping, and a leftover adjustment line if one was needed. A confirmation is written to your activity feed.
- When an order is ready to ship: a dispatched shipment (or one per stock location) appears for the quantities Qoblex could reserve, with no carrier or tracking number.