📋 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 Key
    Merso API key from your dashboard
  • JWT Authentication
    Server-side JWT token generation
  • HTTPS
    All 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);