Returns Management Data Model: Tables and Statuses

Your store takes orders, ships them and gets paid. Now somebody has asked for returns, and the first sketch on the whiteboard is an order with a minus sign in front of it.
That sketch fails on the first real return. A returns management data model needs four things an order model does not have. A link from each returned unit to the exact order line it came from, because a customer sends back 2 of 5 items and you have to price those 2. A record of what the warehouse found when it opened the box, kept apart from what the customer said was wrong. A disposition, meaning the decision about where the unit goes next, with a reason attached. And a date on which you believed each of those things, because the same return can be restated by a sales channel weeks later.
Money is a separate table. An exchange produces no refund, and neither does a rejected return.
Everything else in this post hangs off those four. The order model assumes a transaction moves one way and finishes. A return moves goods and money on different clocks.
What is a returns management data model?
A returns management data model is the set of tables that records a return as its own object: an authorisation linked to the original order lines, a returned unit with an inspection grade, a disposition decision, and the dates each was known. Refund money sits in a separate table, because exchanges and rejected returns produce none.
There is an established enterprise shape to start from. HCL's documentation for WebSphere Commerce version 8, in its order management receipt and disposition data model, read 2026-11-30, lists twelve tables and names RMAITEM, the returned item, as the "Main table of this data model." Around it sit RMA, the authorisation; RTNREASON for reasons; RTNDSPCODE for disposition codes; RTNRECEIPT for receipts; and RTNRCPTDSP, which the page says describes how a returned item has been disposed. That page describes a diagram, so it gives tables, relationships and a one line description of each, and no columns. It is also an older platform. Read it as a proven shape, not as current practice.
The useful lesson from that list is where the weight sits. The main table is the returned item, not the return. HCL describes the RMA table itself as a container for return merchandise authorisations, and almost every decision in the process is made one unit at a time.
There is also a full published schema. A low level design for a returns and refunds service on techinterview.org, with a modified date of 30 June 2026 in its page metadata and read 2026-11-30, gives CREATE TABLE statements for return requests, return items, refunds, an append only refund ledger and fraud signals. It is an interview preparation design, not a vendor product or a standard, and the most complete schema we found, so this post builds on it and, in two places, argues with it.
Why does a return need its own tables instead of a status on the order?
Because a return can cover part of an order, can happen more than once against the same order, and has a lifecycle the order never had. A status column on the order can say "returned". It cannot say which 2 of 5 lines came back, in what condition, or what happened to them.
The techinterview design states the second point in a comment on its return requests table: "a customer may return multiple times per order". One order, three returns, each with its own label and outcome. An order status holds one at a time.
The line link is the column everything else depends on. Each return item carries the identifier of the order line it reverses. That one foreign key does several jobs. It prices the return, because the refundable amount is what that line actually cost after discounts, not today's list price. It stops a customer returning more units than were bought. And it lets the system find the payment to reverse. Lose it and every return becomes a support ticket.
That is why order history migration matters more than it looks. When a store moves platform and its old orders arrive as flat records, with no ability to return or refund against them, every return on an old order loses its line link on day one.
Bundles make the link harder. A customer who returns a gift set with one item missing has returned part of a line, and somebody has to decide whether to break the bundle into its components. That post covers the decision in full. For the returns model, the rule is simple: the return item points at the order line, and a separate component row records which physical units actually arrived. HCL's model has a table for the same idea, RMAITEMCMP, which its page describes as the smallest unit of inventory involved in an RMA.
What is an RMA, and what should the authorisation table hold?
An RMA, short for return merchandise authorisation, is the record that says a return is expected: who is sending what, against which order lines, and under which policy. RMA software is the system that issues those authorisations, prints the label and tracks the parcel back. In the data model, the RMA is the header, and the returned items hang beneath it.
The techinterview schema gives the RMA number a UNIQUE constraint and stores the label URL, a fraud score and timestamps for requested, authorised, received and closed. That is a sound header. Two changes make it survive real warehouses.
First, let a receipt exist without an RMA. Parcels arrive with no paperwork, with a reference that matches nothing, or with three orders packed into one box. Our warehouse management system post makes the point that a system requiring a valid authorisation before accepting anything simply pushes the mess onto a desk. So model the receipt as its own row, created when the parcel is scanned, and match it to an RMA afterwards. HCL's page describes RTNRECEIPT as the receipt record for a returned item from an RMA, and gives no columns, so it does not say whether a receipt can exist before its RMA. Yours should allow it.
Second, store the policy version on the RMA. The return window, the restocking rule and whether shipping is refunded all change over time. The return should carry the policy it was authorised under, so a dispute in March is judged by the rules that applied in January.
Reason codes and inspection grades are two different facts
The reason code is what the customer said. The inspection grade is what the warehouse found. They are recorded at different times by different people, and the model should never let one overwrite the other.
In the techinterview schema, reason_code sits on the return request, the header, while condition_code sits on each return item and takes one of four values: new, like_new, damaged and unsellable. Two consequences follow, and both are worth fixing in your own design.
Put the reason on the line, not the header. A customer returning a dress and a pair of shoes may have two different reasons. A size problem on the dress is a fit return; a broken heel on the shoes is a quality return. A header level reason forces one answer for both, and the data you would use to find a sizing problem in one style is gone.
That matters most in apparel, where a fit return is often an exchange in disguise. Our ecommerce app development cost post covers why an exchange is a different transaction from a refund.
Keep the disagreement, because it is a signal. The same design names "Damage inconsistency: customer claims damage but inspection finds item in new condition" as a fraud pattern. You can only detect that if both facts survive in separate columns. A model that updates the reason after inspection destroys the evidence.
So the returned unit carries the order line, the quantity, the customer's reason, the inspection grade, who graded it and when.
What should be done with the products that have been returned?
Each returned unit needs a disposition: a recorded decision that sends it to one destination, such as back to sellable stock, to quarantine, to repair, to a liquidator or to disposal. The disposition is a decision with a reason, so store it as a row, not as a status.
That heading is borrowed. Oracle Retail Science Cloud Services describes its returns logistics outputs as answering the question "What should be done with the products that have been returned?" in its returns logistics implementation guide, read 2026-11-30. Oracle treats it as an optimisation problem. Most teams start with a rule.
The techinterview design gives one such rule as a decision table. New and like new units go back to stock at the full returned quantity, like new with a possible discount. Damaged units are restocked at zero, quarantined, with a vendor claim filed. Unsellable units are restocked at zero and disposed of or liquidated. That is one author's design, and the right table for your business depends on what you sell: a clothing retailer regrades and resells, an electronics business tests and refurbishes, a food business destroys.
What we would add is the record of the decision itself. A disposition row with the unit, the grade it was based on, the destination, the rule or person that chose it, the rule version and the time. HCL's model points the same way: disposition codes live in their own table, RTNDSPCODE, with descriptions in RTNDSPDESC, and RTNRCPTDSP links a receipt to a disposition rather than writing a code onto the receipt.
The reason is practical. Suppose finance asks, six weeks later, why a batch of one jacket went to a liquidator. With a status column, the answer is that the status says liquidated. With a disposition row, the answer is that inspection graded them damaged on a given date, a named rule version sent damaged outerwear to liquidation, and a named supervisor confirmed it.

In transit and quarantine are stock states, and somebody has to own them
A returned unit spends days in states that are neither sellable nor gone: in transit back to you, received but not yet inspected, and quarantined after inspection. Model each as an explicit stock state with an owner, or your inventory count will be wrong in ways nobody can trace.
Our post on omnichannel inventory sync lists units sitting on a returns pallet among the in flight stock with no owner, and makes the point that states you have not modelled become states your count gets wrong. A returns model is where those states get modelled.
The practical shape is a stock movement per state change. When the RMA is authorised, nothing moves. When the parcel is scanned, the units enter a received location that is not available to sell. When inspection grades them, the disposition moves them on: to sellable stock, to a quarantine location, or out of inventory. Each move is a row with a reason pointing back at the disposition. Available to promise never includes the received or quarantine locations.
If the return increments sellable stock on arrival rather than on inspection, every damaged unit is briefly for sale, and the available to promise figure your channels read is wrong. Our warehouse returns phase discussion covers the physical side: the grading step and a holding area that is not the main inventory.
Exchanges add one more state. An exchange that holds the replacement size when the return is raised has reserved stock against a parcel that may never be posted. That hold needs an expiry, which our post on exchanges and phantom stock describes.
Refunds belong in a separate table, and one per return is too few
Refund money belongs in its own table, linked to the return, because a return can produce no refund at all. But a single refund per return is a constraint that breaks as soon as money moves on a return more than once.
The techinterview design gives the first half plainly. It separates the refund row from the return request because "a return can exist without a refund (e.g., exchange-only returns, rejected returns)". That is right, and it keeps NULL refund columns out of the return table.
The second half is where we disagree with it. Its refunds table puts a UNIQUE constraint on return_id, with the comment "one refund record per return". The design uses that constraint to prevent double refunds. For a single store with one payment, it works. It fails in three ordinary situations:
Situation | What happens to the money | Refund rows needed |
|---|---|---|
Partial refund now, goodwill top up later | Two separate movements | 2 |
Store credit for part, original payment for the rest | Two methods, two movements | 2 |
A channel issues its own adjustment weeks later | A second movement you did not start | 2 or more |
Preventing a double refund is the job of an idempotency key on the payment call, not of a uniqueness rule on the return. The same design already uses one at the gateway. Drop the UNIQUE constraint and let a return own many refund rows, each with its own key and reason.
How the refund itself moves money, including partial refunds, retries and webhooks, is covered in our post on payment gateway integration and partial refunds.
One detail on that same design deserves keeping. When inspection finds a unit unsellable after the refund has already gone out, it does not claw the money back. It appends a vendor claim or write off entry to the ledger. That is the right instinct: the refund and the grade are different facts with different times, and the later fact should add a row, not rewrite the earlier one.
A sales channel restates the same return weeks later
When you sell through marketplaces, the return arrives twice. Once as a physical parcel, and again in the channel's data, sometimes weeks later and under a different name. A returns model that only listens to the parcel will disagree with the channel, and one that appends every channel update will count the same return more than once.
We hit this building Stylebank, a platform serving four apparel businesses, where we built returns reconciliation with package sync and a warehouse dashboard. The case study records the channel feed as "Continuous pull, returns restate for weeks", and records the vocabulary problem in one sentence: "a return to origin is not a customer return, although both reduce the same figure."
A return to origin is a parcel that never reached the customer and came back to the seller. A customer return is goods that were delivered, kept for a while and sent back. Our post on marketplace data that restates itself uses the same distinction to explain why an appended feed double counts. For the returns model, it decides the goods. A parcel that was never delivered may not need the same inspection as one a customer has opened, and it should never count in a customer return rate. So the channel's own return type belongs on the row, mapped to yours, with the original string kept.
The fix is an upsert with a date on it. The case study states the rule: "Pulls upsert on the channel's identifier and carry a snapshot date, so you can answer what you believed on the day you decided." In the returns model, that means a channel return event table keyed on the channel's own return identifier, updated in place when the channel restates it, with a snapshot date on every version you keep. Your internal return and the channel's return are then two records linked to the same returned unit, and a mismatch between them is a report, not a mystery.
Settlement against those restated returns, including refunds when one basket has several sellers, is its own problem and out of scope here.
None of the four pages we read names these mechanics. We re-read the HCL data model, the techinterview design, the Oracle guide and Shopify's returns management guide on 2026-11-30. None of the four uses the words settlement, snapshot, upsert or credit note anywhere in its raw HTML, measured on the full document rather than on rendered text, and all four carry more than 2 per cent readable text.
-- A sketch. Columns trimmed to the ones that matter.
CREATE TABLE return_authorisation (
rma_id BIGINT PRIMARY KEY,
rma_number VARCHAR(64) UNIQUE,
status VARCHAR(16) NOT NULL, -- requested, authorised, received, inspected, closed
order_id BIGINT NOT NULL,
policy_version INT NOT NULL,
authorised_at TIMESTAMP
);
CREATE TABLE return_receipt ( -- may exist before it is matched
receipt_id BIGINT PRIMARY KEY,
rma_id BIGINT NULL REFERENCES return_authorisation,
scanned_at TIMESTAMP NOT NULL
);
CREATE TABLE returned_item (
item_id BIGINT PRIMARY KEY,
rma_id BIGINT REFERENCES return_authorisation,
receipt_id BIGINT REFERENCES return_receipt,
order_line_id BIGINT NOT NULL,
qty INT NOT NULL,
customer_reason VARCHAR(32) NOT NULL, -- what the customer said
inspection_grade VARCHAR(32), -- what the warehouse found
graded_by BIGINT,
graded_at TIMESTAMP
);
CREATE TABLE disposition (
disposition_id BIGINT PRIMARY KEY,
item_id BIGINT NOT NULL REFERENCES returned_item,
destination VARCHAR(32) NOT NULL, -- restock, quarantine, repair, liquidate, dispose
rule_version INT,
decided_by BIGINT,
decided_at TIMESTAMP NOT NULL
);
CREATE TABLE refund ( -- many per return, no UNIQUE on rma_id
refund_id BIGINT PRIMARY KEY,
rma_id BIGINT NOT NULL REFERENCES return_authorisation,
amount_minor BIGINT NOT NULL,
idempotency_key VARCHAR(64) UNIQUE NOT NULL
);
CREATE TABLE channel_return_event (
channel VARCHAR(32) NOT NULL,
channel_return_id VARCHAR(64) NOT NULL,
channel_return_type VARCHAR(64) NOT NULL, -- kept as the channel wrote it
item_id BIGINT REFERENCES returned_item,
snapshot_date DATE NOT NULL,
PRIMARY KEY (channel, channel_return_id, snapshot_date)
);
Reverse logistics data model: what the supply chain side reads
A reverse logistics data model is the same set of facts read from the other end. The returns model records each return as it happens. Reverse logistics reads those records in bulk, by item, location and week, to decide where returned goods should physically go next.
Shopify's ecommerce returns management guide, read 2026-11-30, draws the line between the two clearly. Returns management handles the customer facing and administrative steps, while "Reverse logistics deals with the physical movement and supply chain coordination of moving goods backward."
Oracle's guide shows what the reading side expects. Its returns logistics process "runs weekly as a batch process for products in the top x selling categories, where x is a database configuration parameter stored in the RSE_CONFIG table", and recommends where to ship returned products from, where to ship them to, and in what quantities. Its input table lists the source for Sales and the source for Returns as the same fact table, W_RTL_SLS_IT_LC_WK_A.
Our reading: in that design, a return is a sales fact with a direction, at item, location and week. So the transactional model must emit returns at that grain: which item, which location holds it, and which week it became stock again. If disposition rows record the destination and the date, that is a simple query. If disposition is a status on a header, it is a project.
Can a customer return goods after 28 days?
Whether a customer can return goods after 28 days depends on the merchant's return policy and on the consumer law where the sale happened, which is exactly why the return window belongs in data rather than in code. For the engineer, the question becomes: which window applied to this order, and can the system prove it?
Store the window on a versioned policy record, and copy the policy version onto every RMA when it is authorised. Then a request on day 29 is checked against the window that applied when the goods were bought, not against whatever the window is today. Keep the delivery date on the order line too, since a window may count from delivery rather than from the order date.
Allow an override, and record it: the same RMA as any other, with a flag, a reason and the agent's name. Exceptions made off the system are the ones that break reconciliation later.
The order model was built for a transaction that moves forward and finishes. A return is the same goods coming back on a different clock, graded by a different person, sometimes restated by a channel that keeps its own records. Build the returned unit as the centre of the model, keep every fact with the date you learned it, and the rest of the returns process has something solid to stand on.
Frequently asked questions
Returns management is the process a business uses to handle goods a customer sends back, from approving the request and issuing a label to receiving the parcel, inspecting it, deciding where the item goes and refunding or exchanging. Shopify's returns management guide, read on 2026-11-30, splits it from reverse logistics: returns management covers the customer facing and administrative steps, and reverse logistics covers the physical movement of goods back through the supply chain. In software terms, returns management is the transactional record of each return.
An RMA, a return merchandise authorisation, is the record that says a return is expected. It names the customer, the order, the specific order lines and quantities being returned, the policy the return was authorised under, and usually a return label. In a data model it is the header table, with one row per returned item beneath it. HCL's WebSphere Commerce data model, read on 2026-11-30, names the RMA table alongside RMAITEM, the returned item, which it describes as the main table of the model.
Because a return can cover part of an order, can happen more than once on the same order, and has its own lifecycle of authorisation, receipt, inspection and disposition. A status on the order can only say that something was returned. Separate tables can say which order lines came back, in what condition, what happened to each unit, and how much money moved. The link from each returned item to its original order line is what lets you price the return correctly.
A reason code is what the customer says is wrong, captured when the return is requested. An inspection grade is what the warehouse finds when the parcel is opened, such as new, like new, damaged or unsellable. They are recorded by different people at different times and should be stored in separate columns on each returned item. When they disagree, for example a customer claims damage and inspection finds the item in new condition, the disagreement is itself a useful fraud signal.
Disposition is the decision about where a returned unit goes next: back to sellable stock, to quarantine, to repair, to a liquidator or to disposal. It is usually based on the inspection grade and a business rule that varies by product type. Storing disposition as its own row, with the grade it was based on, the rule or person that decided, and the time, lets you answer later why a unit ended up where it did, which a single status column cannot.
No. A return can produce no refund, as with an exchange or a rejected return, and it can produce more than one, as with a partial refund followed by a goodwill top up, a split between store credit and the original payment, or a later adjustment from a sales channel. Put refunds in their own table with many rows allowed per return, and prevent double refunds with an idempotency key on each payment call rather than with a uniqueness rule on the return.
Treat the channel's version of a return as its own record, keyed on the channel's own return identifier, and update it in place when the channel restates it rather than adding a new row. Carry a snapshot date on each version you keep, so you can see what you believed on the day you made a decision. Keep the channel's own return type as written, because a return to origin and a customer return mean different things for the goods even though both reduce the same sales figure.

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.









