Hybrid API
This page shows you how to integrate Merso using traditional payments for paying NFTs. This means that your players will pay the NFT using fiat money.
🎯 Integration Overview
The Merso API provides this core endpoints for game integration:
/health- API health check/merso-buy-token-with-fiat- Purchase NFT using the Merso PNPL fiat option.
📋 Web2 API Endpoints
1. Health Check
Endpoint: GET /health
Purpose: Verify API connectivity and status
Request:
curl -X GET "https://api3.dev.merso.io/health"Response:
{
"success": true,
"message": "Merso Backend is running",
}JavaScript Example:
2. Buy token with fiat
Endpoint: POST /merso-buy-token-with-fiat
Purpose: Send the fiat payment data to the player. Purchase NFT. You can choose between PNPL or Upfront payment. New optional param added.
Request :
Parameters:
tokenPriceInUSD(number): The price of the NFT in USD.tokenId(number): NFT token ID to purchase.tokenName(string): The name of the NFT.userAddress(string): The user's wallet address.userEmail(string): User's in-game email.collectionAddress(string): The smart contract address of the NFT collection.
OPTIONAL:
paymentMode(string): Desired way to pay the asset. Values must be: "BNPL" or "UPFRONT". Default in case you dont want/need it to send is set as "BNPL".
Response:
Depending on the payment mode selected we give concrete response to each request:
BNPL payment response:
Upfront/full payment response:
JavaScript Example:
Last updated