Merchants
Pricing
Sign in Get Verified

Orders

Retrieve return window

Return the remaining return window for an order, per line, as computed at delivery.

Preview. The WeRefund API is not live yet. Endpoints, fields and examples on this page may change before launch; the values shown are illustrative.
GET https://api.werefund.com/v1/orders/{order_id}/window

The window is computed once, at delivery, and stored. This endpoint reads that stored value — it never recomputes it. An order placed under version 3 of a store's policy keeps those terms for its whole life, even after the store publishes version 4.

Authorization

Authorizationstring Required

A secret API key passed with the Bearer scheme: Authorization: Bearer wr_live_…. Keys are scoped to one tenant and can be restricted to read-only.

Path & query

order_idstring Required

Your own order reference, exactly as supplied when the order was registered. Case sensitive.

include_linesboolean Optional

Return the per-line breakdown as well as the order-level window. Defaults to true. Set it to false on high-volume polling to reduce the payload.

Response fields

days_leftinteger Required

Whole days remaining before the window closes. 0 on the final day; -1 is never returned — a closed window reports state: "closed".

eligible_untilstring (RFC 3339) Required

The return deadline, in UTC. This value never changes once written.

policy_version_idstring Required

The version of the merchant's return policy in force when the order was placed.

Request
curl --request GET \
  --url https://api.werefund.com/v1/orders/A-40917/window \
  --header "Authorization: Bearer wr_live_8f2a…" \
  --header "Accept: application/json"
{
  "order_id": "A-40917",
  "state": "open",
  "days_left": 21,
  "eligible_until": "2026-04-06T23:59:59Z",
  "delivered_at": "2026-03-07T09:14:02Z",
  "policy_version_id": "pv_8842_4",
  "certificate_id": "WR-8842",
  "lines": [
    { "sku": "LMP-CER-01", "returnable": true, "days_left": 21 }
  ]
}

Banners

One script tag renders any of the eight formats and keeps itself current, from the store's public profile.

  • data-store — your store handle, the one on your WeRefund profile.
  • data-format — lockup · inline · card · strip · badge · product · tile · numbers.
  • data-theme — light or dark. Defaults to light.
  • data-size — s · m · l. Defaults to m.
  • While verification is unavailable, the banner renders nothing rather than a stale figure.
4.7 WeRefund
WeRefund Verified
<script src="https://js.werefund.com/badge.js" data-store="your-store" data-format="lockup" async></script>

See the eight formats