Services
Custom SoftwareCRMs, portals, dashboards + internal tools. Automation + IntegrationsWorkflows, APIs + business logic. DataScraping, enrichment + monitoring. AIAgents, assistants + knowledge systems. WebWebsites, performance + conversion.
Company
AboutWorkJournal
Start a project →

How to Automate Ecommerce Returns and Refunds

Follow a two-item parcel from warehouse inspection to refund, then use the same example to test whether your returns app keeps damaged stock off sale.

NM
Written byNathan MackenzieFounder · ZappFlow
Practical notes on software, automation, data, web and AI.

To automate ecommerce returns, match each returned item to its original order line, record what the warehouse can do with it, and track the refund against the original payment. Keep the refund and restocking rules separate: a damaged item can qualify for a refund without adding a unit to the stock customers can buy.

A returns portal can approve a request and produce a label, but neither action tells you what was in the parcel or what condition it arrived in. If staff still have to look up the order, ask the warehouse what came back and check whether someone has already refunded it, those are the hand-offs to fix. Run a mixed-condition partial return through your existing app before commissioning an integration.

The idea in one viewVISUAL GUIDE
SAME BUSINESS, LESS MANUAL WORKBEFORE / BUILT

Ecommerce returns: from manual checks to a clear record

BEFORE

Before: staff join the dots

Staff match the shirt and belt to the order by hand.
They ask the warehouse what arrived and what can go back on sale.
They check payment records before issuing the right refund.
→
BUILT

Built: each item has an outcome

Record the shirt and belt against their original order lines.
Put the shirt back on sale; keep the damaged belt off sale.
Link the correct refund to the original payment.

1. Decide which system owns each record

Start with one order and follow it through the tools you already use. The store usually holds the original order lines, quantities and amounts paid. The returns app can hold the request, reasons and approval. The warehouse or fulfilment partner should record what actually arrived and what staff decided to do with each unit. The payment provider supplies the outcome of the refund, which the store or returns app should show staff alongside the order.

Your setup may allocate these jobs differently. The key is to give each decision one authoritative record and each action one route. If both the store and the returns app can initiate refunds, decide which will do so. If the warehouse already updates sellable stock in the store, don't let the refund workflow add the same unit again.

2. Follow a two-item parcel through a partial return

Suppose a customer bought a shirt, a belt and a cap in one order. They keep the cap and send back the shirt and belt in one parcel. The shirt passes inspection. The belt arrives damaged and goes into quarantine, but it qualifies for a refund in this example. The return is partial because only two of the three order lines come back, even though both returned items are refunded.

When the customer requests the return

The returns app creates a return ID linked to the store's order ID. It records the original line ID, SKU, requested quantity and reason for each item: one shirt and one belt. Use the order line ID to identify what was bought and at what price. A SKU alone can be ambiguous if the same product appears on two lines at different prices. The cap stays outside the return. Approval and label creation don't change sellable stock or prove a refund has been sent.

When the warehouse opens the parcel

Staff use the return ID to find the expected items, then record the quantities actually received against each line. They mark one shirt as sellable at the receiving location and one belt as quarantined. The inventory system records those as separate movements: one unit returns to sellable stock and one stays out of availability. The store's sellable quantities should reflect the shirt increase only, with no change for the belt or cap.

If staff scan the parcel before opening it, show it as received but not yet inspected. Don't increase sellable stock on that scan. If the parcel contains only the shirt, record one shirt received and zero belts received, then route the discrepancy for review. Don't copy the requested quantities into the received fields.

When the refund is due

Calculate the refund from the eligible lines and quantities, using what the customer actually paid. For illustration, if the shirt was £30 and the belt £20 after discounts, those amounts already include any applicable tax, and there is no shipping adjustment in this example, refund £50 against the original payment. The cap contributes nothing. In your own workflow, use the applicable tax and shipping treatment, account for discounts and previous refunds, and check that the amount doesn't exceed the remaining refundable balance. The belt's quarantine status doesn't reduce the refund.

Record the refund request against the return and original payment. Once the provider responds, store its refund reference, amount and status on the order or linked return record. Staff should see whether the refund is pending, confirmed or failed before they consider issuing one manually. Tell the customer it has been issued only after the provider confirms it; don't promise when it will appear in their account.

Some tools provide controls for these separate decisions. For example, Shopify's refund resource documentation shows separate refund transactions and line-level restocking instructions, including a no-restock option. That doesn't tell you what your returns app actually sends, so check the settings and verify the stock result in your own setup.

WHAT HAPPENS WHEN SOMETHING GOES WRONGBACKUP PLAN

When a return update fails

01 · PROBLEM
Two updates need checking

The refund status is unclear and the stock update fails; treat them as separate issues.

→
02 · FALLBACK
Check before retrying

Check the provider’s record before retrying. Send the stock issue to its owner; do not repeat it.

→
03 · RECOVERED
Record each outcome

Show the confirmed refund status on the order. The owner checks stock and records the result once.

OUTCOME
Refund status checked; stock exception handled without a duplicate movement
Exceptions stay visible

3. Define the timing and what happens when an update fails

Decide what evidence starts the refund and what cases need staff review. Before making warehouse inspection a condition for payment, check the applicable refund obligations and deadlines in the markets you sell to, as well as any earlier commitment in your published policy. If a refund is due before inspection, process it on time and leave the stock decision open. Give staff a due date and a way to handle cases where warehouse data is late.

Keep refund and inventory statuses independent. A confirmed refund with a failed stock update is a stock exception, not a reason to send the money again. Likewise, a successful stock update doesn't mean the customer has been refunded.

  • Repeated scans or messages: Give each intended refund and each stock movement its own stable reference. A retry should reuse that reference so the receiving system can recognise an action it has already applied. Use the provider's duplicate protection where supported, and check prior movements before applying a stock update again.
  • No response after a refund request: Treat the outcome as unknown, not failed. Check the provider record before retrying or issuing a manual refund. The provider may have accepted the request even though your app didn't receive the reply.
  • Missing items, conflicting records or failed updates: Assign an owner to the exception. Give them the return ID, expected and received quantities, warehouse decisions and any payment or stock references. Log manual corrections so the next automated run doesn't repeat them.

4. Test your returns app before deciding what to build

Run the shirt, belt and cap example using test orders and a payment test environment where supported. Stripe's refund guidance, for example, covers partial refunds and recommends trying the process in test mode. Inspect the records in each system rather than relying on a single ‘return complete’ badge.

  • Request: Can the app link both requested items to the correct order lines and quantities while leaving the cap untouched?
  • Receipt and inspection: Can the warehouse record actual quantities and different outcomes for two items in one parcel? Repeat with the belt missing to check that a parcel scan doesn't mark both items as received.
  • Stock: Does exactly one shirt become sellable at the right location, with the belt still unavailable? Does replaying the warehouse update leave those quantities unchanged?
  • Payment: Does the provider show one £50 refund against the original payment in this example? Can staff see its reference and status without opening another system? Check that repeating the refund trigger doesn't send another payment.
  • Recovery: Simulate a delayed refund response and a failed inventory update separately. Can staff see what happened, who needs to act, and which action is safe to retry?

If the current app passes, keep it. If it fails, identify the first missing hand-off. A setting may be enough if the app refunds correctly but restocks automatically. A connector may be enough if the warehouse already records item-level decisions and the store can accept them. If the warehouse sends only a parcel-level status, first establish how staff or the fulfilment partner will record item-level outcomes; an integration can't infer them.

Consider a separate connection when the decisions are already recorded but your tools can't pass them reliably. Use the failed test to scope the automation and integration work: name the event that starts it, the fields that must travel, the record that must change and the person who handles failures. Before rolling out to every return, pilot the workflow on a small set of orders and compare the warehouse movements, store availability and payment records. Expand once staff can resolve exceptions without guessing which updates have already happened.

ZappFlow · practical next step

Find the missing step in your returns workflow

Tell ZappFlow which store, warehouse and payment tools you use, and show us a recent partial return that staff had to reconcile by hand. We can help you decide whether a setting, a connector or a separate integration would fix that hand-off.

Discuss your returns workflow