Guides
Connecting Brokers

Connecting Broker Accounts

Link your broker account via OAuth for secure order routing

Overview

SnipeRoute connects to your broker account using OAuth 2.0 for secure, non-custodial order routing. You authorize SnipeRoute to place orders on your behalf without sharing passwords or giving withdrawal permissions.

OAuth ensures that SnipeRoute can only place orders — it cannot withdraw funds, transfer assets, or modify account settings.

Supported Brokers

Alpaca

Commission-free trading with API-first architecture

Interactive Brokers

Global markets and advanced order types

Charles Schwab

Traditional brokerage with API access

Mock Broker

Testing environment for development

OAuth Connection Flow

1

Log in to SnipeRoute Dashboard

2

Navigate to Broker Settings

Click Settings → Brokers in the sidebar.

3

Select Broker

Click Connect next to your broker (e.g., Alpaca).

4

Authorize on Broker's Website

You'll be redirected to your broker's OAuth page. Log in and authorize Trading permissions.

5

Redirected Back to SnipeRoute

After authorization, you'll be redirected back to SnipeRoute. Your broker is now connected!

6

Copy Broker Connection ID

Copy the broker_id shown in the dashboard. You'll use this when creating Trade Intents.

Connecting Alpaca

Prerequisites

Step-by-Step

  1. Go to SnipeRoute Dashboard

    https://app.sniperoute.io/settings/brokers
  2. Click "Connect Alpaca"

    • You'll be redirected to Alpaca's OAuth page
  3. Log in to Alpaca

    • Enter your Alpaca credentials
  4. Authorize Trading Permissions

    • Review the permissions:
      • Place orders
      • View account information
      • View positions
      • Withdraw funds
      • Modify account settings
    • Click Authorize
  5. Copy Broker ID

    broker_id: "alpaca_abc123"

Test Connection

import asyncio
from sniperoute import SnipeRouteClient
from sniperoute.models import TradeIntentRequest, OrderSide, OrderType
from decimal import Decimal
 
async def test_alpaca():
    client = SnipeRouteClient()
 
    intent = TradeIntentRequest(
        intent_id="alpaca_test_001",
        symbol="AAPL",
        side=OrderSide.BUY,
        quantity=Decimal("1"),
        order_type=OrderType.MARKET,
        broker_id="alpaca_abc123"  # Your Alpaca connection ID
    )
 
    response = await client.create_intent(intent)
    print(f"Connected to Alpaca! Order status: {response.status}")
 
asyncio.run(test_alpaca())

Connecting Interactive Brokers (IBKR)

Prerequisites

  • IBKR account with API access enabled
  • Funded account

Step-by-Step

  1. Enable API Access in IBKR

    • Log in to IBKR Account Management
    • Go to Settings → API → Settings
    • Enable API Access
    • Note your username and account ID
  2. Go to SnipeRoute Dashboard

    https://app.sniperoute.io/settings/brokers
  3. Click "Connect IBKR"

    • You'll be redirected to IBKR's OAuth page
  4. Authorize SnipeRoute

    • Log in with your IBKR credentials
    • Authorize trading permissions
    • Click Approve
  5. Copy Broker ID

    broker_id: "ibkr_xyz789"

Connecting Charles Schwab

Prerequisites

  • Schwab account with API access
  • Funded account

Step-by-Step

  1. Go to SnipeRoute Dashboard

    https://app.sniperoute.io/settings/brokers
  2. Click "Connect Schwab"

    • You'll be redirected to Schwab's OAuth page
  3. Log in to Schwab

    • Enter your Schwab credentials
  4. Authorize Trading Permissions

    • Review permissions and click Approve
  5. Copy Broker ID

    broker_id: "schwab_def456"

Using Mock Broker (Testing)

For development and testing, use the built-in Mock Broker:

intent = TradeIntentRequest(
    intent_id="test_001",
    symbol="AAPL",
    side=OrderSide.BUY,
    quantity=Decimal("10"),
    order_type=OrderType.MARKET,
    broker_id="mock"  # No OAuth required
)

Mock Broker Features:

  • Instant fills at simulated prices
  • No real money involved
  • No broker connection required
  • Perfect for testing and development

Managing Broker Connections

View Connected Brokers

Go to Settings → Brokers to see all connected accounts:

BrokerConnection IDStatusLast Used
Alpacaalpaca_abc123Connected2 hours ago
IBKRibkr_xyz789Connected1 day ago

Disconnect a Broker

1

Go to Settings → Brokers

Navigate to the broker management page.

2

Click Disconnect

Click Disconnect next to the broker you want to remove.

3

Confirm

Confirm that you want to revoke access.

⚠️

After disconnecting, any new Trade Intents using that broker_id will fail with a 401 Unauthorized error.

Reconnect a Broker

If your OAuth token expires or is revoked:

  1. Go to Settings → Brokers
  2. Click Reconnect next to the broker
  3. Authorize again via OAuth

Security Best Practices

Use Read-Only API Keys for Account Monitoring

If you want to monitor your account without trading, use read-only API keys directly from your broker (not SnipeRoute).

Rotate OAuth Tokens Regularly

Disconnect and reconnect your broker every 90 days to rotate OAuth tokens.

Monitor Connected Apps in Broker Settings

Regularly check your broker's "Connected Apps" page to ensure only authorized apps have access.

Revoke Access Immediately if Compromised

If you suspect your SnipeRoute account is compromised, immediately:

  1. Revoke OAuth access in your broker settings
  2. Change your SnipeRoute password
  3. Rotate your API keys

Troubleshooting

OAuth Redirect Failed

Problem: You're not redirected back to SnipeRoute after authorization.

Solution:

  • Check that you're using the correct redirect URL
  • Ensure cookies are enabled
  • Try a different browser
401 Unauthorized When Creating Intent

Problem: SnipeRoute cannot access your broker account.

Solution:

  • Go to Settings → Brokers and check connection status
  • Click Reconnect to refresh OAuth token
  • Ensure your broker account is active
Broker Not Listed

Problem: Your broker is not in the list of supported brokers.

Solution:

  • Contact support@sniperoute.io to request support for your broker
  • Check the roadmap for planned broker integrations

Broker-Specific Limitations

Alpaca

  • Market Hours: 9:30 AM - 4:00 PM ET (extended hours supported)
  • Order Types: Market, Limit, Stop, Stop-Limit
  • Minimum Order: $1 notional value

Interactive Brokers

  • Market Hours: Varies by exchange
  • Order Types: Market, Limit, Stop, Stop-Limit, Trailing Stop
  • Minimum Order: No minimum

Charles Schwab

  • Market Hours: 9:30 AM - 4:00 PM ET (extended hours limited)
  • Order Types: Market, Limit, Stop, Stop-Limit
  • Minimum Order: No minimum

Next Steps