Orders
Retrieve return window
Return the remaining return window for an order, per line, as computed at delivery.
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
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
Your own order reference, exactly as supplied when the order was registered. Case sensitive.
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
Whole days remaining before the window closes. 0 on the final day;
-1 is never returned — a closed window reports state: "closed".
The return deadline, in UTC. This value never changes once written.
The version of the merchant's return policy in force when the order was placed.
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 }
]
}
{
"error": {
"code": "order_not_found",
"message": "No order with that reference on this tenant.",
"hint": "Order references are case sensitive."
}
}
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.