Skip to content

Latest commit

 

History

History
97 lines (68 loc) · 1.72 KB

API.md

File metadata and controls

97 lines (68 loc) · 1.72 KB

API Reference

All API responses are JSON unless noted.

GET /api/runtime

Returns public runtime metadata.

Example response:

{
  "ok": true,
  "brand": "outbid.news",
  "domain": "outbid.news",
  "supportEmail": "support@outbid.news",
  "minBidCents": 200,
  "topStepCents": 500,
  "raiseStepCents": 100
}

GET /api/leaderboard

Returns current leaderboard data.

Important fields:

  • leaderboard: ranked listing rows.
  • activity: recent completed bids.
  • trending: listings sorted by recent click activity.
  • nextTopBidCents: suggested amount to claim number one.
  • leaderboardSections: rank groups for top three, top ten, and the remaining board.
  • onlineCount: public online count.
  • visitorCount: public visitor count.

POST /api/analytics

Stores a lightweight analytics event.

Example request:

{
  "event": "page_view",
  "page": "/",
  "payload": {}
}

Internal QA events are separated from visitor traffic.

POST /api/checkout

Creates a checkout session for a bid.

Example request:

{
  "target": "https://example.com/product",
  "amountUsd": 7
}

Example success response:

{
  "ok": true,
  "checkoutUrl": "https://payment-provider.example/checkout/session",
  "checkoutSessionId": "checkout_123",
  "pendingId": "pending_123"
}

If payment is not configured, the endpoint fails closed and does not list the URL.

POST /api/checkout/confirm

Confirms a checkout and updates the leaderboard when payment is complete.

Example request:

{
  "checkoutId": "checkout_123",
  "pendingId": "pending_123"
}

GET /go/:id

Tracks a listing click and redirects to the listing destination.

This endpoint returns a redirect response, not JSON.