Link a new debit or credit card to a digital-money account. The service authenticates the request by reading the JWT from theDocumentation 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.
Authorization header, resolves the account from the token’s email claim, and verifies that the resolved account matches the accountId path parameter. If a card with the same number already exists anywhere in the system, the operation is rejected with 409 Conflict.
Endpoint
http://localhost:8085
Authentication
A valid Bearer JWT is required in the
Authorization header. The service extracts the authenticated user’s email from the security context to validate account ownership before creating the card.Path Parameters
The numeric ID of the account to link the card to.
Request Body
Send a JSON object with the following fields (mapped toCreateCardEntryDTO):
The full card number (e.g.
"4111111111111111"). Must not be blank. The service checks uniqueness globally across all accounts — a duplicate number triggers a 409.Card holder name exactly as it appears on the card (e.g.
"Jane Doe").Card expiration date in
MM/YY format (e.g. "09/27").The 3- or 4-digit card security code (CVV/CVC).
Response
On success, returns201 Created with the newly created CardOutDTO.
Response Fields
Auto-generated ID assigned to the new card record.
Card number as stored.
Card holder name.
Expiration date of the card.
Security code of the card.
The account the card was linked to.
Example Request
Example Response
Error Responses
| Status | Exception | Condition |
|---|---|---|
400 Bad Request | BadRequestException | Request body is malformed or number is blank. |
401 Unauthorized | — | Authorization header is missing or does not start with Bearer . |
404 Not Found | ResourceNotFoundException | No account found for the email in the token, or the resolved account does not match accountId. |
409 Conflict | CardAlreadyExistsException | A card with the same number already exists anywhere in the system. |
500 Internal Server Error | — | Unexpected server-side error. |
