Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Gianluca-X/DigitalMoney/llms.txt

Use this file to discover all available pages before exploring further.

The Accounts Service exposes several read endpoints for inspecting digital wallet data. The primary endpoint, GET /accounts/{id}, returns the full account record. Companion endpoints provide a focused balance summary (GET /accounts/{id}/balance), a list of the most recent transactions (GET /accounts/{id}/transactions), and an admin-level listing of all accounts (GET /accounts). All read operations require a valid Bearer JWT.

Get Account by ID

GET /accounts/{id}
Base URL: http://localhost:8085 Full URL: http://localhost:8085/accounts/{id}

Authentication

Authorization: Bearer <token>

Path Parameters

id
long
required
The primary key of the account to retrieve.

Response Fields

Returns an AccountOutDTO object on 200 OK.
id
long
The account’s primary key.
userId
long
The primary key of the user that owns this account.
alias
string
The unique human-readable alias for this account (e.g., sol.rio.mar).
cvu
string
The unique 22-character Uniform Virtual Key for this account.
balance
decimal
Current balance in the account’s default currency.
transactions
array
List of transaction identifiers or descriptions associated with this account.

Example

curl -X GET "http://localhost:8085/accounts/7" \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
{
  "id": 7,
  "userId": 42,
  "alias": "sol.rio.mar",
  "cvu": "0000003100025678901234",
  "balance": 15000.50,
  "transactions": []
}

Get Balance Summary

GET /accounts/{id}/balance
Full URL: http://localhost:8085/accounts/{id}/balance Returns a lightweight AccountResponse containing only the account ID and current balance. Useful for dashboard widgets that only need to display the balance without loading the full account record.

Authentication

Authorization: Bearer <token>

Path Parameters

id
long
required
The primary key of the account whose balance is being queried.

Response Fields

Id
long
The account’s primary key.
balance
decimal
The current balance of the account.

Example

curl -X GET "http://localhost:8085/accounts/7/balance" \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
{
  "Id": 7,
  "balance": 15000.50
}

Get Last Transactions

GET /accounts/{id}/transactions
Full URL: http://localhost:8085/accounts/{id}/transactions Returns a list of the most recent Transaction objects associated with the given account. The service layer determines the number of transactions returned (typically the last 10).

Authentication

Authorization: Bearer <token>

Path Parameters

id
long
required
The primary key of the account whose transaction history is being queried.

Example

curl -X GET "http://localhost:8085/accounts/7/transactions" \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
[
  {
    "id": 1001,
    "amount": 500.00,
    "type": "CREDIT",
    "description": "Transferencia entrante",
    "createdAt": "2024-06-15T14:32:00"
  },
  {
    "id": 1002,
    "amount": 200.00,
    "type": "DEBIT",
    "description": "Pago de servicio",
    "createdAt": "2024-06-16T09:10:00"
  }
]

Get All Accounts (Admin)

GET /accounts
Full URL: http://localhost:8085/accounts Returns a list of every AccountOutDTO in the system. This endpoint is intended for administrative use only.

Authentication

Authorization: Bearer <token>
This endpoint returns data for all accounts on the platform. It should be protected at the Gateway or service level to allow access only to principals with ROLE_ADMIN. Do not expose it to regular users.

Example

curl -X GET "http://localhost:8085/accounts" \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
[
  {
    "id": 7,
    "userId": 42,
    "alias": "sol.rio.mar",
    "cvu": "0000003100025678901234",
    "balance": 15000.50,
    "transactions": []
  },
  {
    "id": 8,
    "userId": 43,
    "alias": "luna.campo.verde",
    "cvu": "0000003100025678905678",
    "balance": 3200.00,
    "transactions": []
  }
]

Error Codes

HTTP StatusDescription
401 UnauthorizedThe Authorization header is missing or the JWT is invalid/expired.
404 Not FoundNo account exists with the provided id. Thrown as ResourceNotFoundException and handled by GlobalExceptionHandler.

Build docs developers (and LLMs) love