Merchants
Pricing
Sign in Get Verified
For developers

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.

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
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 }
  ]
}
Reference

What the API exposes

Four groups of endpoints, documented one by one in the reference.

Base URL https://api.werefund.com/v1 Full reference

Authentication

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.

Header
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.

Versioning

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

A-40917pv_8842_4

Placed under version 4, it keeps those terms for its whole life.

Policy version 5 In force

A-41290pv_8842_5

Orders placed after the change get the new version.

Illustrative example

Order lifecycle

What each order carries

At order

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.

At delivery

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.

At refund

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.

Events

Webhooks

Create, list and remove webhook endpoints. Webhook payloads are signed, so your endpoint can check where they come from.

Where orders come from

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.