The Policy Behind Every Order, Through an API
Register orders, read the return window computed at delivery and the policy version each order was placed under, list refund events, and receive signed webhooks.
https://api.werefund.com/v1/orders/{order_id}/window
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."
}
}
What the API exposes
Four groups of endpoints, documented one by one in the reference.
Orders
Returns & refunds
Webhooks
Base URL https://api.werefund.com/v1
Full reference
Authorization and parameters
A secret API key passed with the Bearer scheme. Keys are scoped to one tenant and can be restricted to read-only.
Authorization: Bearer wr_live_…
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.
Policy versions
What is recorded is never recomputed. When the policy changes, WeRefund records a new version; orders already placed stay on theirs.
policy_version_idstring
The version of the merchant's return policy in force when the order was placed.
eligible_untilstring (RFC 3339)
The return deadline, in UTC. This value never changes once written.
Policy version 4
Placed under version 4, it keeps those terms for its whole life.
Policy version 5 In force
Orders placed after the change get the new version.
Illustrative example
What each order carries
Policy Record
A WeRefund Policy Record captures the policy published at that moment: original HTML, rendered PDF and screenshot, with its version number, SHA-256 hash, UTC timestamp, return window, order and transaction IDs, and a WeRefund signature. It proves what was published, not what the shopper saw or accepted.
Return window
Each line gets its own eligible_until, written once. The window is computed once, at
delivery, and stored; the endpoint reads that stored value and never recomputes it.
Refund event
The refund event is read from the merchant's payment provider, and the order shows
refund_issued. It is the provider's declaration, not proof that the money reached
the shopper.
Webhooks
Create, list and remove webhook endpoints. Webhook payloads are signed, so your endpoint can check where they come from.
Webhook endpoints
Platforms and the API
Store platformsConnected to your WeRefund account.
Custom or headlessYour orders, through the API.
API preview
Read the reference before launch.
Endpoints, fields and examples may change before launch.