Skip to main content
You can mint both fungible tokens and NFTs using this endpoint.

Prerequisites

  • Valid API key with token minting permissions
  • Target wallet address for token assignment
  • Token metadata (for NFTs) or amount (for fungible tokens)

Request

curl -X POST "https://api.g2cplatform.com/v2/tokens/mint" \
  -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "walletAddress": "0x1234567890abcdef...",
    "tokenType": "NFT",
    "metadata": {
      "name": "Digital Certificate",
      "description": "Certificate of completion",
      "image": "https://example.com/certificate.png",
      "attributes": [
        {
          "trait_type": "Course",
          "value": "Blockchain Fundamentals"
        }
      ]
    }
  }'

Request Body

ParameterTypeRequiredDescription
walletAddressstringYesDestination wallet address for the token
tokenTypestringYesType of token: “FUNGIBLE” or “NFT”
amountnumberConditionalRequired for fungible tokens. Number of tokens to mint
metadataobjectConditionalRequired for NFTs. Token metadata object

Metadata Object (for NFTs)

ParameterTypeRequiredDescription
namestringYesName of the NFT
descriptionstringNoDescription of the NFT
imagestringNoURL to the NFT image
attributesarrayNoArray of trait objects

Response

{
  "transactionId": "tx_abc123...",
  "tokenId": "token_def456...",
  "walletAddress": "0x1234567890abcdef...",
  "tokenType": "NFT",
  "metadata": {
    "name": "Digital Certificate",
    "description": "Certificate of completion",
    "image": "https://example.com/certificate.png"
  },
  "blockchainTxId": "0xabcdef123456...",
  "status": "confirmed",
  "createdAt": "2025-01-15T10:30:00Z"
}

Examples

Mint Fungible Tokens

{
  "walletAddress": "0x1234567890abcdef...",
  "tokenType": "FUNGIBLE",
  "amount": 1000,
  "metadata": {
    "name": "Loyalty Points",
    "symbol": "LP"
  }
}

Mint NFT

{
  "walletAddress": "0x1234567890abcdef...",
  "tokenType": "NFT",
  "metadata": {
    "name": "Achievement Badge",
    "description": "Completed advanced course",
    "image": "https://example.com/badge.png",
    "attributes": [
      {
        "trait_type": "Level",
        "value": "Advanced"
      },
      {
        "trait_type": "Date",
        "value": "2025-01-15"
      }
    ]
  }
}

Error Responses

Status CodeDescription
400Invalid request data or missing required fields
401Unauthorized - invalid API key
403Insufficient permissions for token minting
404Wallet address not found
500Internal server error