Integration architecture

Server‑to‑Server, Front‑Hosted, or Hybrid

The Three Archetypes

ModelWhere requests originateTypical auth methodBest for
Server‑to‑Server (S2S)Partner backend → Wirex Pay APIPartner JWTBanks, payroll platforms, compliance‑heavy apps
Front‑Hosted (Client‑Direct)Mobile/Web client → Wirex Pay APIWirex Pay Token (short‑lived)Crypto wallets, DeFi or NFT apps
HybridClient handles low‑risk calls; backend handles privileged callsMixed (Token + JWT)Super‑apps, gaming platforms, rapid MVPs

Deep Dive per Model

AspectServer‑to‑Server (S2S)Front‑Hosted (Client‑Direct)Hybrid
FlowClient → Partner Backend → Wirex Pay APIClient → Wirex Pay APIClient (reads) + Backend (writes)
ProsCentralised logging, enforceable business rules, API key protectionLowest latency, minimal backend, works offlineBalanced UX and control, offloads backend for reads
ConsHigher latency, backend scaling needed, more real‑time sync logicClient-side token risk, non‑privileged access only, fragmented loggingComplex auth lifecycle, token & JWT coordination
When to ChooseYou have a PCI‑compliant backend or require centralised AML/KYC logicYou serve crypto‑native users or need wallet UI responsivenessYou’re building a super‑app, staging rollout, or minimizing backend load

Security & Compliance Considerations

ConcernS2SFront‑HostedHybrid
API credentials exposureLow (kept server‑side)Medium (token in client)Low‑medium
KYC data handlingCentralisedDecentralisedMixed
Rate‑limiting controlHighMediumHigh
PCI/PSD2 alignmentStraightforwardNeeds token scopingDepends on split

Decision Matrix

Answer these questions to score each model:

  1. Where does KYC data already live?
  2. Do you need millisecond balance refresh in‑app?
  3. Can you safely secure short‑lived tokens on the client?
  4. Is your backend PCI‑ready?_

Implementation Tips

  • Token cache: Front‑hosted and hybrid models should cache Wirex Pay Tokens for up to 5 minutes to avoid auth spam.
  • Webhook proxy: In S2S, route webhooks to an internal bus (Kafka, SNS) for decoupled processing.