Architecture Overview
Learn about the system components, data flow, and how different parts interact.
System Components
Client Application
Your game or application that integrates with Merso via iframe modal or direct API calls.
Merso API
REST API for authentication, transaction management, and configuration.
Smart Contracts
On-chain contracts for payment processing, escrow, and PNPL management.
Webhook Service
Event notification system for real-time updates on transaction status.
Data Flow
API Layer
The Merso API provides a unified interface for all blockchain operations, abstracting away chain-specific complexities.
| Endpoint Category | Purpose | Authentication |
|---|---|---|
/auth |
Obtain JWT tokens for API access | API Key |
/transactions |
Create and manage payment transactions | JWT |
/approvals |
Token approval for smart contract interaction | JWT |
/collections |
NFT collection management | JWT |
/webhooks |
Configure webhook endpoints | JWT |
Security Model
-
✓
JWT AuthenticationShort-lived tokens (12 hours) for API access, refreshed as needed.
-
✓
Server-Side API KeysAPI keys never exposed to client-side code.
-
✓
Wallet SignaturesAll transactions require explicit user approval via wallet.
-
✓
HTTPS OnlyAll API communication over TLS 1.3.
Never expose your API Key in client-side code. Always proxy API calls through your backend server.
Multi-Chain Architecture
Merso provides a unified API that works across multiple blockchains. The system automatically handles chain-specific transaction formatting and gas estimation.
// Same API call works across chains
// Just change the chain_id parameter
// Polygon
{ "chain_id": "137", ... }
// Ethereum
{ "chain_id": "1", ... }
// Solana (uses different address format)
{ "chain": "solana", ... }