API Reference

Base URL

https://quasarflow.dev

Authentication

All API requests require authentication using JWT tokens. Include the token in the Authorization header.

Authorization: Bearer YOUR_JWT_TOKEN

POST /auth/login

Authenticate and receive a JWT token.

Login Request
1curl -X POST https://quasarflow.dev/api/auth/login \
2  -H "Content-Type: application/json" \
3  -d '{
4    "username": "admin",
5    "password": "admin123"
6  }'

Response

Login Response
1{
2  "success": true,
3  "data": {
4    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
5    "expires_at": "2024-01-01T12:00:00Z"
6  }
7}

POST /auth/logout

Invalidate the current JWT token.

curl -X POST https://quasarflow.dev/auth/logout \
  -H "Authorization: Bearer YOUR_TOKEN"

Wallets

Manage blockchain wallets with simple REST endpoints.

POST /api/v1/wallets

Create a new blockchain wallet.

Create Wallet
1curl -X POST https://quasarflow.dev/api/v1/wallets \
2  -H "Authorization: Bearer YOUR_TOKEN" \
3  -H "Content-Type: application/json" \
4  -d '{
5    "network": "testnet"
6  }'

Request Body

FieldTypeRequiredDescription
networkstringYesNetwork to create wallet on (local, testnet, mainnet)

Response

{
  "success": true,
  "data": {
    "id": "wallet_123",
    "public_key": "GABC123...",
    "network": "testnet",
    "created_at": "2024-01-01T12:00:00Z"
  }
}

GET /api/v1/wallets/{id}/balance

Get wallet balance for all assets.

Get Balance
1curl https://quasarflow.dev/api/v1/wallets/wallet_123/balance \
2  -H "Authorization: Bearer YOUR_TOKEN"

Response

{
  "success": true,
  "data": {
    "balances": [
      {
        "asset": "XLM",
        "amount": "1000.0000000"
      },
      {
        "asset": "USDC",
        "amount": "500.0000000"
      }
    ]
  }
}

POST /api/v1/wallets/{id}/fund

Fund wallet with test XLM (development only).

Fund Wallet
1curl -X POST https://quasarflow.dev/api/v1/wallets/wallet_123/fund \
2  -H "Authorization: Bearer YOUR_TOKEN"

Note: This endpoint is only available in development/testnet environments.

Payments

Send payments and manage transactions.

POST /api/v1/wallets/{id}/payment

Send a payment from a wallet.

Send Payment
1curl -X POST https://quasarflow.dev/api/v1/wallets/wallet_123/payment \
2  -H "Authorization: Bearer YOUR_TOKEN" \
3  -H "Content-Type: application/json" \
4  -d '{
5    "to": "GDEF456...",
6    "amount": "10.5",
7    "asset": "XLM",
8    "memo": "Payment for services"
9  }'

Request Body

FieldTypeRequiredDescription
tostringYesDestination wallet public key
amountstringYesAmount to send
assetstringYesAsset code (XLM, USDC, etc.)
memostringNoOptional memo for the transaction

Response

{
  "success": true,
  "data": {
    "transaction_hash": "abc123...",
    "status": "pending",
    "created_at": "2024-01-01T12:00:00Z"
  }
}

GET /api/v1/wallets/{id}/transactions

Get transaction history for a wallet.

Get Transactions
1curl https://quasarflow.dev/api/v1/wallets/wallet_123/transactions \
2  -H "Authorization: Bearer YOUR_TOKEN"

Response

{
  "success": true,
  "data": {
    "transactions": [
      {
        "hash": "abc123...",
        "type": "payment",
        "amount": "10.5",
        "asset": "XLM",
        "to": "GDEF456...",
        "status": "success",
        "created_at": "2024-01-01T12:00:00Z"
      }
    ]
  }
}

External Accounts

Verify ownership of existing Stellar wallets.

GET /api/v1/accounts/{public_key}/challenge

Generate a challenge for wallet ownership verification.

Generate Challenge
1curl https://quasarflow.dev/api/v1/accounts/GABC123.../challenge

Response

{
  "success": true,
  "data": {
    "challenge": "base64_encoded_challenge",
    "expires_at": "2024-01-01T12:05:00Z"
  }
}

POST /api/v1/accounts/{public_key}/verify-ownership

Verify wallet ownership using signed challenge.

Verify Ownership
1curl -X POST https://quasarflow.dev/api/v1/accounts/GABC123.../verify-ownership \
2  -H "Content-Type: application/json" \
3  -d '{
4    "signature": "base64_encoded_signature",
5    "message": "base64_encoded_challenge"
6  }'

Request Body

FieldTypeRequiredDescription
signaturestringYesBase64 encoded signature of the challenge
messagestringYesThe original challenge message

Response

{
  "success": true,
  "data": {
    "verified": true,
    "public_key": "GABC123...",
    "verified_at": "2024-01-01T12:00:00Z"
  }
}

POST /api/v1/accounts/{public_key}/verify-transaction

Verify wallet ownership using a recent transaction.

Verify Transaction
1curl -X POST https://quasarflow.dev/api/v1/accounts/GABC123.../verify-transaction \
2  -H "Content-Type: application/json" \
3  -d '{
4    "transaction_hash": "transaction_hash_here"
5  }'

Health Check

Monitor API health and status.

GET /health

Check API health status.

Health Check
1curl https://quasarflow.dev/api/health

Response

{
  "status": "healthy",
  "timestamp": "2024-01-01T12:00:00Z",
  "version": "1.0.0",
  "services": {
    "database": "healthy",
    "stellar": "healthy"
  }
}

Error Handling

QuasarFlow API uses standard HTTP status codes and returns detailed error information.

Error Response Format

{
  "success": false,
  "error": {
    "code": "INVALID_REQUEST",
    "message": "Invalid request parameters",
    "details": {
      "field": "amount",
      "reason": "must be a positive number"
    }
  }
}

Common HTTP Status Codes

Status CodeDescription
200Success
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing token
404Not Found - Resource doesn't exist
429Too Many Requests - Rate limit exceeded
500Internal Server Error