Infrastructure

Approve or decline an agent top-up request (human, dashboard session)

The HUMAN approval leg of agent-initiated top-up requests. Session-cookie-authed (browser dashboard surface — NOT Bearer/agent-facing) and intentionally outside the /api/v1 namespace next to /api/billing/checkout, so the API-key auth model, response provenance, and scope rules do not apply. Called only by the site's own /dashboard/billing page. decision: "approve" atomically claims the still-pending, unexpired request (a single compare-and-swap — a second approve, an approve after the 24-hour expiry, and concurrent resolutions all fail with 409), re-checks the requested amount against the LIVE adjustable ceiling (a ceiling lowered after the request was created blocks approval), verifies the requesting key is still active, and then drives the EXISTING credit-checkout path with the request's key and amount — returning the Stripe Checkout url for the browser to follow. The human completes (or abandons) payment on Stripe's hosted page exactly as on the direct top-up path; credits accrue only via the deduplicated webhook. decision: "decline" resolves the request without touching any Stripe code path. Cross-tenant resolution is impossible: every read and the claim itself are pinned to the session consumer, and an unknown id, another consumer's request, and an already-resolved request are indistinguishable (uniform 409).

post/api/billing/topup-requests/{id}/resolve

Request

  • Base URL: https://www.apier.no
  • URL: https://www.apier.no/api/billing/topup-requests/{id}/resolve
  • Auth: API key in cookie sb-access-token

Path parameters

idstring uuid required

The top-up request's UUID (from the pending-requests panel).

Request body

decision'approve' | 'decline' required

approve → claim the request and start the Stripe checkout for its amount; decline → resolve it with no payment and no Stripe interaction.

Response

Resolved. On approve, url is the Stripe-hosted Checkout page for the requested amount — the browser follows it and the human completes payment there (the session reference is stored on the request as checkout_session_ref). On decline, no url is returned and no payment surface was ever touched.

idstring uuid required
status'approved' | 'declined' required
urlstring uri

Present only on approve — the Stripe Checkout URL to redirect the human to.

Changes

No recorded changes to this operation across all 1 revision of this API.