Return request
A React block (a whole screen) in Beamline's Shop app.
Staff start a return from an order, and edit the reasons customers pick. New return: the order's lines as a checklist, each with its variant, price and units already returned; tick what comes back (a line fully returned says nothing is left), pick how many when more than one is eligible, and why, as chips: a reason from the active ones, then its subreasons (any that apply, or one, as the reason allows); a note opens on demand; units not returned stay eligible, said. The return label reads as a sentence (the service with its price, or none, and where it goes) with Change; who pays it is the one choice beside it (the customer, taken off the refund; or the shop, charged to its account, not free), and the customer's phone is asked for when a collection needs it and the order has none. Beside it the estimated refund as the screen's figure, over units and the label, issued only after approval; missing reasons said. Creating it makes a request awaiting approval, with no refund. Reasons: a list (off ones marked) and an editor for the label customers see, offered or not (turned off hides it from new returns while returns already made keep its wording), subreasons in order (move, remove, add) and one or several to pick; saving keeps a revision; a duplicate label refused.
Use it for
- Staff creating a return or claim from an order, per line with quantities, reasons and a label.
- Editing the reasons customers pick from, with subreasons and history kept.
Not for
- Working an existing return (return-case).
- The returns queue (return-queue).
Anatomy
- header: the tool's mark, Start a return for <order> with the customer, or Return reasons; the view switch
- what comes back: each line ticked or not, its units (a choice of counts when more than one is eligible), reason chips, subreason chips under them, Add a note, what stays eligible
- label: the service, its price and where it goes as a sentence with Change (service and destination menus while changing); who pays with its consequence; the phone when needed
- estimate: the estimated refund, large, refunded after approval; units and the label; Create the return request; made: awaiting approval
- reasons: list with New reason; editor with label, offered, subreasons, several, Save
States
- nothing picked, a line part-returned, a line with nothing left, a reason missing, a service without a price, a phone needed
- customer or shop paying, submitting, refused, made awaiting approval
- a reason on or off, with or without subreasons, one or several, saved, refused
- phone: one column
- right to left: mirrored
- reduced motion: through the tokens
Keyboard
- Tab through each line's units (arrows step), reason and details, the label choices and Create; in Reasons, the list, the fields and the subreasons' move buttons
Motion
Nothing runs at rest.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
order (required) | { id: string; customer: string; email: string; phone: string | null; } | — | |
lines (required) | OrderLine[] | — | |
reasons | ReturnReason[] | — | The reasons (controlled), edited in the Reasons view. |
defaultReasons | ReturnReason[] | — | |
onReasonsChange | ((reasons: ReturnReason[]) => void) | — | |
onSaveReason (required) | (reason: ReturnReason) => Promise<ReturnReason> | — | Saves one reason; resolve with it as saved, reject with why not. |
locations (required) | string[] | — | Where returns can go. |
services (required) | LabelService[] | — | |
currency (required) | string | — | |
onSubmit (required) | (draft: ReturnRequestDraft) => Promise<{ id: string; }> | — | Sends the request; resolve with the new return's id, reject with why nothing was made. |
defaultUnits | Record<string, number> | — | Units to return at first, by line (a request reopened mid-way). |
defaultReasonsPicked | Record<string, { reasonId: string; subreasonIds: string[]; }> | — | |
defaultView | "reasons" | "request" | — | |
product | string | — | |
className | string | — | Classes on the documented visual root; no override by default. |
style | CSSProperties | — | Inline styles on the documented visual root; no overrides by default. |
ref | Ref<HTMLDivElement> | — | Receives the documented native target or imperative handle; omitted by default. |
Built from
- Alert
- Avatar
- Button
- Checkbox
- Chip group
- Input
- Label
- Number field
- Segmented control
- Select
- Spinner
- Switch
- Text morph
- Textarea
- Tooltip
Dependencies
lucide-react
Import
import { ReturnRequest } from "@beamline/return-request";
Get it
Return request is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Get Beamline · Connect your agent
More in Shop
- Product editor: A product being made in a shop's back office, every value read as text at rest. The variant grid, grouped by the first option, lists each combination…
- Category manager: A shop's product categories, nested and ranked. Each category moves up, down or into another from its menu, and every move gets its own receipt (saving…
- Inventory item: One stock item in a shop's back office, apart from the variants that sell it (how many each uses per unit). Stock per location as stocked, reserved and…
- Plan comparison: Plans side by side against every feature: prices that roll between monthly and yearly, the current and recommended plan marked, a header that stays in…
- Step form: The finished frame for any multi-step form you compose — onboarding, intake brief, questionnaire, booking, application: a wide card with progress, the…
- Orders admin: A shop's order desk: today's orders and revenue, quick filters for what needs doing (to fulfil, unpaid, returns), a virtualised orders grid, and the…
- Order detail: One shop order with payment and fulfilment as two separate lanes. The header says where each stands (paid, partly paid, awaiting, refunded; not…
- Order board: A shop's orders as cards in its columns, on the shared kanban with drag and keyboard moves. Each card: number, estimate or work order, customer, vehicle…
- Order composer: An order made inside a support ticket: products found by name, each variant with its stock drawn and said (in stock, none, oversold, not known) and the…
- Draft orders: A draft order made for a customer in a shop's back office that reads like the order it will become. The lines lead: each with its variant and SKU or…
- Order changes: What happens to a shop order after it's placed. Edit: the order as it stands beside the requested version, each line marked new, changed (old → new…
- Special orders: Customers' special orders as demand to buy for, per outlet: To order apart from Ordered; each product's demand, what is reserved, incoming and on order…
- Order history and fills: Every order the account placed and every fill it got, for a period: totals for volume, fees, fill rate and maker share; orders with their status and how…
- Order ledger: Purchase orders as money. Each order's spend is drawn against its approved total (paid, billed, pending, what is left, and any overrun past the end…
- Ticket orders: A customer's orders inside a support ticket, each action's effect said before it's done: orders and drafts kept apart, a paid draft shown once as its…
- Record search: One search across connected records (customers, vehicles, orders) by name, phone, plate, VIN or order number. What the words look like is said (info)…
- Return queue: A queue of return cases. Search by return, order or customer, exactly (the default) or loosely; status tabs with counts, Requires attention first; a date…
- Return case: One return as one place where every act is its own. The return, its order (linked out) and the customer on three cards; the stage said on its tone. Items…
- Purchase orders: A salon's purchase orders, received: the orders down the side, the chosen one beside them. Each line still due reads as a strip of received, this…
- Print quote: A print shop's quoting in three places. Quote: a group of garments that share one imprint and one quantity break, the group's pieces counted together and…
- Service estimate: An estimate for one vehicle. Services added from the catalogue (one not listed for this vehicle said on warning, fit unknown said); each with its lines…
- Job card: A technician's repair order, phone-first. The vehicle, the customer and when it's due in words (due at, due in, overdue by how long); an offline copy…
- Parts tracker: Parts across a shop's work orders: each with its number, the order and vehicle, supplier, quantity and cost (not known said), and where it is: ordered…
- Visit board: The staff board for a walk-in queue: visits move from waiting through called and serving to done today. Arrival (here or on the way), the place in the…