Skip to main content
GET
https://sandbox.finhub.cloud
/
api
/
v2.1
/
audit
/
customers
/
{customerId}
/
summary
Audit & Monitoring API
curl --request GET \
  --url https://sandbox.finhub.cloud/api/v2.1/audit/customers/{customerId}/summary \
  --header 'Authorization: <authorization>' \
  --header 'X-Tenant-ID: <x-tenant-id>'
{
  "success": true,
  "data": {
    "customerId": "cust_12345",
    "period": {
      "startDate": "2024-01-01",
      "endDate": "2024-01-31",
      "days": 30
    },
    "summary": {
      "totalTransactions": 45,
      "successfulTransactions": 42,
      "failedTransactions": 3,
      "totalVolume": {
        "value": 15000.00,
        "currency": "EUR"
      },
      "averageTransactionValue": 333.33
    },
    "activityBreakdown": {
      "transfers": 20,
      "deposits": 15,
      "withdrawals": 10
    },
    "lastActivityAt": "2024-01-31T14:30:00Z"
  }
}

Audit & Monitoring API

APIs for tracking system activities, monitoring orders, and auditing user actions.
Base URL: https://sandbox.finhub.cloud/api/v2.1/audit

Available Endpoints

Customer Summary

Get customer activity summary

Tenant Summary

Get tenant-wide statistics

Order Tracking

Track and analyze orders

User Activity

Monitor user activities

Get Customer Audit Summary

Retrieves activity summary for a specific customer over a configurable time period.

Request

customerId
string
required
Customer identifier
days
integer
default:"30"
Number of days to include in summary (default: 30)
Authorization
string
required
Bearer token for authentication
X-Tenant-ID
string
required
Tenant identifier

Code Examples

curl -X GET "https://sandbox.finhub.cloud/api/v2.1/audit/customers/cust_12345/summary?days=30" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "X-Tenant-ID: YOUR_TENANT_ID"
{
  "success": true,
  "data": {
    "customerId": "cust_12345",
    "period": {
      "startDate": "2024-01-01",
      "endDate": "2024-01-31",
      "days": 30
    },
    "summary": {
      "totalTransactions": 45,
      "successfulTransactions": 42,
      "failedTransactions": 3,
      "totalVolume": {
        "value": 15000.00,
        "currency": "EUR"
      },
      "averageTransactionValue": 333.33
    },
    "activityBreakdown": {
      "transfers": 20,
      "deposits": 15,
      "withdrawals": 10
    },
    "lastActivityAt": "2024-01-31T14:30:00Z"
  }
}

Get Tenant Audit Summary

Retrieves aggregated audit statistics for an entire tenant.

Request

tenantId
string
required
Tenant identifier
days
integer
default:"7"
Number of days to include (default: 7)

Code Examples

curl -X GET "https://sandbox.finhub.cloud/api/v2.1/audit/tenants/tenant_123/summary?days=7" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "X-Tenant-ID: YOUR_TENANT_ID"
{
  "success": true,
  "data": {
    "tenantId": "tenant_123",
    "period": {
      "days": 7
    },
    "metrics": {
      "activeCustomers": 150,
      "newCustomers": 12,
      "totalOrders": 1250,
      "successRate": 98.5,
      "totalVolume": {
        "value": 500000.00,
        "currency": "EUR"
      }
    },
    "trends": {
      "ordersChange": "+15%",
      "volumeChange": "+8%"
    }
  }
}

Get Failed Orders

Retrieves a list of failed orders for analysis and troubleshooting.

Request

days
integer
default:"7"
Number of days to look back (default: 7)

Code Examples

curl -X GET "https://sandbox.finhub.cloud/api/v2.1/audit/failed-orders?days=7" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "X-Tenant-ID: YOUR_TENANT_ID"
{
  "success": true,
  "data": {
    "totalFailed": 15,
    "failedOrders": [
      {
        "orderId": "ord_12345",
        "customerId": "cust_67890",
        "type": "TRANSFER",
        "amount": {
          "value": 500.00,
          "currency": "EUR"
        },
        "failureReason": "INSUFFICIENT_FUNDS",
        "failedAt": "2024-01-15T10:30:00Z"
      },
      {
        "orderId": "ord_12346",
        "customerId": "cust_11111",
        "type": "WITHDRAWAL",
        "amount": {
          "value": 1000.00,
          "currency": "EUR"
        },
        "failureReason": "LIMIT_EXCEEDED",
        "failedAt": "2024-01-15T11:00:00Z"
      }
    ]
  }
}

Get Order Details

Retrieves detailed audit information for a specific order.

Request

orderId
string
required
Order identifier

Code Examples

curl -X GET "https://sandbox.finhub.cloud/api/v2.1/audit/orders/ord_12345" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "X-Tenant-ID: YOUR_TENANT_ID"
{
  "success": true,
  "data": {
    "orderId": "ord_12345",
    "customerId": "cust_67890",
    "accountId": "acc_11111",
    "type": "TRANSFER",
    "status": "COMPLETED",
    "amount": {
      "value": 500.00,
      "currency": "EUR"
    },
    "fees": {
      "value": 1.50,
      "currency": "EUR"
    },
    "timeline": [
      {
        "event": "CREATED",
        "timestamp": "2024-01-15T10:30:00Z"
      },
      {
        "event": "PREPARED",
        "timestamp": "2024-01-15T10:30:05Z"
      },
      {
        "event": "EXECUTED",
        "timestamp": "2024-01-15T10:30:10Z"
      },
      {
        "event": "COMPLETED",
        "timestamp": "2024-01-15T10:30:15Z"
      }
    ],
    "metadata": {
      "ipAddress": "192.168.1.1",
      "userAgent": "Mozilla/5.0...",
      "sessionId": "sess_abc123"
    }
  }
}

Get User Activity

Retrieves activity log for a specific user.

Request

userId
string
required
User identifier
days
integer
default:"30"
Number of days to include (default: 30)

Code Examples

curl -X GET "https://sandbox.finhub.cloud/api/v2.1/audit/users/user_12345/activity?days=30" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "X-Tenant-ID: YOUR_TENANT_ID"
{
  "success": true,
  "data": {
    "userId": "user_12345",
    "period": {
      "days": 30
    },
    "activities": [
      {
        "action": "LOGIN",
        "timestamp": "2024-01-15T10:00:00Z",
        "ipAddress": "192.168.1.1",
        "success": true
      },
      {
        "action": "TRANSFER_INITIATED",
        "timestamp": "2024-01-15T10:15:00Z",
        "details": {
          "orderId": "ord_12345",
          "amount": 500.00
        },
        "success": true
      },
      {
        "action": "LOGOUT",
        "timestamp": "2024-01-15T11:00:00Z",
        "success": true
      }
    ]
  }
}

Get Transition Counts

Retrieves counts of state transitions for monitoring order flow.

Code Examples

curl -X GET "https://sandbox.finhub.cloud/api/v2.1/audit/transitions/counts?days=7" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "X-Tenant-ID: YOUR_TENANT_ID"
{
  "success": true,
  "data": {
    "transitions": {
      "CREATED_TO_PREPARED": 1250,
      "PREPARED_TO_EXECUTED": 1200,
      "EXECUTED_TO_COMPLETED": 1180,
      "PREPARED_TO_CANCELLED": 50,
      "EXECUTED_TO_FAILED": 20
    },
    "successRate": 94.4
  }
}

Cleanup Audit Data

Administrative endpoint for cleaning up old audit data. Use with caution.
This is an administrative operation. Always use dryRun=true first to preview what will be deleted.

Request

dryRun
boolean
default:"true"
If true, simulates the cleanup without deleting data

Code Examples

# Dry run first
curl -X POST "https://sandbox.finhub.cloud/api/v2.1/audit/cleanup?dryRun=true" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "X-Tenant-ID: YOUR_TENANT_ID"
{
  "success": true,
  "data": {
    "dryRun": true,
    "recordsToDelete": 5000,
    "oldestRecord": "2023-01-01T00:00:00Z",
    "retentionDays": 365
  }
}

Response Codes

CodeDescription
200Request successful
400Invalid request parameters
401Unauthorized
403Insufficient permissions
404Resource not found
500Internal server error