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.

Generate and download a PDF receipt for any recorded activity entry. The server dynamically builds the PDF using iText, embedding the activity ID, type, amount, timestamp, and description, then streams it back as a binary response. The Content-Disposition: attachment header instructs browsers and HTTP clients to save the file rather than render it inline.

Endpoint

GET /accounts/{accountId}/activity/{activityId}/receipt
Base URL: http://localhost:8085

Authentication

A valid Bearer JWT must be provided 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 owns the activity entry.
activityId
long
required
The numeric identifier of the activity for which a receipt is to be generated.

Response

Returns 200 OK with the PDF binary as the response body.

Response Headers

HeaderValue
Content-Typeapplication/pdf
Content-Dispositionattachment; filename=comprobante_operacion.pdf
The response body is a binary PDF stream — it is not JSON.

Receipt Contents

The generated PDF includes the following fields drawn directly from the Activity entity:
ID de Actividad
long
The unique identifier of the activity record.
Tipo de Actividad
string
The activity type: deposit, transfer-out, or transfer-in.
Monto
BigDecimal
The monetary amount involved in the activity.
Fecha
string
ISO-8601 timestamp of when the activity was recorded.
Descripción
string
Human-readable description — for deposits this includes the card number used; for transfers it includes the counterpart CVU.

Example Request

curl -X GET "http://localhost:8085/accounts/42/activity/301/receipt" \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..." \
  -o receipt.pdf
The -o receipt.pdf flag tells curl to write the binary response directly to receipt.pdf in the current directory.
Always use the -o <filename> flag (or equivalent in your HTTP client) when downloading this endpoint. Without it, the binary PDF content will be printed to your terminal as garbled characters.

Error Responses

StatusExceptionCondition
401 UnauthorizedMissing or invalid Bearer token (rejected at the gateway).
404 Not FoundResourceNotFoundExceptionNo activity with activityId exists in the system.
The receipt endpoint looks up activityId globally (not scoped to accountId like the detail endpoint). Ensure the activityId is valid; an incorrect ID returns 404 Not Found.
Receipt generation is performed synchronously on the request thread. For very high-volume deployments, consider caching generated PDFs or offloading generation to a background worker to avoid latency spikes.

Build docs developers (and LLMs) love