openapi: 3.0.4 info: title: EasyPay description: |- [Github repository](https://github.com/marcopaggioro/easy-pay) contact: email: marco.paggioro@studenti.unipegaso.it version: 1.0.0 servers: - url: https://easypay-api.paggiorocloud.it description: Remote server tags: - name: Wallet description: Routes related to wallet - name: User description: Routes related to user paths: /user/login/check: get: tags: - User summary: Check if client has a valid JWT token parameters: - name: Origin description: Header CORS in: header required: true schema: type: string security: - EasyPayToken: [ ] responses: '200': description: User has a valid JWT content: application/json: schema: $ref: "#/components/schemas/OkResponse" '401': description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" '500': description: Internal server error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /user/login: post: tags: - User summary: Login user parameters: - name: Origin description: Header CORS in: header required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/LoginPayload" responses: '200': description: User logged in content: application/json: schema: $ref: "#/components/schemas/OkResponse" '400': description: Invalid payload content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" '401': description: Invalid credentials content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" '500': description: Internal server error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /user/logout: post: tags: - User summary: Logout user parameters: - name: Origin description: Header CORS in: header required: true schema: type: string security: - EasyPayToken: [ ] responses: '200': description: User logged out content: application/json: schema: $ref: "#/components/schemas/OkResponse" '401': description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" '500': description: Internal server error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /user/refresh-token: post: tags: - User summary: Refresh JWT token parameters: - name: Origin description: Header CORS in: header required: true schema: type: string security: - EasyPayRefreshToken: [ ] responses: '200': description: JWT token refreshed content: application/json: schema: $ref: "#/components/schemas/OkResponse" '401': description: Invalid refresh token content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" '500': description: Internal server error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /user: post: tags: - User summary: Create an user parameters: - name: Origin description: Header CORS in: header required: true schema: type: string security: - EasyPayToken: [ ] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateUserPayload" responses: '200': description: User created content: application/json: schema: $ref: "#/components/schemas/OkResponse" '400': description: Invalid payload content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" '401': description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" '500': description: Internal server error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" get: tags: - User summary: Get user data parameters: - name: Origin description: Header CORS in: header required: true schema: type: string security: - EasyPayToken: [ ] responses: '200': description: Got user data content: application/json: schema: $ref: "#/components/schemas/UserDataResponse" '401': description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" '500': description: Internal server error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" patch: tags: - User summary: Update user data parameters: - name: Origin description: Header CORS in: header required: true schema: type: string security: - EasyPayToken: [ ] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateUserDataPayload' responses: '200': description: User updated content: application/json: schema: $ref: "#/components/schemas/OkResponse" '400': description: Invalid payload content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" '401': description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" '500': description: Internal server error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /user/payment-card: post: tags: - User summary: Add payment card parameters: - name: Origin description: Header CORS in: header required: true schema: type: string security: - EasyPayToken: [ ] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/AddPaymentCardPayload" responses: '200': description: Payment card added content: application/json: schema: $ref: "#/components/schemas/OkResponse" '400': description: Invalid payload content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" '401': description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" '500': description: Internal server error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /user/payment-card/{cardId}: delete: tags: - User summary: Delete a payment card parameters: - name: Origin description: Header CORS in: header required: true schema: type: string - name: cardId in: path description: Card id required: true schema: type: integer example: 1 security: - EasyPayToken: [ ] responses: '200': description: Payment card deleted content: application/json: schema: $ref: "#/components/schemas/OkResponse" '401': description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" '500': description: Internal server error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /wallet/balance: get: tags: - Wallet summary: Get wallet balance parameters: - name: Origin description: Header CORS in: header required: true schema: type: string security: - EasyPayToken: [ ] responses: '200': description: Got wallet balance content: application/json: schema: type: number example: 123.45 '401': description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" '500': description: Internal server error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /wallet/operations: post: tags: - Wallet summary: Get wallet operations parameters: - name: Origin description: Header CORS in: header required: true schema: type: string security: - EasyPayToken: [ ] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/GetWalletOperationsPayload" responses: '200': description: Got wallet operations content: application/json: schema: $ref: "#/components/schemas/WalletOperationsResponse" '400': description: Invalid payload content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" '401': description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" '500': description: Internal server error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /wallet/interacted-customers: get: tags: - Wallet summary: Get recent interacted customers parameters: - name: Origin description: Header CORS in: header required: true schema: type: string security: - EasyPayToken: [ ] responses: '200': description: Got recent interacted customers content: application/json: schema: type: array items: $ref: "#/components/schemas/InteractedCustomerResponse" '401': description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" '500': description: Internal server error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /wallet/recharge: post: tags: - Wallet summary: Recharge wallet parameters: - name: Origin description: Header CORS in: header required: true schema: type: string security: - EasyPayToken: [ ] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/RechargeWalletPayload" responses: '200': description: Wallet recharged content: application/json: schema: $ref: "#/components/schemas/OkResponse" '400': description: Invalid payload content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" '401': description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" '500': description: Internal server error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /wallet/transfer: post: tags: - Wallet summary: Transfer money parameters: - name: Origin description: Header CORS in: header required: true schema: type: string security: - EasyPayToken: [ ] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/TransferMoneyPayload" responses: '200': description: Money transferred content: application/json: schema: $ref: "#/components/schemas/OkResponse" '400': description: Invalid payload content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" '401': description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" '404': description: Recipient customer email not found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" '500': description: Internal server error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /wallet/scheduler: get: tags: - Wallet summary: Get scheduled operations parameters: - name: Origin description: Header CORS in: header required: true schema: type: string security: - EasyPayToken: [ ] responses: '200': description: Got scheduled operations content: application/json: schema: type: array items: $ref: '#/components/schemas/ScheduledOperation' '401': description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" '500': description: Internal server error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" post: tags: - Wallet summary: Create scheduled operations parameters: - name: Origin description: Header CORS in: header required: true schema: type: string security: - EasyPayToken: [ ] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateScheduledOperationPayload' responses: '200': description: Scheduled operation created content: application/json: schema: $ref: "#/components/schemas/OkResponse" '400': description: Invalid payload content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" '401': description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" '404': description: Recipient customer email not found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" '500': description: Internal server error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /wallet/scheduler/{scheduledOperationId}: delete: tags: - Wallet summary: Delete a scheduled operation parameters: - name: Origin description: Header CORS in: header required: true schema: type: string - name: scheduledOperationId in: path description: Scheduled operation id required: true schema: type: string format: uuid example: 0afe431b-4e19-4790-a3df-8ececd2a02d2 security: - EasyPayToken: [ ] responses: '200': description: Scheduled operation deleted content: application/json: schema: $ref: "#/components/schemas/OkResponse" '401': description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" '500': description: Internal server error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" components: securitySchemes: EasyPayToken: type: apiKey in: header name: EasyPayToken description: JWT token EasyPayRefreshToken: type: apiKey in: header name: EasyPayRefreshToken description: JWT refresh token schemas: OkResponse: type: object properties: ok: type: boolean example: true required: - ok ErrorResponse: type: object properties: error: type: string example: "Something went wrong" required: - error PaymentCardResponse: type: object properties: cardId: type: integer example: 1 fullName: type: string example: Marco Paggioro cardNumber: type: string example: XXXX-XXXX-XXXX-1234 expiration: type: string example: 2025-12 required: - cardId - fullName - cardNumber - expiration UserDataResponse: type: object properties: id: type: string format: uuid example: 0afe431b-4e19-4790-a3df-8ececd2a02d2 firstName: type: string example: Marco lastName: type: string example: Paggioro birthDate: type: string format: date example: 1998-06-01 email: type: string format: email example: marco.paggioro@studenti.unipegaso.it lastEdit: type: number description: Milliseconds from EPOCH example: 1744789213639 paymentCards: type: array items: $ref: '#/components/schemas/PaymentCardResponse' required: - id - firstName - lastName - birthDate - email - lastEdit UpdateUserDataPayload: type: object properties: firstName: type: string example: Marco lastName: type: string example: Paggioro birthDate: type: string format: date example: 1998-06-01 email: type: string format: email example: marco.paggioro@studenti.unipegaso.it WalletOperationResponse: type: object properties: interactedCustomerId: type: string format: uuid example: "0afe431b-4e19-4790-a3df-8ececd2a02d2" interactedFirstName: type: string example: Marco interactedLastName: type: string example: Paggioro interactedEmail: type: string format: email example: "marco.paggioro@studenti.unipegaso.it" transactionId: type: string format: uuid example: "0afe431b-4e19-4790-a3df-8ececd2a02d2" senderCustomerId: type: string format: uuid example: "0afe431b-4e19-4790-a3df-8ececd2a02d2" recipientCustomerId: type: string format: uuid example: "0afe431b-4e19-4790-a3df-8ececd2a02d2" description: type: string example: "Pizza" instant: type: number description: Millis from EPOCH example: 1744789213639 amount: type: number example: 123.45 required: - interactedCustomerId - interactedFirstName - interactedLastName - interactedEmail - transactionId - senderCustomerId - recipientCustomerId - instant - amount WalletOperationsResponse: type: object properties: pageSize: type: number example: 1 historyCount: type: number example: 80 history: type: array items: $ref: '#/components/schemas/WalletOperationResponse' required: - pageSize - historyCount - history ScheduledOperation: type: object properties: interactedCustomerId: type: string format: uuid example: 0afe431b-4e19-4790-a3df-8ececd2a02d2 interactedFirstName: type: string example: Marco interactedLastName: type: string example: Paggioro interactedEmail: type: string format: email example: marco.paggioro@studenti.unipegaso.it id: type: string format: uuid example: 0afe431b-4e19-4790-a3df-8ececd2a02d2 senderCustomerId: type: string format: uuid example: 0afe431b-4e19-4790-a3df-8ececd2a02d2 recipientCustomerId: type: string format: uuid example: 0afe431b-4e19-4790-a3df-8ececd2a02d2 description: type: string example: Pizza when: type: number description: Milliseconds from EPOCH example: 1744789213639 amount: type: number example: 123.45 repeat: type: string example: 1 Giorno status: type: string example: In attesa required: - interactedCustomerId - interactedFirstName - interactedLastName - interactedEmail - id - senderCustomerId - recipientCustomerId - description - when - amount - status CreateScheduledOperationPayload: type: object properties: recipientEmail: type: string format: email example: marco.paggioro@studenti.unipegaso.it description: type: string example: Pizza when: type: number description: Milliseconds from EPOCH example: 1744789213639 amount: type: number example: 123.45 repeat: type: string description: Period Java-parsable string example: P1M1D required: - recipientEmail - description - when - amount TransferMoneyPayload: type: object properties: recipientEmail: type: string format: email example: marco.paggioro@studenti.unipegaso.it amount: type: number example: 123.45 description: type: string example: Pizza required: - recipientEmail - amount - description LoginPayload: type: object properties: email: type: string format: email example: marco.paggioro@studenti.unipegaso.it encryptedPassword: type: string description: SHA512 encrypted password example: 2bbe0c48b91a7d1b8a6753a8b9cbe1db16b84379f3f91fe115621284df7a48f1cd71e9beb90ea614c7bd924250aa9e446a866725e685a65df5d139a5cd180dc9 required: - email - encryptedPassword RechargeWalletPayload: type: object properties: cardId: type: integer example: 1 amount: type: number example: 123.45 required: - cardId - amount CreateUserPayload: type: object properties: firstName: type: string example: Marco lastName: type: string example: Paggioro birthDate: type: string format: date example: 1998-06-01 email: type: string format: email example: marco.paggioro@studenti.unipegaso.it lastEdit: type: number description: Milliseconds from EPOCH example: 1744789213639 required: - firstName - lastName - birthDate - email - lastEdit AddPaymentCardPayload: type: object properties: fullName: type: string example: Marco Paggioro cardNumber: type: number example: 1234123412341234 expiration: type: string example: 2025-12 securityCode: type: number example: 123 required: - fullName - cardNumber - expiration - securityCode GetWalletOperationsPayload: type: object properties: page: type: number example: 1 email: type: string format: email example: marco.paggioro@studenti.unipegaso.it fullName: type: string example: Mario Rossi start: type: number description: Milliseconds from EPOCH example: 1744789213639 end: type: number description: Milliseconds from EPOCH example: 1744789213639 required: - page InteractedCustomerResponse: type: object properties: interactedCustomerId: type: string format: uuid example: 0afe431b-4e19-4790-a3df-8ececd2a02d2 interactedFirstName: type: string example: Marco interactedLastName: type: string example: Paggioro interactedEmail: type: string format: email example: marco.paggioro@studenti.unipegaso.it required: - interactedCustomerId - interactedFirstName - interactedLastName - interactedEmail