Logo

🎨 Opincur NFT Marketplace API

Complete guide to creating NFT collections, managing assets, and trading on the Solana blockchain

🚀 Getting Started

⚠️ Important: Transaction Signing

Most write operations in this API return base64 encoded transactions that must be signed on the client side before submission. After signing, use the /api/send-transaction endpoint to submit the signed transaction to the blockchain.

API Base URL

https://api.opin.art

Key Features

  • 🔐 Wallet-based authentication using Solana signatures
  • 🎨 Create and manage NFT collections
  • 🖼️ Mint, transfer, and burn NFT assets
  • 💰 List assets for sale and manage offers
  • 👤 User profile and preference management
  • 📊 Track trading history and activities

Transaction Flow

Call API Endpoint
Receive Base64 Transaction
Sign with Wallet
Submit via /api/send-transaction
Blockchain Confirmation

🔐 Authentication

The Opincur API uses wallet-based authentication with Solana signatures. All protected endpoints require a valid JWT token.

Step 1: Get Message to Sign

POST/api/auth/messageToSign
{ "userAddress": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU" }

Response: Returns a message and nonce that you need to sign with your wallet.

Step 2: Sign In with Signature

POST/api/auth/signIn
{ "userAddress": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU", "signature": "2UzGCZxHosKL7K4Zq3J9NKJf2T2WtFbG6qRJzpqdRzS8nJgFzLdKQmW3XqY5N2vBmKcRzT9yLpV7xHjM4nQ8" }

Response: Returns JWT token for authenticated requests.

💡 Using the JWT Token

Include the JWT token in the Authorization header for all protected endpoints:

Authorization: Bearer YOUR_JWT_TOKEN

🎨 Creating NFT Collections

Collections are containers for related NFTs. Before creating individual assets, you need to create a collection.

Step 1: Create Collection

POST/api/collection/create

Content-Type: multipart/form-data

Required Fields:

FieldTypeDescription
imageFileCollection image file (required)
creatorStringSolana address of the collection creator
collectionNameStringName of the collection
categoryStringCategory of the collection

Optional Fields:

  • banner: Collection banner image
  • description: Collection description
  • website, twitter, telegram, instagram, discord, youtube: Social links
  • maxSize: Maximum collection size
  • sellerFee: Seller fee in basis points

⚠️ Transaction Signing Required

This endpoint returns a base64 encoded transaction that must be signed with your wallet before submission.

Step 2: Submit Signed Transaction

POST/api/send-transaction
{ "transaction": "SIGNED_BASE64_TRANSACTION_HERE" }

Managing Collections

GET/api/collection/{collectionAddress}

Get collection details by address

PUT/api/collection/{collectionAddress}

Update collection details (owner only)

GET/api/collection/creator/{userAddress}

Get all collections created by a specific user

🖼️ Creating and Managing NFT Assets

Assets are individual NFTs within a collection. Each asset has unique metadata and can be traded independently.

Step 1: Create NFT Asset

POST/api/asset/create

Content-Type: multipart/form-data

Required Fields: - file: Asset image file (binary) - name: Name of the asset - creator: Solana address of the creator - collectionAddress: Solana address of the collection Optional Fields: - description: Asset description - payer: Solana address of the payer (defaults to creator)

⚠️ Transaction Signing Required

Returns a base64 encoded transaction that must be signed and submitted via /api/send-transaction

Asset Operations

Transfer Asset

POST/api/asset/transfer
{ "assetAddress": "ASSET_SOLANA_ADDRESS", "currentOwner": "CURRENT_OWNER_ADDRESS", "newOwner": "NEW_OWNER_ADDRESS", "collectionAddress": "COLLECTION_ADDRESS" }

Burn Asset

POST/api/asset/burn
{ "assetAddress": "ASSET_SOLANA_ADDRESS", "payer": "PAYER_ADDRESS", "collectionAddress": "COLLECTION_ADDRESS" }

Querying Assets

GET/api/asset/{assetAddress}

Get detailed asset information

GET/api/asset/owner/{ownerAddress}

Get all assets owned by a specific address

GET/api/asset/{assetAddress}/activities

Get activity history for an asset

💰 Trading NFTs

The marketplace supports direct sales where assets are listed at fixed prices.

Step 1: List Asset for Sale

POST/api/asset/for-sale
{ "assetAddress": "ASSET_SOLANA_ADDRESS", "price": 1.5, "owner": "OWNER_ADDRESS", "currencyAddress": "CURRENCY_TOKEN_ADDRESS", "collectionAddress": "COLLECTION_ADDRESS" }

Set a fixed price for your NFT. Supports various currencies including SOL and USDC.

Step 2: Purchase Listed Asset

POST/api/asset/accept-sale
{ "asset": "ASSET_SOLANA_ADDRESS", "buyer": "BUYER_ADDRESS" }

Purchase a listed NFT at the asking price.

Cancel Sale Listing

POST/api/asset/cancel-for-sale
{ "assetAddress": "ASSET_SOLANA_ADDRESS", "owner": "OWNER_ADDRESS", "collectionAddress": "COLLECTION_ADDRESS" }

Remove your NFT from sale (owner only).

💡 Supported Currencies

Get list of supported currencies:

GET/api/currency-list

💡 Price Information

Get current token prices:

GET/api/get-price?tokenAddress=TOKEN_ADDRESS

🤝 Managing Offers

Users can make offers on NFTs that are not necessarily listed for sale. Asset owners can accept or decline these offers.

Step 1: Create Offer

POST/api/offers
{ "assetAddress": "ASSET_SOLANA_ADDRESS", "price": 1.2, "currencyAddress": "CURRENCY_TOKEN_ADDRESS", "currencySymbol": "USDC", "buyer": "BUYER_ADDRESS", "collectionAddress": "COLLECTION_ADDRESS", "receiptAddress": "OFFER_RECEIPT_ADDRESS" }

Step 2: Accept Offer (Asset Owner)

POST/api/offers/accept
{ "offerReceipt": "OFFER_RECEIPT_ADDRESS", "seller": "SELLER_ADDRESS" }

Cancel Offer

POST/api/offers/cancel
{ "assetAddress": "ASSET_SOLANA_ADDRESS", "buyer": "BUYER_ADDRESS", "currencyAddress": "CURRENCY_ADDRESS" }

Querying Offers

GET/api/offers/asset/{assetAddress}

Get all offers for a specific NFT

GET/api/offers/buyer/{buyerAddress}

Get all offers made by a specific buyer

GET/api/offers/my/{userAddress}

Get all offers made by authenticated user

GET/api/offers/received/{userAddress}

Get all offers received by authenticated user

👤 User Management

Manage user profiles, preferences, and track trading activities.

Get User Profile

GET/api/user/{userAddress}

Retrieve user profile information including social links and preferences.

Update User Profile

PUT/api/user/{userAddress}

Content-Type: multipart/form-data

Fields: - name: User display name - bio: User biography - website: Website URL - twitter, telegram, instagram, discord, youtube: Social handles - avatar: Profile image file - banner: Banner image file

User Preferences

POST/api/user/{userAddress}/toggle-favorite-collection

Add/remove collections from favorites

POST/api/user/{userAddress}/toggle-favorite-asset

Add/remove assets from favorites

GET/api/asset/favorites/{userAddress}

Get user's favorite assets

Trading History

GET/api/user/{userAddress}/trades

Get complete trading history for a user

POST/api/user/{userAddress}/balance

Check token balance for specific currencies

📚 Additional Resources

💡 Rate Limiting

  • Write operations: 5 requests per minute
  • Read operations: 20 requests per minute

💡 Error Handling

The API returns standard HTTP status codes:

  • 200: Success
  • 400: Bad Request - Missing required fields
  • 403: Unauthorized - Authentication required
  • 422: Unprocessable Entity - Invalid file type
  • 500: Internal Server Error

⚠️ Remember

  • Always sign transactions client-side before submission
  • Keep your private keys secure and never share them
  • Test with small amounts first
  • Verify all transaction details before signing