Skip to content

API Overview

PayWarden exposes a REST API for creating and managing payment orders.

Base URL

http://localhost:3000/api/v1      # local development
https://pay.yourdomain.com/api/v1 # production[^1]

[^1]: pay.yourdomain.com is illustrative. The operator is responsible for placing PayWarden behind a reverse proxy (TLS termination, hostname, rate limiting) in production.

Authentication

PayWarden has two auth surfaces — see Authentication for details.

  • Merchant APIX-API-Key header. Required on all merchant endpoints.
  • Admin API — httpOnly admin_token cookie. No Bearer token support.

The following endpoints are public (no authentication required):

EndpointPurpose
GET /api/v1/healthReadiness probe (ok / degraded)
GET /api/v1/health/liveLiveness probe (process up)
GET /api/v1/checkout/:id/statusPublic order status for the checkout page
bash
curl -H "X-API-Key: your-api-key" https://pay.yourdomain.com/api/v1/payments

Response format

All responses are JSON. Errors follow this structure:

json
{
  "error": "Human-readable message",
  "code": "ERROR_CODE"
}

Monetary amounts are always strings (e.g. "100.500000"), never numbers. See DECISIONS.md in the core repo for the rationale.

Endpoint index

MethodPathAuthDescription
POST/paymentsX-API-KeyCreate a payment order
GET/payments/:idX-API-KeyGet order details
GET/paymentsX-API-KeyList orders (paginated)
GET/checkout/:id/statuspublicPublic order status
GET/healthpublicReadiness probe
GET/health/livepublicLiveness probe
POST/admin/auth/loginpublicAdmin login (sets admin_token cookie)
POST/admin/auth/logoutcookieAdmin logout
GET/admin/statscookieDashboard stats
GET/admin/merchantscookieList merchants
POST/admin/merchantscookieCreate merchant
GET/admin/merchants/:idcookieMerchant detail with stats
PUT/admin/merchants/:idcookieUpdate merchant
POST/admin/merchants/:id/rotate-api-keycookieRotate merchant API key
GET/admin/orderscookieList all orders
GET/admin/orders/:idcookieOrder detail with events
POST/admin/orders/:id/retry-webhookcookieRe-enqueue webhook delivery
POST/admin/orders/:id/retry-sweepcookieRe-enqueue fund sweep
GET/admin/walletcookieHot/cold wallet + address pool + sweep queue

See individual pages for full request/response schemas:

Rate limiting

Admin login is rate-limited to 5 attempts per 15 minutes per IP. Other endpoints inherit the Fastify instance's default limits; tune at the reverse proxy if you need tighter per-route controls. PayWarden does not currently ship a per-merchant token bucket.

Released under the BSL 1.1 License.