Hybrid API (Solana)
REST API with Solana backend for seamless integration.
Overview
The Hybrid API provides a traditional REST interface while maintaining Solana functionality on the backend. This approach is ideal for games that prefer familiar API patterns or have internal wallet management with keypairs.
Requirements
-
✓
API KeyMerso API key from your dashboard
-
✓
JWT AuthenticationServer-side JWT token generation
-
✓
HTTPSAll requests must use HTTPS
Base URL
URL
https://api.merso.com/v1/solana
Authentication
HTTP Header
Authorization: Bearer YOUR_JWT_TOKEN
X-API-Key: YOUR_API_KEY
Key Endpoints
Get Purchase Quote
HTTP
GET /quote?collection={mint}&nftMint={mint}&paymentMint={mint}
Initiate PNPL Purchase
HTTP
POST /purchase/pnpl
Content-Type: application/json
{
"collection": "COLLECTION_MINT_ADDRESS",
"nftMint": "NFT_MINT_ADDRESS",
"paymentMint": "TOKEN_MINT_ADDRESS",
"userWallet": "USER_PUBKEY"
}
Get Transaction Status
HTTP
GET /transaction/{signature}
Example Integration
JavaScript
const response = await fetch('https://api.merso.com/v1/solana/purchase/pnpl', {
method: 'POST',
headers: {
'Authorization': `Bearer ${jwtToken}`,
'X-API-Key': apiKey,
'Content-Type': 'application/json'
},
body: JSON.stringify({
collection: 'CoLLeCtion111111111111111111111111111111111',
nftMint: 'NFTMint1111111111111111111111111111111111111',
paymentMint: 'TokenMint11111111111111111111111111111111111',
userWallet: 'UserWaLLet1111111111111111111111111111111111'
})
});
const result = await response.json();
console.log('Transaction signature:', result.signature);