🎨 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
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
🔐 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
/api/auth/messageToSignResponse: Returns a message and nonce that you need to sign with your wallet.
Step 2: Sign In with Signature
/api/auth/signInResponse: Returns JWT token for authenticated requests.
💡 Using the JWT Token
Include the JWT token in the Authorization header for all protected endpoints:
🎨 Creating NFT Collections
Collections are containers for related NFTs. Before creating individual assets, you need to create a collection.
Step 1: Create Collection
/api/collection/createContent-Type: multipart/form-data
Required Fields:
| Field | Type | Description |
|---|---|---|
| image | File | Collection image file (required) |
| creator | String | Solana address of the collection creator |
| collectionName | String | Name of the collection |
| category | String | Category 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
/api/send-transactionManaging Collections
/api/collection/{collectionAddress}Get collection details by address
/api/collection/{collectionAddress}Update collection details (owner only)
/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
/api/asset/createContent-Type: multipart/form-data
⚠️ Transaction Signing Required
Returns a base64 encoded transaction that must be signed and submitted via /api/send-transaction
Asset Operations
Transfer Asset
/api/asset/transferBurn Asset
/api/asset/burnQuerying Assets
/api/asset/{assetAddress}Get detailed asset information
/api/asset/owner/{ownerAddress}Get all assets owned by a specific address
/api/asset/{assetAddress}/activitiesGet 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
/api/asset/for-saleSet a fixed price for your NFT. Supports various currencies including SOL and USDC.
Step 2: Purchase Listed Asset
/api/asset/accept-salePurchase a listed NFT at the asking price.
Cancel Sale Listing
/api/asset/cancel-for-saleRemove your NFT from sale (owner only).
💡 Supported Currencies
Get list of supported currencies:
/api/currency-list💡 Price Information
Get current token prices:
/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
/api/offersStep 2: Accept Offer (Asset Owner)
/api/offers/acceptCancel Offer
/api/offers/cancelQuerying Offers
/api/offers/asset/{assetAddress}Get all offers for a specific NFT
/api/offers/buyer/{buyerAddress}Get all offers made by a specific buyer
/api/offers/my/{userAddress}Get all offers made by authenticated user
/api/offers/received/{userAddress}Get all offers received by authenticated user
👤 User Management
Manage user profiles, preferences, and track trading activities.
Get User Profile
/api/user/{userAddress}Retrieve user profile information including social links and preferences.
Update User Profile
/api/user/{userAddress}Content-Type: multipart/form-data
User Preferences
/api/user/{userAddress}/toggle-favorite-collectionAdd/remove collections from favorites
/api/user/{userAddress}/toggle-favorite-assetAdd/remove assets from favorites
/api/asset/favorites/{userAddress}Get user's favorite assets
Trading History
/api/user/{userAddress}/tradesGet complete trading history for a user
/api/user/{userAddress}/balanceCheck 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