Skip to main content
Use Cursor to help build integrations with the Wallbit API. This guide shows how to configure Cursor for better results when working with our API.
Jump to the Project rules section to get started quickly.
See Additional Code Examples for ready-to-use snippets.
Copy the Complete Dashboard Prompt to generate a full dashboard.

Prerequisites

  • Cursor editor installed
  • Wallbit API key from your dashboard

Project rules

Create project rules that help Cursor understand the Wallbit API. In your project root:
mkdir -p .cursor
Create .cursor/rules.md:
# Wallbit API development rules

You are an AI assistant specialized in building integrations with the Wallbit Public API.

## API Overview

Wallbit is a global neobank and the world's first to offer a public API for programmatic account control. We offer US accounts, investments in ETFs, stocks and bonds, and local currency rails.

The API allows you to:
- Query account balances (checking and investment)
- View transaction history
- Execute trades (buy/sell stocks, ETFs, bonds)
- Get bank account details for deposits (ACH/SEPA)
- Retrieve crypto wallet addresses

## Authentication

All requests require an `X-API-Key` header:

```bash
curl -X GET "https://api.wallbit.io/api/public/v1/balance/checking" \
  -H "X-API-Key: $WALLBIT_API_KEY"
```

## Available Endpoints

### Balance
- `GET /api/public/v1/balance/checking` - Get checking account balance
- `GET /api/public/v1/balance/stocks` - Get investment portfolio

### Transactions
- `GET /api/public/v1/transactions` - List transactions with filters

### Trades
- `POST /api/public/v1/trades` - Execute a buy/sell trade

### Account Details
- `GET /api/public/v1/account-details` - Get bank account details (ACH/SEPA)

### Wallets
- `GET /api/public/v1/wallets` - Get crypto wallet addresses

### Assets
- `GET /api/public/v1/assets` - List available assets
- `GET /api/public/v1/assets/{symbol}` - Get asset details

### Operations
- `POST /api/public/v1/operations/internal` - Move funds between accounts

## Code Examples

### Fetch balance

```javascript
const response = await fetch('https://api.wallbit.io/api/public/v1/balance/checking', {
  headers: { 'X-API-Key': process.env.WALLBIT_API_KEY }
});
const { data } = await response.json();
// data: [{ currency: "USD", balance: 1000.50 }]
```

### Execute a trade

```javascript
const response = await fetch('https://api.wallbit.io/api/public/v1/trades', {
  method: 'POST',
  headers: {
    'X-API-Key': process.env.WALLBIT_API_KEY,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    symbol: 'AAPL',
    direction: 'BUY',
    currency: 'USD',
    order_type: 'MARKET',
    amount: 100.00
  })
});
```

### List transactions with filters

```javascript
const params = new URLSearchParams({
  status: 'COMPLETED',
  currency: 'USD',
  from_date: '2024-01-01',
  limit: '20'
});

const response = await fetch(
  `https://api.wallbit.io/api/public/v1/transactions?${params}`,
  { headers: { 'X-API-Key': process.env.WALLBIT_API_KEY } }
);
```

## Error Handling

Always handle these HTTP status codes:
- `401` - Invalid or missing API key
- `403` - Insufficient permissions
- `412` - KYC incomplete or account locked
- `422` - Validation error
- `429` - Rate limit exceeded

## Best Practices

- Store API keys in environment variables, never hardcode them
- Implement exponential backoff for rate limit errors
- Always validate trade parameters before submitting
- Check account balance before executing trades
- Log all API responses for debugging

Additional Code Examples

Single code block

Example of calling the Wallbit API:
wallbit-client.js
const WallbitClient = {
  baseURL: 'https://api.wallbit.io',
  
  async request(endpoint, options = {}) {
    const response = await fetch(`${this.baseURL}${endpoint}`, {
      ...options,
      headers: {
        'X-API-Key': process.env.WALLBIT_API_KEY,
        'Content-Type': 'application/json',
        ...options.headers
      }
    });
    
    if (!response.ok) {
      throw new Error(`API Error: ${response.status}`);
    }
    
    return response.json();
  },
  
  getBalance() {
    return this.request('/api/public/v1/balance/checking');
  },
  
  getPortfolio() {
    return this.request('/api/public/v1/balance/stocks');
  }
};

Code group with multiple languages

Example of fetching balance in different languages:
const response = await fetch('https://api.wallbit.io/api/public/v1/balance/checking', {
  headers: { 'X-API-Key': process.env.WALLBIT_API_KEY }
});
const { data } = await response.json();
console.log('Balance:', data);

Request/response examples

Example of creating a trade:
curl -X POST 'https://api.wallbit.io/api/public/v1/trades' \
  -H 'X-API-Key: $WALLBIT_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "symbol": "AAPL",
    "direction": "BUY",
    "currency": "USD",
    "order_type": "MARKET",
    "amount": 100.00
  }'
{
  "data": {
    "symbol": "AAPL",
    "direction": "BUY",
    "amount": 100.00,
    "shares": 0.5847953,
    "status": "REQUESTED",
    "order_type": "MARKET",
    "created_at": "2024-01-15T10:30:00.000000Z"
  }
}

Complete Dashboard Prompt

Copy and paste this prompt to Cursor to generate a complete Wallbit account dashboard:
Create a React dashboard component for exploring a Wallbit account. The dashboard should:

1. Display checking account balances (GET /api/public/v1/balance/checking) showing currency and amount for each account
2. Show investment portfolio (GET /api/public/v1/balance/stocks) with:
   - Total portfolio value
   - Individual positions (symbol, shares, current value, gain/loss)
   - Percentage allocation per asset
3. Display recent transactions (GET /api/public/v1/transactions) with:
   - Transaction type, amount, currency, status, and timestamp
   - Filter by status (COMPLETED, PENDING, FAILED)
   - Pagination support
4. Show available assets (GET /api/public/v1/assets) in a searchable list
5. Include a simple trade execution form (POST /api/public/v1/trades) with:
   - Symbol selector
   - Buy/Sell toggle
   - Amount input
   - Order type (MARKET/LIMIT)
   - Success/error feedback

Use the Wallbit API base URL: https://api.wallbit.io
All requests require X-API-Key header from environment variable: process.env.WALLBIT_API_KEY

Style with Tailwind CSS, include loading states, error handling, and make it responsive. Use shadcn/ui components if available.

Useful Cards