swagger: '2.0' info: title: Bank Argent API documentation description: Contains all available API endpoints in this codebase version: '1.0.0' termsOfService: 'http://swagger.io/terms/' host: localhost:3001 basePath: /api/v1 schemes: - http paths: /user/login: post: tags: - User Module summary: Login description: API for Login parameters: - in: body name: body description: Login Payload required: true schema: $ref: '#/definitions/Login' produces: - application/json responses: '200': description: Login Successfully schema: $ref: '#/definitions/LoginResponse' '400': description: Invalid Fields '500': description: Internal Server Error /user/signup: post: tags: - User Module summary: Signup description: API for Signup parameters: - in: body name: body description: Signup Payload required: true schema: $ref: '#/definitions/User' produces: - application/json responses: '200': description: Signup Successfully schema: $ref: '#/definitions/ApiResponse' '400': description: Invalid Fields '500': description: Internal Server Error /user/profile: post: security: - Bearer: [] tags: - User Module summary: User Profile API description: API for fetching a user profile #produces: # - application/json responses: '200': description: User profile retrieved successully schema: $ref: '#/definitions/ApiResponse' '400': description: Invalid Fields '500': description: Internal Server Error put: security: - Bearer: [] tags: - User Module summary: User Profile API description: API for updating a user profile parameters: - in: body name: body description: Update user profile attributes required: true schema: $ref: '#/definitions/UserProfile' produces: - application/json responses: '200': description: User profile retrieved successully schema: $ref: '#/definitions/ApiResponse' '400': description: Invalid Fields '500': description: Internal Server Error /user/accounts: get: security: - Bearer: [] tags: - Transactions Module summary: Return all the bank accounts for a user description: API for getting all the bank accounts for a user parameters: - in: header name: Authorization required: true type: string minimum: description: Bearer JWT token produces: -application/json responses: '200': description: Bank accounts retrieved successfully schema: $ref: '#/definitions/BankAccount' '400': description: Invalid fields '401': description: Unauthorized access '500': description: Internal Server Error /user/accounts/{account_id}: get: security: - Bearer: [] tags: - Transactions Module summary: Return a bank account for a user description: API for getting a bank account for a user parameters: - in: header name: Authorization required: true type: string minimum: description: Bearer JWT token - in: path name: account_id required: true type: integer description: Bank Account Id produces: -application/json responses: '200': description: Bank account retrieved successfully schema: $ref: '#/definitions/BankAccount' '400': description: Invalid fields '401': description: Unauthorized access '404': description: Bank account not found '500': description: Internal Server Error /user/accounts/{account_id}/transactions/{month}: get: security: - Bearer: [] tags: - Transactions Module summary: Return all the transactions for a user bank account and for a specific month description: API for getting all the transactions for a user bank account and for a specific month parameters: - in: header name: Authorization required: true type: string minimum: description: Bearer JWT token - in: path name: account_id required: true type: integer description: Bank Account Id - in: path name: month required: true type: string description: Month for which transactions have to be retrieved produces: -application/json responses: '200': description: Transactions retrieved successfully schema: $ref: '#/definitions/Transaction' '400': description: Invalid fields '401': description: Unauthorized access '500': description: Internal Server Error /user/accounts/{account_id}/transactions/{transaction_id}: get: security: - Bearer: [] tags: - Transactions Module summary: Return a transaction for a bank account for a user description: API for getting a transaction for a bank account for a user parameters: - in: header name: Authorization required: true type: string minimum: description: Bearer JWT token - in: path name: account_id required: true type: integer description: Bank Account Id - in: path name: transaction_id required: true type: integer description: Transaction Id produces: -application/json responses: '200': description: Transaction retrieved successfully schema: $ref: '#/definitions/Transaction' '400': description: Invalid fields '401': description: Unauthorized access '404': description: Transaction not found '500': description: Internal Server Error /user/accounts/{account_id}/transactions/{transaction_id}: put: tags: - Transactions Module summary: Update the category of an existing transaction description: API for updating a transaction's category consumes: - application/json produces: - application/json parameters: - in: header name: Authorization description: Bearer JWT token type: string required: true - in: path name: account_id description: Bank account ID type: integer required: true - in: path name: transaction_id description: Transaction ID required: true type: integer - in: body name: property required: true description: Category to be updated schema: $ref: '#/definitions/TransactionUpdateCategory' responses: '200': description: Transaction updated successully schema: $ref: '#/definitions/Transaction' '400': description: Bad request '500': description: Internal Server Error /user/accounts/{account_id}/transactions/{transaction_id}: put: tags: - Transactions Module summary: Update the notes for an existing transaction description: API for updating transaction's notes consumes: - application/json produces: - application/json parameters: - in: header name: Authorization description: Bearer JWT token type: string required: true - in: path name: account_id description: Bank account ID type: integer required: true - in: path name: transaction_id description: Transaction ID to be updated required: true type: integer - in: body name: property required: true description: Notes to be updated schema: $ref: '#/definitions/TransactionUpdateNote' responses: '200': description: Transaction updated successully schema: $ref: '#/definitions/Transaction' '400': description: Bad request '500': description: Internal Server Error securityDefinitions: Bearer: type: apiKey name: Authorization in: header definitions: User: properties: email: type: string description: user email password: type: string description: user password firstName: type: string description: user first name lastName: type: string description: user last name userName: type: string description: user public name Login: properties: email: type: string description: user email password: type: string description: user password ApiResponse: type: object properties: status: type: integer message: type: string body: type: object properties: id: type: string email: type: string LoginResponse: type: object properties: token: type: string UserProfile: type: object properties: userName: type: string BankAccount: type: object properties: account_id: type: integer format: int64 date: type: string format: date description: type: string amount: type: number format: float currency: type: string balance: type: number format: float Transaction: type: object properties: transaction_id: type: integer format: int64 date: type: string format: date description: type: string amount: type: number format: float currency: type: string transaction type: type: string category: type: string notes: type: string TransactionUpdateCategory: type: object properties: category: type: string TransactionUpdateNote: type: object properties: notes: type: string