API Reference

HTTP API

REST over JSON. Merchant routes use a Bearer API key; the client checkout uses a publishable client key bound to a session. All money amounts are decimal strings paired with an ISO-4217 currency. The Admin API is served on a separate, isolated endpoint.

Sessions

Auth · Bearer api key
MethodPathDescription
POST/api/v1/sessionsCreate a checkout session; pins amount, currency, region (→ processor) and methods. Returns a one-time client_secret.

Client checkout

Auth · X-Client-Key + origin
MethodPathDescription
POST/api/v1/client/payPay against a session with a processor token. Honors an optional Idempotency-Key header. Returns the transaction (captured / pending / declined).
POST/api/v1/client/checkoutHosted-checkout card submission (used by the @oxagile/checkout SDK): vaults the PAN (KMS-encrypted CDE) and charges the token. Returns {transaction_id, status, masked_pan, …} — never the PAN.

Transactions

Auth · Bearer api key
MethodPathDescription
GET/api/v1/transactions/{id}Fetch a transaction.
POST/api/v1/transactions/{id}/captureCapture an authorized transaction.
POST/api/v1/transactions/{id}/settleMark a captured transaction settled (clearing complete).
POST/api/v1/transactions/{id}/voidVoid an authorized transaction.
POST/api/v1/transactions/{id}/refundRefund. No body → full remaining; {amount, currency} → partial. Supports multiple partial refunds.

Wallet & top-ups

Auth · Bearer api key or X-Client-Key
MethodPathDescription
GET/api/v1/wallet/{customer}Stored-value balance + ledger for a customer.
POST/api/v1/wallet/topupTop up: a geo-routed card payment that credits the balance on capture.
POST/api/v1/wallet/{customer}/spendSpend from balance (in-app purchase) — no processor round-trip.
POST/api/v1/wallet/{customer}/payoutWithdraw to an external destination via the regional acquirer.

Buyer-facing equivalents under /api/v1/client/wallet/… use X-Client-Key. Mutations accept an Idempotency-Key header (exactly-once); top-up also accepts a stored instrument_id instead of a fresh token.

Double-entry ledger

Auth · Bearer api key
MethodPathDescription
GET/api/v1/ledgerRecent immutable journal entries (balanced debits/credits).
GET/api/v1/ledger/balancesTrial balance per account/currency + global debit/credit totals.

Network tokenization & account updater

Auth · Bearer api key
MethodPathDescription
POST/api/v1/instrumentsNetwork-tokenize a processor token into a reusable stored instrument.
GET/api/v1/instruments/{customer}List a customer's stored instruments.
POST/api/v1/instruments/{id}/updaterAccount-updater event (reissued/expired/closed) — refreshes the credential.

Token vault (PCI CDE)

Auth · Bearer api key
MethodPathDescription
POST/api/v1/vault/cardsVault a PAN: Luhn-validated, envelope-encrypted via KMS, returns an opaque routing token + masked PAN/BIN/brand. The cleartext PAN is never returned.
GET/api/v1/vault/cards/{id}Fetch the non-sensitive vault metadata (token, masked PAN, BIN, network, expiry, key version).

Detokenization is egress-only (to a processor) and never exposed over the merchant API.

Stored credentials & MIT

Auth · Bearer api key
MethodPathDescription
POST/api/v1/agreementsCapture consent for a credential-on-file agreement against a vault token.
GET/api/v1/agreements · /{id}List agreements / fetch one.
POST/api/v1/agreements/{id}/activateActivate on the initial charge, recording the network transaction id.
POST/api/v1/agreements/{id}/mitResolve the COF/MIT framing for a merchant-initiated charge (recurring/unscheduled/installment).
POST/api/v1/agreements/{id}/revokeRevoke consent.

3-D Secure 2

Auth · Bearer api key
MethodPathDescription
POST/api/v1/3dsInitiate authentication; the SCA engine + policy decide frictionless vs challenge. Returns flow, ECI/CAVV and liability-shift state.
GET/api/v1/3ds/{id}Fetch an authentication's current state.
POST/api/v1/3ds/{id}/challengeResolve an outstanding challenge (approve/fail/cancel/timeout).

Settlement batches

Auth · Bearer api key
MethodPathDescription
POST/api/v1/batches/captureAdd a captured amount to the open batch (opens one if none is open).
POST/api/v1/batches/closeClose the open batch for settlement submission.
GET/api/v1/batches · /{id}List batches / fetch one.
POST/api/v1/batches/{id}/settle · /errorMark a closed batch funded, or rejected by the acquirer.

Disputes & chargebacks

Auth · Bearer api key
MethodPathDescription
POST/api/v1/disputesOpen a dispute (chargeback).
GET/api/v1/disputes · /{id}List disputes / fetch one with its representment packet.
POST/api/v1/disputes/{id}/evidenceAttach evidence.
POST/api/v1/disputes/{id}/representSubmit a representment (network-specific, e.g. Visa CE3.0).
POST/api/v1/disputes/{id}/accept · /resolve · /expireConcede / apply network ruling / lapse the deadline.

SCA, fraud & reconciliation

Auth · Bearer api key
MethodPathDescription
POST/api/v1/sca/previewPSD2 SCA decision for a context — exemption (low-value/TRA/MIT) vs 3-D Secure challenge.
GET/api/v1/fraud/score/{tx}Adaptive fraud probability + band + top signals.
POST/api/v1/fraud/feedbackLabel an outcome — online model update + consortium counter.
GET/api/v1/metrics · /insights · /anomaliesBI metrics, AI summary, anomaly signals.
GET/api/v1/reconciliationReconciliation summary; POST triggers a run.

Tamper-evident audit trail

Auth · Bearer api key
MethodPathDescription
GET/api/v1/auditHash-chained audit entries (each commits to the previous entry's hash).
GET/api/v1/audit/verifyRe-derive the chain and prove integrity: {intact, entries, broken_at_seq}.

Append-only; any edit, insert or deletion breaks the chain and is detected by verify — SOC 2 / PCI DSS §10 logging.

Security & admin

Auth · X-Admin-Key
MethodPathDescription
GET/api/v1/security/kmsEnvelope-encryption / KMS status (scheme, key version). Admin-only.
GET/api/v1/fraud/modelFraud model status (weights, training count). Admin-only.
GET/api/v1/admin/dlqList webhook deliveries that exhausted their retries (dead-letter queue).
POST/api/v1/admin/dlq/{id}/replayRequeue a dead-lettered delivery for another attempt.

Privileged endpoints require X-Admin-Key (constant-time check), separate from merchant auth.

Webhook subscriptions

Auth · Bearer api key
MethodPathDescription
POST/api/v1/webhooksSubscribe a URL + signing secret to outbound events.
GET/api/v1/webhooksList subscriptions (secret never returned).
DELETE/api/v1/webhooks/{id}Remove a subscription.

Deliveries carry X-Webhook-Timestamp and X-Webhook-Signature: t=<ts>,v1=<hmac> (HMAC-SHA256 of {ts}.{body} with your secret), so receivers can reject replays; retried by the outbox worker. Signing secrets are stored envelope-encrypted at rest.

Processor webhooks & health

Auth · signature / none
MethodPathDescription
POST/hooks/{processor}Inbound processor callback (confirms async QR / VA / e-wallet). Signature verified before parsing.
GET/healthLiveness check. No auth.

Examples

1 · Create session (backend)

POST /api/v1/sessions
Authorization: Bearer ak_live_...
Content-Type: application/json

{
  "region": "north_america",
  "amount": "19.99",
  "currency": "USD",
  "methods": ["card","apple_pay","qr"],
  "mode": "sale"
}

→ 200
{
  "session_id": "0199...",
  "client_secret": "cs_3f9c...",
  "amount": "19.99",
  "currency": "USD",
  "methods": ["card","apple_pay","qr"]
}

2 · Pay (client)

POST /api/v1/client/pay
X-Client-Key: ck_live_...
Idempotency-Key: 0199...:card
Content-Type: application/json

{
  "session_id": "0199...",
  "client_secret": "cs_3f9c...",
  "method": "card",
  "processor_token": "PIxxxxx"
}

→ 200
{
  "id": "019e...",
  "status": "captured",
  "processor_name": "finix",
  "processor_reference": "TRxxxx",
  "amount": { "amount": "19.99", "currency": "USD" }
}

Errors

StatusMeaning
401Missing / invalid api or client key
403Origin not allowed for the client key
409Concurrent modification — retry
410Session expired or already used
422Invalid transition / amount (e.g. refund exceeds remaining)
502Processor error or circuit open