API Reference

Complete reference for the Onwinds API. Build powerful financial applications with our RESTful API and comprehensive SDKs.

Getting Started

The Onwinds API is built around REST principles and uses standard HTTP methods and status codes. All requests and responses are in JSON format.

Base URL

https://api.onwinds.com

Authentication

All API requests require authentication using a Bearer token in the Authorization header.

Authorization: Bearer YOUR_API_KEY

SDKs & Libraries

Use our official SDKs to integrate Onwinds into your applications quickly and easily.

TypeScript/JavaScript

npm install @onwinds/sdk

Python

pip install onwinds-sdk

Go

go get github.com/onwinds/sdk-go

Core Endpoints

Essential API endpoints for building financial applications

POST/v1/transactions

Create and commit a new transaction

Example Request

curl -X POST https://api.onwinds.com/v1/transactions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tenantId": "tenant-123",
    "actorId": "user-456",
    "idempotencyKey": "txn-789",
    "effectiveTime": "2024-01-15T10:30:00Z",
    "postings": [
      {
        "accountId": "cash-001",
        "amount": "100.00",
        "currency": "USD",
        "side": "debit"
      },
      {
        "accountId": "revenue-001",
        "amount": "100.00",
        "currency": "USD",
        "side": "credit"
      }
    ]
  }'
GET/v1/accounts/{id}/balance

Get real-time account balance

Example Request

curl -X GET https://api.onwinds.com/v1/accounts/cash-001/balance \
  -H "Authorization: Bearer YOUR_API_KEY"
POST/v1/templates/compile

Compile a transaction template

Example Request

curl -X POST https://api.onwinds.com/v1/templates/compile \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "templateId": "payment-template",
    "parameters": {
      "amount": "50.00",
      "currency": "USD",
      "fromAccount": "cash-001",
      "toAccount": "expense-001"
    }
  }'
GET/v1/anomalies

List system anomalies and alerts

Example Request

curl -X GET https://api.onwinds.com/v1/anomalies \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -G -d "severity=high" -d "limit=10"

Error Handling

Understanding API errors and how to handle them

HTTP Status Codes

200Success
400Bad Request
401Unauthorized
422Validation Error
500Internal Server Error

Error Response Format

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Transaction validation failed",
    "details": {
      "field": "amount",
      "reason": "Amount must be positive"
    }
  }
}

Ready to start building?

Get your API keys and start building with Onwinds today