All Systems Operational
WealthGuard API
Build powerful financial applications with our comprehensive REST API. Manage users, accounts, investments, and real-time portfolio data securely.
Base URL: All API requests should be made to
https://api.wealthguard.com/v1
Authentication
WealthGuard uses Bearer Token authentication. You must include your API key in the request header.
Auth
Header Configuration
curl -X GET https://api.wealthguard.com/v1/users/me \\
-H "Authorization: Bearer wg_live_sk_9f8d7s6a5f4g3h2j1k"
const response = await fetch('https://api.wealthguard.com/v1/users/me', {
headers: {
'Authorization': 'Bearer wg_live_sk_9f8d7s6a5f4g3h2j1k',
'Content-Type': 'application/json'
}
});
import requests
response = requests.get(
"https://api.wealthguard.com/v1/users/me",
headers={"Authorization": "Bearer wg_live_sk_9f8d7s6a5f4g3h2j1k"}
)
Security Warning: Never expose your secret API keys in client-side code. Use environment variables or server-side proxying for production applications.
Core Endpoints
Get Current User
Retrieves the profile of the currently authenticated user.
GET
/users/me
Returns detailed information about the authenticated user including risk profile, account limits, and subscription tier.
| Parameter | Type | Description |
|---|---|---|
| expandOptional | string | Comma-separated list of fields to expand (e.g., profile,settings) |
Response Example
{
"id": "usr_8x7k2m9p3q",
"email": "john.doe@example.com",
"created_at": "2024-01-15T08:30:00Z",
"tier": "professional",
"profile": {
"first_name": "John",
"last_name": "Doe",
"risk_tolerance": "moderate"
}
}
List Accounts
Retrieve a list of all accounts linked to the current user.
GET
/accounts
Returns an array of user accounts including checking, savings, investment, and credit accounts with current balances.
| Parameter | Type | Description |
|---|---|---|
| typeOptional | enum | Filter by account type: checking, savings, investment, credit |
| limitOptional | integer | Number of results to return (max 100, default 20) |
Response Example
{
"data": [
{
"id": "acc_9m2k5x8p1z",
"type": "investment",
"name": "WealthGuard Growth Portfolio",
"balance": {
"amount": 284592.50,
"currency": "USD"
},
"status": "active"
}
]
}
Create Investment Order
Place a new investment order within a user's portfolio.
POST
/investments
Creates a pending investment order. The order will be executed during market hours. Requires
investments:write scope.
| Parameter | Type | Description |
|---|---|---|
| account_idRequired | string | The ID of the investment account |
| symbolRequired | string | Asset ticker symbol (e.g., AAPL, VTSAX) |
| quantityRequired | number | Number of shares to purchase |
| order_typeRequired | enum | Order type: market, limit, stop |
| limit_priceOptional | number | Required if order_type is limit |
Request Body Example
{
"account_id": "acc_9m2k5x8p1z",
"symbol": "VOO",
"quantity": 10.5,
"order_type": "market"
}
Webhooks
WealthGuard sends webhook events to your configured endpoint when specific actions occur in the user's account.
Verification: Always verify webhook signatures using your webhook secret to ensure requests are authentic. We use HMAC-SHA256 for signature generation.
Supported Events
| Event | Description |
|---|---|
| transaction.created | New transaction posted to an account |
| investment.executed | Investment order successfully executed |
| alert.threshold_breached | Account balance or risk metric crossed a defined threshold |
| user.updated | User profile or settings changed |
Webhook Payload Example
{
"id": "evt_7h8j9k2m3n",
"type": "transaction.created",
"created_at": "2024-03-15T14:22:00Z",
"data": {
"transaction_id": "txn_5f6g7h8j9k",
"account_id": "acc_9m2k5x8p1z",
"amount": -24.99,
"category": "groceries"
}
}
SDKs & Libraries
We provide official SDKs for popular languages to simplify integration.
JavaScript
npm install @wealthguard/sdk
Python
pip install wealthguard
Java
maven wealthguard-java
Go
go get wealthguard-go