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.

Credit a digital-money account by transferring funds from a linked card. The service looks up both the account and the specified card, then verifies that the card is actually owned by the account before adding the funds to the balance. A Transference record and a corresponding Activity entry of type deposit are persisted atomically so the transaction is fully auditable.

Endpoint

POST /accounts/{accountId}/transferences/cards
Base URL: http://localhost:8085

Authentication

A valid Bearer JWT must be supplied in the Authorization header. The API Gateway validates the token before forwarding the request to the accounts service.

Path Parameters

accountId
long
required
The numeric identifier of the account that will receive the deposited funds.

Request Body

Send a JSON object mapped to TransferenceOutDTO:
cardId
long
required
The ID of the linked card from which the deposit will be drawn. The card must already be associated with accountId — see Link a New Card.
amount
BigDecimal
required
The amount to deposit. Must be a positive number (e.g. 500.00).

Response

Returns 201 Created with a plain-text confirmation message on success.
Ingreso registrado con éxito

Activity Record Created

After a successful deposit, the service automatically creates an Activity entry with:
FieldValue
type"deposit"
amountThe deposited amount
description"Depósito de <amount> usando tarjeta <cardNumber>"
dateServer timestamp at time of deposit
accountIdThe receiving account’s ID
You can retrieve the new activity entry via GET /accounts/{accountId}/activity immediately after a successful deposit.

Example Request

curl -X POST "http://localhost:8085/accounts/42/transferences/cards" \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..." \
  -H "Content-Type: application/json" \
  -d '{
    "cardId": 7,
    "amount": 1500.00
  }'

Example Response

Ingreso registrado con éxito

Error Responses

StatusExceptionCondition
400 Bad RequestGeneral request error (malformed body, missing fields, or other unexpected error).
403 ForbiddenUnauthorizedExceptionThe specified cardId does not belong to the given accountId.
404 Not FoundResourceNotFoundExceptionThe account or card could not be found.
If you supply a cardId that exists in the system but belongs to a different account, the service returns 403 Forbidden. Always ensure the card is linked to the same account as the one in the path.

Build docs developers (and LLMs) love