v41

latestOpenAPI 3.0.0UNLICENSEDraw.githubusercontent.com2026-07-0839165177.6 KB
Test Helpers

Create simulated return

Create a simulated return for an order, then drive it through its lifecycle with the approve/deny/refund/fail helpers below.

post/api/v1/test-helpers/returns

Request body

reason'defective' | 'wrong_item' | 'unwanted' | 'color' | 'not_as_described' | 'size_too_large' | 'size_too_small' | 'style' | 'other'

Reason a shopper is returning an order, supplied on the create-return call: defective (arrived damaged or faulty), wrong_item (not what was ordered), unwanted (changed their mind), color / size_too_large / size_too_small / style (wrong color, size, or style), not_as_described (differs from the listing), and other (anything else).

orderIdstring required

Rye order id (oi_<hex> / order_<hex>) to open the simulated return against.

Response

Created

updatedAtstring date-time required

When the Return record was last updated.

createdAtstring date-time required

When the Return record was created.

reason'defective' | 'wrong_item' | 'unwanted' | 'color' | 'not_as_described' | 'size_too_large' | 'size_too_small' | 'style' | 'other' required

Reason a shopper is returning an order, supplied on the create-return call: defective (arrived damaged or faulty), wrong_item (not what was ordered), unwanted (changed their mind), color / size_too_large / size_too_small / style (wrong color, size, or style), not_as_described (differs from the listing), and other (anything else).

checkoutIntentIdstring required

Rye checkout intent id that produced the order being returned.

orderIdstring required

Rye order id (order_<32 hex>) this Return was opened against.

state'requested' | 'requires_action' | 'processing' | 'refunded' | 'denied' | 'failed' required

Lifecycle state of a Return:

  • requested — submitted to the merchant, awaiting approval.
  • requires_action — approved; the shopper must ship the items back.
  • processing — approved and in flight (items shipped, or no shipping required), awaiting the refund.
  • refunded — terminal; the refund has been issued and reconciled.
  • denied — terminal; the merchant declined the return.
  • failed — terminal; the return could not be completed.
idstring required

Rye return id (ret_<32 hex>).

Example response

{
  "refunds": [
    {
      "shopperRefundTotal": {
        "currencyCode": "USD",
        "amountSubunits": 1500
      }
    }
  ]
}