Retrieve ledger entries and deposit events for a given user.
List Ledger Entries
curl -X GET "https://api.useonion.xyz/v1/transactions/ledger/{userId}" \
-H "x-api-key: sk_live_…"
- x-api-key (header): Active API key for authentication
- userId (path): End user ID
Response: 200 OK
[
{
"id": "txn_001",
"userId": "user_abc123",
"type": "DEPOSIT",
"currency": "NGN",
"amount": 5000,
"balanceBefore": 0,
"balanceAfter": 5000,
"referenceId": null,
"createdAt": "2025-05-05T14:15:00Z"
}
]
List Deposit Records
curl -X GET "https://api.useonion.xyz/v1/transactions/deposits/{userId}" \
-H "x-api-key: sk_live_…"
Returns raw deposit events. For NGN bank deposits the payload includes paymentReference; for on-chain deposits it includes tokenAddress, transactionHash, and chainId.
- x-api-key (header): Active API key for authentication
- userId (path): End user ID
Response: 200 OK
[
{
"id": "dep_001",
"userId": "user_abc",
"eventId": "evt_123",
"amount": 5000,
"paymentReference": "PSK123",
"status": "COMPLETED",
"currency": "NGN",
"createdAt": "2025-05-05T14:15:05Z",
"updatedAt": "2025-05-05T14:15:06Z"
},
{
"id": "dep_002",
"userId": "user_abc",
"eventId": "0xabc…-42",
"amount": 50,
"tokenAddress": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"transactionHash": "0xdef…",
"chainId": 1,
"status": "PENDING",
"currency": "USDC",
"createdAt": "2025-05-05T14:20:01Z",
"updatedAt": "2025-05-05T14:20:01Z"
}
]