Create return
Create a return for a completed order. Whole-order returns only — the order’s line items are enumerated for you. The return is submitted for approval and then progresses asynchronously toward the refund; poll the returned return id (or listen for webhooks) to follow its state.
Authorizations
Rye API key
Body
Request body for POST /api/v1/returns. Whole-order returns only —
server enumerates the order's line items at create time.
Response
Created
A single Return record. The state discriminator tells you which of
denial, failure, and refunds is populated; nextAction is set once the
Return is approved (see {@link NextActionResponse}).
When the Return record was last updated.
When the Return record was created.
Per-transition timestamps; later stamps fill in as the Return advances.
Reason the return was requested, echoed back from the create call.
defective, wrong_item, unwanted, color, not_as_described, size_too_large, size_too_small, style, other Rye checkout intent id that produced the order being returned.
Rye order id (order_<32 hex>) this Return was opened against.
Lifecycle state; the discriminator for the optional sub-objects below.
requested, requires_action, processing, refunded, denied, failed Rye return id (ret_<32 hex>).
Issued refunds. Present only on refunded.
What went wrong. Present only on failed.
Why the merchant declined the return. Present only on denied.
What the shopper must do next (e.g. ship the items back). Present once the
return is approved — i.e. on requires_action, processing, and
refunded — and may be present on denied / failed if they were
approved before terminating. Absent on requested.

