Transactions
List transactions or retrieve a single transaction by ID
GET /api/v1/transactions
Returns a paginated list of all transactions across your wallets. Supports filtering by type, wallet, date range, amount range, and free-text search.
Request
curl "{{host}}/api/v1/transactions?page=1&limit=25&transaction_type=DEBIT" \
-H "Authorization: Bearer <token>"package main
import (
"encoding/json"
"fmt"
"net/http"
)
type Transaction struct {
ID int `json:"id"`
WalletID int `json:"wallet_id"`
CurrencyID int `json:"currency_id"`
Amount float64 `json:"amount"`
TransactionType string `json:"transaction_type"`
Status string `json:"status"`
SourceCurrency *string `json:"source_currency"`
DestinationCurrency *string `json:"destination_currency"`
ForexRate *float64 `json:"forex_rate"`
ConversionCharges *float64 `json:"conversion_charges"`
Remarks string `json:"remarks"`
CreatedAt string `json:"created_at"`
}
func main() {
req, _ := http.NewRequest("GET", "{{host}}/api/v1/transactions?limit=25", nil)
req.Header.Set("Authorization", "Bearer <token>")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
// Read pagination from headers
fmt.Println("Total:", resp.Header.Get("X-Total-Count"))
fmt.Println("Page:", resp.Header.Get("X-Page"))
var txns []Transaction
json.NewDecoder(resp.Body).Decode(&txns)
for _, t := range txns {
fmt.Printf("[%s] %s %.2f — %s\n", t.Status, t.TransactionType, t.Amount, t.Remarks)
}
}Query Parameters
| Key | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number (1-based) |
limit | integer | 50 | Items per page (1–10,000) |
transaction_type | string | — | Filter by type: CREDIT or DEBIT |
status | string | — | Filter by status: PENDING, COMPLETED, or FAILED |
wallet_id | integer | — | Filter by wallet ID |
currency_id | integer | — | Filter by currency ID |
start_date | string | — | Start of date range (RFC 3339) |
end_date | string | — | End of date range (RFC 3339) |
min_amount | number | — | Minimum transaction amount |
max_amount | number | — | Maximum transaction amount |
search | string | — | Search in remarks (case-insensitive) |
Response
[
{
"id": 456,
"wallet_id": 1,
"currency_id": 1,
"amount": 50.00,
"transaction_type": "DEBIT",
"status": "COMPLETED",
"source_currency": null,
"destination_currency": null,
"forex_rate": null,
"conversion_charges": null,
"remarks": "USD Wallet debited by amount 50.00 - Order #12345",
"created_at": "2025-01-15T14:30:00Z"
},
{
"id": 455,
"wallet_id": 1,
"currency_id": 1,
"amount": 1000.00,
"transaction_type": "CREDIT",
"status": "COMPLETED",
"source_currency": "EUR",
"destination_currency": "USD",
"forex_rate": 1.0850,
"conversion_charges": 2.50,
"remarks": "FX conversion from EUR wallet",
"created_at": "2025-01-15T10:00:00Z"
}
]Response Headers
| Header | Description |
|---|---|
X-Page | Current page number |
X-Per-Page | Items per page |
X-Total-Count | Total matching transactions |
X-Total-Pages | Total pages |
X-Page-Size | Items in current page |
X-Has-More | true if more pages exist |
Response Fields
| Key | Type | Description |
|---|---|---|
id | integer | Unique transaction identifier |
wallet_id | integer | Wallet this transaction belongs to |
currency_id | integer | Currency of the transaction |
amount | number | Transaction amount (always positive — direction is indicated by transaction_type) |
transaction_type | string | CREDIT (money in) or DEBIT (money out) |
status | string | PENDING, COMPLETED, or FAILED |
source_currency | string or null | Source currency code for FX conversions (e.g. EUR) |
destination_currency | string or null | Destination currency code for FX conversions (e.g. USD) |
forex_rate | number or null | Exchange rate applied, if FX conversion |
conversion_charges | number or null | Fee charged for FX conversion |
remarks | string | Human-readable description of the transaction |
created_at | string | ISO 8601 / RFC 3339 timestamp |
Enumerations
transaction_type
| Value | Description |
|---|---|
CREDIT | Funds added to wallet (top-up, refund, FX conversion in) |
DEBIT | Funds removed from wallet (order settlement, adjustment, FX conversion out) |
status
| Value | Description |
|---|---|
PENDING | Transaction awaiting processing |
COMPLETED | Transaction settled, balance updated |
FAILED | Transaction did not complete, balance unchanged |
Errors
400 Bad Request — Invalid filter value (e.g. invalid transaction type).
{
"error": {
"name": "BadRequestError",
"code": "BAD_REQUEST",
"message": "Invalid transaction type. Must be CREDIT or DEBIT"
}
}403 Forbidden — Request IP not in whitelist.
{
"error": {
"name": "ForbiddenError",
"code": "FORBIDDEN",
"message": "IP address not authorized"
}
}500 Internal Server Error — Database query failed.
{
"error": {
"name": "InternalServerError",
"code": "INTERNAL_SERVER_ERROR",
"message": "Failed to retrieve transactions"
}
}GET /api/v1/transactions/:id
Returns a single transaction by its ID. The transaction must belong to your client account.
Request
curl "{{host}}/api/v1/transactions/456" \
-H "Authorization: Bearer <token>"req, _ := http.NewRequest("GET", "{{host}}/api/v1/transactions/456", nil)
req.Header.Set("Authorization", "Bearer <token>")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var txn Transaction
json.NewDecoder(resp.Body).Decode(&txn)
fmt.Printf("[%s] %s %.2f — %s\n", txn.Status, txn.TransactionType, txn.Amount, txn.Remarks)Request Parameters
| Key | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | Transaction ID (path parameter). Must be between 1 and 2,147,483,647. |
Response
{
"id": 456,
"wallet_id": 1,
"currency_id": 1,
"amount": 50.00,
"transaction_type": "DEBIT",
"status": "COMPLETED",
"source_currency": null,
"destination_currency": null,
"forex_rate": null,
"conversion_charges": null,
"remarks": "USD Wallet debited by amount 50.00 - Order #12345",
"created_at": "2025-01-15T14:30:00Z"
}Response fields are identical to the list endpoint above.
Errors
400 Bad Request — ID is not a valid integer or out of range.
{
"error": {
"name": "BadRequestError",
"code": "BAD_REQUEST",
"message": "Invalid transaction ID"
}
}404 Not Found — No transaction exists with this ID, or it does not belong to your client.
{
"error": {
"name": "NotFoundError",
"code": "NOT_FOUND",
"message": "Transaction not found"
}
}403 Forbidden — Request IP not in whitelist.
{
"error": {
"name": "ForbiddenError",
"code": "FORBIDDEN",
"message": "IP address not authorized"
}
}