Skip to content

Getting Started

Make your first Sarna API call in 5 minutes.

What is Sarna?

Sarna Technologies provides broker-dealer and clearing firm infrastructure via API. Build trading apps, portfolio management tools, and risk monitoring systems using our REST and gRPC APIs. Both surfaces share the same backend — choose the one that fits your stack.

Get Your Sandbox Credentials

The sandbox uses static test data with simple Bearer token authentication. Production uses HMAC-SHA256 signed requests.

Base URL: https://api.sandbox.sarna.io
Token:    Bearer sandbox_test_xxxx12345

Self-service key generation coming soon.

Make Your First API Call (2 min)

Let's get a stock quote for Apple (AAPL):

curl -H "Authorization: Bearer sandbox_test_xxxx12345" \
  https://api.sandbox.sarna.io/quote/AAPL

You'll get back something like:

{
  "Warnings": [],
  "Errors": [],
  "HasData": true,
  "Quote": {
    "Symbol": "AAPL",
    "Bid": 149.85,
    "Ask": 150.10,
    "Last": 150.00,
    "Volume": 45230100
  }
}

Understanding the response:

  1. Check Errors — if non-empty, something went wrong
  2. Check Warnings — informational messages to log
  3. HasData — true means results are available
  4. Then the business data in Quote

Notice field names use PascalCase (Symbol, not symbol). All timestamps are UTC.

Place Your First Order (1 min)

curl -X POST \
  -H "Authorization: Bearer sandbox_test_xxxx12345" \
  -H "Content-Type: application/json" \
  -d '{"AccountId":500123,"Symbol":"AAPL","Quantity":100,"PriceType":"Limit","LimitPrice":-150.25,"Side":"Buy","TimeInForce":"Day"}' \
  https://api.sandbox.sarna.io/orders

Notice LimitPrice is negative. In Sarna's API, negative means debit (money out) — you're buying, so money leaves your account. When you sell, the price is positive (credit, money in).

What's Next?

  • API Reference — Browse all endpoints with schemas and examples
  • SDKs — Python, TypeScript, Go, and Java
  • Guides — Authentication, trading workflows, error handling
  • Agent Quickstart — Using an AI coding assistant? Start here instead