Marketplace Order Reconciliation: Handling Late Returns

Your order table says one thing about last month's marketplace sales. The settlement report says another. Run the same query next week and both will have moved.
Nothing is broken. A marketplace sale is not final when it is placed. VTEX's order flow documentation describes a cancellation window that "allows the customer to cancel the purchase without the store's approval", and says that once an order is invoiced, "the customer can return items, but no longer change the order." Spryker's marketplace documentation describes the same tail from the platform side: a return period, and only "When that period expires, the marketplace order item gets the Closed state." Settlement then follows on its own cycle. So one sale changes several times after you first record it, and every change is correct.
The fix is in the data model, not in the spreadsheet. Upsert every pull on the channel's own line identifier, so a restatement corrects the row instead of adding one. Keep a dated history beside it, so you can say what you believed on the day you decided. Keep a return to origin and a customer return apart. And reconcile once, in the pipeline, never in each dashboard.
Our post on running a marketplace rather than selling on one explains from the platform side why channel data restates itself. This post is for the other side of the same API: the engineer whose company sells on several marketplaces and has to build ingestion that survives it.
Marketplace order reconciliation: the short answer
Marketplace order reconciliation is the work of keeping your records true after the marketplace changes its mind. A sale is not final when placed: cancellations, returns to origin, customer returns and settlement adjustments all restate it, sometimes weeks later. Upsert each pull on the channel's own line identifier so a restatement corrects the row instead of adding one.
Two details turn that answer into a design.
The order is not the unit. The line is. A customer cancels one item in a basket of three, or returns one size and keeps the other. If your key is the order, the second arrival overwrites a whole order to describe a change to one line of it.
Correct is not the same as current. The current row tells you what is true today. Finance and buying teams often ask a different question: what did we believe on the day we reordered, or cut a price, or paid a supplier? Only a dated history answers that, and the current row destroys the evidence every time it updates.
What does it mean when a marketplace order is reconciled?
A marketplace order is reconciled when three figures agree for each of its lines: what you expected to be paid, what the marketplace's settlement report says it paid after fees and adjustments, and what reached your bank in the deposit that carried that settlement.
That gives you two kinds of matching, and they fail for different reasons. Order to settlement matches each line in your order data to its line in the settlement report. It fails on identifiers. Settlement to bank matches each settlement total to a deposit. It fails on timing and on netting, because a deposit carries many orders minus their fees, refunds and adjustments. M2P Fintech's reconciliation guide names the same three sources, order reports, settlement reports and bank statements, and puts the core difficulty plainly: "These reports often use different formats and identifiers".
Marketplaces publish the adjustments as data in their own right, separate from the sale. Walmart's Recon Report documentation says "The Recon Report API provides data about your settlements, order transactions, commissions, shipping fees, taxes, adjustments, and refund information." That is a marketplace telling you, in its own API, that the order and the money are two streams.
Reconciled is a state with an expiry date. A line that matched on Tuesday can stop matching when a return lands inside the return window. So mark a line as provisionally reconciled until the channel's own terminal state arrives, the equivalent of Spryker's Closed, and only then treat the match as final.
The same problem appears one layer down when you take card payments through two providers, and our post on matching one payment across two settlement files covers the reference design for that case.
Why does the same marketplace order arrive more than once with different numbers?
Because each arrival describes a different moment in the same sale, and the marketplace publishes those moments through different feeds on different schedules.
The order feed reports status changes. The settlement report reports money, later, with commission and fees attached. The returns flow reports a reversal, sometimes before the parcel is back. Eshopbox's payment reconciliation overview records two consequences that catch teams out. "Marketplaces sometimes release payments for older orders long after settling newer ones." And on a customer refund: "This amount is deducted from your next settlement, even if you haven't received the returned package yet."
So the question is never which arrival is right. Each is right about the moment it describes. The question is what your table does when the next one lands. Appending double counts, which the marketplace platform post already covers. Two other failures are less obvious.
A blind overwrite lets old data win. Pulls get re-run. A job fails, someone re-triggers last Tuesday's window, and Tuesday's view of an order overwrites Friday's. The row now says delivered when the item was returned. Every upsert needs a guard that refuses to replace newer state with older state.
Delete and reload loses the past. Reloading the window each night gets the totals right and throws away what the order looked like last week, which is exactly what you need when someone asks why a reorder was placed on numbers that later shrank.
Choosing the upsert key, and what happens when a channel changes it
Use a composite key made of the channel, your seller account on that channel, the channel's order identifier and the channel's line identifier. Each part is there because a real collision forces it.
Channel, because two marketplaces can issue identifiers that look alike, and nothing stops them colliding in your table.
Seller account, because one company often holds more than one account on the same marketplace, by brand or by region, and the order numbers are only unique inside an account.
Line identifier, because cancellations and returns act on lines. Some channels and aggregators carry a separate sub-order identifier for this, next to the order number.
If you sell through an aggregator, store both identifiers. The aggregator has its own order id and the marketplace has its own. Key on whichever one the marketplace's settlement report carries, because the settlement report is the file you will match against, and keep the other as an attribute.
Identifiers change, and your match rate is how you find out. A channel moves to a new API version with a new id format, or a line splits in two when an order ships in two parcels. Neither arrives as an announcement. It arrives as settlement lines that suddenly match nothing.
The defence is an alias table. Give every line your own surrogate key, map each external identifier you have ever seen for it onto that key, and never rewrite an identifier already stored in history. When a split or a new format appears, you add a mapping. You do not migrate the past. Watch the share of settlement lines that fail to match, per channel, per day, because a jump in it is how an identifier change shows itself.
The product side matters here too. You cannot reconcile a line whose item you cannot identify, which is why modelling variants and SKUs properly comes before any of this.
The snapshot date: what you believed on the day you decided
A snapshot date is the date of the pull that observed a state. It is not the date the channel says something happened. Keep both, because they answer different questions: the event date tells you what happened in October, and the snapshot date tells you what you believed about October on 3 November.
When we built Stylebank's multi-tenant apparel platform, the case study records the rule in one line: "Pulls upsert on the channel's identifier and carry a snapshot date, so you can answer what you believed on the day you decided." Here is a minimal sketch of the pattern, written for this post rather than lifted from that build. It runs on PostgreSQL and on SQLite 3.24 or later; MySQL uses ON DUPLICATE KEY UPDATE, so rewrite the older-pull guard for it rather than copying it across.
-- Current state: one row per line, latest known truth.
CREATE TABLE order_line (
channel TEXT NOT NULL,
seller_account TEXT NOT NULL,
channel_order_id TEXT NOT NULL,
channel_line_id TEXT NOT NULL,
status TEXT NOT NULL,
quantity INTEGER NOT NULL,
net_amount NUMERIC NOT NULL,
snapshot_date DATE NOT NULL,
PRIMARY KEY (channel, seller_account, channel_order_id, channel_line_id)
);
-- order_line_history has the same columns, with snapshot_date
-- added to the primary key: one row per line per snapshot day.
-- Upsert from a pull. The WHERE clause stops a re-run of an old pull
-- from overwriting newer state.
INSERT INTO order_line
(channel, seller_account, channel_order_id, channel_line_id,
status, quantity, net_amount, snapshot_date)
VALUES (:channel, :account, :order_id, :line_id,
:status, :quantity, :net_amount, :snapshot_date)
ON CONFLICT (channel, seller_account, channel_order_id, channel_line_id)
DO UPDATE SET
status = excluded.status,
quantity = excluded.quantity,
net_amount = excluded.net_amount,
snapshot_date = excluded.snapshot_date
WHERE excluded.snapshot_date >= order_line.snapshot_date;
-- What did we believe on :as_of?
SELECT h.channel_order_id, h.channel_line_id, h.status, h.net_amount
FROM order_line_history h
WHERE h.snapshot_date = (
SELECT MAX(h2.snapshot_date)
FROM order_line_history h2
WHERE h2.channel = h.channel
AND h2.seller_account = h.seller_account
AND h2.channel_order_id = h.channel_order_id
AND h2.channel_line_id = h.channel_line_id
AND h2.snapshot_date <= :as_of
);
The history insert uses the same ON CONFLICT shape on its five column key, so a pull run twice in a day leaves one row. We tested the sequence on SQLite: placed, re-pulled the same day, delivered, returned, then an old pull re-run late. The current table ended on returned, the history held three rows, and the as-of query gave each state for its date. The guard is only as fine as the snapshot: two pulls on the same day tie on the date, so record a pull timestamp as well if you re-run within a day.
Plan the history table's growth on day one. Stylebank's case study is candid about the cost of not doing so: a style history table that should have been append only and partitioned from the start grew inside the operational database instead, so that "a schema change is now a scheduling exercise rather than a migration." Write a history row only when a value changes, partition by snapshot month, and move the long tail out to your reporting warehouse. Once that table is large, every change to it becomes a zero downtime migration problem.
A return to origin and a customer return need different rows, not different labels
A return to origin is a parcel that never reached the customer and came back. A customer return is a parcel that was delivered, accepted, and then sent back. Both reduce the same sales figure, but they reverse different things, so they need different effects in the model and not just different status values.
This distinction is not ours. The Stylebank case study records it in one line: "a return to origin is not a customer return, although both reduce the same figure." Cancellations need the same care around one boundary, invoicing, which is where VTEX draws its rule that a retailer can cancel only before an order is invoiced.
What changes in the model:
Question | Return to origin | Customer return |
|---|---|---|
Did the customer receive it? | No | Yes |
What is reversed? | A sale that never completed | A completed sale |
How does it show in the money? | As a reverse shipping charge | As a refund that can be deducted before the parcel is back |
What comes back to the warehouse? | Stock that never left the delivery network | Stock in unknown condition until inspected |
A return to origin reverses the sale line. The status moves to a terminal not-delivered state and the line's net amount drops out of sales. Revenue was never earned.
A customer return is a second record linked to the line. It carries its own refund amount, its own dates and its own state, because the money and the parcel move separately. Eshopbox's note that the refund can come out of the next settlement before the package arrives means you need a state for refunded but not yet received. Without it, finance sees a refund with no matching stock and the warehouse sees stock with no matching refund.
What happens after inspection, the grades and dispositions, is a returns data model of its own and outside this post. For the physical side, where parcels and data arrive in either order, see our notes on warehouse operations.
Should you ingest marketplace orders with webhooks or scheduled pulls?
Use scheduled, re-runnable pulls as the backbone, and add webhooks only where a channel offers a dependable event stream and freshness matters more than completeness.
That is the decision recorded for Stylebank, which reaches five marketplaces through one aggregator. Webhooks and streaming from each upstream system were rejected for a stated reason: several sources publish on their own batch schedule with no usable event stream, and "a re-runnable pull recovers more cheaply than a missed event." The case study records the cost that came with it too: "Data is only as fresh as its cron window", and around 35 scheduled jobs need watching.

The reasoning generalises. A missed webhook is silent, and the order it described stays wrong until something else touches it. A failed pull is visible, and re-running it is safe because the upsert is idempotent. Make every pull overlap the previous window by a margin, so a late restatement is caught on the next run rather than falling into a gap.
Stock is the exception. Overselling costs you on the day, so stock levels earn a faster path. Even there, pair the event stream with a periodic full pull that corrects whatever the events missed, which is the approach in our post on keeping stock in agreement across channels.
Reconciliation belongs in the pipeline, never in the dashboard
Reconcile once, in the pipeline that loads your reporting store, and let every dashboard read the reconciled result. If each dashboard does its own matching, you will have as many versions of net sales as you have dashboards.
The Stylebank case study puts the rule in one sentence: "The system that owns the event owns the number, and reconciliation belongs in the pipeline, never in each dashboard." It also records why this gets harder once you add an analytics warehouse beside the operational database: there are now two places a number could be computed, so the definitions have to be pinned in the pipeline.
The practical tool is an ownership map. Adapted from the one in that case study for a seller on several marketplaces:
System | Owns | Do not ask it for | How the data arrives |
|---|---|---|---|
Marketplace order feed | Line status, cancellations, returns | What was paid | Continuous pulls, restates for weeks |
Marketplace settlement report | What was paid per line, fees, commission, adjustments | Current order status | On the marketplace's own settlement cycle |
Warehouse system | What physically came back, and its condition | What the customer was refunded | When the parcel is received |
Accounting system | Invoices and credit notes | Physical stock | When a document is created |
Reporting warehouse | Reconciled history everyone reports off | Anything live | Whenever the pipeline last ran |
Read across a row and the arguments stop. The order feed is right about status and wrong about money, the settlement report is the reverse, and the reconciled history is the only place they meet.
It is also one reason custom dashboards go unused. A dashboard whose net sales disagree with finance's stops being trusted, and when each dashboard carries its own matching logic, that disagreement is built in from the first day.
A reconciliation run in five steps
A reconciliation run that holds up has five steps, in this order.
- Pull every source for the window, overlapping the last run. Orders, settlement reports and returns, each with that day's snapshot date.
- Upsert current state and write history. Key on the line, guard against older pulls, and write a history row only where a value changed.
- Match order lines to settlement lines. Join on the identifier the settlement report carries, through your alias table. M2P's guide makes the same point about the method: match each individual order to its entry in the settlement report using a unique identifier.
- Match settlement totals to bank deposits. Sum each settlement's lines, net of fees, refunds and adjustments, and match the total to a deposit.
- Classify every difference as timing or variance, and age it. A line not yet settled is timing, and Eshopbox's note about older orders settling after newer ones says timing gaps are normal. A line settled at the wrong amount is a variance. Only variances go to finance, and anything still unmatched after the channel's settlement cycle has passed gets promoted from timing to variance.
Step 5 is where the effort pays back. Without it, finance gets every unmatched line every day, learns to ignore the list, and misses the real short payment inside it.
Buying a reconciliation tool instead of building
Buy a reconciliation tool when the problem you have is money the marketplace kept, and build the ingestion when the problem is that channel data has to sit beside your own data.
The case for buying is real. Recovering money kept through fee errors, wrong deductions and short settlements is what these tools are built for, and if that is your whole problem a tool will get you there faster than a build.
The case for building is about joins. Stylebank integrates 15 external systems. Its marketplace orders had to land beside production output and cost per unit from a factory ERP, BOM and fabric valuation from a materials ERP, and invoices from the accounting system, and the case study records that nobody asked for a new system of record, only for one place where those sources reconcile daily. No reconciliation tool owns that join. In apparel the join reaches back to what a garment ERP runs on the factory floor and to the product record apparel PLM holds. If your reporting needs channel sales next to your own production, cost or replenishment data, you are building ingestion whether or not you also buy a tool, and the same build or buy arithmetic as a custom ERP applies.
Ask any tool how it models a restatement. Of the two reconciliation pages we cite here, read on 2026-11-30, Eshopbox's and M2P Fintech's, neither uses the words upsert, idempotent, snapshot date or restate. Eshopbox describes the restatement problem well, and both treat reconciliation as an accounting exercise rather than an ingestion design problem. That is not a flaw in the tools. It means the questions are yours to ask: does a late return correct the row or add one, can it show you yesterday's view of last month, does it keep a return to origin apart from a customer return, and can you export reconciled lines into your own warehouse?
If the answers are yes, buy it and spend your engineering time elsewhere. If they are not, the numbers in your database will keep disagreeing with the marketplace, and no amount of finance effort downstream will fix a key that was chosen wrong at the first pull.
Frequently asked questions
Marketplace order reconciliation is the work of keeping your own order and sales records true after a marketplace changes them. A marketplace sale is not final when it is placed: cancellations, returns to origin, customer returns and settlement adjustments all restate it, sometimes weeks later. Reconciliation has two parts. The first matches each order line to its line in the marketplace's settlement report. The second matches each settlement total to the bank deposit that carried it. Doing it reliably depends on upserting every pull on the channel's own line identifier, so a restatement corrects a row rather than adding a new one.
Because the order feed and the settlement report describe different moments in the same sale and are published on different schedules. The settlement arrives later, with commission, fees, refunds and adjustments applied, and Eshopbox's reconciliation documentation notes that marketplaces sometimes release payments for older orders long after settling newer ones. A refund can also be deducted from the next settlement before the returned parcel reaches you. Most mismatches are timing, not error. Classify each difference as timing or variance, age it against the channel's settlement cycle, and send only real variances to finance.
RTO, return to origin, is a parcel that never reached the customer and came back to the seller, so the sale never completed. A customer return is a parcel that was delivered and then sent back, so a completed sale is reversed. Both reduce the same sales figure, but they need different handling in your data model. An RTO reverses the sale line itself. A customer return is a separate record linked to the line, with its own refund amount and dates, because the refund can be deducted before the parcel arrives.
Use scheduled pulls as the backbone and add webhooks only where a channel offers a dependable event stream and you need the speed. A missed webhook fails silently, and the order it described stays wrong. A failed pull can be seen and re-run safely if the load is an idempotent upsert. Make each pull overlap the previous window so late restatements are caught. The accepted cost is freshness: data is only as current as the last scheduled run, and the jobs need a status page that records every run. Stock levels are the common exception, where an event stream plus a periodic full pull works better.
A composite of the channel, your seller account on that channel, the channel's order identifier and the channel's line identifier. The channel and account stop identifiers from different marketplaces or accounts colliding. The line identifier matters because cancellations and returns act on individual lines, not whole orders. If you sell through an aggregator, store both its id and the marketplace's, and key on whichever one the marketplace's settlement report carries. Keep an alias table that maps every external identifier you have seen to your own surrogate key, so a split shipment or an id format change adds a mapping rather than rewriting history.
A snapshot date is the date of the data pull that observed a record's state, as distinct from the event date the channel reports. Storing it in a history table, one row per line per snapshot day, lets you answer what you believed about a period on any given date, not only what is true now. That matters when someone asks why a reorder or price change was made on figures that later shrank. Guard the current-state upsert so an older snapshot can never overwrite a newer one, and write history rows only when a value changes so the table does not outgrow your database.
Buy a tool if your problem is recovering money the marketplace kept through wrong fees, deductions or short settlements, and you do not need channel data joined to your own systems. Build the ingestion if your reporting needs marketplace sales beside production, cost or replenishment data, because no reconciliation tool owns that join. Either way, ask how a tool handles a late return: whether it corrects the row or adds one, and whether it can show you yesterday's view of last month.

Vikas Choudhary
Vikas has around fifteen years of experience building software and now builds generative AI systems at Zyneto. His work covers retrieval augmented generation, agentic AI, knowledge graphs, AI memory, and the evaluation and guardrails that decide whether any of it is safe to put in front of customers. He has shipped enterprise copilots, document AI, chatbots and predictive analytics for e-commerce, fintech and marketing teams, and works day to day in Python, JavaScript and SQL. He follows multimodal models, business process automation and enterprise AI security closely, and mentors engineers moving into AI. He writes about architecture, inference cost and the failure modes that only show up at production scale.
Zyneto builds custom software, AI and automation
Tell us what you are building and we will reply with a clear next step.









