openapi: 3.0.3 info: title: sabisave description: '' version: 1.0.0 servers: - url: 'https://sabisave.com' paths: /api/admin/login: post: summary: 'Admin login' operationId: adminLogin description: "Authenticates an admin user and returns an access token.\nIf two-factor authentication is enabled, it will require verification." parameters: [] responses: 200: description: '' content: application/json: schema: oneOf: - description: Success type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Successfully logged in' data: token: 1|abcdefghijklmnopqrstuvwxyz123456 refresh_token: abcdefghijklmnopqrstuvwxyz123456 expire_at: '01-01-23 12:30:00' token_type: Bearer admin: id: 1 name: 'Admin User' email: admin@example.com role: super_admin roles: - super_admin permissions: - view_dashboard - manage_users profile_image: 'https://example.com/images/profile.jpg' two_factor_enabled: true two_factor_method: email properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Successfully logged in' data: type: object properties: token: type: string example: 1|abcdefghijklmnopqrstuvwxyz123456 refresh_token: type: string example: abcdefghijklmnopqrstuvwxyz123456 expire_at: type: string example: '01-01-23 12:30:00' token_type: type: string example: Bearer admin: type: object properties: id: type: integer example: 1 name: type: string example: 'Admin User' email: type: string example: admin@example.com role: type: string example: super_admin roles: type: array example: - super_admin items: type: string permissions: type: array example: - view_dashboard - manage_users items: type: string profile_image: type: string example: 'https://example.com/images/profile.jpg' two_factor_enabled: type: boolean example: true two_factor_method: type: string example: email - description: 'Two-factor required' type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Two-factor authentication required' data: two_factor_required: true two_factor_method: email properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Two-factor authentication required' data: type: object properties: two_factor_required: type: boolean example: true two_factor_method: type: string example: email 403: description: 'Account deactivated' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Your account has been deactivated. Please contact support.' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Your account has been deactivated. Please contact support.' data: type: string example: null 422: description: 'Invalid credentials' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'invalid credentials' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'invalid credentials' data: type: string example: null tags: - 'Admin Authentication' requestBody: required: true content: application/json: schema: type: object properties: email: type: string description: 'Admin email address.' example: admin@example.com password: type: string description: 'Admin password (min 6 characters).' example: password123 two_factor_code: type: string description: 'Two-factor authentication code (6 digits).' example: '123456' recovery_code: type: string description: 'Recovery code for two-factor authentication.' example: ABCDEF-123456 required: - email - password security: [] /api/admin/logout: post: summary: 'Admin logout' operationId: adminLogout description: 'Invalidates the current access token for the authenticated admin user.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Successfully logged out' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Successfully logged out' data: type: string example: null 500: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Internal server error' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Internal server error' data: type: string example: null tags: - 'Admin Authentication' /api/admin/forgot-password: post: summary: 'Request password reset' operationId: requestPasswordReset description: "Sends a password reset OTP to the admin's email address." parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Password reset OTP sent to your email' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Password reset OTP sent to your email' data: type: string example: null 404: description: 'Email not found' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Admin with this email not found' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Admin with this email not found' data: type: string example: null tags: - 'Admin Authentication' requestBody: required: true content: application/json: schema: type: object properties: email: type: string description: 'Admin email address.' example: admin@example.com required: - email security: [] /api/admin/reset-password: post: summary: 'Verify OTP and reset password' operationId: verifyOTPAndResetPassword description: "Verifies the OTP and resets the admin's password." parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Password reset successfully' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Password reset successfully' data: type: string example: null 400: description: 'Invalid OTP' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Invalid verification code' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Invalid verification code' data: type: string example: null 404: description: 'Email not found' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Admin with this email not found' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Admin with this email not found' data: type: string example: null tags: - 'Admin Authentication' requestBody: required: true content: application/json: schema: type: object properties: email: type: string description: 'Admin email address.' example: admin@example.com otp: type: string description: "The verification code sent to the admin's email." example: '123456' password: type: string description: 'New password (min 6 characters).' example: newpassword123 password_confirmation: type: string description: 'Password confirmation.' example: newpassword123 required: - email - otp - password - password_confirmation security: [] /api/admin/chat/conversations: get: summary: 'List conversations' operationId: listConversations description: 'Retrieves all chat conversations for the authenticated admin user.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Conversations retrieved successfully' data: - id: 1 title: 'Support Conversation' admin_id: 1 agent_id: 2 is_closed: false last_message: 'How can I help you today?' last_message_at: '2023-01-01T12:00:00.000000Z' unread_count: 0 created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' agent: id: 2 first_name: John last_name: Doe profile: profiles/agent.jpg properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Conversations retrieved successfully' data: type: array example: - id: 1 title: 'Support Conversation' admin_id: 1 agent_id: 2 is_closed: false last_message: 'How can I help you today?' last_message_at: '2023-01-01T12:00:00.000000Z' unread_count: 0 created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' agent: id: 2 first_name: John last_name: Doe profile: profiles/agent.jpg items: type: object properties: id: type: integer example: 1 title: type: string example: 'Support Conversation' admin_id: type: integer example: 1 agent_id: type: integer example: 2 is_closed: type: boolean example: false last_message: type: string example: 'How can I help you today?' last_message_at: type: string example: '2023-01-01T12:00:00.000000Z' unread_count: type: integer example: 0 created_at: type: string example: '2023-01-01T12:00:00.000000Z' updated_at: type: string example: '2023-01-01T12:00:00.000000Z' agent: type: object properties: id: type: integer example: 2 first_name: type: string example: John last_name: type: string example: Doe profile: type: string example: profiles/agent.jpg tags: - 'Admin Chat' post: summary: 'Create conversation' operationId: createConversation description: 'Creates a new chat conversation between the authenticated admin and an agent.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Conversation created successfully' data: id: 1 title: 'Support Request' admin_id: 1 agent_id: 2 is_closed: false created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' agent: id: 2 first_name: John last_name: Doe email: john.doe@example.com phone: '+1234567890' profile: profiles/agent.jpg properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Conversation created successfully' data: type: object properties: id: type: integer example: 1 title: type: string example: 'Support Request' admin_id: type: integer example: 1 agent_id: type: integer example: 2 is_closed: type: boolean example: false created_at: type: string example: '2023-01-01T12:00:00.000000Z' updated_at: type: string example: '2023-01-01T12:00:00.000000Z' agent: type: object properties: id: type: integer example: 2 first_name: type: string example: John last_name: type: string example: Doe email: type: string example: john.doe@example.com phone: type: string example: '+1234567890' profile: type: string example: profiles/agent.jpg 422: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'The agent id field is required' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'The agent id field is required' data: type: string example: null tags: - 'Admin Chat' requestBody: required: true content: application/json: schema: type: object properties: agent_id: type: integer description: 'The ID of the agent to start a conversation with.' example: 2 title: type: string description: 'Optional title for the conversation.' example: 'Support Request' required: - agent_id '/api/admin/chat/conversations/{id}': get: summary: 'Get conversation details' operationId: getConversationDetails description: 'Retrieves details of a specific conversation by ID.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Conversation retrieved successfully' data: id: 1 title: 'Support Conversation' admin_id: 1 agent_id: 2 is_closed: false last_message: 'How can I help you today?' last_message_at: '2023-01-01T12:00:00.000000Z' created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' agent: id: 2 first_name: John last_name: Doe email: john.doe@example.com phone: '+1234567890' profile: profiles/agent.jpg properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Conversation retrieved successfully' data: type: object properties: id: type: integer example: 1 title: type: string example: 'Support Conversation' admin_id: type: integer example: 1 agent_id: type: integer example: 2 is_closed: type: boolean example: false last_message: type: string example: 'How can I help you today?' last_message_at: type: string example: '2023-01-01T12:00:00.000000Z' created_at: type: string example: '2023-01-01T12:00:00.000000Z' updated_at: type: string example: '2023-01-01T12:00:00.000000Z' agent: type: object properties: id: type: integer example: 2 first_name: type: string example: John last_name: type: string example: Doe email: type: string example: john.doe@example.com phone: type: string example: '+1234567890' profile: type: string example: profiles/agent.jpg 403: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'You do not have access to this conversation' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'You do not have access to this conversation' data: type: string example: null 404: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Conversation not found' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Conversation not found' data: type: string example: null tags: - 'Admin Chat' parameters: - in: path name: id description: 'The ID of the conversation.' example: 1 required: true schema: type: integer '/api/admin/chat/conversations/{id}/messages': get: summary: 'List conversation messages' operationId: listConversationMessages description: "Retrieves messages for a specific conversation with pagination support.\nAlso marks messages as read for the authenticated admin." parameters: - in: query name: page description: 'Page number for pagination.' example: 1 required: false schema: type: integer description: 'Page number for pagination.' example: 1 - in: query name: per_page description: 'Number of messages per page.' example: 15 required: false schema: type: integer description: 'Number of messages per page.' example: 15 responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Messages retrieved successfully' data: current_page: 1 data: - id: 1 conversation_id: 1 sender_type: App\Models\Admin sender_id: 1 message: 'Hello, how can I help you today?' attachments: [] is_read: true created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' sender: id: 1 name: 'Admin User' profile_image: profiles/admin.jpg - id: 2 conversation_id: 1 sender_type: App\Models\Agent sender_id: 2 message: 'I need help with my account' attachments: [] is_read: true created_at: '2023-01-01T12:05:00.000000Z' updated_at: '2023-01-01T12:05:00.000000Z' sender: id: 2 first_name: John last_name: Doe profile: profiles/agent.jpg first_page_url: 'http://example.com/api/admin/chat/conversations/1/messages?page=1' from: 1 last_page: 1 last_page_url: 'http://example.com/api/admin/chat/conversations/1/messages?page=1' links: [] next_page_url: null path: 'http://example.com/api/admin/chat/conversations/1/messages' per_page: 15 prev_page_url: null to: 2 total: 2 properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Messages retrieved successfully' data: type: object properties: current_page: type: integer example: 1 data: type: array example: - id: 1 conversation_id: 1 sender_type: App\Models\Admin sender_id: 1 message: 'Hello, how can I help you today?' attachments: [] is_read: true created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' sender: id: 1 name: 'Admin User' profile_image: profiles/admin.jpg - id: 2 conversation_id: 1 sender_type: App\Models\Agent sender_id: 2 message: 'I need help with my account' attachments: [] is_read: true created_at: '2023-01-01T12:05:00.000000Z' updated_at: '2023-01-01T12:05:00.000000Z' sender: id: 2 first_name: John last_name: Doe profile: profiles/agent.jpg items: type: object properties: id: type: integer example: 1 conversation_id: type: integer example: 1 sender_type: type: string example: App\Models\Admin sender_id: type: integer example: 1 message: type: string example: 'Hello, how can I help you today?' attachments: type: array example: [] is_read: type: boolean example: true created_at: type: string example: '2023-01-01T12:00:00.000000Z' updated_at: type: string example: '2023-01-01T12:00:00.000000Z' sender: type: object properties: id: type: integer example: 1 name: type: string example: 'Admin User' profile_image: type: string example: profiles/admin.jpg first_page_url: type: string example: 'http://example.com/api/admin/chat/conversations/1/messages?page=1' from: type: integer example: 1 last_page: type: integer example: 1 last_page_url: type: string example: 'http://example.com/api/admin/chat/conversations/1/messages?page=1' links: type: array example: [] next_page_url: type: string example: null path: type: string example: 'http://example.com/api/admin/chat/conversations/1/messages' per_page: type: integer example: 15 prev_page_url: type: string example: null to: type: integer example: 2 total: type: integer example: 2 403: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'You do not have access to this conversation' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'You do not have access to this conversation' data: type: string example: null 404: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Conversation not found' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Conversation not found' data: type: string example: null tags: - 'Admin Chat' post: summary: 'Send message' operationId: sendMessage description: 'Sends a new message in an existing conversation.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Message sent successfully' data: id: 3 conversation_id: 1 sender_type: App\Models\Admin sender_id: 1 message: 'Hello, how can I help you today?' attachments: [] is_read: false created_at: '2023-01-01T12:10:00.000000Z' updated_at: '2023-01-01T12:10:00.000000Z' sender: id: 1 name: 'Admin User' profile_image: profiles/admin.jpg properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Message sent successfully' data: type: object properties: id: type: integer example: 3 conversation_id: type: integer example: 1 sender_type: type: string example: App\Models\Admin sender_id: type: integer example: 1 message: type: string example: 'Hello, how can I help you today?' attachments: type: array example: [] is_read: type: boolean example: false created_at: type: string example: '2023-01-01T12:10:00.000000Z' updated_at: type: string example: '2023-01-01T12:10:00.000000Z' sender: type: object properties: id: type: integer example: 1 name: type: string example: 'Admin User' profile_image: type: string example: profiles/admin.jpg 400: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'This conversation is closed' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'This conversation is closed' data: type: string example: null 403: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'You do not have access to this conversation' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'You do not have access to this conversation' data: type: string example: null 404: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Conversation not found' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Conversation not found' data: type: string example: null 422: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'The message field is required' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'The message field is required' data: type: string example: null tags: - 'Admin Chat' requestBody: required: true content: application/json: schema: type: object properties: message: type: string description: 'The message content to send.' example: 'Hello, how can I help you today?' attachments: type: array description: 'Optional array of attachments to include with the message.' example: - laboriosam items: type: string required: - message parameters: - in: path name: id description: 'The ID of the conversation.' example: ipsam required: true schema: type: string - in: path name: conversationId description: 'The ID of the conversation.' example: 1 required: true schema: type: integer '/api/admin/chat/conversations/{id}/close': post: summary: 'Close conversation' operationId: closeConversation description: 'Closes an active conversation, preventing new messages from being sent.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Conversation closed successfully' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Conversation closed successfully' data: type: string example: null 403: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'You do not have access to this conversation' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'You do not have access to this conversation' data: type: string example: null 404: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Conversation not found' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Conversation not found' data: type: string example: null tags: - 'Admin Chat' parameters: - in: path name: id description: 'The ID of the conversation.' example: fugiat required: true schema: type: string - in: path name: conversationId description: 'The ID of the conversation to close.' example: 1 required: true schema: type: integer '/api/admin/chat/conversations/{id}/reopen': post: summary: 'Reopen conversation' operationId: reopenConversation description: 'Reopens a previously closed conversation, allowing new messages to be sent.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Conversation reopened successfully' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Conversation reopened successfully' data: type: string example: null 403: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'You do not have access to this conversation' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'You do not have access to this conversation' data: type: string example: null 404: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Conversation not found' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Conversation not found' data: type: string example: null tags: - 'Admin Chat' parameters: - in: path name: id description: 'The ID of the conversation.' example: non required: true schema: type: string - in: path name: conversationId description: 'The ID of the conversation to reopen.' example: 1 required: true schema: type: integer /api/admin/chat/agents: get: summary: 'List available agents' operationId: listAvailableAgents description: 'Retrieves a list of all agents available for starting a new conversation.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Agents retrieved successfully' data: - id: 1 first_name: John last_name: Doe email: john.doe@example.com phone: '+1234567890' profile: profiles/agent1.jpg - id: 2 first_name: Jane last_name: Smith email: jane.smith@example.com phone: '+0987654321' profile: profiles/agent2.jpg properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Agents retrieved successfully' data: type: array example: - id: 1 first_name: John last_name: Doe email: john.doe@example.com phone: '+1234567890' profile: profiles/agent1.jpg - id: 2 first_name: Jane last_name: Smith email: jane.smith@example.com phone: '+0987654321' profile: profiles/agent2.jpg items: type: object properties: id: type: integer example: 1 first_name: type: string example: John last_name: type: string example: Doe email: type: string example: john.doe@example.com phone: type: string example: '+1234567890' profile: type: string example: profiles/agent1.jpg tags: - 'Admin Chat' /api/admin/dashboard: get: summary: 'Get Dashboard Statistics' operationId: getDashboardStatistics description: "Retrieves comprehensive dashboard statistics and analytics data for the admin dashboard,\nincluding financial summaries, user counts, and chart data for visualizations." parameters: - in: query name: time_frame description: "optional The time period for which to retrieve statistics.\n Options: today, yesterday, last_30_days (default)." example: last_30_days required: false schema: type: string description: "optional The time period for which to retrieve statistics.\n Options: today, yesterday, last_30_days (default)." example: last_30_days - in: query name: chart_period description: "optional The period for chart data.\n Options: yearly (default)." example: yearly required: false schema: type: string description: "optional The period for chart data.\n Options: yearly (default)." example: yearly responses: 200: description: Success content: application/json: schema: type: object example: success: true message: 'Dashboard data retrieved successfully' data: summary: total_collections: 250000.5 total_withdrawals: 125000.25 total_traders: 500 total_agents: 50 analytics: labels: - Jan - Feb - Mar - Apr - May - Jun - Jul - Aug - Sep - Oct - Nov - Dec datasets: - label: Collections data: - 15000 - 21000 - 18000 - 24000 - 23000 - 24000 - 19000 - 20000 - 22000 - 20000 - 25000 - 19000 borderColor: '#F6C000' backgroundColor: 'rgba(246, 192, 0, 0.1)' - label: Withdrawals data: - 10000 - 15000 - 12000 - 14000 - 9000 - 10000 - 12000 - 8000 - 7500 - 9000 - 10000 - 8500 borderColor: '#000000' backgroundColor: 'rgba(0, 0, 0, 0.1)' time_frame: last_30_days properties: success: type: boolean example: true message: type: string example: 'Dashboard data retrieved successfully' data: type: object properties: summary: type: object properties: total_collections: type: number example: 250000.5 total_withdrawals: type: number example: 125000.25 total_traders: type: integer example: 500 total_agents: type: integer example: 50 analytics: type: object properties: labels: type: array example: - Jan - Feb - Mar - Apr - May - Jun - Jul - Aug - Sep - Oct - Nov - Dec items: type: string datasets: type: array example: - label: Collections data: - 15000 - 21000 - 18000 - 24000 - 23000 - 24000 - 19000 - 20000 - 22000 - 20000 - 25000 - 19000 borderColor: '#F6C000' backgroundColor: 'rgba(246, 192, 0, 0.1)' - label: Withdrawals data: - 10000 - 15000 - 12000 - 14000 - 9000 - 10000 - 12000 - 8000 - 7500 - 9000 - 10000 - 8500 borderColor: '#000000' backgroundColor: 'rgba(0, 0, 0, 0.1)' items: type: object properties: label: type: string example: Collections data: type: array example: - 15000 - 21000 - 18000 - 24000 - 23000 - 24000 - 19000 - 20000 - 22000 - 20000 - 25000 - 19000 items: type: integer borderColor: type: string example: '#F6C000' backgroundColor: type: string example: 'rgba(246, 192, 0, 0.1)' time_frame: type: string example: last_30_days 500: description: 'Server Error' content: application/json: schema: type: object example: success: false message: 'Internal server error' error: code: 500 message: 'Server error details' properties: success: type: boolean example: false message: type: string example: 'Internal server error' error: type: object properties: code: type: integer example: 500 message: type: string example: 'Server error details' tags: - 'Admin Dashboard' /api/admin/admins: get: summary: 'List all admins' operationId: listAllAdmins description: 'Retrieves a paginated list of all admin users with optional filtering by name, email, role, or status.' parameters: - in: query name: search description: 'Search term for filtering by name or email.' example: john required: false schema: type: string description: 'Search term for filtering by name or email.' example: john - in: query name: role description: 'Filter by role name.' example: editor required: false schema: type: string description: 'Filter by role name.' example: editor - in: query name: status description: 'Filter by account status (1 for active, 0 for inactive).' example: true required: false schema: type: boolean description: 'Filter by account status (1 for active, 0 for inactive).' example: true - in: query name: page description: 'Page number for pagination.' example: 1 required: false schema: type: integer description: 'Page number for pagination.' example: 1 responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Admins retrieved successfully' data: admins: current_page: 1 data: - id: 1 name: 'Admin User' email: admin@example.com phone: '1234567890' profile_image: admin-profiles/image.jpg status: true created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' roles: - id: 1 name: super-admin guard_name: admin description: 'Super Administrator' created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' first_page_url: 'http://example.com/api/admin/admins?page=1' from: 1 last_page: 1 last_page_url: 'http://example.com/api/admin/admins?page=1' links: [] next_page_url: null path: 'http://example.com/api/admin/admins' per_page: 10 prev_page_url: null to: 1 total: 1 roles: - id: 1 name: super-admin guard_name: admin description: 'Super Administrator' created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Admins retrieved successfully' data: type: object properties: admins: type: object properties: current_page: type: integer example: 1 data: type: array example: - id: 1 name: 'Admin User' email: admin@example.com phone: '1234567890' profile_image: admin-profiles/image.jpg status: true created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' roles: - id: 1 name: super-admin guard_name: admin description: 'Super Administrator' created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' items: type: object properties: id: type: integer example: 1 name: type: string example: 'Admin User' email: type: string example: admin@example.com phone: type: string example: '1234567890' profile_image: type: string example: admin-profiles/image.jpg status: type: boolean example: true created_at: type: string example: '2023-01-01T12:00:00.000000Z' updated_at: type: string example: '2023-01-01T12:00:00.000000Z' roles: type: array example: - id: 1 name: super-admin guard_name: admin description: 'Super Administrator' created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' items: type: object properties: id: { type: integer, example: 1 } name: { type: string, example: super-admin } guard_name: { type: string, example: admin } description: { type: string, example: 'Super Administrator' } created_at: { type: string, example: '2023-01-01T12:00:00.000000Z' } updated_at: { type: string, example: '2023-01-01T12:00:00.000000Z' } first_page_url: type: string example: 'http://example.com/api/admin/admins?page=1' from: type: integer example: 1 last_page: type: integer example: 1 last_page_url: type: string example: 'http://example.com/api/admin/admins?page=1' links: type: array example: [] next_page_url: type: string example: null path: type: string example: 'http://example.com/api/admin/admins' per_page: type: integer example: 10 prev_page_url: type: string example: null to: type: integer example: 1 total: type: integer example: 1 roles: type: array example: - id: 1 name: super-admin guard_name: admin description: 'Super Administrator' created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' items: type: object properties: id: type: integer example: 1 name: type: string example: super-admin guard_name: type: string example: admin description: type: string example: 'Super Administrator' created_at: type: string example: '2023-01-01T12:00:00.000000Z' updated_at: type: string example: '2023-01-01T12:00:00.000000Z' tags: - 'Admin Management' post: summary: 'Create a new admin' operationId: createANewAdmin description: 'Creates a new admin user with the specified details and assigns a role.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Admin created successfully' data: id: 2 name: John last_name: Doe email: john.doe@example.com phone: '+1234567890' profile_image: admin-profiles/profile.jpg status: true is_admin: true gender: male dob: '1990-01-01' address: '123 Main St, City' created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Admin created successfully' data: type: object properties: id: type: integer example: 2 name: type: string example: John last_name: type: string example: Doe email: type: string example: john.doe@example.com phone: type: string example: '+1234567890' profile_image: type: string example: admin-profiles/profile.jpg status: type: boolean example: true is_admin: type: boolean example: true gender: type: string example: male dob: type: string example: '1990-01-01' address: type: string example: '123 Main St, City' created_at: type: string example: '2023-01-01T12:00:00.000000Z' updated_at: type: string example: '2023-01-01T12:00:00.000000Z' 422: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'The given data was invalid.' data: email: - 'The email has already been taken.' properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'The given data was invalid.' data: type: object properties: email: type: array example: - 'The email has already been taken.' items: type: string tags: - 'Admin Management' requestBody: required: true content: multipart/form-data: schema: type: object properties: name: type: string description: "Admin's first name." example: John email: type: string description: "Admin's email address." example: john.doe@example.com password: type: string description: "Admin's password (min 8 characters)." example: password123 role: type: string description: 'Role name to assign to the admin.' example: editor phone: type: string description: "Admin's phone number." example: '+1234567890' profile_image: type: string format: binary description: "Admin's profile image (jpeg, png, jpg, gif, max 2MB)." last_name: type: string description: "Admin's last name." example: Doe gender: type: string description: "Admin's gender (male, female, rather_not_say)." example: male dob: type: date description: "Admin's date of birth." example: '1990-01-01' address: type: string description: "Admin's address." example: '123 Main St, City' required: - name - email - password - role '/api/admin/admins/{id}': get: summary: 'Get admin details' operationId: getAdminDetails description: 'Retrieves detailed information about a specific admin user including their roles.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Admin retrieved successfully' data: id: 1 name: Admin last_name: User email: admin@example.com phone: '+1234567890' profile_image: admin-profiles/profile.jpg status: true is_admin: true gender: male dob: '1990-01-01' address: '123 Main St, City' created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' roles: - id: 1 name: super-admin guard_name: admin description: 'Super Administrator' created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Admin retrieved successfully' data: type: object properties: id: type: integer example: 1 name: type: string example: Admin last_name: type: string example: User email: type: string example: admin@example.com phone: type: string example: '+1234567890' profile_image: type: string example: admin-profiles/profile.jpg status: type: boolean example: true is_admin: type: boolean example: true gender: type: string example: male dob: type: string example: '1990-01-01' address: type: string example: '123 Main St, City' created_at: type: string example: '2023-01-01T12:00:00.000000Z' updated_at: type: string example: '2023-01-01T12:00:00.000000Z' roles: type: array example: - id: 1 name: super-admin guard_name: admin description: 'Super Administrator' created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' items: type: object properties: id: type: integer example: 1 name: type: string example: super-admin guard_name: type: string example: admin description: type: string example: 'Super Administrator' created_at: type: string example: '2023-01-01T12:00:00.000000Z' updated_at: type: string example: '2023-01-01T12:00:00.000000Z' 404: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Admin not found' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Admin not found' data: type: string example: null tags: - 'Admin Management' put: summary: 'Update admin' operationId: updateAdmin description: "Updates an existing admin user's details and role." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Admin updated successfully' data: id: 1 name: John last_name: Doe email: john.doe@example.com phone: '+1234567890' profile_image: admin-profiles/profile.jpg status: true is_admin: true gender: male dob: '1990-01-01' address: '123 Main St, City' created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Admin updated successfully' data: type: object properties: id: type: integer example: 1 name: type: string example: John last_name: type: string example: Doe email: type: string example: john.doe@example.com phone: type: string example: '+1234567890' profile_image: type: string example: admin-profiles/profile.jpg status: type: boolean example: true is_admin: type: boolean example: true gender: type: string example: male dob: type: string example: '1990-01-01' address: type: string example: '123 Main St, City' created_at: type: string example: '2023-01-01T12:00:00.000000Z' updated_at: type: string example: '2023-01-01T12:00:00.000000Z' 404: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Admin not found' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Admin not found' data: type: string example: null 422: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'The given data was invalid.' data: email: - 'The email has already been taken.' properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'The given data was invalid.' data: type: object properties: email: type: array example: - 'The email has already been taken.' items: type: string tags: - 'Admin Management' requestBody: required: true content: multipart/form-data: schema: type: object properties: name: type: string description: "Admin's first name." example: John email: type: string description: "Admin's email address." example: john.doe@example.com role: type: string description: 'Role name to assign to the admin.' example: editor phone: type: string description: "Admin's phone number." example: '+1234567890' profile_image: type: string format: binary description: "Admin's profile image (jpeg, png, jpg, gif, max 2MB)." last_name: type: string description: "Admin's last name." example: Doe gender: type: string description: "Admin's gender (male, female, rather_not_say)." example: male dob: type: date description: "Admin's date of birth." example: '1990-01-01' password: type: string description: "Admin's new password (min 8 characters)." example: newpassword123 address: type: string description: "Admin's address." example: '123 Main St, City' required: - name - email - role delete: summary: 'Delete admin' operationId: deleteAdmin description: 'Permanently deletes an admin account.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Admin deleted successfully' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Admin deleted successfully' data: type: string example: null 403: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Cannot delete your own account' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Cannot delete your own account' data: type: string example: null 404: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Admin not found' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Admin not found' data: type: string example: null tags: - 'Admin Management' parameters: - in: path name: id description: 'The ID of the admin.' example: 1 required: true schema: type: integer /api/admin/admins/store: post: summary: 'Create a new admin' operationId: createANewAdmin description: 'Creates a new admin user with the specified details and assigns a role.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Admin created successfully' data: id: 2 name: John last_name: Doe email: john.doe@example.com phone: '+1234567890' profile_image: admin-profiles/profile.jpg status: true is_admin: true gender: male dob: '1990-01-01' address: '123 Main St, City' created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Admin created successfully' data: type: object properties: id: type: integer example: 2 name: type: string example: John last_name: type: string example: Doe email: type: string example: john.doe@example.com phone: type: string example: '+1234567890' profile_image: type: string example: admin-profiles/profile.jpg status: type: boolean example: true is_admin: type: boolean example: true gender: type: string example: male dob: type: string example: '1990-01-01' address: type: string example: '123 Main St, City' created_at: type: string example: '2023-01-01T12:00:00.000000Z' updated_at: type: string example: '2023-01-01T12:00:00.000000Z' 422: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'The given data was invalid.' data: email: - 'The email has already been taken.' properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'The given data was invalid.' data: type: object properties: email: type: array example: - 'The email has already been taken.' items: type: string tags: - 'Admin Management' requestBody: required: true content: multipart/form-data: schema: type: object properties: name: type: string description: "Admin's first name." example: John email: type: string description: "Admin's email address." example: john.doe@example.com password: type: string description: "Admin's password (min 8 characters)." example: password123 role: type: string description: 'Role name to assign to the admin.' example: editor phone: type: string description: "Admin's phone number." example: '+1234567890' profile_image: type: string format: binary description: "Admin's profile image (jpeg, png, jpg, gif, max 2MB)." last_name: type: string description: "Admin's last name." example: Doe gender: type: string description: "Admin's gender (male, female, rather_not_say)." example: male dob: type: date description: "Admin's date of birth." example: '1990-01-01' address: type: string description: "Admin's address." example: '123 Main St, City' required: - name - email - password - role '/api/admin/admins/update/{id}': put: summary: 'Update admin' operationId: updateAdmin description: "Updates an existing admin user's details and role." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Admin updated successfully' data: id: 1 name: John last_name: Doe email: john.doe@example.com phone: '+1234567890' profile_image: admin-profiles/profile.jpg status: true is_admin: true gender: male dob: '1990-01-01' address: '123 Main St, City' created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Admin updated successfully' data: type: object properties: id: type: integer example: 1 name: type: string example: John last_name: type: string example: Doe email: type: string example: john.doe@example.com phone: type: string example: '+1234567890' profile_image: type: string example: admin-profiles/profile.jpg status: type: boolean example: true is_admin: type: boolean example: true gender: type: string example: male dob: type: string example: '1990-01-01' address: type: string example: '123 Main St, City' created_at: type: string example: '2023-01-01T12:00:00.000000Z' updated_at: type: string example: '2023-01-01T12:00:00.000000Z' 404: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Admin not found' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Admin not found' data: type: string example: null 422: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'The given data was invalid.' data: email: - 'The email has already been taken.' properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'The given data was invalid.' data: type: object properties: email: type: array example: - 'The email has already been taken.' items: type: string tags: - 'Admin Management' requestBody: required: true content: multipart/form-data: schema: type: object properties: name: type: string description: "Admin's first name." example: John email: type: string description: "Admin's email address." example: john.doe@example.com role: type: string description: 'Role name to assign to the admin.' example: editor phone: type: string description: "Admin's phone number." example: '+1234567890' profile_image: type: string format: binary description: "Admin's profile image (jpeg, png, jpg, gif, max 2MB)." last_name: type: string description: "Admin's last name." example: Doe gender: type: string description: "Admin's gender (male, female, rather_not_say)." example: male dob: type: date description: "Admin's date of birth." example: '1990-01-01' password: type: string description: "Admin's new password (min 8 characters)." example: newpassword123 address: type: string description: "Admin's address." example: '123 Main St, City' required: - name - email - role parameters: - in: path name: id description: 'The ID of the admin.' example: 1 required: true schema: type: integer '/api/admin/admins/delete/{id}': delete: summary: 'Delete admin' operationId: deleteAdmin description: 'Permanently deletes an admin account.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Admin deleted successfully' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Admin deleted successfully' data: type: string example: null 403: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Cannot delete your own account' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Cannot delete your own account' data: type: string example: null 404: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Admin not found' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Admin not found' data: type: string example: null tags: - 'Admin Management' parameters: - in: path name: id description: 'The ID of the admin.' example: 1 required: true schema: type: integer '/api/admin/admins/toggle-status/{id}': patch: summary: 'Toggle admin status' operationId: toggleAdminStatus description: 'Activates or deactivates an admin account.' parameters: [] responses: 200: description: '' content: application/json: schema: oneOf: - description: Deactivated type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Admin deactivated successfully' data: id: 1 status: false updated_at: '2023-01-01T12:00:00.000000Z' properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Admin deactivated successfully' data: type: object properties: id: type: integer example: 1 status: type: boolean example: false updated_at: type: string example: '2023-01-01T12:00:00.000000Z' - description: Activated type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Admin activated successfully' data: id: 1 status: true updated_at: '2023-01-01T12:00:00.000000Z' properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Admin activated successfully' data: type: object properties: id: type: integer example: 1 status: type: boolean example: true updated_at: type: string example: '2023-01-01T12:00:00.000000Z' 403: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Cannot deactivate your own account' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Cannot deactivate your own account' data: type: string example: null 404: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Admin not found' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Admin not found' data: type: string example: null tags: - 'Admin Management' parameters: - in: path name: id description: 'The ID of the admin.' example: 1 required: true schema: type: integer '/api/admin/admins/{id}/toggle-status': patch: summary: 'Toggle admin status' operationId: toggleAdminStatus description: 'Activates or deactivates an admin account.' parameters: [] responses: 200: description: '' content: application/json: schema: oneOf: - description: Deactivated type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Admin deactivated successfully' data: id: 1 status: false updated_at: '2023-01-01T12:00:00.000000Z' properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Admin deactivated successfully' data: type: object properties: id: type: integer example: 1 status: type: boolean example: false updated_at: type: string example: '2023-01-01T12:00:00.000000Z' - description: Activated type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Admin activated successfully' data: id: 1 status: true updated_at: '2023-01-01T12:00:00.000000Z' properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Admin activated successfully' data: type: object properties: id: type: integer example: 1 status: type: boolean example: true updated_at: type: string example: '2023-01-01T12:00:00.000000Z' 403: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Cannot deactivate your own account' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Cannot deactivate your own account' data: type: string example: null 404: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Admin not found' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Admin not found' data: type: string example: null tags: - 'Admin Management' parameters: - in: path name: id description: 'The ID of the admin.' example: 1 required: true schema: type: integer /api/admin/profile: get: summary: 'Get Admin Profile' operationId: getAdminProfile description: "Retrieves the authenticated admin's profile information including personal details and last login time." parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: success: true message: 'Profile retrieved successfully' data: id: 1 name: John email: admin@example.com phone: '+1234567890' role: super_admin profile_image: storage/admin/profile/image.jpg last_name: Doe gender: male dob: '1990-01-01' address: '123 Admin Street, City' last_login_at: '2023-05-17 10:30:45' properties: success: type: boolean example: true message: type: string example: 'Profile retrieved successfully' data: type: object properties: id: type: integer example: 1 name: type: string example: John email: type: string example: admin@example.com phone: type: string example: '+1234567890' role: type: string example: super_admin profile_image: type: string example: storage/admin/profile/image.jpg last_name: type: string example: Doe gender: type: string example: male dob: type: string example: '1990-01-01' address: type: string example: '123 Admin Street, City' last_login_at: type: string example: '2023-05-17 10:30:45' 500: description: 'Server Error' content: application/json: schema: type: object example: success: false message: 'Internal server error' error: code: 500 message: 'Server error details' properties: success: type: boolean example: false message: type: string example: 'Internal server error' error: type: object properties: code: type: integer example: 500 message: type: string example: 'Server error details' tags: - 'Admin Profile Management' /api/admin/profile/update: post: summary: 'Update Admin Profile' operationId: updateAdminProfile description: "Updates the authenticated admin's profile information with the provided data." parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: success: true message: 'Profile updated successfully' data: id: 1 name: John email: admin@example.com phone: '+1234567890' role: super_admin profile_image: storage/admin/profile/image.jpg last_name: Doe gender: male dob: '1990-01-01' address: '123 Admin Street, City' properties: success: type: boolean example: true message: type: string example: 'Profile updated successfully' data: type: object properties: id: type: integer example: 1 name: type: string example: John email: type: string example: admin@example.com phone: type: string example: '+1234567890' role: type: string example: super_admin profile_image: type: string example: storage/admin/profile/image.jpg last_name: type: string example: Doe gender: type: string example: male dob: type: string example: '1990-01-01' address: type: string example: '123 Admin Street, City' 400: description: 'Validation Error' content: application/json: schema: type: object example: success: false message: 'Validation failed' error: code: 400 message: 'The email has already been taken.' data: email: - 'The email has already been taken.' properties: success: type: boolean example: false message: type: string example: 'Validation failed' error: type: object properties: code: type: integer example: 400 message: type: string example: 'The email has already been taken.' data: type: object properties: email: type: array example: - 'The email has already been taken.' items: type: string 500: description: 'Server Error' content: application/json: schema: type: object example: success: false message: 'Internal server error' error: code: 500 message: 'Server error details' properties: success: type: boolean example: false message: type: string example: 'Internal server error' error: type: object properties: code: type: integer example: 500 message: type: string example: 'Server error details' tags: - 'Admin Profile Management' requestBody: required: false content: application/json: schema: type: object properties: name: type: string description: "optional The admin's first name." example: John email: type: string description: "optional The admin's email address. Must be unique." example: admin@example.com phone: type: string description: "optional The admin's phone number." example: '+1234567890' last_name: type: string description: "optional The admin's last name." example: Doe gender: type: string description: "optional The admin's gender. Must be one of: male, female, rather_not_say." example: male dob: type: date description: "optional The admin's date of birth." example: '1990-01-01' address: type: string description: "optional The admin's address." example: '123 Admin Street, City' /api/admin/profile/update-image: post: summary: 'Update Admin Profile Image' operationId: updateAdminProfileImage description: "Updates the authenticated admin's profile image." parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: success: true message: 'Profile image updated successfully' data: profile_image: storage/admin/profile/image123456.jpg properties: success: type: boolean example: true message: type: string example: 'Profile image updated successfully' data: type: object properties: profile_image: type: string example: storage/admin/profile/image123456.jpg 400: description: 'Validation Error' content: application/json: schema: type: object example: success: false message: 'Validation failed' error: code: 400 message: 'The profile image field is required.' data: profile_image: - 'The profile image field is required.' properties: success: type: boolean example: false message: type: string example: 'Validation failed' error: type: object properties: code: type: integer example: 400 message: type: string example: 'The profile image field is required.' data: type: object properties: profile_image: type: array example: - 'The profile image field is required.' items: type: string 500: description: 'Server Error' content: application/json: schema: type: object example: success: false message: 'Internal server error' error: code: 500 message: 'Server error details' properties: success: type: boolean example: false message: type: string example: 'Internal server error' error: type: object properties: code: type: integer example: 500 message: type: string example: 'Server error details' tags: - 'Admin Profile Management' requestBody: required: true content: multipart/form-data: schema: type: object properties: profile_image: type: string format: binary description: "The admin's profile image file. Must be an image (jpeg, png, jpg, gif) and less than 2MB." required: - profile_image /api/admin/profile/change-password: post: summary: 'Change Admin Password' operationId: changeAdminPassword description: "Updates the authenticated admin's password after verifying the current password." parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: success: true message: 'Password changed successfully' properties: success: type: boolean example: true message: type: string example: 'Password changed successfully' 400: description: '' content: application/json: schema: oneOf: - description: 'Validation Error' type: object example: success: false message: 'Validation failed' error: code: 400 message: 'The password confirmation does not match.' data: password: - 'The password confirmation does not match.' properties: success: type: boolean example: false message: type: string example: 'Validation failed' error: type: object properties: code: type: integer example: 400 message: type: string example: 'The password confirmation does not match.' data: type: object properties: password: type: array example: - 'The password confirmation does not match.' items: type: string - description: 'Incorrect Current Password' type: object example: success: false message: 'Current password is incorrect' error: code: 102 message: 'Current password is incorrect' properties: success: type: boolean example: false message: type: string example: 'Current password is incorrect' error: type: object properties: code: type: integer example: 102 message: type: string example: 'Current password is incorrect' 500: description: 'Server Error' content: application/json: schema: type: object example: success: false message: 'Internal server error' error: code: 500 message: 'Server error details' properties: success: type: boolean example: false message: type: string example: 'Internal server error' error: type: object properties: code: type: integer example: 500 message: type: string example: 'Server error details' tags: - 'Admin Profile Management' requestBody: required: true content: application/json: schema: type: object properties: current_password: type: string description: "The admin's current password." example: null password: type: string description: 'The new password. Must be at least 8 characters.' example: null password_confirmation: type: string description: 'Must match the new password.' example: null required: - current_password - password - password_confirmation /api/admin/admins/roles: get: summary: 'List all roles' operationId: listAllRoles description: 'Retrieves a list of all available admin roles.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Roles retrieved successfully' data: - id: 1 name: super-admin guard_name: admin description: 'Super Administrator' created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' permissions: - id: 1 name: manage_admins guard_name: admin created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Roles retrieved successfully' data: type: array example: - id: 1 name: super-admin guard_name: admin description: 'Super Administrator' created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' permissions: - id: 1 name: manage_admins guard_name: admin created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' items: type: object properties: id: type: integer example: 1 name: type: string example: super-admin guard_name: type: string example: admin description: type: string example: 'Super Administrator' created_at: type: string example: '2023-01-01T12:00:00.000000Z' updated_at: type: string example: '2023-01-01T12:00:00.000000Z' permissions: type: array example: - id: 1 name: manage_admins guard_name: admin created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' items: type: object properties: id: type: integer example: 1 name: type: string example: manage_admins guard_name: type: string example: admin created_at: type: string example: '2023-01-01T12:00:00.000000Z' updated_at: type: string example: '2023-01-01T12:00:00.000000Z' tags: - 'Admin Roles & Permissions' /api/admin/roles: get: summary: 'List all roles' operationId: listAllRoles description: 'Retrieves a list of all available admin roles.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Roles retrieved successfully' data: - id: 1 name: super-admin guard_name: admin description: 'Super Administrator' created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' permissions: - id: 1 name: manage_admins guard_name: admin created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Roles retrieved successfully' data: type: array example: - id: 1 name: super-admin guard_name: admin description: 'Super Administrator' created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' permissions: - id: 1 name: manage_admins guard_name: admin created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' items: type: object properties: id: type: integer example: 1 name: type: string example: super-admin guard_name: type: string example: admin description: type: string example: 'Super Administrator' created_at: type: string example: '2023-01-01T12:00:00.000000Z' updated_at: type: string example: '2023-01-01T12:00:00.000000Z' permissions: type: array example: - id: 1 name: manage_admins guard_name: admin created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' items: type: object properties: id: type: integer example: 1 name: type: string example: manage_admins guard_name: type: string example: admin created_at: type: string example: '2023-01-01T12:00:00.000000Z' updated_at: type: string example: '2023-01-01T12:00:00.000000Z' tags: - 'Admin Roles & Permissions' post: summary: 'Create role' operationId: createRole description: 'Creates a new role with assigned permissions.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Role created successfully' data: id: 2 name: editor guard_name: admin description: 'Content Editor Role' created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' permissions: - id: 2 name: view_dashboard guard_name: admin created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' - id: 3 name: manage_content guard_name: admin created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Role created successfully' data: type: object properties: id: type: integer example: 2 name: type: string example: editor guard_name: type: string example: admin description: type: string example: 'Content Editor Role' created_at: type: string example: '2023-01-01T12:00:00.000000Z' updated_at: type: string example: '2023-01-01T12:00:00.000000Z' permissions: type: array example: - id: 2 name: view_dashboard guard_name: admin created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' - id: 3 name: manage_content guard_name: admin created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' items: type: object properties: id: type: integer example: 2 name: type: string example: view_dashboard guard_name: type: string example: admin created_at: type: string example: '2023-01-01T12:00:00.000000Z' updated_at: type: string example: '2023-01-01T12:00:00.000000Z' 422: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'The given data was invalid.' data: name: - 'The name has already been taken.' properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'The given data was invalid.' data: type: object properties: name: type: array example: - 'The name has already been taken.' items: type: string tags: - 'Admin Roles & Permissions' requestBody: required: true content: application/json: schema: type: object properties: name: type: string description: 'The name of the role.' example: editor permissions: type: array description: 'List of permission names to assign to the role.' example: - view_dashboard - manage_content items: type: string description: type: string description: 'Description of the role.' example: 'Content Editor Role' required: - name - permissions '/api/admin/roles/{id}': put: summary: 'Update role' operationId: updateRole description: 'Updates an existing role and its assigned permissions.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Role updated successfully' data: id: 2 name: content_editor guard_name: admin description: 'Content Editor with publishing rights' created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' permissions: - id: 2 name: view_dashboard guard_name: admin created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' - id: 3 name: manage_content guard_name: admin created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' - id: 4 name: publish_articles guard_name: admin created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Role updated successfully' data: type: object properties: id: type: integer example: 2 name: type: string example: content_editor guard_name: type: string example: admin description: type: string example: 'Content Editor with publishing rights' created_at: type: string example: '2023-01-01T12:00:00.000000Z' updated_at: type: string example: '2023-01-01T12:00:00.000000Z' permissions: type: array example: - id: 2 name: view_dashboard guard_name: admin created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' - id: 3 name: manage_content guard_name: admin created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' - id: 4 name: publish_articles guard_name: admin created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' items: type: object properties: id: type: integer example: 2 name: type: string example: view_dashboard guard_name: type: string example: admin created_at: type: string example: '2023-01-01T12:00:00.000000Z' updated_at: type: string example: '2023-01-01T12:00:00.000000Z' 403: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Cannot modify super-admin role' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Cannot modify super-admin role' data: type: string example: null 404: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Role not found' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Role not found' data: type: string example: null tags: - 'Admin Roles & Permissions' requestBody: required: true content: application/json: schema: type: object properties: name: type: string description: 'The name of the role.' example: content_editor permissions: type: array description: 'List of permission names to assign to the role.' example: - view_dashboard - manage_content - publish_articles items: type: string description: type: string description: 'Description of the role.' example: 'Content Editor with publishing rights' required: - name - permissions delete: summary: 'Delete role' operationId: deleteRole description: "Permanently deletes a role if it's not assigned to any admin users." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Role deleted successfully' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Role deleted successfully' data: type: string example: null 400: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Cannot delete role that is assigned to 2 admin(s)' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Cannot delete role that is assigned to 2 admin(s)' data: type: string example: null 403: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Cannot delete super-admin role' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Cannot delete super-admin role' data: type: string example: null 404: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Role not found' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Role not found' data: type: string example: null tags: - 'Admin Roles & Permissions' parameters: - in: path name: id description: 'The ID of the role.' example: 2 required: true schema: type: integer /api/admin/permissions: get: summary: 'List all permissions' operationId: listAllPermissions description: 'Retrieves a list of all available permissions for admin roles.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Permissions retrieved successfully' data: - id: 1 name: manage_admins guard_name: admin created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' - id: 2 name: view_dashboard guard_name: admin created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Permissions retrieved successfully' data: type: array example: - id: 1 name: manage_admins guard_name: admin created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' - id: 2 name: view_dashboard guard_name: admin created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' items: type: object properties: id: type: integer example: 1 name: type: string example: manage_admins guard_name: type: string example: admin created_at: type: string example: '2023-01-01T12:00:00.000000Z' updated_at: type: string example: '2023-01-01T12:00:00.000000Z' tags: - 'Admin Roles & Permissions' /api/admin/two-factor-auth/status: get: summary: 'Get 2FA status' operationId: get2FAStatus description: 'Retrieves the current two-factor authentication status for the authenticated admin user.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Two-factor authentication status retrieved successfully' data: enabled: true method: email confirmed: true has_recovery_codes: true properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Two-factor authentication status retrieved successfully' data: type: object properties: enabled: type: boolean example: true method: type: string example: email confirmed: type: boolean example: true has_recovery_codes: type: boolean example: true 401: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'User not authenticated' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'User not authenticated' data: type: string example: null tags: - 'Admin Two-Factor Authentication' /api/admin/two-factor-auth/enable: post: summary: 'Enable 2FA' operationId: enable2FA description: 'Enables two-factor authentication for the authenticated admin user and generates recovery codes.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Two-factor authentication has been enabled' data: recovery_codes: - ABCDEF-123456 - GHIJKL-789012 - MNOPQR-345678 - STUVWX-901234 - YZABCD-567890 - EFGHIJ-123456 - KLMNOP-789012 - QRSTUV-345678 properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Two-factor authentication has been enabled' data: type: object properties: recovery_codes: type: array example: - ABCDEF-123456 - GHIJKL-789012 - MNOPQR-345678 - STUVWX-901234 - YZABCD-567890 - EFGHIJ-123456 - KLMNOP-789012 - QRSTUV-345678 items: type: string 400: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Two-factor authentication is already enabled' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Two-factor authentication is already enabled' data: type: string example: null 401: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'User not authenticated' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'User not authenticated' data: type: string example: null 422: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'The method field must be either email or sms' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'The method field must be either email or sms' data: type: string example: null tags: - 'Admin Two-Factor Authentication' requestBody: required: true content: application/json: schema: type: object properties: method: type: string description: 'The 2FA method to use (email or sms).' example: email required: - method /api/admin/two-factor-auth/disable: post: summary: 'Disable 2FA' operationId: disable2FA description: 'Disables two-factor authentication for the authenticated admin user.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Two-factor authentication has been disabled' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Two-factor authentication has been disabled' data: type: string example: null 400: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Two-factor authentication is not enabled' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Two-factor authentication is not enabled' data: type: string example: null 401: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'User not authenticated' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'User not authenticated' data: type: string example: null tags: - 'Admin Two-Factor Authentication' /api/admin/two-factor-auth/change-method: post: summary: 'Change 2FA method' operationId: change2FAMethod description: 'Changes the two-factor authentication method for the authenticated admin user.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Two-factor authentication method has been changed to sms' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Two-factor authentication method has been changed to sms' data: type: string example: null 400: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Two-factor authentication is not enabled' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Two-factor authentication is not enabled' data: type: string example: null 401: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'User not authenticated' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'User not authenticated' data: type: string example: null 422: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'The method field must be either email or sms' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'The method field must be either email or sms' data: type: string example: null tags: - 'Admin Two-Factor Authentication' requestBody: required: true content: application/json: schema: type: object properties: method: type: string description: 'The new 2FA method to use (email or sms).' example: sms required: - method /api/admin/two-factor-auth/generate-code: post: summary: 'Generate verification code' operationId: generateVerificationCode description: 'Generates and sends a new verification code to the admin user via their chosen method (email or SMS).' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Verification code has been sent to your email' data: method: email properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Verification code has been sent to your email' data: type: object properties: method: type: string example: email 400: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Two-factor authentication is not enabled' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Two-factor authentication is not enabled' data: type: string example: null 401: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'User not authenticated' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'User not authenticated' data: type: string example: null tags: - 'Admin Two-Factor Authentication' /api/admin/two-factor-auth/verify-code: post: summary: 'Verify 2FA code' operationId: verify2FACode description: 'Verifies a two-factor authentication code for the authenticated admin user.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Two-factor authentication has been confirmed' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Two-factor authentication has been confirmed' data: type: string example: null 400: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Invalid verification code' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Invalid verification code' data: type: string example: null 401: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'User not authenticated' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'User not authenticated' data: type: string example: null 422: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'The code must be 6 characters' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'The code must be 6 characters' data: type: string example: null tags: - 'Admin Two-Factor Authentication' requestBody: required: true content: application/json: schema: type: object properties: code: type: string description: 'The 6-digit verification code.' example: '123456' required: - code /api/admin/two-factor-auth/verify-recovery-code: post: summary: 'Verify recovery code' operationId: verifyRecoveryCode description: "Verifies a recovery code for the authenticated admin user. Recovery codes can be used\nwhen the user doesn't have access to their primary 2FA method." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Recovery code verified successfully' data: remaining_codes: 7 properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Recovery code verified successfully' data: type: object properties: remaining_codes: type: integer example: 7 400: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Invalid recovery code' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Invalid recovery code' data: type: string example: null 401: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'User not authenticated' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'User not authenticated' data: type: string example: null 422: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'The recovery code field is required' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'The recovery code field is required' data: type: string example: null tags: - 'Admin Two-Factor Authentication' requestBody: required: true content: application/json: schema: type: object properties: recovery_code: type: string description: 'The recovery code to verify.' example: ABCDEF-123456 required: - recovery_code /api/admin/two-factor-auth/regenerate-recovery-codes: post: summary: 'Regenerate recovery codes' operationId: regenerateRecoveryCodes description: "Generates a new set of recovery codes for the authenticated admin user.\nThis invalidates all previously generated recovery codes." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Recovery codes have been regenerated' data: recovery_codes: - ABCDEF-123456 - GHIJKL-789012 - MNOPQR-345678 - STUVWX-901234 - YZABCD-567890 - EFGHIJ-123456 - KLMNOP-789012 - QRSTUV-345678 properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Recovery codes have been regenerated' data: type: object properties: recovery_codes: type: array example: - ABCDEF-123456 - GHIJKL-789012 - MNOPQR-345678 - STUVWX-901234 - YZABCD-567890 - EFGHIJ-123456 - KLMNOP-789012 - QRSTUV-345678 items: type: string 400: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Two-factor authentication is not enabled' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Two-factor authentication is not enabled' data: type: string example: null 401: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'User not authenticated' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'User not authenticated' data: type: string example: null tags: - 'Admin Two-Factor Authentication' /api/admin/agents: get: summary: 'List all agents' operationId: listAllAgents description: "Retrieves a paginated list of all agents along with summary statistics,\nstatus overview, and monthly analytics data." parameters: - in: query name: page description: 'Page number for pagination.' example: 1 required: false schema: type: integer description: 'Page number for pagination.' example: 1 responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Agents data retrieved successfully' data: summary: total_collections: 500000 total_withdrawals: 200000 earned_interest: 40000 outstanding_balance: 300000 total_agents: 50 agents_status: total: 50 active: 45 inactive: 5 active_percentage: 90 inactive_percentage: 10 analytics: labels: - Jan - Feb - Mar - Apr - May - Jun - Jul - Aug - Sep - Oct - Nov - Dec datasets: - label: Collections data: - 10000 - 15000 - 20000 - 25000 - 30000 - 35000 - 40000 - 45000 - 50000 - 55000 - 60000 - 65000 backgroundColor: '#F6C000' - label: Withdrawals data: - 5000 - 7500 - 10000 - 12500 - 15000 - 17500 - 20000 - 22500 - 25000 - 27500 - 30000 - 32500 backgroundColor: '#000000' agents: data: - id: 1 name: 'John Doe' email: john.doe@example.com phone: '+1234567890' status: id: 1 name: active location: country: Nigeria state: Lagos lga: Ikeja created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' links: first: 'http://example.com/api/admin/agents?page=1' last: 'http://example.com/api/admin/agents?page=5' prev: null next: 'http://example.com/api/admin/agents?page=2' meta: current_page: 1 from: 1 last_page: 5 path: 'http://example.com/api/admin/agents' per_page: 10 to: 10 total: 50 properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Agents data retrieved successfully' data: type: object properties: summary: type: object properties: total_collections: type: integer example: 500000 total_withdrawals: type: integer example: 200000 earned_interest: type: integer example: 40000 outstanding_balance: type: integer example: 300000 total_agents: type: integer example: 50 agents_status: type: object properties: total: type: integer example: 50 active: type: integer example: 45 inactive: type: integer example: 5 active_percentage: type: integer example: 90 inactive_percentage: type: integer example: 10 analytics: type: object properties: labels: type: array example: - Jan - Feb - Mar - Apr - May - Jun - Jul - Aug - Sep - Oct - Nov - Dec items: type: string datasets: type: array example: - label: Collections data: - 10000 - 15000 - 20000 - 25000 - 30000 - 35000 - 40000 - 45000 - 50000 - 55000 - 60000 - 65000 backgroundColor: '#F6C000' - label: Withdrawals data: - 5000 - 7500 - 10000 - 12500 - 15000 - 17500 - 20000 - 22500 - 25000 - 27500 - 30000 - 32500 backgroundColor: '#000000' items: type: object properties: label: type: string example: Collections data: type: array example: - 10000 - 15000 - 20000 - 25000 - 30000 - 35000 - 40000 - 45000 - 50000 - 55000 - 60000 - 65000 items: type: integer backgroundColor: type: string example: '#F6C000' agents: type: object properties: data: type: array example: - id: 1 name: 'John Doe' email: john.doe@example.com phone: '+1234567890' status: id: 1 name: active location: country: Nigeria state: Lagos lga: Ikeja created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' items: type: object properties: id: type: integer example: 1 name: type: string example: 'John Doe' email: type: string example: john.doe@example.com phone: type: string example: '+1234567890' status: type: object properties: id: type: integer example: 1 name: type: string example: active location: type: object properties: country: type: string example: Nigeria state: type: string example: Lagos lga: type: string example: Ikeja created_at: type: string example: '2023-01-01T12:00:00.000000Z' updated_at: type: string example: '2023-01-01T12:00:00.000000Z' links: type: object properties: first: type: string example: 'http://example.com/api/admin/agents?page=1' last: type: string example: 'http://example.com/api/admin/agents?page=5' prev: type: string example: null next: type: string example: 'http://example.com/api/admin/agents?page=2' meta: type: object properties: current_page: type: integer example: 1 from: type: integer example: 1 last_page: type: integer example: 5 path: type: string example: 'http://example.com/api/admin/agents' per_page: type: integer example: 10 to: type: integer example: 10 total: type: integer example: 50 500: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Internal server error' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Internal server error' data: type: string example: null tags: - 'Agent Management' '/api/admin/agents/agent/{id}': get: summary: 'Get agent details' operationId: getAgentDetails description: "Retrieves detailed information about a specific agent including their\npersonal details, financial summary, and transaction history." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Agent details retrieved successfully' data: agent: id: 1 name: 'John Doe' email: john.doe@example.com phone: '+1234567890' status: id: 1 name: active location: country: Nigeria state: Lagos lga: Ikeja address: '123 Main Street' bank_details: bank_name: 'Example Bank' account_number: '1234567890' account_name: 'John Doe' created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' financial_summary: balance: 50000 total_collections: 100000 total_withdrawals: 50000 total_traders: 10 recent_transactions: - id: 1 type: deposit amount: 10000 status: id: 1 name: completed trader: id: 1 name: 'Jane Smith' created_at: '2023-01-01T12:00:00.000000Z' properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Agent details retrieved successfully' data: type: object properties: agent: type: object properties: id: type: integer example: 1 name: type: string example: 'John Doe' email: type: string example: john.doe@example.com phone: type: string example: '+1234567890' status: type: object properties: id: type: integer example: 1 name: type: string example: active location: type: object properties: country: type: string example: Nigeria state: type: string example: Lagos lga: type: string example: Ikeja address: type: string example: '123 Main Street' bank_details: type: object properties: bank_name: type: string example: 'Example Bank' account_number: type: string example: '1234567890' account_name: type: string example: 'John Doe' created_at: type: string example: '2023-01-01T12:00:00.000000Z' updated_at: type: string example: '2023-01-01T12:00:00.000000Z' financial_summary: type: object properties: balance: type: integer example: 50000 total_collections: type: integer example: 100000 total_withdrawals: type: integer example: 50000 total_traders: type: integer example: 10 recent_transactions: type: array example: - id: 1 type: deposit amount: 10000 status: id: 1 name: completed trader: id: 1 name: 'Jane Smith' created_at: '2023-01-01T12:00:00.000000Z' items: type: object properties: id: type: integer example: 1 type: type: string example: deposit amount: type: integer example: 10000 status: type: object properties: id: type: integer example: 1 name: type: string example: completed trader: type: object properties: id: type: integer example: 1 name: type: string example: 'Jane Smith' created_at: type: string example: '2023-01-01T12:00:00.000000Z' 404: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Agent not found' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Agent not found' data: type: string example: null tags: - 'Agent Management' parameters: - in: path name: id description: 'The ID of the agent.' example: 1 required: true schema: type: integer '/api/admin/agents/{id}/toggle-block': post: summary: 'Toggle agent status' operationId: toggleAgentStatus description: "Blocks or unblocks an agent account. When blocked, the agent cannot\naccess the system or perform any transactions." parameters: [] responses: 200: description: '' content: application/json: schema: oneOf: - description: Blocked type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Agent blocked successfully' data: id: 1 name: 'John Doe' status: id: 2 name: inactive block_reason: 'Suspicious activity detected' updated_at: '2023-01-01T12:00:00.000000Z' properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Agent blocked successfully' data: type: object properties: id: type: integer example: 1 name: type: string example: 'John Doe' status: type: object properties: id: type: integer example: 2 name: type: string example: inactive block_reason: type: string example: 'Suspicious activity detected' updated_at: type: string example: '2023-01-01T12:00:00.000000Z' - description: Unblocked type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Agent unblocked successfully' data: id: 1 name: 'John Doe' status: id: 1 name: active block_reason: null updated_at: '2023-01-01T12:00:00.000000Z' properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Agent unblocked successfully' data: type: object properties: id: type: integer example: 1 name: type: string example: 'John Doe' status: type: object properties: id: type: integer example: 1 name: type: string example: active block_reason: type: string example: null updated_at: type: string example: '2023-01-01T12:00:00.000000Z' 404: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Agent not found' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Agent not found' data: type: string example: null tags: - 'Agent Management' requestBody: required: true content: application/json: schema: type: object properties: reason: type: string description: 'Reason for blocking/unblocking the agent.' example: 'Suspicious activity detected' required: - reason parameters: - in: path name: id description: 'The ID of the agent.' example: 1 required: true schema: type: integer '/api/admin/agents/{id}': delete: summary: 'Delete agent' operationId: deleteAgent description: "Permanently deletes an agent account and all associated data.\nThis action cannot be undone." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Agent deleted successfully' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Agent deleted successfully' data: type: string example: null 400: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Cannot delete agent with active balance' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Cannot delete agent with active balance' data: type: string example: null 404: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Agent not found' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Agent not found' data: type: string example: null tags: - 'Agent Management' parameters: - in: path name: id description: 'The ID of the agent.' example: 1 required: true schema: type: integer /api/admin/agents/transactions: get: summary: 'List agent transactions' operationId: listAgentTransactions description: "Retrieves a paginated list of agent transactions with optional filtering\nby agent ID, date range, transaction type, and status." parameters: - in: query name: agent_id description: 'ID of the agent to filter transactions.' example: 1 required: false schema: type: integer description: 'ID of the agent to filter transactions.' example: 1 - in: query name: start_date description: 'date Start date for filtering transactions (YYYY-MM-DD).' example: '2023-01-01' required: false schema: type: string description: 'date Start date for filtering transactions (YYYY-MM-DD).' example: '2023-01-01' - in: query name: end_date description: 'date End date for filtering transactions (YYYY-MM-DD).' example: '2023-12-31' required: false schema: type: string description: 'date End date for filtering transactions (YYYY-MM-DD).' example: '2023-12-31' - in: query name: type description: 'Transaction type (deposit/withdrawal).' example: deposit required: false schema: type: string description: 'Transaction type (deposit/withdrawal).' example: deposit - in: query name: status_id description: 'Status ID for filtering transactions.' example: 1 required: false schema: type: integer description: 'Status ID for filtering transactions.' example: 1 - in: query name: page description: 'Page number for pagination.' example: 1 required: false schema: type: integer description: 'Page number for pagination.' example: 1 responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Transactions retrieved successfully' data: transactions: current_page: 1 data: - id: 1 agent: id: 1 name: 'John Doe' trader: id: 1 name: 'Jane Smith' type: deposit amount: 10000 status: id: 1 name: completed created_at: '2023-01-01T12:00:00.000000Z' first_page_url: 'http://example.com/api/admin/agents/transactions?page=1' from: 1 last_page: 5 last_page_url: 'http://example.com/api/admin/agents/transactions?page=5' links: [] next_page_url: 'http://example.com/api/admin/agents/transactions?page=2' path: 'http://example.com/api/admin/agents/transactions' per_page: 10 prev_page_url: null to: 10 total: 50 summary: total_amount: 500000 total_count: 50 properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Transactions retrieved successfully' data: type: object properties: transactions: type: object properties: current_page: type: integer example: 1 data: type: array example: - id: 1 agent: id: 1 name: 'John Doe' trader: id: 1 name: 'Jane Smith' type: deposit amount: 10000 status: id: 1 name: completed created_at: '2023-01-01T12:00:00.000000Z' items: type: object properties: id: type: integer example: 1 agent: type: object properties: id: type: integer example: 1 name: type: string example: 'John Doe' trader: type: object properties: id: type: integer example: 1 name: type: string example: 'Jane Smith' type: type: string example: deposit amount: type: integer example: 10000 status: type: object properties: id: type: integer example: 1 name: type: string example: completed created_at: type: string example: '2023-01-01T12:00:00.000000Z' first_page_url: type: string example: 'http://example.com/api/admin/agents/transactions?page=1' from: type: integer example: 1 last_page: type: integer example: 5 last_page_url: type: string example: 'http://example.com/api/admin/agents/transactions?page=5' links: type: array example: [] next_page_url: type: string example: 'http://example.com/api/admin/agents/transactions?page=2' path: type: string example: 'http://example.com/api/admin/agents/transactions' per_page: type: integer example: 10 prev_page_url: type: string example: null to: type: integer example: 10 total: type: integer example: 50 summary: type: object properties: total_amount: type: integer example: 500000 total_count: type: integer example: 50 500: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Internal server error' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Internal server error' data: type: string example: null tags: - 'Agent Transactions' /api/agents/login: post: summary: 'Agent Login.' operationId: agentLogin description: '' parameters: [] responses: 200: description: '' content: text/plain: schema: type: string example: "{\n \"status\": 1,\n \"token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...\",\n \"refresh_token\": \"def50200ea86c5d6161c...\",\n \"expire_at\": \"29-06-24 14:57:10\",\n \"token_type\": \"Bearer\",\n \"message\": \"Successfully logged in\",\n \"agent\": {\n \"id\": 1,\n \"name\": \"John Doe\",\n \"agent_number\": \"8013221673\",\n \"email\": \"john.doe@example.com\",\n ...\n }\n}" 422: description: '' content: application/json: schema: type: object example: message: 'Invalid data sent' details: agent_id: - 'The agent id field is required.' password: - 'The password must be at least 6 characters.' properties: message: type: string example: 'Invalid data sent' details: type: object properties: agent_id: type: array example: - 'The agent id field is required.' items: type: string password: type: array example: - 'The password must be at least 6 characters.' items: type: string tags: - Agents requestBody: required: true content: application/json: schema: type: object properties: agent_number: type: string description: 'The agent number of the agent.' example: '8013221673' password: type: string description: 'The password of the agent. Minimum length of 6 characters.' example: '12345678' required: - agent_number - password security: [] /api/agents/register-step-1: post: summary: 'Create Agent Step 1.' operationId: createAgentStep1 description: '' parameters: [] responses: 201: description: '' content: application/json: schema: type: object example: data: id: 4 trader_union: 'user trader_union' email: mail@user.com username: user_name password: '12345678' first_name: John last_name: mark phone: '08013221673' gender: male dob: '2024-03-09' properties: data: type: object properties: id: type: integer example: 4 trader_union: type: string example: 'user trader_union' email: type: string example: mail@user.com username: type: string example: user_name password: type: string example: '12345678' first_name: type: string example: John last_name: type: string example: mark phone: type: string example: '08013221673' gender: type: string example: male dob: type: string example: '2024-03-09' 422: description: '' content: application/json: schema: type: object example: message: 'Invalid data sent' details: email: - 'The email field is required.' password: - 'The password must be at least 8 characters.' properties: message: type: string example: 'Invalid data sent' details: type: object properties: email: type: array example: - 'The email field is required.' items: type: string password: type: array example: - 'The password must be at least 8 characters.' items: type: string tags: - Agents requestBody: required: true content: application/json: schema: type: object properties: username: type: string description: 'The username of the user.' example: user_name email: type: string description: 'The email of the user.' example: mail@user.com phone: type: string description: 'The phone number of the user.' example: '08013221673' trader_union: type: string description: 'The trader union of the user.' example: 'user trader_union' password: type: string description: 'The password of the user.' example: '12345678' first_name: type: string description: 'The first name of the user.' example: John last_name: type: string description: 'The last name of the user.' example: mark gender: type: string description: 'The gender of the user.' example: male dob: type: date description: 'The date of birth of the user.' example: '2024-03-09' required: - username - email - phone - trader_union - password - first_name - last_name - gender - dob security: [] /api/agents/register-step-2: post: summary: 'Complete agent registration step 2.' operationId: completeAgentRegistrationStep2 description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Agent step 2 registration completed' data: id: 1 trader_union: 'user trader_union' email: mail@user.com username: user_name password: '12345678' first_name: John last_name: mark phone: '08013221673' gender: male dob: '2024-03-09' country_id: Nigeria state_id: 'Abia State' lga_id: Ikwuano address: '5 cape ville' post_code: '10090' properties: message: type: string example: 'Agent step 2 registration completed' data: type: object properties: id: type: integer example: 1 trader_union: type: string example: 'user trader_union' email: type: string example: mail@user.com username: type: string example: user_name password: type: string example: '12345678' first_name: type: string example: John last_name: type: string example: mark phone: type: string example: '08013221673' gender: type: string example: male dob: type: string example: '2024-03-09' country_id: type: string example: Nigeria state_id: type: string example: 'Abia State' lga_id: type: string example: Ikwuano address: type: string example: '5 cape ville' post_code: type: string example: '10090' 403: description: '' content: application/json: schema: type: object example: message: 'User not verified' details: [] properties: message: type: string example: 'User not verified' details: type: array example: [] 404: description: '' content: application/json: schema: type: object example: message: 'Agent not found' details: [] properties: message: type: string example: 'Agent not found' details: type: array example: [] tags: - Agents requestBody: required: true content: application/json: schema: type: object properties: agent_id: type: integer description: 'The ID of the agent.' example: 1 country_id: type: numeric description: 'The ID of the country.' example: '1' state_id: type: numeric description: 'The ID of the state.' example: '1' lga_id: type: numeric description: 'The ID of the local government area.' example: '1' address: type: string description: 'The address of the agent.' example: '"123 Street, City, State"' post_code: type: string description: "The postal code of the agent's address." example: '"100001"' required: - agent_id - country_id - state_id - lga_id - address - post_code security: [] /api/agents/transaction-pin: post: summary: 'Create a new transaction PIN for an agent.' operationId: createANewTransactionPINForAnAgent description: '' parameters: [] responses: 201: description: '' content: application/json: schema: type: object example: message: 'Transaction PIN created successfully' data: agent_id: '8013221673' meta-links: [] properties: message: type: string example: 'Transaction PIN created successfully' data: type: object properties: agent_id: type: string example: '8013221673' meta-links: type: array example: [] 404: description: '' content: application/json: schema: type: object example: message: 'Agent not found' details: error: 'Agent not found' properties: message: type: string example: 'Agent not found' details: type: object properties: error: type: string example: 'Agent not found' 500: description: '' content: application/json: schema: type: object example: message: 'Failed to create transaction PIN' details: error: 'Internal Server Error' properties: message: type: string example: 'Failed to create transaction PIN' details: type: object properties: error: type: string example: 'Internal Server Error' tags: - Agents requestBody: required: true content: application/json: schema: type: object properties: pin: type: string description: 'The PIN of the transaction.' example: '1234' pin_confirmation: type: string description: 'The confirmation of the PIN.' example: '1234' agent_id: type: integer description: 'The ID of the agent.' example: 1 required: - pin - pin_confirmation - agent_id security: [] /api/agents/uploadid: post: summary: 'Profile image upload.' operationId: profileImageUpload description: '' parameters: [] responses: 200: description: '' content: text/plain: schema: type: string example: "{\n \"message\": \"File uploaded successfully\",\n\n}" 500: description: '' content: application/json: schema: type: object example: message: 'Failed to create ID' error: 'Error message' properties: message: type: string example: 'Failed to create ID' error: type: string example: 'Error message' tags: - Agents requestBody: required: true content: multipart/form-data: schema: type: object properties: agent_id: type: string description: 'The ID of the agent.' example: '1' id_type: type: string description: 'The type of ID.' example: passport id_file: type: string format: binary description: 'The file of the ID.' required: - agent_id - id_type - id_file security: [] /api/agents/verify-phone: post: summary: 'Verify the token for the agent.' operationId: verifyTheTokenForTheAgent description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Verification successful' data: [] meta-links: [] properties: message: type: string example: 'Verification successful' data: type: array example: [] meta-links: type: array example: [] 400: description: '' content: application/json: schema: type: object example: success: false message: 'Invalid or expired verification code' errors: [] properties: success: type: boolean example: false message: type: string example: 'Invalid or expired verification code' errors: type: array example: [] 404: description: '' content: application/json: schema: type: object example: success: false message: 'Agent not found' errors: [] properties: success: type: boolean example: false message: type: string example: 'Agent not found' errors: type: array example: [] 500: description: '' content: application/json: schema: type: object example: success: false message: 'Failed to verify token' errors: [] properties: success: type: boolean example: false message: type: string example: 'Failed to verify token' errors: type: array example: [] tags: - Agents requestBody: required: true content: application/json: schema: type: object properties: phone: type: string description: 'The ID of the agent.' example: '2348012345678' token: type: string description: 'The verification token.' example: '123456' required: - phone - token security: [] /api/agents/resend-verification: post: summary: "Resend the verification token to the agent's phone number." operationId: resendTheVerificationTokenToTheAgentsPhoneNumber description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: success: true message: 'Verification code resent successfully' data: [] meta-links: [] properties: success: type: boolean example: true message: type: string example: 'Verification code resent successfully' data: type: array example: [] meta-links: type: array example: [] 404: description: '' content: application/json: schema: type: object example: success: false message: 'Agent not found' errors: [] properties: success: type: boolean example: false message: type: string example: 'Agent not found' errors: type: array example: [] 500: description: '' content: application/json: schema: type: object example: success: false message: 'Failed to resend verification code' errors: [] properties: success: type: boolean example: false message: type: string example: 'Failed to resend verification code' errors: type: array example: [] tags: - Agents requestBody: required: true content: application/json: schema: type: object properties: phone: type: string description: 'The ID of the agent.' example: '2348012345678' required: - phone security: [] '/api/agents/{agent_id}': get: summary: 'Get the profile for the specified agent.' operationId: getTheProfileForTheSpecifiedAgent description: 'This endpoint retrieves the profile information for an agent.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: data: id: 1 first_name: John last_name: Doe email: johndoe@example.com phone: '1234567890' gender: male dob: '1990-01-01' properties: data: type: object properties: id: type: integer example: 1 first_name: type: string example: John last_name: type: string example: Doe email: type: string example: johndoe@example.com phone: type: string example: '1234567890' gender: type: string example: male dob: type: string example: '1990-01-01' 404: description: '' content: application/json: schema: type: object example: error: 'Agent not found' message: 'Agent not found' properties: error: type: string example: 'Agent not found' message: type: string example: 'Agent not found' 500: description: '' content: application/json: schema: type: object example: error: 'Failed to get profile' message: 'Failed to get profile' properties: error: type: string example: 'Failed to get profile' message: type: string example: 'Failed to get profile' tags: - Agents parameters: - in: path name: agent_id description: 'The ID of the agent.' example: 1 required: true schema: type: integer /api/agents: get: summary: 'Get all agents.' operationId: getAllAgents description: 'This endpoint retrieves all the agents in the system.' parameters: - in: query name: number description: 'The number of agents to retrieve. Defaults to 10.' example: 3 required: false schema: type: integer description: 'The number of agents to retrieve. Defaults to 10.' example: 3 responses: 200: description: '' content: text/plain: schema: type: string example: '{"data": [{"id": 1, "first_name": "John", "last_name": "Doe", "email": "johndoe@example.com", "phone": "1234567890", "gender": "male", "dob": "1990-01-01"}, {"id": 2, "first_name": "Jane", "last_name": "Doe", "email": "janedoe@example.com", "phone": "1234567890", "gender": "female", "dob": "1990-01-01"}, ...]}' 500: description: '' content: application/json: schema: type: object example: error: 'Failed to get agents' message: 'Failed to get agents' properties: error: type: string example: 'Failed to get agents' message: type: string example: 'Failed to get agents' tags: - Agents /api/agents/update-transaction-pin: post: summary: 'Updates the transaction PIN for the specified agent.' operationId: updatesTheTransactionPINForTheSpecifiedAgent description: "This endpoint updates the transaction PIN for an agent after verifying a one-time password (OTP) sent to the agent's phone." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Transaction PIN updated successfully' properties: message: type: string example: 'Transaction PIN updated successfully' 400: description: '' content: application/json: schema: type: object example: error: 'Invalid OTP' message: 'Invalid OTP provided' properties: error: type: string example: 'Invalid OTP' message: type: string example: 'Invalid OTP provided' 500: description: '' content: text/plain: schema: type: string example: "{\"error\": \"Failed to update transaction PIN\", \"message\": \"Failed to update transaction PIN\"}\n\nExample Request:\n{\n \"pin\": \"1234\",\n \"pin_confirmation\": \"1234\",\n \"otp\": \"5678\"\n}\n\nExample Response (Success):\n{\n \"message\": \"Transaction PIN updated successfully\"\n}\n\nExample Response (Invalid OTP):\n{\n \"error\": \"Invalid OTP\",\n \"message\": \"Invalid OTP provided\"\n}\n\nExample Response (Failed to update transaction PIN):\n{\n \"error\": \"Failed to update transaction PIN\",\n \"message\": \"Failed to update transaction PIN\"\n}" tags: - Agents requestBody: required: true content: application/json: schema: type: object properties: pin: type: string description: 'The new transaction PIN for the agent. Must be numeric and exactly 4 digits.' example: voluptatibus pin_confirmation: type: string description: 'The confirmation of the new transaction PIN.' example: laborum otp: type: string description: "The one-time password sent to the agent's phone. Must be numeric and exactly 4 digits." example: repudiandae required: - pin - pin_confirmation - otp /api/agents/update-profile-image: post: summary: 'Updates the profile image for the specified agent.' operationId: updatesTheProfileImageForTheSpecifiedAgent description: "This endpoint updates the profile image for an agent after verifying a one-time password (OTP) sent to the agent's phone." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'image updated successfully' properties: message: type: string example: 'image updated successfully' 400: description: '' content: application/json: schema: type: object example: error: 'Invalid OTP' message: 'Invalid OTP provided' properties: error: type: string example: 'Invalid OTP' message: type: string example: 'Invalid OTP provided' 500: description: '' content: application/json: schema: type: object example: error: 'Failed to update profile image' message: 'Failed to update profile image' properties: error: type: string example: 'Failed to update profile image' message: type: string example: 'Failed to update profile image' tags: - Agents requestBody: required: true content: multipart/form-data: schema: type: object properties: profile_image: type: string format: binary description: 'nullable The profile image of the agent. Must be in JPEG, PNG, or JPG format and cannot exceed 1MB in size.' otp: type: string description: "The one-time password sent to the agent's phone. Must be numeric and exactly 4 digits." example: sit required: - otp /api/agents/deactivate: post: summary: 'Deactivate an agent account.' operationId: deactivateAnAgentAccount description: 'This endpoint deactivates an agent account after verifying a specific delete phrase.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Agent deleted successfully' properties: message: type: string example: 'Agent deleted successfully' 400: description: '' content: application/json: schema: type: object example: error: 'Invalid delete phrase' message: 'Invalid delete phrase provided' properties: error: type: string example: 'Invalid delete phrase' message: type: string example: 'Invalid delete phrase provided' 500: description: '' content: application/json: schema: type: object example: error: 'Failed to delete agent' message: 'Failed to delete agent' properties: error: type: string example: 'Failed to delete agent' message: type: string example: 'Failed to delete agent' tags: - Agents requestBody: required: true content: application/json: schema: type: object properties: delete_phrase: type: string description: 'The delete phrase to verify the deletion.' example: '"delete_johndoe".' required: - delete_phrase /api/agents/reactivate: post: summary: 'Reactivate an agent account.' operationId: reactivateAnAgentAccount description: 'This endpoint reactivates an agent account that has been previously deactivated.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Agent restored successfully' properties: message: type: string example: 'Agent restored successfully' 404: description: '' content: application/json: schema: type: object example: error: 'Agent not found' message: 'Agent not found' properties: error: type: string example: 'Agent not found' message: type: string example: 'Agent not found' tags: - Agents requestBody: required: true content: application/json: schema: type: object properties: agent_id: type: integer description: 'The ID of the agent to reactivate.' example: 1 required: - agent_id /api/agents/change-password: post: summary: 'Update the password for the specified agent.' operationId: updateThePasswordForTheSpecifiedAgent description: "This endpoint updates the password for an agent after verifying the current password and a one-time password (OTP) sent to the agent's phone." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Password updated successfully' properties: message: type: string example: 'Password updated successfully' 400: description: '' content: application/json: schema: oneOf: - description: '' type: object example: error: 'In correct password' message: 'Current password does not match' properties: error: type: string example: 'In correct password' message: type: string example: 'Current password does not match' - description: '' type: object example: error: 'Invalid OTP' message: 'Invalid OTP provided' properties: error: type: string example: 'Invalid OTP' message: type: string example: 'Invalid OTP provided' 500: description: '' content: application/json: schema: type: object example: error: 'Failed to update password' message: 'Failed to update password' properties: error: type: string example: 'Failed to update password' message: type: string example: 'Failed to update password' tags: - Agents requestBody: required: true content: application/json: schema: type: object properties: password: type: string description: 'The new password for the agent. Must be at least 8 characters.' example: '0L?iHQl_I' password_confirmation: type: string description: 'The confirmation of the new password.' example: quae current_password: type: string description: 'The current password of the agent. Must be at least 8 characters.' example: voluptas otp: type: string description: "The one-time password sent to the agent's phone. Must be numeric and exactly 4 digits." example: sed required: - password - password_confirmation - current_password - otp /api/agents/update-profile: post: summary: 'Update the profile for the specified agent.' operationId: updateTheProfileForTheSpecifiedAgent description: "This endpoint updates the profile information for an agent after verifying a one-time password (OTP) sent to the agent's phone." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Profile updated successfully' properties: message: type: string example: 'Profile updated successfully' 400: description: '' content: application/json: schema: type: object example: error: 'Invalid OTP' message: 'Invalid OTP provided' properties: error: type: string example: 'Invalid OTP' message: type: string example: 'Invalid OTP provided' 500: description: '' content: application/json: schema: type: object example: error: 'Failed to update profile' message: 'Failed to update profile' properties: error: type: string example: 'Failed to update profile' message: type: string example: 'Failed to update profile' tags: - Agents requestBody: required: true content: application/json: schema: type: object properties: first_name: type: string description: 'nullable The first name of the agent. Maximum length is 255 characters.' example: quod last_name: type: string description: 'nullable The last name of the agent. Maximum length is 255 characters.' example: enim email: type: string description: 'nullable The email address of the agent. Must be a valid email address and maximum length is 255 characters.' example: felicita74@example.org phone: type: string description: 'nullable The phone number of the agent. Maximum length is 255 characters.' example: voluptatem gender: type: string description: 'nullable The gender of the agent.' example: dolor dob: type: date description: 'nullable The date of birth of the agent.' example: numquam trader_union: type: string description: 'nullable The trader union of the agent. Maximum length is 255 characters.' example: impedit otp: type: string description: "The one-time password sent to the agent's phone. Must be numeric and exactly 4 digits." example: nam required: - otp /api/banks: get: summary: 'Get list of supported banks.' operationId: getListOfSupportedBanks description: "This endpoint returns a list of banks available for transactions.\nRequires Bearer Token Authentication." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2025-05-18T06:00:39.874949Z' status: true message: Banks data: success: true data: - id: 302 name: '9mobile 9Payment Service Bank' slug: 9mobile-9payment-service-bank-ng code: '120001' longcode: '120001' gateway: '' pay_with_bank: false supports_transfer: true active: true country: Nigeria currency: NGN type: nuban is_deleted: false createdAt: '2022-05-31T06:50:27.000Z' updatedAt: '2022-06-23T09:33:55.000Z' - id: 174 name: 'Abbey Mortgage Bank' slug: abbey-mortgage-bank-ng code: '404' longcode: '' gateway: null pay_with_bank: false supports_transfer: true active: true country: Nigeria currency: NGN type: nuban is_deleted: false createdAt: '2020-12-07T16:19:09.000Z' updatedAt: '2023-09-14T13:02:38.000Z' properties: timestamp: type: string example: '2025-05-18T06:00:39.874949Z' status: type: boolean example: true message: type: string example: Banks data: type: object properties: success: type: boolean example: true data: type: array example: - id: 302 name: '9mobile 9Payment Service Bank' slug: 9mobile-9payment-service-bank-ng code: '120001' longcode: '120001' gateway: '' pay_with_bank: false supports_transfer: true active: true country: Nigeria currency: NGN type: nuban is_deleted: false createdAt: '2022-05-31T06:50:27.000Z' updatedAt: '2022-06-23T09:33:55.000Z' - id: 174 name: 'Abbey Mortgage Bank' slug: abbey-mortgage-bank-ng code: '404' longcode: '' gateway: null pay_with_bank: false supports_transfer: true active: true country: Nigeria currency: NGN type: nuban is_deleted: false createdAt: '2020-12-07T16:19:09.000Z' updatedAt: '2023-09-14T13:02:38.000Z' items: type: object properties: id: type: integer example: 302 name: type: string example: '9mobile 9Payment Service Bank' slug: type: string example: 9mobile-9payment-service-bank-ng code: type: string example: '120001' longcode: type: string example: '120001' gateway: type: string example: '' pay_with_bank: type: boolean example: false supports_transfer: type: boolean example: true active: type: boolean example: true country: type: string example: Nigeria currency: type: string example: NGN type: type: string example: nuban is_deleted: type: boolean example: false createdAt: type: string example: '2022-05-31T06:50:27.000Z' updatedAt: type: string example: '2022-06-23T09:33:55.000Z' 500: description: '' content: application/json: schema: type: object example: message: 'cURL Error #: ' properties: message: type: string example: 'cURL Error #: ' tags: - Banks /api/countries: get: summary: 'Get Counteries' operationId: getCounteries description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: data: - id: 1 name: 'Country Name' - id: 2 name: 'Another Country' properties: data: type: array example: - id: 1 name: 'Country Name' - id: 2 name: 'Another Country' items: type: object properties: id: type: integer example: 1 name: type: string example: 'Country Name' tags: - Country security: [] /api/deposits: post: summary: 'Process a deposit for a trader.' operationId: processADepositForATrader description: '' parameters: [] responses: 200: description: '' content: text/plain: schema: type: string example: "{\n \"message\": \"Deposit successful\",\n\n}" 500: description: '' content: application/json: schema: type: object example: message: 'Deposit failed' errors: [] properties: message: type: string example: 'Deposit failed' errors: type: array example: [] tags: - Deposit requestBody: required: true content: application/json: schema: type: object properties: trader_account_number: type: integer description: 'The account number of the trader.' example: 1 amount: type: string description: 'The amount to be deposited.' example: '"23000"' agent_id: type: string description: 'The ID of the agent processing the deposit.' example: '"1"' pin: type: string description: 'The PIN of the agent processing the deposit.' example: '"1234"' required: - trader_account_number - amount - agent_id - pin /api/notifications/register-token: post: summary: 'Register a device token for push notifications' operationId: registerADeviceTokenForPushNotifications description: '' parameters: [] responses: { } tags: - Endpoints requestBody: required: true content: application/json: schema: type: object properties: token: type: string description: 'Must not be greater than 255 characters.' example: djweqeyjnt device_type: type: string description: '' example: ios enum: - android - ios - web required: - token - device_type security: [] /api/notifications/unregister-token: post: summary: 'Unregister a device token' operationId: unregisterADeviceToken description: '' parameters: [] responses: { } tags: - Endpoints requestBody: required: true content: application/json: schema: type: object properties: token: type: string description: 'Must not be greater than 255 characters.' example: qtzlxredxlexpdorsp required: - token security: [] /api/notifications/settings: get: summary: 'Get notification settings' operationId: getNotificationSettings description: '' parameters: [] responses: 403: description: '' content: application/json: schema: type: object example: status: false message: Unauthorize properties: status: type: boolean example: false message: type: string example: Unauthorize tags: - Endpoints security: [] post: summary: 'Update notification settings' operationId: updateNotificationSettings description: '' parameters: [] responses: { } tags: - Endpoints requestBody: required: false content: application/json: schema: type: object properties: general_notifications: type: boolean description: '' example: true payment_notifications: type: boolean description: '' example: true system_notifications: type: boolean description: '' example: false security: [] /api/notifications: get: summary: 'Get all notifications for the authenticated user' operationId: getAllNotificationsForTheAuthenticatedUser description: '' parameters: [] responses: 403: description: '' content: application/json: schema: type: object example: status: false message: Unauthorize properties: status: type: boolean example: false message: type: string example: Unauthorize tags: - Endpoints security: [] /api/notifications/unread-count: get: summary: 'Get unread notification count' operationId: getUnreadNotificationCount description: '' parameters: [] responses: 403: description: '' content: application/json: schema: type: object example: status: false message: Unauthorize properties: status: type: boolean example: false message: type: string example: Unauthorize tags: - Endpoints security: [] '/api/notifications/{id}/read': post: summary: 'Mark a notification as read' operationId: markANotificationAsRead description: '' parameters: [] responses: { } tags: - Endpoints security: [] parameters: - in: path name: id description: 'The ID of the notification.' example: ut required: true schema: type: string /api/notifications/read-all: post: summary: 'Mark all notifications as read' operationId: markAllNotificationsAsRead description: '' parameters: [] responses: { } tags: - Endpoints security: [] '/api/notifications/{id}': delete: summary: 'Delete a notification' operationId: deleteANotification description: '' parameters: [] responses: { } tags: - Endpoints security: [] parameters: - in: path name: id description: 'The ID of the notification.' example: qui required: true schema: type: string /api/webhook/paystack: post: summary: '' operationId: postApiWebhookPaystack description: '' parameters: [] responses: { } tags: - Endpoints security: [] /api/admin/notifications/test: post: summary: 'Send a test notification to the authenticated admin' operationId: sendATestNotificationToTheAuthenticatedAdmin description: '' parameters: [] responses: { } tags: - Endpoints security: [] /api/admin/notifications/notify-all-traders: post: summary: 'Send a notification to all traders' operationId: sendANotificationToAllTraders description: '' parameters: [] responses: { } tags: - Endpoints security: [] /api/admin/notifications/notify-selected-traders: post: summary: 'Send a notification to specific traders' operationId: sendANotificationToSpecificTraders description: '' parameters: [] responses: { } tags: - Endpoints security: [] /api/admin/notifications/notify-topic: post: summary: 'Send a notification to a topic' operationId: sendANotificationToATopic description: '' parameters: [] responses: { } tags: - Endpoints security: [] /api/agent/chat/conversations: get: summary: 'Get all conversations for the authenticated agent.' operationId: getAllConversationsForTheAuthenticatedAgent description: '' parameters: [] responses: { } tags: - Endpoints security: [] post: summary: 'Create a new conversation with an admin.' operationId: createANewConversationWithAnAdmin description: '' parameters: [] responses: { } tags: - Endpoints requestBody: required: true content: application/json: schema: type: object properties: admin_id: type: string description: '' example: officia title: type: string description: 'Must not be greater than 255 characters.' example: euzfgmlgprwhrizq required: - admin_id security: [] '/api/agent/chat/conversations/{id}': get: summary: 'Get a specific conversation.' operationId: getASpecificConversation description: '' parameters: [] responses: { } tags: - Endpoints security: [] parameters: - in: path name: id description: 'The ID of the conversation.' example: pariatur required: true schema: type: string '/api/agent/chat/conversations/{id}/messages': get: summary: 'Get messages for a conversation.' operationId: getMessagesForAConversation description: '' parameters: [] responses: { } tags: - Endpoints security: [] post: summary: 'Send a message in a conversation.' operationId: sendAMessageInAConversation description: '' parameters: [] responses: { } tags: - Endpoints requestBody: required: true content: application/json: schema: type: object properties: message: type: string description: '' example: veritatis attachments: type: object description: '' example: null properties: { } required: - message security: [] parameters: - in: path name: id description: 'The ID of the conversation.' example: rerum required: true schema: type: string /api/agent/chat/admins: get: summary: 'Get all admins for starting a new conversation.' operationId: getAllAdminsForStartingANewConversation description: '' parameters: [] responses: { } tags: - Endpoints security: [] /api/agents/guarantor: post: summary: 'Create a new guarantor.' operationId: createANewGuarantor description: '' parameters: [] responses: 201: description: '' content: application/json: schema: type: object example: data: id: 1 agent_id: 1 gua1_relationship: Father gua1_marital_status: Married gua1_name: 'John Doe' gua1_phone_1: '08012345678' gua1_phone_2: '08098765432' gua1_work_category: Employed gua1_work_address: '123 Street, Lagos' gua1_place_of_work: 'ABC Company' gua2_relationship: Mother gua2_marital_status: Single gua2_name: 'Jane Doe' gua2_phone_1: '08011122233' gua2_phone_2: '08033344455' gua2_work_category: Self-Employed gua2_work_address: '456 Street, Abuja' gua2_place_of_work: 'XYZ Enterprise' properties: data: type: object properties: id: type: integer example: 1 agent_id: type: integer example: 1 gua1_relationship: type: string example: Father gua1_marital_status: type: string example: Married gua1_name: type: string example: 'John Doe' gua1_phone_1: type: string example: '08012345678' gua1_phone_2: type: string example: '08098765432' gua1_work_category: type: string example: Employed gua1_work_address: type: string example: '123 Street, Lagos' gua1_place_of_work: type: string example: 'ABC Company' gua2_relationship: type: string example: Mother gua2_marital_status: type: string example: Single gua2_name: type: string example: 'Jane Doe' gua2_phone_1: type: string example: '08011122233' gua2_phone_2: type: string example: '08033344455' gua2_work_category: type: string example: Self-Employed gua2_work_address: type: string example: '456 Street, Abuja' gua2_place_of_work: type: string example: 'XYZ Enterprise' 400: description: '' content: application/json: schema: type: object example: message: 'Invalid data sent' details: agent_id: - 'The agent_id field is required.' gua1_relationship: - 'The gua1_relationship field is required.' properties: message: type: string example: 'Invalid data sent' details: type: object properties: agent_id: type: array example: - 'The agent_id field is required.' items: type: string gua1_relationship: type: array example: - 'The gua1_relationship field is required.' items: type: string tags: - Guarantor requestBody: required: true content: application/json: schema: type: object properties: agent_id: type: integer description: 'The ID of the agent.' example: 1 gua1_relationship: type: string description: 'The relationship of the first guarantor.' example: '"Father"' gua1_marital_status: type: string description: 'The marital status of the first guarantor.' example: '"Married"' gua1_name: type: string description: 'The name of the first guarantor.' example: '"John Doe"' gua1_phone_1: type: string description: 'The first phone number of the first guarantor.' example: '"08012345678"' gua1_phone_2: type: string description: 'nullable The second phone number of the first guarantor.' example: '"08098765432"' gua1_work_category: type: string description: 'The work category of the first guarantor.' example: '"Employed"' gua1_work_address: type: string description: 'The work address of the first guarantor.' example: '"123 Street, Lagos"' gua1_place_of_work: type: string description: 'The place of work of the first guarantor.' example: '"ABC Company"' gua2_relationship: type: string description: 'nullable The relationship of the second guarantor.' example: '"Mother"' gua2_marital_status: type: string description: 'nullable The marital status of the second guarantor.' example: '"Single"' gua2_name: type: string description: 'nullable The name of the second guarantor.' example: '"Jane Doe"' gua2_phone_1: type: string description: 'nullable The first phone number of the second guarantor.' example: '"08011122233"' gua2_phone_2: type: string description: 'nullable The second phone number of the second guarantor.' example: '"08033344455"' gua2_work_category: type: string description: 'nullable The work category of the second guarantor.' example: '"Self-Employed"' gua2_work_address: type: string description: 'nullable The work address of the second guarantor.' example: '"456 Street, Abuja"' gua2_place_of_work: type: string description: 'nullable The place of work of the second guarantor.' example: '"XYZ Enterprise"' required: - agent_id - gua1_relationship - gua1_marital_status - gua1_name - gua1_phone_1 - gua1_work_category - gua1_work_address - gua1_place_of_work security: [] /api/lgas: get: summary: 'Get Local Government Area' operationId: getLocalGovernmentArea description: '' parameters: - in: query name: country_id description: '(optional)string The ID of the country.' example: 1 required: false schema: type: integer description: '(optional)string The ID of the country.' example: 1 - in: query name: state_id description: '(optional)string The ID of the state.' example: '1' required: false schema: type: string description: '(optional)string The ID of the state.' example: '1' responses: 200: description: '' content: application/json: schema: type: object example: data: - id: 1 name: 'Lga Name' state_id: '1' country_id: '1' - id: 2 name: 'Another Lga' state_id: '1' country_id: '1' properties: data: type: array example: - id: 1 name: 'Lga Name' state_id: '1' country_id: '1' - id: 2 name: 'Another Lga' state_id: '1' country_id: '1' items: type: object properties: id: type: integer example: 1 name: type: string example: 'Lga Name' state_id: type: string example: '1' country_id: type: string example: '1' 500: description: '' content: application/json: schema: type: object example: message: 'An error occurred' data: [] statusCode: 500 properties: message: type: string example: 'An error occurred' data: type: array example: [] statusCode: type: integer example: 500 tags: - LGA security: [] /api/auth/refresh-token: post: summary: 'Refreshes an existing token.' operationId: refreshesAnExistingToken description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: status: 1 message: 'Successfully refreshed token' token: your_new_token_here refresh_token: your_new_refresh_token_here expire_at: 'dd-mm-yy HH:mm:ss' token_type: Bearer properties: status: type: integer example: 1 message: type: string example: 'Successfully refreshed token' token: type: string example: your_new_token_here refresh_token: type: string example: your_new_refresh_token_here expire_at: type: string example: 'dd-mm-yy HH:mm:ss' token_type: type: string example: Bearer 400: description: '' content: application/json: schema: type: object example: status: 0 message: refresh_token: - 'The refresh token is required.' - 'The refresh token must be at least 6 characters.' properties: status: type: integer example: 0 message: type: object properties: refresh_token: type: array example: - 'The refresh token is required.' - 'The refresh token must be at least 6 characters.' items: type: string 403: description: '' content: application/json: schema: type: object example: status: 0 message: 'Refresh token expired' properties: status: type: integer example: 0 message: type: string example: 'Refresh token expired' 404: description: '' content: application/json: schema: type: object example: status: 0 message: 'Refresh Token does not exist' properties: status: type: integer example: 0 message: type: string example: 'Refresh Token does not exist' tags: - OAuth requestBody: required: true content: application/json: schema: type: object properties: refresh_token: type: string description: 'The refresh token to be used for token refresh.' example: '"your_refresh_token_here"' required: - refresh_token security: [] /api/states: get: summary: 'Get all State' operationId: getAllState description: 'Get state by country id .' parameters: [] responses: 201: description: '' content: application/json: schema: type: object example: data: id: 4 name: 'State Name' country_id: '1' properties: data: type: object properties: id: type: integer example: 4 name: type: string example: 'State Name' country_id: type: string example: '1' 422: description: '' content: application/json: schema: type: object example: message: 'Invalid data sent' details: country_id: - 'The country_id field is required.' properties: message: type: string example: 'Invalid data sent' details: type: object properties: country_id: type: array example: - 'The country_id field is required.' items: type: string tags: - State security: [] parameters: - in: path name: country_id description: 'Optional parameter. The ID of the country.' required: true schema: type: string examples: omitted: summary: 'When the value is omitted' value: '' present: summary: 'When the value is present' value: '1' /api/admin/traders: get: summary: 'List all traders' operationId: listAllTraders description: "Retrieves a paginated list of all traders along with summary statistics,\ntrader status overview, savings plans overview, and monthly analytics data." parameters: - in: query name: page description: 'Page number for pagination.' example: 1 required: false schema: type: integer description: 'Page number for pagination.' example: 1 responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Traders data retrieved successfully' data: summary: total_savings: 500000 total_withdrawals: 200000 earned_interest: 40000 total_traders: 50 traders_overview: total: 50 active: 45 inactive: 5 active_percentage: 90 inactive_percentage: 10 savings_plans_overview: daily: 30 weekly: 20 analytics: labels: - Jan - Feb - Mar - Apr - May - Jun - Jul - Aug - Sep - Oct - Nov - Dec datasets: - label: Deposits data: - 10000 - 15000 - 20000 - 25000 - 30000 - 35000 - 40000 - 45000 - 50000 - 55000 - 60000 - 65000 backgroundColor: '#F6C000' - label: Withdrawals data: - 5000 - 7500 - 10000 - 12500 - 15000 - 17500 - 20000 - 22500 - 25000 - 27500 - 30000 - 32500 backgroundColor: '#000000' traders: data: - id: 1 first_name: John last_name: Doe email: john.doe@example.com phone: '+1234567890' status: id: 1 name: active location: country: Nigeria state: Lagos lga: Ikeja created_at: '2023-01-01T12:00:00.000000Z' links: first: 'http://example.com/api/admin/traders?page=1' last: 'http://example.com/api/admin/traders?page=5' prev: null next: 'http://example.com/api/admin/traders?page=2' meta: current_page: 1 from: 1 last_page: 5 path: 'http://example.com/api/admin/traders' per_page: 10 to: 10 total: 50 properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Traders data retrieved successfully' data: type: object properties: summary: type: object properties: total_savings: type: integer example: 500000 total_withdrawals: type: integer example: 200000 earned_interest: type: integer example: 40000 total_traders: type: integer example: 50 traders_overview: type: object properties: total: type: integer example: 50 active: type: integer example: 45 inactive: type: integer example: 5 active_percentage: type: integer example: 90 inactive_percentage: type: integer example: 10 savings_plans_overview: type: object properties: daily: type: integer example: 30 weekly: type: integer example: 20 analytics: type: object properties: labels: type: array example: - Jan - Feb - Mar - Apr - May - Jun - Jul - Aug - Sep - Oct - Nov - Dec items: type: string datasets: type: array example: - label: Deposits data: - 10000 - 15000 - 20000 - 25000 - 30000 - 35000 - 40000 - 45000 - 50000 - 55000 - 60000 - 65000 backgroundColor: '#F6C000' - label: Withdrawals data: - 5000 - 7500 - 10000 - 12500 - 15000 - 17500 - 20000 - 22500 - 25000 - 27500 - 30000 - 32500 backgroundColor: '#000000' items: type: object properties: label: type: string example: Deposits data: type: array example: - 10000 - 15000 - 20000 - 25000 - 30000 - 35000 - 40000 - 45000 - 50000 - 55000 - 60000 - 65000 items: type: integer backgroundColor: type: string example: '#F6C000' traders: type: object properties: data: type: array example: - id: 1 first_name: John last_name: Doe email: john.doe@example.com phone: '+1234567890' status: id: 1 name: active location: country: Nigeria state: Lagos lga: Ikeja created_at: '2023-01-01T12:00:00.000000Z' items: type: object properties: id: type: integer example: 1 first_name: type: string example: John last_name: type: string example: Doe email: type: string example: john.doe@example.com phone: type: string example: '+1234567890' status: type: object properties: id: type: integer example: 1 name: type: string example: active location: type: object properties: country: type: string example: Nigeria state: type: string example: Lagos lga: type: string example: Ikeja created_at: type: string example: '2023-01-01T12:00:00.000000Z' links: type: object properties: first: type: string example: 'http://example.com/api/admin/traders?page=1' last: type: string example: 'http://example.com/api/admin/traders?page=5' prev: type: string example: null next: type: string example: 'http://example.com/api/admin/traders?page=2' meta: type: object properties: current_page: type: integer example: 1 from: type: integer example: 1 last_page: type: integer example: 5 path: type: string example: 'http://example.com/api/admin/traders' per_page: type: integer example: 10 to: type: integer example: 10 total: type: integer example: 50 500: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Internal server error' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Internal server error' data: type: string example: null tags: - 'Trader Management' '/api/admin/traders/trader/{id}': get: summary: 'Get trader details' operationId: getTraderDetails description: "Retrieves detailed information about a specific trader including their\npersonal details, financial summary, savings plan, and transaction history." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Trader details retrieved successfully' data: trader: id: 1 first_name: John last_name: Doe email: john.doe@example.com phone: '+1234567890' status: id: 1 name: active location: country: Nigeria state: Lagos lga: Ikeja address: '123 Main Street' business_details: business_name: 'Example Business' business_type: Retail business_address: '456 Market Street' bank_details: bank_name: 'Example Bank' account_number: '1234567890' account_name: 'John Doe' identification: id_type: 'National ID' id_number: ID12345678 id_image: identifications/id.jpg created_at: '2023-01-01T12:00:00.000000Z' updated_at: '2023-01-01T12:00:00.000000Z' financial_summary: balance: 50000 total_deposits: 100000 total_withdrawals: 50000 earned_interest: 0 savings_plan: id: 1 frequency: daily amount: 1000 start_date: '2023-01-01' end_date: '2023-12-31' status: active transactions: data: - id: 1 type: deposit amount: 10000 status: id: 1 name: completed created_at: '2023-01-01T12:00:00.000000Z' links: first: 'http://example.com/api/admin/traders/1?page=1' last: 'http://example.com/api/admin/traders/1?page=1' prev: null next: null meta: current_page: 1 from: 1 last_page: 1 path: 'http://example.com/api/admin/traders/1' per_page: 10 to: 1 total: 1 properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Trader details retrieved successfully' data: type: object properties: trader: type: object properties: id: type: integer example: 1 first_name: type: string example: John last_name: type: string example: Doe email: type: string example: john.doe@example.com phone: type: string example: '+1234567890' status: type: object properties: id: type: integer example: 1 name: type: string example: active location: type: object properties: country: type: string example: Nigeria state: type: string example: Lagos lga: type: string example: Ikeja address: type: string example: '123 Main Street' business_details: type: object properties: business_name: type: string example: 'Example Business' business_type: type: string example: Retail business_address: type: string example: '456 Market Street' bank_details: type: object properties: bank_name: type: string example: 'Example Bank' account_number: type: string example: '1234567890' account_name: type: string example: 'John Doe' identification: type: object properties: id_type: type: string example: 'National ID' id_number: type: string example: ID12345678 id_image: type: string example: identifications/id.jpg created_at: type: string example: '2023-01-01T12:00:00.000000Z' updated_at: type: string example: '2023-01-01T12:00:00.000000Z' financial_summary: type: object properties: balance: type: integer example: 50000 total_deposits: type: integer example: 100000 total_withdrawals: type: integer example: 50000 earned_interest: type: integer example: 0 savings_plan: type: object properties: id: type: integer example: 1 frequency: type: string example: daily amount: type: integer example: 1000 start_date: type: string example: '2023-01-01' end_date: type: string example: '2023-12-31' status: type: string example: active transactions: type: object properties: data: type: array example: - id: 1 type: deposit amount: 10000 status: id: 1 name: completed created_at: '2023-01-01T12:00:00.000000Z' items: type: object properties: id: type: integer example: 1 type: type: string example: deposit amount: type: integer example: 10000 status: type: object properties: id: type: integer example: 1 name: type: string example: completed created_at: type: string example: '2023-01-01T12:00:00.000000Z' links: type: object properties: first: type: string example: 'http://example.com/api/admin/traders/1?page=1' last: type: string example: 'http://example.com/api/admin/traders/1?page=1' prev: type: string example: null next: type: string example: null meta: type: object properties: current_page: type: integer example: 1 from: type: integer example: 1 last_page: type: integer example: 1 path: type: string example: 'http://example.com/api/admin/traders/1' per_page: type: integer example: 10 to: type: integer example: 1 total: type: integer example: 1 404: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Trader not found' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Trader not found' data: type: string example: null tags: - 'Trader Management' parameters: - in: path name: id description: 'The ID of the trader.' example: 1 required: true schema: type: integer '/api/admin/traders/{id}/toggle-block': post: summary: 'Toggle trader status' operationId: toggleTraderStatus description: "Blocks or unblocks a trader account. When blocked, the trader cannot\naccess the system or perform any transactions." parameters: [] responses: 200: description: '' content: application/json: schema: oneOf: - description: Blocked type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Trader blocked successfully' data: id: 1 first_name: John last_name: Doe status: id: 2 name: inactive block_reason: 'Suspicious activity detected' updated_at: '2023-01-01T12:00:00.000000Z' properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Trader blocked successfully' data: type: object properties: id: type: integer example: 1 first_name: type: string example: John last_name: type: string example: Doe status: type: object properties: id: type: integer example: 2 name: type: string example: inactive block_reason: type: string example: 'Suspicious activity detected' updated_at: type: string example: '2023-01-01T12:00:00.000000Z' - description: Unblocked type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Trader unblocked successfully' data: id: 1 first_name: John last_name: Doe status: id: 1 name: active block_reason: null updated_at: '2023-01-01T12:00:00.000000Z' properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Trader unblocked successfully' data: type: object properties: id: type: integer example: 1 first_name: type: string example: John last_name: type: string example: Doe status: type: object properties: id: type: integer example: 1 name: type: string example: active block_reason: type: string example: null updated_at: type: string example: '2023-01-01T12:00:00.000000Z' 404: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Trader not found' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Trader not found' data: type: string example: null tags: - 'Trader Management' requestBody: required: true content: application/json: schema: type: object properties: reason: type: string description: 'Reason for blocking/unblocking the trader.' example: 'Suspicious activity detected' required: - reason parameters: - in: path name: id description: 'The ID of the trader.' example: 1 required: true schema: type: integer '/api/admin/traders/{id}': delete: summary: 'Delete trader' operationId: deleteTrader description: "Permanently deletes a trader account and all associated data.\nThis action cannot be undone." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Trader deleted successfully' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Trader deleted successfully' data: type: string example: null 400: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Cannot delete trader with active balance' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Cannot delete trader with active balance' data: type: string example: null 404: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Trader not found' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Trader not found' data: type: string example: null tags: - 'Trader Management' parameters: - in: path name: id description: 'The ID of the trader.' example: 1 required: true schema: type: integer /api/admin/traders/transactions: get: summary: 'List trader transactions' operationId: listTraderTransactions description: "Retrieves a paginated list of trader transactions with optional filtering\nby trader ID, date range, transaction type, and status." parameters: - in: query name: trader_id description: 'ID of the trader to filter transactions.' example: 1 required: false schema: type: integer description: 'ID of the trader to filter transactions.' example: 1 - in: query name: start_date description: 'date Start date for filtering transactions (YYYY-MM-DD).' example: '2023-01-01' required: false schema: type: string description: 'date Start date for filtering transactions (YYYY-MM-DD).' example: '2023-01-01' - in: query name: end_date description: 'date End date for filtering transactions (YYYY-MM-DD).' example: '2023-12-31' required: false schema: type: string description: 'date End date for filtering transactions (YYYY-MM-DD).' example: '2023-12-31' - in: query name: type description: 'Transaction type (deposit/withdrawal).' example: deposit required: false schema: type: string description: 'Transaction type (deposit/withdrawal).' example: deposit - in: query name: status_id description: 'Status ID for filtering transactions.' example: 1 required: false schema: type: integer description: 'Status ID for filtering transactions.' example: 1 - in: query name: page description: 'Page number for pagination.' example: 1 required: false schema: type: integer description: 'Page number for pagination.' example: 1 responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Transactions retrieved successfully' data: transactions: current_page: 1 data: - id: 1 trader: id: 1 name: 'John Doe' type: deposit amount: 10000 status: id: 1 name: completed created_at: '2023-01-01T12:00:00.000000Z' first_page_url: 'http://example.com/api/admin/traders/transactions?page=1' from: 1 last_page: 5 last_page_url: 'http://example.com/api/admin/traders/transactions?page=5' links: [] next_page_url: 'http://example.com/api/admin/traders/transactions?page=2' path: 'http://example.com/api/admin/traders/transactions' per_page: 10 prev_page_url: null to: 10 total: 50 summary: total_amount: 500000 total_count: 50 properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Transactions retrieved successfully' data: type: object properties: transactions: type: object properties: current_page: type: integer example: 1 data: type: array example: - id: 1 trader: id: 1 name: 'John Doe' type: deposit amount: 10000 status: id: 1 name: completed created_at: '2023-01-01T12:00:00.000000Z' items: type: object properties: id: type: integer example: 1 trader: type: object properties: id: type: integer example: 1 name: type: string example: 'John Doe' type: type: string example: deposit amount: type: integer example: 10000 status: type: object properties: id: type: integer example: 1 name: type: string example: completed created_at: type: string example: '2023-01-01T12:00:00.000000Z' first_page_url: type: string example: 'http://example.com/api/admin/traders/transactions?page=1' from: type: integer example: 1 last_page: type: integer example: 5 last_page_url: type: string example: 'http://example.com/api/admin/traders/transactions?page=5' links: type: array example: [] next_page_url: type: string example: 'http://example.com/api/admin/traders/transactions?page=2' path: type: string example: 'http://example.com/api/admin/traders/transactions' per_page: type: integer example: 10 prev_page_url: type: string example: null to: type: integer example: 10 total: type: integer example: 50 summary: type: object properties: total_amount: type: integer example: 500000 total_count: type: integer example: 50 500: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Internal server error' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Internal server error' data: type: string example: null tags: - 'Trader Transactions' /api/address/update: post: summary: 'update trader address details' operationId: updateTraderAddressDetails description: '' parameters: [] responses: 114: description: '' content: application/json: schema: type: object example: message: 'address details update failed' details: [] properties: message: type: string example: 'address details update failed' details: type: array example: [] 200: description: '' content: application/json: schema: type: object example: message: 'Trader step 2 registration completed' data: country_id: '1' state_id: '1' lga_id: '1' address: abuja post_code: '1234' properties: message: type: string example: 'Trader step 2 registration completed' data: type: object properties: country_id: type: string example: '1' state_id: type: string example: '1' lga_id: type: string example: '1' address: type: string example: abuja post_code: type: string example: '1234' 404: description: '' content: application/json: schema: type: object example: message: 'not found ' details: [] properties: message: type: string example: 'not found ' details: type: array example: [] tags: - Traders requestBody: required: true content: application/json: schema: type: object properties: country_id: type: numeric description: 'The ID of the country.' example: '1' state_id: type: numeric description: 'The ID of the state.' example: '1' lga_id: type: numeric description: 'The ID of the local government area.' example: '1' address: type: string description: 'The address of the agent.' example: '"123 Street, City, State"' post_code: type: string description: "The postal code of the agent's address." example: '"100001"' required: - country_id - state_id - lga_id - address - post_code security: [] /api/traders/register: post: summary: 'Create Trader Step 1.' operationId: createTraderStep1 description: '' parameters: [] responses: 201: description: '' content: application/json: schema: type: object example: data: id: 4 full_name: 'John Smith' other_name: Abraham phone: '+2348013221673' gender: male dob: '2000-01-15' has_cooperative: true cooperative: 'Ikokun Cooperative' properties: data: type: object properties: id: type: integer example: 4 full_name: type: string example: 'John Smith' other_name: type: string example: Abraham phone: type: string example: '+2348013221673' gender: type: string example: male dob: type: string example: '2000-01-15' has_cooperative: type: boolean example: true cooperative: type: string example: 'Ikokun Cooperative' 422: description: '' content: application/json: schema: type: object example: message: 'Invalid data sent' details: email: - 'The email field is required.' password: - 'The password must be at least 8 characters.' properties: message: type: string example: 'Invalid data sent' details: type: object properties: email: type: array example: - 'The email field is required.' items: type: string password: type: array example: - 'The password must be at least 8 characters.' items: type: string tags: - Traders requestBody: required: true content: application/json: schema: type: object properties: phone: type: string description: 'The phone number of the user.' example: '+2348013221673' full_name: type: string description: 'The full name of the user.' example: 'John Smith' other_name: type: string description: 'optional The other name of the user.' example: Abraham gender: type: string description: 'The gender of the user (male or female).' example: male dob: type: date description: 'The date of birth of the user.' example: '2000-01-15' has_cooperative: type: boolean description: 'optional Whether the user belongs to a cooperative.' example: true cooperative: type: string description: 'optional The cooperative name (required if has_cooperative is true).' example: 'Ikokun Cooperative' password: type: string description: 'The password of the user.' example: '12345678' required: - phone - full_name - gender - dob - password security: [] /api/traders/register-step-2: post: summary: 'Complete trader registration step 2.' operationId: completeTraderRegistrationStep2 description: '' parameters: [] responses: 112: description: '' content: application/json: schema: type: object example: message: 'unable to register user' details: [] properties: message: type: string example: 'unable to register user' details: type: array example: [] 200: description: '' content: text/plain: schema: type: string example: "{\n \"message\": \"Trader step 2 registration completed\",\n \"data\": {\n \"id\": 1,\n \"cooperative\": \"user cooperative\",\n \"email\": \"mail@user.com\",\n \"password\": \"12345678\",\n \"first_name\": \"John\",\n \"mid_name\":Doe\n \"last_name\": \"mark\",\n \"phone\": \"08013221673\",\n \"gender\": \"male\",\n \"dob\": \"2024-03-09\",\n \"country_id\": \"Nigeria\",\n \"state_id\": \"Abia State\",\n \"lga_id\": \"Ikwuano\",\n \"address\": \"5 cape ville\",\n \"post_code\": \"10090\"\n \"frequency\": \"daily\",\n \"amount\": \"1000\"\n }\n}" 403: description: '' content: application/json: schema: type: object example: message: 'User not verified' details: [] properties: message: type: string example: 'User not verified' details: type: array example: [] 404: description: '' content: application/json: schema: type: object example: message: 'not found ' details: [] properties: message: type: string example: 'not found ' details: type: array example: [] tags: - Traders requestBody: required: true content: application/json: schema: type: object properties: trader_id: type: numeric description: 'The ID of the trader.' example: '1' country_id: type: numeric description: 'The ID of the country.' example: '1' state_id: type: numeric description: 'The ID of the state.' example: '1' lga_id: type: numeric description: 'The ID of the local government area.' example: '1' address: type: string description: 'The address of the trader.' example: '"123 Street, City, State"' post_code: type: string description: "The postal code of the trader's address." example: '100001' business_type: type: string description: 'type of business being run by trader.' example: retail is_registered_with_CAC: type: boolean description: 'is users business registered with CAC .' example: true business_name: type: users description: 'business name if any.' example: SABISAVE reg_number: type: string description: 'user business reg number.' example: '1234567' savings_frequency: type: string description: 'type of frequency of savings plan.' example: daily savings_amount: type: string description: 'amount of savings plan.' example: '1000' account_type: type: enum description: 'type of account used by trader.' example: current bank_name: type: string description: 'users bank name.' example: GTB bank_code: type: string description: 'bank code used for creating recipients to enable traders recieve paymnet user.' example: '"058"' account_number: type: string description: 'account number of user.' example: '100001300' required: - trader_id - country_id - state_id - lga_id - address - post_code - is_registered_with_CAC - reg_number - account_type security: [] /api/traders/login: post: summary: 'Trader Login.' operationId: traderLogin description: '' parameters: [] responses: 200: description: '' content: text/plain: schema: type: string example: "{\n \"status\": 1,\n \"token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...\",\n \"refresh_token\": \"def50200ea86c5d6161c...\",\n \"expire_at\": \"29-06-24 14:57:10\",\n \"token_type\": \"Bearer\",\n \"message\": \"Successfully logged in\",\n \"trader\": {\n \"id\": 1,\n \"name\": \"John Doe\",\n \"email\": \"john.doe@example.com\",\n ...\n }\n}" 422: description: '' content: application/json: schema: type: object example: message: 'Invalid data sent' details: phone: - 'phone field is required.' pin: - 'The pin must be at least 4 characters.' properties: message: type: string example: 'Invalid data sent' details: type: object properties: phone: type: array example: - 'phone field is required.' items: type: string pin: type: array example: - 'The pin must be at least 4 characters.' items: type: string tags: - Traders requestBody: required: true content: application/json: schema: type: object properties: phone: type: string description: 'The agent number of the agent.' example: '08013221673' pin: type: string description: 'The pin of the agent. Minimum and maximum length of 4 characters.' example: '1234' required: - phone - pin security: [] /api/traders/verify-phone: post: summary: 'Verify the token for the trader.' operationId: verifyTheTokenForTheTrader description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Verification successful' data: [] meta-links: [] properties: message: type: string example: 'Verification successful' data: type: array example: [] meta-links: type: array example: [] 400: description: '' content: application/json: schema: type: object example: success: false message: 'Invalid or expired verification code' errors: [] properties: success: type: boolean example: false message: type: string example: 'Invalid or expired verification code' errors: type: array example: [] 404: description: '' content: application/json: schema: type: object example: success: false message: 'trader not found' errors: [] properties: success: type: boolean example: false message: type: string example: 'trader not found' errors: type: array example: [] 500: description: '' content: application/json: schema: type: object example: success: false message: 'Failed to verify token' errors: [] properties: success: type: boolean example: false message: type: string example: 'Failed to verify token' errors: type: array example: [] tags: - Traders requestBody: required: true content: application/json: schema: type: object properties: phone: type: string description: 'The phone number of the trader.' example: '+2348012345678' token: type: string description: 'The verification token.' example: '123456' required: - phone - token security: [] /api/traders/resend-verification: post: summary: "Resend the verification token to the trader's phone number." operationId: resendTheVerificationTokenToTheTradersPhoneNumber description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: success: true message: 'Verification code resent successfully' data: [] meta-links: [] properties: success: type: boolean example: true message: type: string example: 'Verification code resent successfully' data: type: array example: [] meta-links: type: array example: [] 404: description: '' content: application/json: schema: type: object example: success: false message: 'trader not found' errors: [] properties: success: type: boolean example: false message: type: string example: 'trader not found' errors: type: array example: [] 500: description: '' content: application/json: schema: type: object example: success: false message: 'Failed to resend verification code' errors: [] properties: success: type: boolean example: false message: type: string example: 'Failed to resend verification code' errors: type: array example: [] tags: - Traders requestBody: required: true content: application/json: schema: type: object properties: phone: type: string description: 'The phone number of the trader.' example: '+2348012345678' required: - phone security: [] /api/traders/upload/id: post: summary: 'Profile image upload.' operationId: profileImageUpload description: '' parameters: [] responses: 200: description: '' content: text/plain: schema: type: string example: "{\n \"message\": \"ID uploaded successfully\",\n\n}" 500: description: '' content: application/json: schema: type: object example: message: 'Failed to create ID' error: 'Error message' properties: message: type: string example: 'Failed to create ID' error: type: string example: 'Error message' tags: - Traders requestBody: required: true content: multipart/form-data: schema: type: object properties: type: type: string description: 'The type of ID.' example: passport document: type: string format: binary description: 'The file of the ID.' trader_id: type: string description: 'The ID of the trader.' example: '1' required: - type - document - trader_id security: [] /api/traders/create/pin: post: summary: 'Trader pin create.' operationId: traderPinCreate description: '' parameters: [] responses: 200: description: '' content: text/plain: schema: type: string example: "{\n \"message\": \"trader pin created successfully\",\n\n}" 404: description: '' content: text/plain: schema: type: string example: "{\n \"message\": \"trader not found\",\n \"details\": []\n}\n @response 500 {\n \"message\": \"internal server error\",\n \"details\": []\n}" tags: - Traders requestBody: required: true content: application/json: schema: type: object properties: pin: type: numeric description: '.Minimum and maximum length of 4 characters..' example: '1234' pin_confirmation: type: same description: 'with pin .' example: '1234' trader_id: type: string description: '' example: consequuntur required: - pin - trader_id security: [] '/api/traders/transactions/{id}': get: summary: 'Display the specified resource.' operationId: displayTheSpecifiedResource description: '' parameters: [] responses: 403: description: '' content: application/json: schema: type: object example: status: false message: Unauthorize properties: status: type: boolean example: false message: type: string example: Unauthorize tags: - Traders security: [] parameters: - in: path name: id description: 'The ID of the transaction.' example: totam required: true schema: type: string /api/traders/confirm/pin: post: summary: 'Trader pin confirmation .' operationId: traderPinConfirmation description: '' parameters: [] responses: 200: description: '' content: text/plain: schema: type: string example: "{\n \"message\": \"trader pin confirmed\",\n\n}" 404: description: '' content: text/plain: schema: type: string example: "{\n \"message\": \"trader not found\",\n \"details\": []\n}\n @response 500 {\n \"message\": \"internal server error\",\n \"details\": []\n}" tags: - Traders requestBody: required: false content: application/json: schema: type: object properties: pin: type: numeric description: 'required. Minimum and maximum length of 4 characters..' example: '1234' security: [] /api/traders/reset-pin/send-otp: post: summary: 'Verify phone number with OTP for PIN change' operationId: verifyPhoneNumberWithOTPForPINChange description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'OTP sent to your phone number' data: phone: '09031922234' properties: message: type: string example: 'OTP sent to your phone number' data: type: object properties: phone: type: string example: '09031922234' 404: description: '' content: application/json: schema: type: object example: message: 'Trader not found' details: [] properties: message: type: string example: 'Trader not found' details: type: array example: [] tags: - Traders requestBody: required: true content: application/json: schema: type: object properties: phone: type: string description: 'The phone number of the trader.' example: '09031922234' required: - phone security: [] /api/traders/reset-pin/create-new-pin: post: summary: 'Create new PIN after verification' operationId: createNewPINAfterVerification description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'PIN changed successfully' data: success: true properties: message: type: string example: 'PIN changed successfully' data: type: object properties: success: type: boolean example: true 404: description: '' content: application/json: schema: type: object example: message: 'Trader not found' details: [] properties: message: type: string example: 'Trader not found' details: type: array example: [] tags: - Traders requestBody: required: true content: application/json: schema: type: object properties: phone: type: string description: 'The phone number of the trader.' example: '09031922234' otp: type: string description: 'The OTP received on the phone.' example: '123456' pin: type: numeric description: 'Minimum and maximum length of 4 characters.' example: '1234' pin_confirmation: type: same description: 'with pin.' example: '1234' required: - phone - otp - pin security: [] /api/traders/bankdetails/update: post: summary: '' operationId: postApiTradersBankdetailsUpdate description: '' parameters: [] responses: 114: description: '' content: application/json: schema: type: object example: message: 'bank details update failed' details: [] properties: message: type: string example: 'bank details update failed' details: type: array example: [] 200: description: '' content: text/plain: schema: type: string example: "{\n \"message\": \"Trader step 2 registration completed\",\n \"data\": {\n \"bank_name\": \"GTB\",\n \"account_type\": \"savings\",\n \"account_number\": \"1234567890\",\n \"trader_id\": 1,\n }\n}" 404: description: '' content: application/json: schema: type: object example: message: 'not found ' details: [] properties: message: type: string example: 'not found ' details: type: array example: [] tags: - Traders requestBody: required: true content: application/json: schema: type: object properties: bank_name: type: string. description: 'name of traders bank.' example: GTB account_type: type: enum description: "Enum('savings','current') ........" example: savings account_number: type: strinng description: 'The account number of trader.' example: '1234567890' required: - account_type - account_number security: [] /api/traders/address/update: post: summary: 'update trader address details' operationId: updateTraderAddressDetails description: '' parameters: [] responses: 114: description: '' content: application/json: schema: type: object example: message: 'address details update failed' details: [] properties: message: type: string example: 'address details update failed' details: type: array example: [] 200: description: '' content: application/json: schema: type: object example: message: 'Trader step 2 registration completed' data: country_id: '1' state_id: '1' lga_id: '1' address: abuja post_code: '1234' properties: message: type: string example: 'Trader step 2 registration completed' data: type: object properties: country_id: type: string example: '1' state_id: type: string example: '1' lga_id: type: string example: '1' address: type: string example: abuja post_code: type: string example: '1234' 404: description: '' content: application/json: schema: type: object example: message: 'not found ' details: [] properties: message: type: string example: 'not found ' details: type: array example: [] tags: - Traders requestBody: required: true content: application/json: schema: type: object properties: country_id: type: numeric description: 'The ID of the country.' example: '1' state_id: type: numeric description: 'The ID of the state.' example: '1' lga_id: type: numeric description: 'The ID of the local government area.' example: '1' address: type: string description: 'The address of the agent.' example: '"123 Street, City, State"' post_code: type: string description: "The postal code of the agent's address." example: '"100001"' required: - country_id - state_id - lga_id - address - post_code security: [] /api/traders/reset-pin/initiate: post: summary: 'Initiate Trader PIN reset by phone number.' operationId: initiateTraderPINResetByPhoneNumber description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'OTP sent to your phone number' data: phone: '09031922234' properties: message: type: string example: 'OTP sent to your phone number' data: type: object properties: phone: type: string example: '09031922234' 404: description: '' content: application/json: schema: type: object example: message: 'trader not found' details: [] properties: message: type: string example: 'trader not found' details: type: array example: [] tags: - Traders requestBody: required: true content: application/json: schema: type: object properties: phone: type: string description: 'The phone number of the trader.' example: '09031922234' required: - phone security: [] /api/traders/reset-pin/complete: post: summary: 'Complete Trader pin reset.' operationId: completeTraderPinReset description: '' parameters: [] responses: 114: description: '' content: application/json: schema: type: object example: message: 'pin update failed' details: [] properties: message: type: string example: 'pin update failed' details: type: array example: [] 200: description: '' content: application/json: schema: type: object example: message: 'PIN changed successfully' data: success: true properties: message: type: string example: 'PIN changed successfully' data: type: object properties: success: type: boolean example: true 404: description: '' content: application/json: schema: type: object example: message: 'trader not found' details: [] properties: message: type: string example: 'trader not found' details: type: array example: [] 500: description: '' content: application/json: schema: type: object example: message: 'internal server error' details: [] properties: message: type: string example: 'internal server error' details: type: array example: [] tags: - Traders requestBody: required: true content: application/json: schema: type: object properties: phone: type: string description: 'The phone number of the trader.' example: '09031922234' otp: type: string description: 'The OTP received on the phone.' example: '123456' pin: type: numeric description: '.Minimum and maximum length of 4 characters..' example: '1234' pin_confirmation: type: same description: 'with pin .' example: '1234' required: - phone - otp - pin security: [] /api/traders/logout: post: summary: 'Logout trader' operationId: logoutTrader description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Successfully logged out' data: success: true properties: message: type: string example: 'Successfully logged out' data: type: object properties: success: type: boolean example: true tags: - Traders security: [] /api/traders/banks: get: summary: "Get trader's bank details" operationId: getTradersBankDetails description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Bank details retrieved successfully' data: - id: 1 bank_name: GTB account_type: savings account_number: '1234567890' bank_code: '058' properties: message: type: string example: 'Bank details retrieved successfully' data: type: array example: - id: 1 bank_name: GTB account_type: savings account_number: '1234567890' bank_code: '058' items: type: object properties: id: type: integer example: 1 bank_name: type: string example: GTB account_type: type: string example: savings account_number: type: string example: '1234567890' bank_code: type: string example: '058' tags: - Traders security: [] /api/traders/profile: get: summary: 'Get trader profile' operationId: getTraderProfile description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Profile retrieved successfully' data: id: 1 full_name: 'Ibraheem Razaq' email: ibraheem@example.com phone: '+2348016067' gender: Male dob: 12/08/1990 address: 'No 18 Allen Str Ikeja' customer_id: '802430840' trader_level: 'Silver Level' account_status: verified saving_plan: 'Daily Saving Plan' profile_image: /storage/profile/image.jpg properties: message: type: string example: 'Profile retrieved successfully' data: type: object properties: id: type: integer example: 1 full_name: type: string example: 'Ibraheem Razaq' email: type: string example: ibraheem@example.com phone: type: string example: '+2348016067' gender: type: string example: Male dob: type: string example: 12/08/1990 address: type: string example: 'No 18 Allen Str Ikeja' customer_id: type: string example: '802430840' trader_level: type: string example: 'Silver Level' account_status: type: string example: verified saving_plan: type: string example: 'Daily Saving Plan' profile_image: type: string example: /storage/profile/image.jpg tags: - Traders security: [] /api/traders/profile/update: post: summary: 'Update trader profile information' operationId: updateTraderProfileInformation description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Profile updated successfully' data: id: 1 full_name: 'Ibraheem Razaq' email: ibraheem@example.com phone: '+2348016067' gender: Male dob: 12/08/1990 address: 'No 18 Allen Str Ikeja' properties: message: type: string example: 'Profile updated successfully' data: type: object properties: id: type: integer example: 1 full_name: type: string example: 'Ibraheem Razaq' email: type: string example: ibraheem@example.com phone: type: string example: '+2348016067' gender: type: string example: Male dob: type: string example: 12/08/1990 address: type: string example: 'No 18 Allen Str Ikeja' tags: - Traders requestBody: required: false content: application/json: schema: type: object properties: address: type: string description: "The trader's address." example: 'No 18 Allen Str Ikeja' gender: type: string description: "The trader's gender." example: Male email: type: string description: "The trader's email." example: ibraheem@example.com security: [] /api/traders/bank-details: get: summary: 'Get all bank details for the authenticated trader' operationId: getAllBankDetailsForTheAuthenticatedTrader description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Bank details retrieved successfully' data: - id: 1 bank_name: GTB account_type: savings account_number: '1234567890' bank_code: '058' properties: message: type: string example: 'Bank details retrieved successfully' data: type: array example: - id: 1 bank_name: GTB account_type: savings account_number: '1234567890' bank_code: '058' items: type: object properties: id: type: integer example: 1 bank_name: type: string example: GTB account_type: type: string example: savings account_number: type: string example: '1234567890' bank_code: type: string example: '058' 404: description: '' content: application/json: schema: type: object example: message: 'No bank details found' details: [] properties: message: type: string example: 'No bank details found' details: type: array example: [] tags: - Traders security: [] post: summary: 'Store a new bank detail for the trader' operationId: storeANewBankDetailForTheTrader description: '' parameters: [] responses: 201: description: '' content: application/json: schema: type: object example: message: 'Bank detail created successfully' data: id: 1 bank_name: GTB account_type: savings account_number: '1234567890' bank_code: '058' recipient_code: RCP_1a2b3c4d5e6f properties: message: type: string example: 'Bank detail created successfully' data: type: object properties: id: type: integer example: 1 bank_name: type: string example: GTB account_type: type: string example: savings account_number: type: string example: '1234567890' bank_code: type: string example: '058' recipient_code: type: string example: RCP_1a2b3c4d5e6f 400: description: '' content: application/json: schema: type: object example: message: 'Validation error' details: bank_name: - 'The bank name field is required.' properties: message: type: string example: 'Validation error' details: type: object properties: bank_name: type: array example: - 'The bank name field is required.' items: type: string tags: - Traders requestBody: required: true content: application/json: schema: type: object properties: bank_name: type: string description: 'The name of the bank.' example: GTB account_type: type: string description: 'The type of account (savings/current).' example: savings account_number: type: string description: 'The account number.' example: '1234567890' bank_code: type: string description: 'The bank code.' example: '058' required: - bank_name - account_type - account_number - bank_code security: [] /api/traders/bank-details/banks-list: get: summary: 'Get list of banks from Paystack' operationId: getListOfBanksFromPaystack description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Banks retrieved successfully' data: - id: 1 name: 'Access Bank' slug: access-bank code: '044' longcode: '044150149' gateway: emandate pay_with_bank: true active: true country: Nigeria currency: NGN type: nuban is_deleted: false createdAt: '2016-07-14T10:04:29.000Z' updatedAt: '2020-02-18T08:06:44.000Z' properties: message: type: string example: 'Banks retrieved successfully' data: type: array example: - id: 1 name: 'Access Bank' slug: access-bank code: '044' longcode: '044150149' gateway: emandate pay_with_bank: true active: true country: Nigeria currency: NGN type: nuban is_deleted: false createdAt: '2016-07-14T10:04:29.000Z' updatedAt: '2020-02-18T08:06:44.000Z' items: type: object properties: id: type: integer example: 1 name: type: string example: 'Access Bank' slug: type: string example: access-bank code: type: string example: '044' longcode: type: string example: '044150149' gateway: type: string example: emandate pay_with_bank: type: boolean example: true active: type: boolean example: true country: type: string example: Nigeria currency: type: string example: NGN type: type: string example: nuban is_deleted: type: boolean example: false createdAt: type: string example: '2016-07-14T10:04:29.000Z' updatedAt: type: string example: '2020-02-18T08:06:44.000Z' tags: - Traders security: [] /api/traders/bank-details/verify: post: summary: 'Verify a bank account' operationId: verifyABankAccount description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Account verified successfully' data: account_number: '1234567890' account_name: 'John Doe' bank_id: 1 properties: message: type: string example: 'Account verified successfully' data: type: object properties: account_number: type: string example: '1234567890' account_name: type: string example: 'John Doe' bank_id: type: integer example: 1 400: description: '' content: application/json: schema: type: object example: message: 'Could not verify account' details: [] properties: message: type: string example: 'Could not verify account' details: type: array example: [] tags: - Traders requestBody: required: true content: application/json: schema: type: object properties: account_number: type: string description: 'The account number.' example: '1234567890' bank_code: type: string description: 'The bank code.' example: '058' required: - account_number - bank_code security: [] '/api/traders/bank-details/{id}': get: summary: 'Get a specific bank detail by ID' operationId: getASpecificBankDetailByID description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Bank detail retrieved successfully' data: id: 1 bank_name: GTB account_type: savings account_number: '1234567890' bank_code: '058' properties: message: type: string example: 'Bank detail retrieved successfully' data: type: object properties: id: type: integer example: 1 bank_name: type: string example: GTB account_type: type: string example: savings account_number: type: string example: '1234567890' bank_code: type: string example: '058' 404: description: '' content: application/json: schema: type: object example: message: 'Bank detail not found' details: [] properties: message: type: string example: 'Bank detail not found' details: type: array example: [] tags: - Traders security: [] put: summary: 'Update a bank detail' operationId: updateABankDetail description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Bank detail updated successfully' data: id: 1 bank_name: GTB account_type: savings account_number: '1234567890' bank_code: '058' recipient_code: RCP_1a2b3c4d5e6f properties: message: type: string example: 'Bank detail updated successfully' data: type: object properties: id: type: integer example: 1 bank_name: type: string example: GTB account_type: type: string example: savings account_number: type: string example: '1234567890' bank_code: type: string example: '058' recipient_code: type: string example: RCP_1a2b3c4d5e6f 404: description: '' content: application/json: schema: type: object example: message: 'Bank detail not found' details: [] properties: message: type: string example: 'Bank detail not found' details: type: array example: [] tags: - Traders requestBody: required: false content: application/json: schema: type: object properties: bank_name: type: string description: 'The name of the bank.' example: GTB account_type: type: string description: 'The type of account (savings/current).' example: savings account_number: type: string description: 'The account number.' example: '1234567890' bank_code: type: string description: 'The bank code.' example: '058' security: [] delete: summary: 'Delete a bank detail' operationId: deleteABankDetail description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Bank detail deleted successfully' properties: message: type: string example: 'Bank detail deleted successfully' 404: description: '' content: application/json: schema: type: object example: message: 'Bank detail not found' details: [] properties: message: type: string example: 'Bank detail not found' details: type: array example: [] tags: - Traders security: [] parameters: - in: path name: id description: 'The ID of the bank detail.' example: 1 required: true schema: type: integer /api/traders/withdraw: post: summary: 'Process a withdrawal request' operationId: processAWithdrawalRequest description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Withdrawal request processed successfully' data: success: true properties: message: type: string example: 'Withdrawal request processed successfully' data: type: object properties: success: type: boolean example: true 400: description: '' content: application/json: schema: type: object example: message: 'Insufficient funds' details: [] properties: message: type: string example: 'Insufficient funds' details: type: array example: [] 401: description: '' content: application/json: schema: type: object example: message: 'Invalid PIN' details: [] properties: message: type: string example: 'Invalid PIN' details: type: array example: [] 404: description: '' content: application/json: schema: type: object example: message: 'Trader not found' details: [] properties: message: type: string example: 'Trader not found' details: type: array example: [] tags: - Traders requestBody: required: true content: application/json: schema: type: object properties: amount: type: numeric description: 'The amount to withdraw.' example: '1000' type: type: string description: 'The type of withdrawal (cash/transfer).' example: cash pin: type: string description: "The trader's transaction PIN." example: '1234' bank_id: type: integer description: "The trader's bank details id." example: 1 required: - amount - type - pin - bank_id security: [] /api/admin/transactions: get: summary: 'List all transactions' operationId: listAllTransactions description: 'Retrieves a paginated list of all transactions (both trader and agent) with optional filtering.' parameters: - in: query name: user_type description: 'Filter by user type (trader, agent, or all).' example: trader required: false schema: type: string description: 'Filter by user type (trader, agent, or all).' example: trader - in: query name: user_id description: 'Filter by specific user ID.' example: 1 required: false schema: type: integer description: 'Filter by specific user ID.' example: 1 - in: query name: start_date description: 'date Start date for filtering transactions (YYYY-MM-DD).' example: '2023-01-01' required: false schema: type: string description: 'date Start date for filtering transactions (YYYY-MM-DD).' example: '2023-01-01' - in: query name: end_date description: 'date End date for filtering transactions (YYYY-MM-DD).' example: '2023-12-31' required: false schema: type: string description: 'date End date for filtering transactions (YYYY-MM-DD).' example: '2023-12-31' - in: query name: transaction_type description: 'Filter by transaction type (deposit/withdrawal).' example: deposit required: false schema: type: string description: 'Filter by transaction type (deposit/withdrawal).' example: deposit - in: query name: collection_type description: 'Filter by collection type.' example: cash required: false schema: type: string description: 'Filter by collection type.' example: cash - in: query name: status description: 'Filter by status ID.' example: 1 required: false schema: type: integer description: 'Filter by status ID.' example: 1 - in: query name: page description: 'Page number for pagination.' example: 1 required: false schema: type: integer description: 'Page number for pagination.' example: 1 responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Transactions retrieved successfully' data: transactions: data: - id: 1 amount: 10000 type: deposit ref_id: TRX123456 trader_id: 1 agent_id: 2 status_id: 1 status: id: 1 name: completed recipient: null reason: null ref_type: deposit created_at: '2023-01-01 12:00:00' updated_at: '2023-01-01 12:00:00' trader: id: 1 name: 'John Doe' agent: id: 2 name: 'Jane Smith' links: first: 'http://example.com/api/admin/transactions?page=1' last: 'http://example.com/api/admin/transactions?page=5' prev: null next: 'http://example.com/api/admin/transactions?page=2' meta: current_page: 1 from: 1 last_page: 5 path: 'http://example.com/api/admin/transactions' per_page: 10 to: 10 total: 50 properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Transactions retrieved successfully' data: type: object properties: transactions: type: object properties: data: type: array example: - id: 1 amount: 10000 type: deposit ref_id: TRX123456 trader_id: 1 agent_id: 2 status_id: 1 status: id: 1 name: completed recipient: null reason: null ref_type: deposit created_at: '2023-01-01 12:00:00' updated_at: '2023-01-01 12:00:00' trader: id: 1 name: 'John Doe' agent: id: 2 name: 'Jane Smith' items: type: object properties: id: type: integer example: 1 amount: type: integer example: 10000 type: type: string example: deposit ref_id: type: string example: TRX123456 trader_id: type: integer example: 1 agent_id: type: integer example: 2 status_id: type: integer example: 1 status: type: object properties: id: type: integer example: 1 name: type: string example: completed recipient: type: string example: null reason: type: string example: null ref_type: type: string example: deposit created_at: type: string example: '2023-01-01 12:00:00' updated_at: type: string example: '2023-01-01 12:00:00' trader: type: object properties: id: type: integer example: 1 name: type: string example: 'John Doe' agent: type: object properties: id: type: integer example: 2 name: type: string example: 'Jane Smith' links: type: object properties: first: type: string example: 'http://example.com/api/admin/transactions?page=1' last: type: string example: 'http://example.com/api/admin/transactions?page=5' prev: type: string example: null next: type: string example: 'http://example.com/api/admin/transactions?page=2' meta: type: object properties: current_page: type: integer example: 1 from: type: integer example: 1 last_page: type: integer example: 5 path: type: string example: 'http://example.com/api/admin/transactions' per_page: type: integer example: 10 to: type: integer example: 10 total: type: integer example: 50 422: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'The user type must be one of the following types: trader, agent' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'The user type must be one of the following types: trader, agent' data: type: string example: null 500: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Internal server error' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Internal server error' data: type: string example: null tags: - Transactions /api/admin/transactions/statistics: get: summary: 'Get transaction statistics' operationId: getTransactionStatistics description: 'Retrieves summary statistics for all transactions, including monthly trends and totals.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Transaction statistics retrieved successfully' data: summary: total_deposits: 500000 total_withdrawals: 200000 net_balance: 300000 trader_count: 50 agent_count: 20 transaction_count: 500 monthly_trends: labels: - Jan - Feb - Mar - Apr - May - Jun - Jul - Aug - Sep - Oct - Nov - Dec datasets: - label: 'Trader Deposits' data: - 10000 - 15000 - 20000 - 25000 - 30000 - 35000 - 40000 - 45000 - 50000 - 55000 - 60000 - 65000 - label: 'Trader Withdrawals' data: - 5000 - 7500 - 10000 - 12500 - 15000 - 17500 - 20000 - 22500 - 25000 - 27500 - 30000 - 32500 - label: 'Agent Deposits' data: - 8000 - 12000 - 16000 - 20000 - 24000 - 28000 - 32000 - 36000 - 40000 - 44000 - 48000 - 52000 - label: 'Agent Withdrawals' data: - 4000 - 6000 - 8000 - 10000 - 12000 - 14000 - 16000 - 18000 - 20000 - 22000 - 24000 - 26000 status_breakdown: completed: 450 pending: 30 failed: 20 properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Transaction statistics retrieved successfully' data: type: object properties: summary: type: object properties: total_deposits: type: integer example: 500000 total_withdrawals: type: integer example: 200000 net_balance: type: integer example: 300000 trader_count: type: integer example: 50 agent_count: type: integer example: 20 transaction_count: type: integer example: 500 monthly_trends: type: object properties: labels: type: array example: - Jan - Feb - Mar - Apr - May - Jun - Jul - Aug - Sep - Oct - Nov - Dec items: type: string datasets: type: array example: - label: 'Trader Deposits' data: - 10000 - 15000 - 20000 - 25000 - 30000 - 35000 - 40000 - 45000 - 50000 - 55000 - 60000 - 65000 - label: 'Trader Withdrawals' data: - 5000 - 7500 - 10000 - 12500 - 15000 - 17500 - 20000 - 22500 - 25000 - 27500 - 30000 - 32500 - label: 'Agent Deposits' data: - 8000 - 12000 - 16000 - 20000 - 24000 - 28000 - 32000 - 36000 - 40000 - 44000 - 48000 - 52000 - label: 'Agent Withdrawals' data: - 4000 - 6000 - 8000 - 10000 - 12000 - 14000 - 16000 - 18000 - 20000 - 22000 - 24000 - 26000 items: type: object properties: label: type: string example: 'Trader Deposits' data: type: array example: - 10000 - 15000 - 20000 - 25000 - 30000 - 35000 - 40000 - 45000 - 50000 - 55000 - 60000 - 65000 items: type: integer status_breakdown: type: object properties: completed: type: integer example: 450 pending: type: integer example: 30 failed: type: integer example: 20 500: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: false message: 'Internal server error' data: null properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: false message: type: string example: 'Internal server error' data: type: string example: null tags: - Transactions /api/withdrawals: post: summary: 'Withdraw funds from trader to agent.' operationId: withdrawFundsFromTraderToAgent description: 'Requires Bearer Token Authentication.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Withdrawal request is being processed.' data: [] meta-links: [] properties: message: type: string example: 'Withdrawal request is being processed.' data: type: array example: [] meta-links: type: array example: [] 400: description: '' content: application/json: schema: oneOf: - description: '' type: object example: message: 'Insufficient balance in Trader account' properties: message: type: string example: 'Insufficient balance in Trader account' - description: '' type: object example: message: 'Insufficient balance in Agent account' properties: message: type: string example: 'Insufficient balance in Agent account' 404: description: '' content: application/json: schema: type: object example: message: 'Trader or Agent not found' properties: message: type: string example: 'Trader or Agent not found' 422: description: '' content: application/json: schema: type: object example: message: 'Validation Error' errors: amount: - 'The amount field is required.' type: - 'The type field is required.' properties: message: type: string example: 'Validation Error' errors: type: object properties: amount: type: array example: - 'The amount field is required.' items: type: string type: type: array example: - 'The type field is required.' items: type: string 500: description: '' content: application/json: schema: type: object example: message: 'Internal Server Error' properties: message: type: string example: 'Internal Server Error' tags: - Withdrawals requestBody: required: true content: application/json: schema: type: object properties: amount: type: numeric description: 'Amount to withdraw.' example: '10000' type: type: string description: 'Type of withdrawal: "cash" or "bank".' example: '"cash"' account_number: type: string description: "Trader's account number." example: '"8012345678"' reason: type: string description: 'Reason for withdrawal.' example: '"Savings withdrawal"' pin: type: string description: "Trader's transaction PIN if cash and agent's transaction PIN if transfer." example: '"1234"' required: - amount - type - account_number - reason - pin tags: - name: 'Admin Authentication' description: '' - name: 'Admin Chat' description: '' - name: 'Admin Dashboard' description: "\nAPIs for retrieving dashboard statistics and analytics data" - name: 'Admin Management' description: '' - name: 'Admin Profile Management' description: "\nAPIs for managing admin profile information" - name: 'Admin Roles & Permissions' description: '' - name: 'Admin Two-Factor Authentication' description: '' - name: 'Agent Management' description: '' - name: 'Agent Transactions' description: '' - name: Agents description: "\nAPIs for Agents" - name: Banks description: '' - name: Country description: '' - name: Deposit description: '' - name: Endpoints description: '' - name: Guarantor description: '' - name: LGA description: '' - name: OAuth description: "\nAPIs for OAuth token refresh" - name: State description: '' - name: 'Trader Management' description: '' - name: 'Trader Transactions' description: '' - name: Traders description: "\nAPIs for Traders" - name: Transactions description: '' - name: Withdrawals description: ''