Base URL
Authentication
G2C Platform supports two authentication methods:API Key Authentication
For server-to-server communication:JWT Bearer Authentication
For wallet-based operations:Core Resources
System Health
Monitor API and authentication system status:| Endpoint | Method | Description | Auth Required |
|---|---|---|---|
/health | GET | Check overall API health | ❌ |
/auth/health | GET | Check authentication system health | ✅ |
Wallet Management
Create and manage digital identities:| Endpoint | Method | Description | Auth Required |
|---|---|---|---|
/wallets | GET | List wallets | ✅ API Key |
/wallets | POST | Create new wallet | ✅ API Key |
/wallets/{walletId} | GET | Get wallet details | ✅ API Key |
/wallets/{walletId} | PUT | Update wallet | ✅ API Key |
/wallets/{walletId} | DELETE | Delete wallet | ✅ API Key |
Wallet Authentication
Authenticate wallets and manage sessions:| Endpoint | Method | Description | Auth Required |
|---|---|---|---|
/auth/wallet/login | POST | Authenticate wallet | ❌ |
/auth/wallet/logout | POST | Invalidate JWT token | ✅ JWT |
/auth/wallet/refresh | POST | Refresh JWT token | ✅ JWT |
/auth/wallet/recover | POST | Request password recovery | ❌ |
/auth/wallet/reset | POST | Reset wallet password | ❌ |
Token Management
Create, transfer, and track blockchain tokens:| Endpoint | Method | Description | Auth Required |
|---|---|---|---|
/tokens/mint | POST | Create new tokens (fungible/NFT) | ✅ API Key |
/tokens/transfer | POST | Transfer tokens between wallets | ✅ API Key |
/tokens/{tokenId} | GET | Get token details | ✅ API Key |
/tokens | GET | List tokens with filters | ✅ API Key |
/tokens/history | GET | Get token transaction history | ✅ API Key |
Category Management
Organize digital objects hierarchically:| Endpoint | Method | Description | Auth Required |
|---|---|---|---|
/categories | GET | List categories | ✅ API Key |
/categories | POST | Create new category | ✅ API Key |
/categories/{categoryId} | GET | Get category details | ✅ API Key |
/categories/{categoryId} | PUT | Update category | ✅ API Key |
/categories/{categoryId} | DELETE | Delete category | ✅ API Key |
Subcategory Management
Manage subcategories within categories:| Endpoint | Method | Description | Auth Required |
|---|---|---|---|
/categories/{categoryId}/subcategories | POST | Create subcategory | ✅ API Key |
/categories/{categoryId}/subcategories/{subcategoryId} | GET | Get subcategory | ✅ API Key |
/categories/{categoryId}/subcategories/{subcategoryId} | PUT | Update subcategory | ✅ API Key |
/categories/{categoryId}/subcategories/{subcategoryId} | DELETE | Delete subcategory | ✅ API Key |
Object Management
Track digital objects with blockchain audit trails:| Endpoint | Method | Description | Auth Required |
|---|---|---|---|
/categories/{categoryId}/subcategories/{subcategoryId}/objects | GET | List objects in subcategory | ✅ API Key |
/categories/{categoryId}/subcategories/{subcategoryId}/objects | POST | Create object | ✅ API Key |
/objects | GET | List all objects with filters | ✅ API Key |
/objects/{objectId} | GET | Get object details | ✅ API Key |
/objects/{objectId} | PUT | Update object | ✅ API Key |
/objects/{objectId} | DELETE | Delete object | ✅ API Key |
File Management
Handle file uploads and downloads:| Endpoint | Method | Description | Auth Required |
|---|---|---|---|
/files/upload | POST | Upload file | ✅ API Key |
/files/{fileId} | GET | Get file details | ✅ API Key |
/files/{fileId} | DELETE | Delete file | ✅ API Key |
Hierarchical Structure
G2C Platform uses a clear hierarchical structure for organizing digital assets:Token Types
Fungible Tokens
Interchangeable digital assets:- Digital currencies
- Loyalty points
- Credits or rewards
- Represented by symbol and amount
Non-Fungible Tokens (NFTs)
Unique digital assets:- Digital certificates
- Unique collectibles
- Identity tokens
- Represented by unique metadata
Request/Response Patterns
Content Types
- JSON Requests:
application/json - File Uploads:
multipart/form-data
Standard Response Format
Success Response
List Response with Pagination
Error Response
Pagination
List endpoints support consistent pagination:| Parameter | Type | Default | Description |
|---|---|---|---|
limit | integer | 20 | Items per page (max 100) |
offset | integer | 0 | Items to skip |
sort | string | createdAt:desc | Sort field and direction |
Example Paginated Request
HTTP Status Codes
| Status Code | Description | Common Usage |
|---|---|---|
200 | OK | Successful GET, PUT operations |
201 | Created | Successful POST operations |
204 | No Content | Successful DELETE operations |
400 | Bad Request | Invalid request data |
401 | Unauthorized | Missing or invalid credentials |
403 | Forbidden | Insufficient permissions |
404 | Not Found | Resource not found |
409 | Conflict | Resource already exists |
500 | Internal Server Error | Server-side error |
Blockchain Integration
BSV Blockchain
All token operations and object events are recorded on the BSV blockchain for:- Immutable audit trails
- Cryptographic verification
- Complete transaction history
- Compliance and regulatory requirements
Blockchain Data
Responses include blockchain information:Security Best Practices
API Key Security
- Store keys in environment variables
- Never expose keys in client-side code
- Use different keys for different environments
- Rotate keys regularly
JWT Token Security
- Tokens expire after a set time
- Use refresh tokens for extended sessions
- Invalidate tokens on logout
- Store securely on client side
Data Protection
- All requests use HTTPS
- Data is encrypted in transit and at rest
- Access controls by wallet and API key
- Audit trails for all operations
Common Use Cases
Digital Asset Management
- Create categories for asset types
- Mint NFTs for unique items
- Track ownership with blockchain proof
- Manage asset lifecycle events
Token Economy
- Issue fungible tokens for rewards
- Create NFT certificates
- Track token transfers
- Build loyalty programs
Supply Chain Traceability
- Create objects for products
- Record manufacturing steps
- Track transfers between parties
- Verify authenticity with blockchain