Developer portal
The APEX API,
for your engineers.
Everything on this site is available programmatically. Scoped keys, idempotent requests, signed webhooks, and a test environment that models the failure modes most providers can't demo.
The API is the product, not an afterthought - the console you see is built on the same endpoints you will call. API keys are scoped by role so a reporting worker never carries payment authority, and plaintext secrets are shown exactly once at creation. Every write accepts an idempotency key, so a retried request replays its original result instead of duplicating the operation - the difference between a safe retry and a double charge.
Webhook deliveries are signed so you can verify they came from us, retried on a schedule until your endpoint answers, and replayable through the console when your side has a bad day. The sandbox environment goes further than most: deterministic payment methods let you rehearse declines, timeouts, disputes and provider outages on demand, so your error handling is tested against the failures that actually cost money - not just the success path.
Authentication & API keys
Bearer API keys in the Authorization header.
Keys are SHA-256 hashed at rest, prefixed for identification
(ak_test_ / ak_live_), expirable, and revocable.
Roles map to scope sets - mint keys with the least privilege the integration needs:
owner | * - full account access |
developer | payments:*, refunds:write, webhooks:*, billing:write, merchants:read |
finance | payments/payouts/billing/ledger reads + writes, merchants:read |
support | payments:read, merchants:read, refunds:read |
read_only | payments, merchants, payouts, wallets, billing, ledger - read |
operator | ops:*, payments:read, merchants:read, ledger:read |
Cross-merchant access returns
404 - never 403 - so tenant boundaries aren't
observable. POST /v1/auth/signup creates a merchant + first
key; /v1/api_keys manages rotation and revocation.
Idempotency
Send Idempotency-Key on any POST. The
semantics are Stripe-style and enforced at the storage layer:
Replay
Same key + same payload returns the original response verbatim - safe to retry over flaky networks.
Conflict
Same key + different payload returns 409 - the key can never silently alias two operations.
In-flight
A concurrent duplicate blocks rather than double-executing - the second caller sees the first result.
Webhooks
Events fan out over the transactional outbox - at-least-once delivery, signed, dead-lettered on exhaustion.
- Subscriptions via
GET|POST /v1/webhooks; secrets are platform-generated (whsec_…), shown once at creation. - Signature header:
X-Apex-Signature: t=<unix>,v1=<hmac-sha256(secret, "t.body")>- verify before trusting, and use the timestamp against replay. - Delivery is idempotent on the wire - consumers must be idempotent too; dead-lettered events are inspectable and replayable via ops.
Test tokens
The deterministic test adapter scripts every outcome by payment-method token - including the uncertain paths.
sb_ok | Clean authorization / capture / refund |
sb_decline_* | Provider decline family |
sb_auth_timeout · sb_auth_lost | Uncertain authorization - drives the reconcile path |
sb_capture_fail · sb_capture_timeout | Capture failure and uncertain capture |
sb_refund_fail · sb_refund_timeout | Refund failure modes |
sb_void_timeout | Uncertain void |
sb_outage | Provider outage |
sb_provider_error | Generic provider error |
sb_payout_fail · sb_payout_returned · sb_payout_timeout | Payout failure, return-after-settlement, uncertain send |
Run the scripted end-to-end flow
yourself: scripts/demo_e2e.py exercises merchant → auth →
capture → refund → settle, and scripts/smoke_test.py probes a
live deployment.
Endpoint index
The complete /v1 surface. Authenticated
routes require a scoped key; ops routes require the operator role.
Identity
POST /v1/auth/signup · /v1/auth/login | Merchant onboarding & key minting |
GET /v1/session | Current principal: merchant_id + scopes |
GET /v1/merchants/me | Own merchant profile |
GET|POST /v1/api_keys · POST /v1/api_keys/{id}/revoke | Key management |
Payments
POST /v1/payments | Create a payment (idempotent) |
GET /v1/payments · /v1/payments/{id} | List / inspect |
GET /v1/payments/{id}/events | Transition history |
POST /v1/payments/{id}/authorize|capture|refund|void|cancel|settle|retry_authorize | Lifecycle transitions |
Checkout
POST /v1/checkout_sessions | Mint a hosted checkout link |
GET /v1/checkout/{token} | Payer-safe session details |
POST /v1/checkout/{token}/complete | Payer completion (method token only) |
Money out & billing
GET|POST /v1/payouts · GET /v1/payouts/{id} | Payouts |
GET|POST /v1/invoices · GET /v1/invoices/{id} | Invoices |
POST /v1/invoices/{id}/finalize|void | Invoice lifecycle |
Risk
GET|POST /v1/disputes · GET /v1/disputes/{id} | Dispute cases |
POST /v1/disputes/{id}/evidence|decide | Evidence & decisions |
GET /v1/fraud/reviews · POST /v1/fraud/reviews/{id}/decide | Risk review queue |
POST /v1/fraud/rules | Deterministic fraud rules |
Webhooks
GET|POST /v1/webhooks | Subscriptions + shown-once secrets |
POST /v1/webhooks/{id}/disable | Disable a subscription |
Operations (operator scope)
GET /v1/ops/health · /v1/ops/safety · /v1/ops/providers | Health & provider snapshots |
GET /v1/ops/operations · /v1/ops/operations/{id} | Coordinated operations journal |
GET /v1/ops/outbox · POST /v1/ops/outbox/replay | Outbox backlog & replay |
GET /v1/ops/recon · /v1/ops/audit · /v1/ops/workers | Reconciliation, audit, workers |
POST /v1/ops/workers/{w}/drain · /v1/ops/windows · /v1/ops/halt | Drain, maintenance windows, kill switch |
GET|POST /v1/ops/incidents · GET /v1/ops/incidents/{id}/timeline | Incident management |
POST /v1/ops/incidents/{id}/comment|transition | Timeline & state |
POST /v1/ops/copilot/ask | Read-only ops copilot |
Command Nexus (fleet)
POST /v1/command/enroll · /v1/command/enroll-tokens | Node enrollment, per-node HMAC |
GET /v1/command/nodes · /topology · /gateway/leader | Fleet state |
POST /v1/command/nodes/{id}/revoke|rotate-secret · /telemetry | Node lifecycle |
GET|POST /v1/command/tasks · /{id}/dispatch|approve|cancel|result|self-review | Supervised task pipeline |
GET /v1/command/deployments · /audit · /recovery · /repairs · /outbox/classify | Fleet operations |
System
GET /health · /ready · /metrics | Liveness, readiness, counters |
/console/* · /public/* | Ops console & public pages |