openapi: 3.0.3 info: title: sabisave description: '' version: 1.0.0 servers: - url: 'https://api.sabisave.com' paths: /api/admin/beneficiaries: get: summary: 'Get all beneficiaries with filtering' operationId: getAllBeneficiariesWithFiltering description: '' parameters: - in: query name: search description: 'optional Search by name, phone, email, or NIN.' example: John required: false schema: type: string description: 'optional Search by name, phone, email, or NIN.' example: John - in: query name: status description: 'optional Filter by status (active,inactive,suspended).' example: active required: false schema: type: string description: 'optional Filter by status (active,inactive,suspended).' example: active - in: query name: per_page description: 'optional Number of items per page.' example: 15 required: false schema: type: integer description: 'optional Number of items per page.' example: 15 responses: 200: description: '' content: application/json: schema: type: object example: message: 'Beneficiaries retrieved successfully' data: current_page: 1 data: - id: 1 name: 'John Doe' email: john@example.com phone: '08012345678' nin: '12345678901' account_number: '1234567890' bank_name: GTBank status: active total_disbursed: '150000.00' disbursements_count: 3 created_at: '2024-01-01T00:00:00.000000Z' total: 1 properties: message: type: string example: 'Beneficiaries retrieved successfully' data: type: object properties: current_page: type: integer example: 1 data: type: array example: - id: 1 name: 'John Doe' email: john@example.com phone: '08012345678' nin: '12345678901' account_number: '1234567890' bank_name: GTBank status: active total_disbursed: '150000.00' disbursements_count: 3 created_at: '2024-01-01T00:00:00.000000Z' items: type: object properties: id: type: integer example: 1 name: type: string example: 'John Doe' email: type: string example: john@example.com phone: type: string example: '08012345678' nin: type: string example: '12345678901' account_number: type: string example: '1234567890' bank_name: type: string example: GTBank status: type: string example: active total_disbursed: type: string example: '150000.00' disbursements_count: type: integer example: 3 created_at: type: string example: '2024-01-01T00:00:00.000000Z' total: type: integer example: 1 tags: - 'Admin - Beneficiaries' security: [] '/api/admin/beneficiaries/{id}': get: summary: 'Get a specific beneficiary' operationId: getASpecificBeneficiary description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Beneficiary retrieved successfully' data: id: 1 name: 'John Doe' email: john@example.com phone: '08012345678' nin: '12345678901' account_number: '1234567890' bank_name: GTBank bank_code: '058' address: '123 Main Street, Lagos' average_yearly_income: '500000.00' max_qualification: "Bachelor's Degree" occupation: Teacher status: active total_disbursed: '150000.00' disbursements: - id: 1 reference: DISB_ABC123 amount: '50000.00' status: successful created_at: '2024-01-01T00:00:00.000000Z' properties: message: type: string example: 'Beneficiary retrieved successfully' data: type: object properties: id: type: integer example: 1 name: type: string example: 'John Doe' email: type: string example: john@example.com phone: type: string example: '08012345678' nin: type: string example: '12345678901' account_number: type: string example: '1234567890' bank_name: type: string example: GTBank bank_code: type: string example: '058' address: type: string example: '123 Main Street, Lagos' average_yearly_income: type: string example: '500000.00' max_qualification: type: string example: "Bachelor's Degree" occupation: type: string example: Teacher status: type: string example: active total_disbursed: type: string example: '150000.00' disbursements: type: array example: - id: 1 reference: DISB_ABC123 amount: '50000.00' status: successful created_at: '2024-01-01T00:00:00.000000Z' items: type: object properties: id: type: integer example: 1 reference: type: string example: DISB_ABC123 amount: type: string example: '50000.00' status: type: string example: successful created_at: type: string example: '2024-01-01T00:00:00.000000Z' tags: - 'Admin - Beneficiaries' security: [] put: summary: 'Update beneficiary information' operationId: updateBeneficiaryInformation description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Beneficiary updated successfully' data: id: 1 name: 'John Doe' email: john@example.com phone: '08012345678' status: active properties: message: type: string example: 'Beneficiary updated successfully' data: type: object properties: id: type: integer example: 1 name: type: string example: 'John Doe' email: type: string example: john@example.com phone: type: string example: '08012345678' status: type: string example: active tags: - 'Admin - Beneficiaries' requestBody: required: false content: application/json: schema: type: object properties: name: type: string description: 'optional The full name.' example: 'John Doe' email: type: string description: 'optional The email address.' example: john@example.com address: type: string description: 'optional The address.' example: '123 Main Street, Lagos' average_yearly_income: type: numeric description: 'optional Average yearly income.' example: '600000' max_qualification: type: string description: 'optional Highest qualification.' example: "Master's Degree" occupation: type: string description: 'optional Occupation.' example: Engineer security: [] delete: summary: 'Delete a beneficiary' operationId: deleteABeneficiary description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Beneficiary deleted successfully' properties: message: type: string example: 'Beneficiary deleted successfully' tags: - 'Admin - Beneficiaries' security: [] parameters: - in: path name: id description: 'The ID of the beneficiary.' example: 1 required: true schema: type: integer '/api/admin/beneficiaries/{id}/status': put: summary: 'Update beneficiary status' operationId: updateBeneficiaryStatus description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Beneficiary status updated successfully' data: id: 1 name: 'John Doe' status: suspended properties: message: type: string example: 'Beneficiary status updated successfully' data: type: object properties: id: type: integer example: 1 name: type: string example: 'John Doe' status: type: string example: suspended tags: - 'Admin - Beneficiaries' requestBody: required: true content: application/json: schema: type: object properties: status: type: string description: 'The new status (active,inactive,suspended).' example: suspended reason: type: string description: 'optional Reason for status change.' example: 'Account verification required' required: - status security: [] parameters: - in: path name: id description: 'The ID of the beneficiary.' example: 1 required: true schema: type: integer /api/admin/beneficiaries/analytics/overview: get: summary: 'Get beneficiary analytics' operationId: getBeneficiaryAnalytics description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Analytics retrieved successfully' data: total_beneficiaries: 150 active_beneficiaries: 140 inactive_beneficiaries: 5 suspended_beneficiaries: 5 verified_beneficiaries: 130 total_disbursed: '5000000.00' average_income: '450000.00' monthly_registrations: - month: 2024-01 count: 25 properties: message: type: string example: 'Analytics retrieved successfully' data: type: object properties: total_beneficiaries: type: integer example: 150 active_beneficiaries: type: integer example: 140 inactive_beneficiaries: type: integer example: 5 suspended_beneficiaries: type: integer example: 5 verified_beneficiaries: type: integer example: 130 total_disbursed: type: string example: '5000000.00' average_income: type: string example: '450000.00' monthly_registrations: type: array example: - month: 2024-01 count: 25 items: type: object properties: month: type: string example: 2024-01 count: type: integer example: 25 tags: - 'Admin - Beneficiaries' security: [] /api/admin/disbursements: get: summary: 'Get all disbursements with filtering' operationId: getAllDisbursementsWithFiltering description: '' parameters: - in: query name: search description: 'optional Search by beneficiary name, phone, or reference.' example: John required: false schema: type: string description: 'optional Search by beneficiary name, phone, or reference.' example: John - in: query name: status description: 'optional Filter by status (pending,processing,successful,failed,cancelled).' example: successful required: false schema: type: string description: 'optional Filter by status (pending,processing,successful,failed,cancelled).' example: successful - in: query name: beneficiary_id description: 'optional Filter by beneficiary ID.' example: 1 required: false schema: type: integer description: 'optional Filter by beneficiary ID.' example: 1 - in: query name: start_date description: 'optional Filter by start date (Y-m-d).' example: '2024-01-01' required: false schema: type: string description: 'optional Filter by start date (Y-m-d).' example: '2024-01-01' - in: query name: end_date description: 'optional Filter by end date (Y-m-d).' example: '2024-12-31' required: false schema: type: string description: 'optional Filter by end date (Y-m-d).' example: '2024-12-31' - in: query name: per_page description: 'optional Number of items per page.' example: 15 required: false schema: type: integer description: 'optional Number of items per page.' example: 15 responses: 200: description: '' content: application/json: schema: type: object example: message: 'Disbursements retrieved successfully' data: current_page: 1 data: - id: 1 reference: DISB_ABC123 amount: '50000.00' status: successful beneficiary: id: 1 name: 'John Doe' phone: '08012345678' processed_by: id: 1 name: 'Admin User' created_at: '2024-01-01T00:00:00.000000Z' total: 1 properties: message: type: string example: 'Disbursements retrieved successfully' data: type: object properties: current_page: type: integer example: 1 data: type: array example: - id: 1 reference: DISB_ABC123 amount: '50000.00' status: successful beneficiary: id: 1 name: 'John Doe' phone: '08012345678' processed_by: id: 1 name: 'Admin User' created_at: '2024-01-01T00:00:00.000000Z' items: type: object properties: id: type: integer example: 1 reference: type: string example: DISB_ABC123 amount: type: string example: '50000.00' status: type: string example: successful beneficiary: type: object properties: id: type: integer example: 1 name: type: string example: 'John Doe' phone: type: string example: '08012345678' processed_by: type: object properties: id: type: integer example: 1 name: type: string example: 'Admin User' created_at: type: string example: '2024-01-01T00:00:00.000000Z' total: type: integer example: 1 tags: - 'Admin - Disbursements' security: [] post: summary: 'Create a new disbursement' operationId: createANewDisbursement description: '' parameters: [] responses: 201: description: '' content: application/json: schema: type: object example: message: 'Disbursement created successfully' data: id: 1 reference: DISB_ABC123 amount: '50000.00' purpose: 'Emergency Relief' status: pending beneficiary: id: 1 name: 'John Doe' phone: '08012345678' properties: message: type: string example: 'Disbursement created successfully' data: type: object properties: id: type: integer example: 1 reference: type: string example: DISB_ABC123 amount: type: string example: '50000.00' purpose: type: string example: 'Emergency Relief' status: type: string example: pending beneficiary: type: object properties: id: type: integer example: 1 name: type: string example: 'John Doe' phone: type: string example: '08012345678' tags: - 'Admin - Disbursements' requestBody: required: true content: application/json: schema: type: object properties: beneficiary_id: type: integer description: 'The ID of the beneficiary.' example: 1 amount: type: numeric description: 'The amount to disburse.' example: '50000' purpose: type: string description: 'optional The purpose of disbursement.' example: 'Emergency Relief' description: type: string description: 'optional Additional description.' example: 'Emergency fund for medical expenses' required: - beneficiary_id - amount security: [] '/api/admin/disbursements/{id}': get: summary: 'Get a specific disbursement' operationId: getASpecificDisbursement description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Disbursement retrieved successfully' data: id: 1 reference: DISB_ABC123 amount: '50000.00' purpose: 'Emergency Relief' description: 'Emergency fund disbursement' status: successful payment_reference: PAY_123456 processed_at: '2024-01-01T12:00:00.000000Z' beneficiary: id: 1 name: 'John Doe' phone: '08012345678' account_number: '1234567890' bank_name: GTBank processed_by: id: 1 name: 'Admin User' properties: message: type: string example: 'Disbursement retrieved successfully' data: type: object properties: id: type: integer example: 1 reference: type: string example: DISB_ABC123 amount: type: string example: '50000.00' purpose: type: string example: 'Emergency Relief' description: type: string example: 'Emergency fund disbursement' status: type: string example: successful payment_reference: type: string example: PAY_123456 processed_at: type: string example: '2024-01-01T12:00:00.000000Z' beneficiary: type: object properties: id: type: integer example: 1 name: type: string example: 'John Doe' phone: type: string example: '08012345678' account_number: type: string example: '1234567890' bank_name: type: string example: GTBank processed_by: type: object properties: id: type: integer example: 1 name: type: string example: 'Admin User' tags: - 'Admin - Disbursements' security: [] parameters: - in: path name: id description: 'The ID of the disbursement.' example: 1 required: true schema: type: integer '/api/admin/disbursements/{id}/process': post: summary: 'Process a disbursement' operationId: processADisbursement description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Disbursement processed successfully' data: id: 1 reference: DISB_ABC123 amount: '50000.00' status: successful payment_reference: PAY_123456 processed_at: '2024-01-01T12:00:00.000000Z' properties: message: type: string example: 'Disbursement processed successfully' data: type: object properties: id: type: integer example: 1 reference: type: string example: DISB_ABC123 amount: type: string example: '50000.00' status: type: string example: successful payment_reference: type: string example: PAY_123456 processed_at: type: string example: '2024-01-01T12:00:00.000000Z' tags: - 'Admin - Disbursements' security: [] parameters: - in: path name: id description: 'The ID of the disbursement.' example: 1 required: true schema: type: integer '/api/admin/disbursements/{id}/cancel': post: summary: 'Cancel a disbursement' operationId: cancelADisbursement description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Disbursement cancelled successfully' properties: message: type: string example: 'Disbursement cancelled successfully' tags: - 'Admin - Disbursements' requestBody: required: false content: application/json: schema: type: object properties: reason: type: string description: 'optional Reason for cancellation.' example: 'Beneficiary request' security: [] parameters: - in: path name: id description: 'The ID of the disbursement.' example: 1 required: true schema: type: integer /api/admin/disbursements/analytics/overview: get: summary: 'Get disbursement analytics' operationId: getDisbursementAnalytics description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Analytics retrieved successfully' data: total_disbursements: 150 total_amount: '5000000.00' successful_disbursements: 140 successful_amount: '4800000.00' pending_disbursements: 5 failed_disbursements: 5 monthly_stats: - month: 2024-01 count: 25 amount: '1000000.00' properties: message: type: string example: 'Analytics retrieved successfully' data: type: object properties: total_disbursements: type: integer example: 150 total_amount: type: string example: '5000000.00' successful_disbursements: type: integer example: 140 successful_amount: type: string example: '4800000.00' pending_disbursements: type: integer example: 5 failed_disbursements: type: integer example: 5 monthly_stats: type: array example: - month: 2024-01 count: 25 amount: '1000000.00' items: type: object properties: month: type: string example: 2024-01 count: type: integer example: 25 amount: type: string example: '1000000.00' tags: - 'Admin - Disbursements' security: [] /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/resend-token: post: summary: "Resend the verification token to the admin's phone number." operationId: resendTheVerificationTokenToTheAdminsPhoneNumber 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: - 'Admin Authentication' requestBody: required: false content: application/json: schema: type: object properties: phone: type: or description: 'id string required The ID of the agent.' example: '2348012345678' 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: - distinctio items: type: string required: - message parameters: - in: path name: id description: 'The ID of the conversation.' example: neque 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: consectetur 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: eligendi 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/search: get: summary: 'Search agents' operationId: searchAgents description: 'Searches for agents by name, email, phone or location.' parameters: - in: query name: search description: 'Search by name, email, phone .' example: John required: false schema: type: string description: 'Search by name, email, phone .' example: John responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Agents found' 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 - id: 2 name: 'Jane Doe' email: jane.doe@example.com phone: '+2347012345678' status: id: 2 name: inactive location: country: Nigeria state: Abuja lga: Kuje properties: timestamp: type: string example: '2023-01-01T12:00:00.000000Z' status: type: boolean example: true message: type: string example: 'Agents found' 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 - id: 2 name: 'Jane Doe' email: jane.doe@example.com phone: '+2347012345678' status: id: 2 name: inactive location: country: Nigeria state: Abuja lga: Kuje 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 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/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: fugiat pin_confirmation: type: string description: 'The confirmation of the new transaction PIN.' example: aliquid otp: type: string description: "The one-time password sent to the agent's phone. Must be numeric and exactly 4 digits." example: tempora 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: false 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.' '/api/agents/deactivate/{id}': post: summary: 'Deactivate/delete an agent account.' operationId: deactivatedeleteAnAgentAccount description: '' 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 parameters: - in: path name: id description: 'The ID of the deactivate.' example: 1 required: true schema: type: integer '/api/agents/delete-account/{id}': post: summary: 'Delete agent account' operationId: deleteAgentAccount 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: - Agents parameters: - in: path name: id description: 'The ID of the agent.' example: 1 required: true schema: type: integer /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: 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' 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: '`zcLcq' password_confirmation: type: string description: 'The confirmation of the new password.' example: id current_password: type: string description: 'The current password of the agent. Must be at least 8 characters.' example: alias required: - password - password_confirmation - current_password /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' 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: false 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: et last_name: type: string description: 'nullable The last name of the agent. Maximum length is 255 characters.' example: sunt email: type: string description: 'nullable The email address of the agent. Must be a valid email address and maximum length is 255 characters.' example: etreutel@example.com phone: type: string description: 'nullable The phone number of the agent. Maximum length is 255 characters.' example: eius gender: type: string description: 'nullable The gender of the agent.' example: distinctio dob: type: date description: 'nullable The date of birth of the agent.' example: animi trader_union: type: string description: 'nullable The trader union of the agent. Maximum length is 255 characters.' example: recusandae /api/agents/update-bank-details: post: summary: 'Update the bank details for the specified agent.' operationId: updateTheBankDetailsForTheSpecifiedAgent description: 'This endpoint updates the bank details for an agent.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Bank details updated successfully' properties: message: type: string example: 'Bank details updated successfully' 400: description: '' content: application/json: schema: type: object example: error: 'Failed to update bank details' message: 'Failed to update bank details' properties: error: type: string example: 'Failed to update bank details' message: type: string example: 'Failed to update bank details' 500: description: '' content: application/json: schema: type: object example: error: 'Failed to update bank details' message: 'Failed to update bank details' properties: error: type: string example: 'Failed to update bank details' message: type: string example: 'Failed to update bank details' tags: - Agents requestBody: required: true content: application/json: schema: type: object properties: bank_name: type: string description: 'The name of the bank. Maximum length is 255 characters.' example: '"First Bank of Nigeria"' account_type: type: string description: 'nullable The type of the account. Maximum length is 255 characters.' example: '"Savings"' account_number: type: numeric description: 'The account number of the agent. Must be a numeric value and must be between 10 and 12 digits.' example: '0123456789' account_name: type: string description: 'The account name of the agent. Maximum length is 255 characters.' example: '"John Doe"' bank_code: type: string description: 'The bank code of the agent. Maximum length is 255 characters.' example: '"011"' required: - bank_name - account_number - account_name - bank_code /api/agents/transactions/getall: get: summary: '' operationId: getApiAgentsTransactionsGetall 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: - Agents security: [] /api/agents/balance: get: summary: 'Get the balance of the authenticated agent' operationId: getTheBalanceOfTheAuthenticatedAgent description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Balance retrieved successfully' data: balance: 1000 properties: message: type: string example: 'Balance retrieved successfully' data: type: object properties: balance: type: integer example: 1000 404: description: '' content: application/json: schema: type: object example: message: 'Agent not found' properties: message: type: string example: 'Agent not found' tags: - Agents '/api/agents/transactions/{id}': get: summary: 'Retrieve a single transaction by id' operationId: retrieveASingleTransactionById description: '' parameters: [] responses: 200: description: '' content: text/plain: schema: type: string example: "{\n \"message\": \"Transaction retrieved successfully\",\n \"data\": {\n \"id\": 1,\n \"amount\": 10000,\n \"type\": \"debit\",\n \"trader\": {\n \"id\": 1,\n \"phone\": \"08132221963\",\n \"full_name\": \"Super Admin\",\n \"other_name\": null,\n \"email\": \"sabisaveinfo@gmail.com\",\n \"dob\": \"2016-07-29\",\n \"gender\": \"male\",\n \"has_cooperative\": true,\n \"cooperative\": \"Cronin-Kshlerin\",\n \"username\": \"super-admin\",\n \"balance\": 980000,\n \"account_number\": \"8132221963\",\n \"bank_details\": {\n \"id\": 19,\n \"bank_name\": \"UBA\",\n \"account_type\": \"savings\",\n \"account_number\": \"0737775790\",\n \"bank_code\": \"857\"\n },\n \"created_at\": \"2025-06-04 08:37:18\",\n \"updated_at\": \"2025-06-04 08:37:18\"\n },\n \"recipient\": \"agent\",\n \"status\": \"completed\",\n \"agent\": {\n \"id\": 1,\n \"trader_union\": \"nihil\",\n \"email\": \"sabisaveinfo@gmail.com\",\n \"username\": \"super-admin\",\n \"first_name\": \"Super\",\n \"last_name\": \"Admin\",\n \"phone\": \"08132221963\",\n \"gender\": \"female\",\n \"dob\": \"1999-08-15T00:00:00.000000Z\",\n \"country\": \"Nigeria\",\n \"state\": \"Lagos State\",\n \"lga\": \"Ikeja\",\n \"address\": \"9957 Rafael Viaduct\\nHirtheview, NJ 18671\",\n \"post_code\": \"04387-0972\",\n \"profile\": \"https://via.placeholder.com/640x480.png/00aaaa?text=exercitationem\",\n \"agent_number\": \"08132221963\",\n \"balance\": 9980000,\n \"bank_details\": {\n \"id\": 1,\n \"bank_name\": \"GTB\",\n \"account_type\": \"savings\",\n \"account_number\": \"23298140144727\",\n \"bank_code\": \"058\"\n }\n },\n \"created_at\": \"2025-06-06 02:42:31\",\n \"updated_at\": \"2025-06-06 02:42:31\",\n \"reference\": null\n }" 404: description: '' content: application/json: schema: type: object example: message: 'Transaction not found' details: error: 'Transaction not found' properties: message: type: string example: 'Transaction not found' details: type: object properties: error: type: string example: 'Transaction not found' tags: - Agents parameters: - in: path name: id description: 'The ID of the transaction.' example: '1' required: true schema: type: string /api/agents/trader-onboarding/step-1: post: summary: 'Step one of trader onboarding process' operationId: stepOneOfTraderOnboardingProcess 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: - Agents requestBody: required: true content: application/json: schema: type: object properties: phone: type: string description: 'The phone number of the trader.' example: '09031922234' full_name: type: string description: 'The full name of the trader.' example: 'John Smith' other_name: type: string description: 'optional The other name of the trader.' example: Abraham gender: type: string description: 'The gender of the trader (male or female).' example: male dob: type: date description: 'The date of birth of the trader.' example: '2000-01-15' has_cooperative: type: boolean description: '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 trader.' example: Pass@123 required: - phone - full_name - gender - dob - has_cooperative - password security: [] /api/agents/trader-onboarding/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 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: 'Trader not found' details: [] properties: message: type: string example: 'Trader not found' details: type: array example: [] tags: - Agents requestBody: required: true content: application/json: schema: type: object properties: trader_id: type: integer description: 'The ID of the trader.' example: 1 country_id: type: integer description: 'The ID of the country.' example: 1 state_id: type: integer description: 'The ID of the state.' example: 1 lga_id: type: integer 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: "nullable The postal code of the trader's address." example: '"100001"' business_type: type: string description: 'The type of business.' example: retail is_registered_with_CAC: type: boolean description: 'Is the trader registered with CAC.' example: true business_name: type: string description: "The name of the trader's business." example: SABISAVE reg_number: type: string description: 'The business registration number.' example: '1234567' savings_frequency: type: string description: 'The savings frequency.' example: daily savings_amount: type: numeric description: 'The savings amount.' example: '1000' account_type: type: string description: 'If the trader has a bank account.' example: current bank_name: type: string description: 'sometimes The name of the bank.' example: GTB bank_code: type: string description: 'If the trader has a bank account.' example: '058' account_number: type: string description: 'If the trader has a bank account.' example: '100001300' required: - trader_id - country_id - state_id - lga_id - address - business_type - is_registered_with_CAC - business_name - reg_number - savings_frequency - savings_amount - account_type - bank_code - account_number security: [] /api/agents/trader-onboarding/create-pin: post: summary: 'Create a new transaction PIN for a trader.' operationId: createANewTransactionPINForATrader description: '' parameters: [] responses: 201: description: '' content: application/json: schema: type: object example: message: 'Transaction PIN created successfully' data: trader_id: 1 meta-links: [] properties: message: type: string example: 'Transaction PIN created successfully' data: type: object properties: trader_id: type: integer example: 1 meta-links: type: array example: [] 404: description: '' content: application/json: schema: type: object example: message: 'Trader not found' details: error: 'Trader not found' properties: message: type: string example: 'Trader not found' details: type: object properties: error: type: string example: 'Trader 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' trader_id: type: integer description: 'The ID of the trader.' example: 1 required: - pin - pin_confirmation - trader_id security: [] /api/agents/trader-onboarding/upload-profile-pic: post: summary: 'Uploads a profile picture for the specified trader.' operationId: uploadsAProfilePictureForTheSpecifiedTrader description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Profile image updated successfully' data: profile_image: /storage/profile/image.jpg trader_number: TRD001 properties: message: type: string example: 'Profile image updated successfully' data: type: object properties: profile_image: type: string example: /storage/profile/image.jpg trader_number: type: string example: TRD001 400: description: '' content: application/json: schema: type: object example: message: 'Validation failed' error: code: 400 message: 'Validation failed' data: profile_image: - 'The profile image field is required.' properties: message: type: string example: 'Validation failed' error: type: object properties: code: type: integer example: 400 message: type: string example: 'Validation failed' data: type: object properties: profile_image: type: array example: - 'The profile image field is required.' items: type: string 500: description: '' content: application/json: schema: type: object example: message: 'Internal server error' error: code: 500 message: 'Server error details' properties: message: type: string example: 'Internal server error' error: type: object properties: code: type: integer example: 500 message: type: string example: 'Server error details' tags: - Agents requestBody: required: true content: multipart/form-data: schema: type: object properties: profile_image: type: string format: binary description: 'The profile image of the trader. Must be an image (jpeg, png, jpg, gif) and less than 2MB in size.' trader_id: type: integer description: 'The ID of the trader.' example: 8 required: - profile_image - trader_id security: [] /api/agents/trader-onboarding/upload-id: post: summary: 'Upload ID for a trader.' operationId: uploadIDForATrader description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'File uploaded successfully' properties: message: type: string example: 'File uploaded successfully' 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: trader_id: type: string description: 'The ID of the trader.' 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. Must be of type jpeg, png, jpg, gif, svg, pdf and not exceed 1MB.' required: - trader_id - id_type - id_file '/api/agents/trader/{trader_id}': get: summary: 'Get a single trader' operationId: getASingleTrader description: 'This endpoint returns a single trader belonging to the authenticated agent' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Trader found successfully' data: id: 2 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: 'Trader found successfully' data: type: object properties: id: type: integer example: 2 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 404: description: '' content: application/json: schema: type: object example: message: 'Trader not found' errors: [] properties: message: type: string example: 'Trader not found' errors: type: array example: [] tags: - Agents parameters: - in: path name: trader_id description: 'The ID of the trader.' example: 1 required: true schema: type: integer - in: path name: trader description: 'The ID of the trader.' example: '2' required: true schema: type: string /api/agents/recent-collections: get: summary: 'Get recent collections' operationId: getRecentCollections description: 'This endpoint returns a list of recent collections by the authenticated agent' parameters: - in: query name: page description: 'The page number to return.' example: '1' required: true schema: type: string description: 'The page number to return.' example: '1' responses: 200: description: '' content: text/plain: schema: type: string example: "{\n \"message\": \"Collections retrieved successfully\",\n \"data\": {\n \"data\": [\n {\n \"amount\": 4390,\n \"type\": \"credit\",\n \"trader\": {\n \"id\": 5,\n \"phone\": \"325-367-7061\",\n \"full_name\": \"Marley Yost\",\n \"other_name\": null,\n \"email\": \"laurianne.larson@example.net\",\n \"username\": \"marley.yost164\",\n \"balance\": 1000000,\n \"account_number\": \"4967805157\",\n \"bank_details\": {\n \"id\": 23,\n \"bank_name\": \"UBA\",\n \"account_type\": \"savings\",\n \"account_number\": \"2062595419\",\n \"bank_code\": \"930\"\n }\n },\n \"agent_id\": 1,\n \"status\": \"remitted\",\n \"recipient\": \"agent\",\n \"reason\": \"Cash Deposit from Trader\",\n \"balance\": null,\n \"reference\": null\n }\n \"links\": {\n \"first\": \"http://localhost/api/admin/collections?page=1\",\n \"last\": \"http://localhost/api/admin/collections?page=5\",\n \"prev\": null,\n \"next\": \"http://localhost/api/admin/collections?page=2\"\n },\n \"meta\": {\n \"current_page\": 1,\n \"from\": 1,\n \"last_page\": 5,\n \"path\": \"http://localhost/api/admin/collections\",\n \"per_page\": 10,\n \"to\": 10,\n \"total\": 50\n }\n }\n}" 404: description: '' content: application/json: schema: type: object example: message: 'No collection found' errors: [] properties: message: type: string example: 'No collection found' errors: type: array example: [] tags: - Agents /api/agents/trader-search: get: summary: 'Search for traders by account number or phone number.' operationId: searchForTradersByAccountNumberOrPhoneNumber description: "Retrieves a paginated list of traders filtered by account number or phone number\nand ensures the trader is associated with the authenticated agent." parameters: - in: query name: account_number description: 'optional The account number to search for.' example: '123456' required: false schema: type: string description: 'optional The account number to search for.' example: '123456' - in: query name: phone description: 'optional The phone number to search for.' example: '+1234567890' required: false schema: type: string description: 'optional The phone number to search for.' example: '+1234567890' responses: 200: description: '' content: text/plain: schema: type: string example: "{\n \"data\": [\n {\n \"id\": 1,\n \"phone\": \"08132221963\",\n \"full_name\": \"Super Admin\",\n \"other_name\": null,\n \"email\": \"sabisaveinfo@gmail.com\",\n \"username\": \"super-admin\",\n \"balance\": 980000,\n \"account_number\": \"8132221963\",\n \"bank_details\": {\n \"id\": 19,\n \"bank_name\": \"UBA\",\n \"account_type\": \"savings\",\n \"account_number\": \"0737775790\",\n \"bank_code\": \"857\"\n }\n },\n ],\n \"links\": {\n \"first\": \"http://example.com/api/traders?page=1\",\n \"last\": \"http://example.com/api/traders?page=5\",\n \"prev\": null,\n \"next\": \"http://example.com/api/traders?page=2\"\n },\n \"meta\": {\n \"current_page\": 1,\n \"from\": 1,\n \"last_page\": 5,\n \"path\": \"http://example.com/api/traders\",\n \"per_page\": 15,\n \"to\": 15,\n \"total\": 75\n }\n}" 404: description: '' content: application/json: schema: type: object example: message: 'No traders found' errors: [] properties: message: type: string example: 'No traders found' errors: type: array example: [] tags: - Agents /api/agents/top-traders: get: summary: 'Get Top 10 Traders by Balance' operationId: getTop10TradersByBalance description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: data: - id: 1 full_name: 'John Doe' email: john@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 total_amount: 1000000.0 links: first: 'http://localhost/api/agent/top-traders?page=1' last: 'http://localhost/api/agent/top-traders?page=1' prev: null next: null meta: current_page: 1 from: 1 last_page: 1 path: 'http://localhost/api/agent/top-traders' per_page: 10 to: 10 total: 10 properties: data: type: array example: - id: 1 full_name: 'John Doe' email: john@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 total_amount: 1000000 items: type: object properties: id: type: integer example: 1 full_name: type: string example: 'John Doe' email: type: string example: john@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 total_amount: type: number example: 1000000.0 links: type: object properties: first: type: string example: 'http://localhost/api/agent/top-traders?page=1' last: type: string example: 'http://localhost/api/agent/top-traders?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://localhost/api/agent/top-traders' per_page: type: integer example: 10 to: type: integer example: 10 total: type: integer example: 10 404: description: '' content: application/json: schema: type: object example: message: 'No traders found' errors: [] properties: message: type: string example: 'No traders found' errors: type: array example: [] tags: - Agents /api/agents/stats: get: summary: 'Get Agent Trader Statistics' operationId: getAgentTraderStatistics description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: success data: number_agent_traders: 10 number_active_agent_traders: 5 agent_balance: amount: 100000 currency: NGN trader_plans: 5 properties: message: type: string example: success data: type: object properties: number_agent_traders: type: integer example: 10 number_active_agent_traders: type: integer example: 5 agent_balance: type: object properties: amount: type: integer example: 100000 currency: type: string example: NGN trader_plans: type: integer example: 5 tags: - Agents '/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: 4 required: false schema: type: integer description: 'The number of agents to retrieve. Defaults to 10.' example: 4 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/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: - Agents 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/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: - Agents 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 /api/agents/biometric/enable: post: summary: 'Enable biometric authentication for agent' operationId: enableBiometricAuthenticationForAgent description: '' parameters: [] responses: { } tags: - 'Agents - Biometric Authentication' requestBody: required: true content: application/json: schema: type: object properties: device_id: type: string description: 'Must not be greater than 255 characters.' example: dtitnxtvoexzynfxgmpix device_name: type: string description: 'Must not be greater than 255 characters.' example: w biometric_type: type: string description: '' example: fingerprint enum: - fingerprint - face_id - both public_key: type: string description: '' example: fuga required: - device_id - biometric_type - public_key security: [] /api/agents/biometric/disable: post: summary: 'Disable biometric authentication for current device' operationId: disableBiometricAuthenticationForCurrentDevice description: '' parameters: [] responses: { } tags: - 'Agents - Biometric Authentication' requestBody: required: true content: application/json: schema: type: object properties: device_id: type: string description: 'Must not be greater than 255 characters.' example: provlhwoxktutckjujpdqw required: - device_id security: [] /api/agents/biometric/devices: get: summary: 'Get all biometric devices for agent' operationId: getAllBiometricDevicesForAgent 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: - 'Agents - Biometric Authentication' security: [] '/api/agents/biometric/devices/{deviceId}': delete: summary: 'Revoke biometric authentication for a device' operationId: revokeBiometricAuthenticationForADevice description: '' parameters: [] responses: { } tags: - 'Agents - Biometric Authentication' security: [] parameters: - in: path name: deviceId description: '' example: praesentium required: true schema: type: string /api/agents/biometric/authenticate: post: summary: 'Authenticate agent using biometric token' operationId: authenticateAgentUsingBiometricToken description: '' parameters: [] responses: { } tags: - 'Agents - Biometric Authentication' requestBody: required: true content: application/json: schema: type: object properties: biometric_token: type: string description: '' example: nesciunt device_id: type: string description: 'Must not be greater than 255 characters.' example: epqmgfxihets required: - biometric_token - device_id security: [] /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/admin/v1/beneficiary/register: post: summary: 'Register a new beneficiary' operationId: registerANewBeneficiary description: '' parameters: [] responses: 201: description: '' content: application/json: schema: type: object example: message: 'Beneficiary registered successfully' data: id: 1 name: 'John Doe' email: john@example.com phone: '08012345678' nin: '12345678901' account_number: '1234567890' bank_name: GTBank bank_code: '058' address: '123 Main Street, Lagos' status: active token: 1|abc123def456... properties: message: type: string example: 'Beneficiary registered successfully' data: type: object properties: id: type: integer example: 1 name: type: string example: 'John Doe' email: type: string example: john@example.com phone: type: string example: '08012345678' nin: type: string example: '12345678901' account_number: type: string example: '1234567890' bank_name: type: string example: GTBank bank_code: type: string example: '058' address: type: string example: '123 Main Street, Lagos' status: type: string example: active token: type: string example: 1|abc123def456... 422: description: '' content: application/json: schema: type: object example: message: 'Validation error' details: phone: - 'The phone has already been taken.' properties: message: type: string example: 'Validation error' details: type: object properties: phone: type: array example: - 'The phone has already been taken.' items: type: string tags: - Beneficiaries requestBody: required: true content: application/json: schema: type: object properties: name: type: string description: 'The full name of the beneficiary.' example: 'John Doe' email: type: string description: 'optional The email address of the beneficiary.' example: john@example.com phone: type: string description: 'The phone number of the beneficiary.' example: '08012345678' nin: type: string description: 'The National Identification Number.' example: '12345678901' account_number: type: string description: 'The bank account number.' example: '1234567890' bank_name: type: string description: 'The name of the bank.' example: GTBank bank_code: type: string description: 'The bank code.' example: '058' address: type: string description: 'The residential address.' example: '123 Main Street, Lagos' average_yearly_income: type: numeric description: 'optional Average yearly income in Naira.' example: '500000' max_qualification: type: string description: 'optional Highest educational qualification.' example: "Bachelor's Degree" occupation: type: string description: 'optional Current occupation.' example: Teacher password: type: string description: 'The password for the account.' example: password123 password_confirmation: type: string description: 'Password confirmation.' example: password123 required: - name - phone - nin - account_number - bank_name - bank_code - address - password - password_confirmation security: [] /api/admin/v1/beneficiary/login: post: summary: 'Login a beneficiary' operationId: loginABeneficiary description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Login successful' data: beneficiary: id: 1 name: 'John Doe' email: john@example.com phone: '08012345678' status: active token: 1|abc123def456... properties: message: type: string example: 'Login successful' data: type: object properties: beneficiary: type: object properties: id: type: integer example: 1 name: type: string example: 'John Doe' email: type: string example: john@example.com phone: type: string example: '08012345678' status: type: string example: active token: type: string example: 1|abc123def456... 401: description: '' content: application/json: schema: type: object example: message: 'Invalid credentials' details: [] properties: message: type: string example: 'Invalid credentials' details: type: array example: [] tags: - Beneficiaries requestBody: required: true content: application/json: schema: type: object properties: phone: type: string description: 'The phone number of the beneficiary.' example: '08012345678' password: type: string description: 'The password.' example: password123 required: - phone - password security: [] /api/admin/v1/beneficiary/logout: post: summary: 'Logout the authenticated beneficiary' operationId: logoutTheAuthenticatedBeneficiary description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Logout successful' properties: message: type: string example: 'Logout successful' tags: - Beneficiaries security: [] /api/admin/v1/beneficiary/profile: get: summary: 'Get authenticated beneficiary profile' operationId: getAuthenticatedBeneficiaryProfile description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Profile retrieved successfully' data: id: 1 name: 'John Doe' email: john@example.com phone: '08012345678' nin: '12345678901' account_number: '1234567890' bank_name: GTBank address: '123 Main Street, Lagos' status: active total_disbursed: '150000.00' disbursements_count: 3 properties: message: type: string example: 'Profile retrieved successfully' data: type: object properties: id: type: integer example: 1 name: type: string example: 'John Doe' email: type: string example: john@example.com phone: type: string example: '08012345678' nin: type: string example: '12345678901' account_number: type: string example: '1234567890' bank_name: type: string example: GTBank address: type: string example: '123 Main Street, Lagos' status: type: string example: active total_disbursed: type: string example: '150000.00' disbursements_count: type: integer example: 3 tags: - Beneficiaries security: [] /api/admin/v1/beneficiary/biometric/authenticate: post: summary: 'Authenticate beneficiary using biometric token' operationId: authenticateBeneficiaryUsingBiometricToken description: '' parameters: [] responses: { } tags: - 'Beneficiaries - Biometric Authentication' requestBody: required: true content: application/json: schema: type: object properties: biometric_token: type: string description: '' example: alias device_id: type: string description: 'Must not be greater than 255 characters.' example: hqwi required: - biometric_token - device_id security: [] /api/admin/v1/beneficiary/biometric/enable: post: summary: 'Enable biometric authentication for beneficiary' operationId: enableBiometricAuthenticationForBeneficiary description: '' parameters: [] responses: { } tags: - 'Beneficiaries - Biometric Authentication' requestBody: required: true content: application/json: schema: type: object properties: device_id: type: string description: 'Must not be greater than 255 characters.' example: dhlrbsgmcoadymemwjomys device_name: type: string description: 'Must not be greater than 255 characters.' example: vicwknjqkidcswk biometric_type: type: string description: '' example: fingerprint enum: - fingerprint - face_id - both public_key: type: string description: '' example: perferendis required: - device_id - biometric_type - public_key security: [] /api/admin/v1/beneficiary/biometric/disable: post: summary: 'Disable biometric authentication for current device' operationId: disableBiometricAuthenticationForCurrentDevice description: '' parameters: [] responses: { } tags: - 'Beneficiaries - Biometric Authentication' requestBody: required: true content: application/json: schema: type: object properties: device_id: type: string description: 'Must not be greater than 255 characters.' example: kblanzxuzr required: - device_id security: [] /api/admin/v1/beneficiary/biometric/devices: get: summary: 'Get all biometric devices for beneficiary' operationId: getAllBiometricDevicesForBeneficiary 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: - 'Beneficiaries - Biometric Authentication' security: [] '/api/admin/v1/beneficiary/biometric/devices/{deviceId}': delete: summary: 'Revoke biometric authentication for a device' operationId: revokeBiometricAuthenticationForADevice description: '' parameters: [] responses: { } tags: - 'Beneficiaries - Biometric Authentication' security: [] parameters: - in: path name: deviceId description: '' example: ut required: true schema: type: string /api/admin/v1/beneficiary/phone/send-verification: post: summary: "Send verification code to beneficiary's phone" operationId: sendVerificationCodeToBeneficiarysPhone description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Verification code sent to your phone number' data: phone: '08012345678' expires_in_minutes: 10 properties: message: type: string example: 'Verification code sent to your phone number' data: type: object properties: phone: type: string example: '08012345678' expires_in_minutes: type: integer example: 10 400: description: '' content: application/json: schema: type: object example: message: 'Beneficiary not found or account not active' properties: message: type: string example: 'Beneficiary not found or account not active' 429: description: '' content: application/json: schema: type: object example: message: 'Please wait before requesting another code' data: retry_after_minutes: 5 properties: message: type: string example: 'Please wait before requesting another code' data: type: object properties: retry_after_minutes: type: integer example: 5 tags: - 'Beneficiary - Phone Verification' requestBody: required: true content: application/json: schema: type: object properties: phone: type: string description: 'The phone number to verify.' example: '08012345678' required: - phone security: [] /api/admin/v1/beneficiary/phone/verify: post: summary: 'Verify phone number with OTP code' operationId: verifyPhoneNumberWithOTPCode description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Phone number verified successfully' data: phone: '08012345678' verified_at: '2024-01-01T12:00:00.000000Z' properties: message: type: string example: 'Phone number verified successfully' data: type: object properties: phone: type: string example: '08012345678' verified_at: type: string example: '2024-01-01T12:00:00.000000Z' 400: description: '' content: application/json: schema: type: object example: message: 'Invalid or expired verification code' properties: message: type: string example: 'Invalid or expired verification code' tags: - 'Beneficiary - Phone Verification' requestBody: required: true content: application/json: schema: type: object properties: phone: type: string description: 'The phone number to verify.' example: '08012345678' otp: type: string description: 'The verification code received via SMS.' example: '1234' required: - phone - otp security: [] /api/admin/v1/beneficiary/phone/status: post: summary: 'Check phone verification status' operationId: checkPhoneVerificationStatus description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Phone verification status retrieved' data: phone: '08012345678' is_verified: true verified_at: '2024-01-01T12:00:00.000000Z' properties: message: type: string example: 'Phone verification status retrieved' data: type: object properties: phone: type: string example: '08012345678' is_verified: type: boolean example: true verified_at: type: string example: '2024-01-01T12:00:00.000000Z' tags: - 'Beneficiary - Phone Verification' requestBody: required: true content: application/json: schema: type: object properties: phone: type: string description: 'The phone number to check.' example: '08012345678' required: - phone security: [] /api/admin/v1/beneficiary/phone/resend-verification: post: summary: 'Resend verification code (protected route)' operationId: resendVerificationCodeprotectedRoute description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Verification code sent to your phone number' data: phone: '08012345678' expires_in_minutes: 10 properties: message: type: string example: 'Verification code sent to your phone number' data: type: object properties: phone: type: string example: '08012345678' expires_in_minutes: type: integer example: 10 tags: - 'Beneficiary - Phone Verification' /api/agent/chat/conversations: get: summary: 'Get all conversations for the authenticated agent.' operationId: getAllConversationsForTheAuthenticatedAgent description: '' parameters: [] responses: { } tags: - Chat security: [] post: summary: 'Create a new conversation with an admin.' operationId: createANewConversationWithAnAdmin description: '' parameters: [] responses: { } tags: - Chat requestBody: required: true content: application/json: schema: type: object properties: admin_id: type: string description: '' example: et title: type: string description: 'Must not be greater than 255 characters.' example: exuejyucmywrjmkeabwayak required: - admin_id security: [] '/api/agent/chat/conversations/{id}': get: summary: 'Get a specific conversation.' operationId: getASpecificConversation description: '' parameters: [] responses: { } tags: - Chat security: [] parameters: - in: path name: id description: 'The ID of the conversation.' example: delectus required: true schema: type: string '/api/agent/chat/conversations/{id}/messages': get: summary: 'Get messages for a conversation.' operationId: getMessagesForAConversation description: '' parameters: [] responses: { } tags: - Chat security: [] post: summary: 'Send a message in a conversation.' operationId: sendAMessageInAConversation description: '' parameters: [] responses: { } tags: - Chat requestBody: required: true content: application/json: schema: type: object properties: message: type: string description: '' example: nihil attachments: type: object description: '' example: null properties: { } required: - message security: [] parameters: - in: path name: id description: 'The ID of the conversation.' example: veritatis 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: - Chat security: [] /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/webhook/paystack: post: summary: '' operationId: postApiWebhookPaystack description: '' parameters: [] responses: { } tags: - Endpoints security: [] /api/webhook/9psb: post: summary: '' operationId: postApiWebhook9psb description: '' parameters: [] responses: { } tags: - Endpoints security: [] /api/traders/biometric/enable: post: summary: 'Enable biometric authentication for trader' operationId: enableBiometricAuthenticationForTrader description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Biometric authentication enabled successfully' data: device_id: abc123def456 biometric_token: token123... biometric_type: fingerprint enabled_at: '2024-01-01T12:00:00.000000Z' properties: message: type: string example: 'Biometric authentication enabled successfully' data: type: object properties: device_id: type: string example: abc123def456 biometric_token: type: string example: token123... biometric_type: type: string example: fingerprint enabled_at: type: string example: '2024-01-01T12:00:00.000000Z' tags: - Endpoints requestBody: required: true content: application/json: schema: type: object properties: device_id: type: string description: 'Unique device identifier.' example: abc123def456 device_name: type: string description: 'optional Human-readable device name.' example: 'iPhone 13 Pro' biometric_type: type: string description: 'Type of biometric.' example: fingerprint public_key: type: string description: 'Device public key for encryption.' example: '-----BEGIN PUBLIC KEY-----...' required: - device_id - biometric_type - public_key security: [] /api/traders/biometric/disable: post: summary: 'Disable biometric authentication for current device' operationId: disableBiometricAuthenticationForCurrentDevice description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Biometric authentication disabled successfully' properties: message: type: string example: 'Biometric authentication disabled successfully' tags: - Endpoints requestBody: required: true content: application/json: schema: type: object properties: device_id: type: string description: 'Device identifier to disable.' example: abc123def456 required: - device_id security: [] /api/traders/biometric/devices: get: summary: 'Get all biometric devices for trader' operationId: getAllBiometricDevicesForTrader description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Devices retrieved successfully' data: - device_id: abc123def456 device_name: 'iPhone 13 Pro' biometric_type: fingerprint is_enabled: true last_used_at: '2024-01-01T12:00:00.000000Z' created_at: '2024-01-01T10:00:00.000000Z' is_expired: false properties: message: type: string example: 'Devices retrieved successfully' data: type: array example: - device_id: abc123def456 device_name: 'iPhone 13 Pro' biometric_type: fingerprint is_enabled: true last_used_at: '2024-01-01T12:00:00.000000Z' created_at: '2024-01-01T10:00:00.000000Z' is_expired: false items: type: object properties: device_id: type: string example: abc123def456 device_name: type: string example: 'iPhone 13 Pro' biometric_type: type: string example: fingerprint is_enabled: type: boolean example: true last_used_at: type: string example: '2024-01-01T12:00:00.000000Z' created_at: type: string example: '2024-01-01T10:00:00.000000Z' is_expired: type: boolean example: false tags: - Endpoints security: [] '/api/traders/biometric/devices/{deviceId}': delete: summary: 'Revoke biometric authentication for a device' operationId: revokeBiometricAuthenticationForADevice description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Device revoked successfully' properties: message: type: string example: 'Device revoked successfully' tags: - Endpoints security: [] parameters: - in: path name: deviceId description: '' example: sequi required: true schema: type: string - in: path name: device_id description: 'Device identifier to revoke.' example: abc123def456 required: true schema: type: string /api/traders/biometric/authenticate: post: summary: 'Authenticate trader using biometric token' operationId: authenticateTraderUsingBiometricToken description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Authentication successful' data: user: id: 1 name: 'John Doe' phone: '08012345678' token: 1|abc123... device_id: abc123def456 authenticated_at: '2024-01-01T12:00:00.000000Z' properties: message: type: string example: 'Authentication successful' data: type: object properties: user: type: object properties: id: type: integer example: 1 name: type: string example: 'John Doe' phone: type: string example: '08012345678' token: type: string example: 1|abc123... device_id: type: string example: abc123def456 authenticated_at: type: string example: '2024-01-01T12:00:00.000000Z' tags: - Endpoints requestBody: required: true content: application/json: schema: type: object properties: biometric_token: type: string description: 'Biometric token from device.' example: token123... device_id: type: string description: 'Device identifier.' example: abc123def456 required: - biometric_token - device_id 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/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/identity/bvn/verify: post: summary: 'Verify BVN' operationId: verifyBVN description: "Submit a user's BVN for verification." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: success: true message: 'BVN verified successfully' data: bvn: '12345678901' first_name: John last_name: Doe properties: success: type: boolean example: true message: type: string example: 'BVN verified successfully' data: type: object properties: bvn: type: string example: '12345678901' first_name: type: string example: John last_name: type: string example: Doe 422: description: '' content: application/json: schema: type: object example: success: false message: 'BVN verification failed' errors: detail: 'Invalid BVN number' properties: success: type: boolean example: false message: type: string example: 'BVN verification failed' errors: type: object properties: detail: type: string example: 'Invalid BVN number' tags: - 'Identity Verification' requestBody: required: true content: application/json: schema: type: object properties: bvn: type: string description: 'The 11-digit BVN.' example: '12345678901' first_name: type: string description: "The user's first name." example: John last_name: type: string description: "The user's last name." example: Doe date_of_birth: type: string description: "The user's date of birth in YYYY-MM-DD format." example: '1990-01-01' phone: type: string description: "The user's phone number." example: '08012345678' required: - bvn /api/identity/nin/verify: post: summary: 'Verify NIN' operationId: verifyNIN description: "Submit a user's NIN for verification." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: success: true message: 'NIN verified successfully' data: nin: '63184876213' first_name: Bunch last_name: Dillon properties: success: type: boolean example: true message: type: string example: 'NIN verified successfully' data: type: object properties: nin: type: string example: '63184876213' first_name: type: string example: Bunch last_name: type: string example: Dillon 422: description: '' content: application/json: schema: type: object example: success: false message: 'NIN verification failed' errors: detail: 'Invalid NIN number' properties: success: type: boolean example: false message: type: string example: 'NIN verification failed' errors: type: object properties: detail: type: string example: 'Invalid NIN number' tags: - 'Identity Verification' requestBody: required: true content: application/json: schema: type: object properties: nin: type: string description: 'The 11-digit NIN.' example: '63184876213' first_name: type: string description: "The user's first name." example: Bunch last_name: type: string description: "The user's last name." example: Dillon date_of_birth: type: string description: "The user's date of birth in YYYY-MM-DD format." example: '1990-01-01' phone: type: string description: "The user's phone number." example: '08000000000' required: - nin /api/identity/address/verify: post: summary: 'Verify Address' operationId: verifyAddress description: "Submit a user's address for verification." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: success: true message: 'Address verified successfully' data: address: '123 Main Street, Ikeja' state: Lagos verification_status: verified properties: success: type: boolean example: true message: type: string example: 'Address verified successfully' data: type: object properties: address: type: string example: '123 Main Street, Ikeja' state: type: string example: Lagos verification_status: type: string example: verified 422: description: '' content: application/json: schema: type: object example: success: false message: 'Address verification failed' properties: success: type: boolean example: false message: type: string example: 'Address verification failed' tags: - 'Identity Verification' requestBody: required: true content: application/json: schema: type: object properties: address: type: string description: 'The full address (max 500 chars).' example: '123 Main Street, Ikeja' state: type: string description: 'The state (max 100 chars).' example: Lagos lga: type: string description: 'The LGA (max 100 chars).' example: Ikeja landmark: type: string description: 'A nearby landmark (max 255 chars).' example: 'Near Shoprite' last_name: type: string description: 'Must not be greater than 255 characters.' example: mhryawvcm first_name: type: string description: 'Must not be greater than 255 characters.' example: dnkvmhfjynvwntcce phone: type: string description: 'Must not be greater than 20 characters.' example: cyoqzkmjd city: type: string description: 'Must not be greater than 100 characters.' example: qpnbkihfamgkvjwnldhkvi candidate_name: type: string description: 'The candidate name (max 255 chars).' example: 'John Doe' candidate_phone: type: string description: 'The candidate phone (max 20 chars).' example: '08012345678' required: - address - city /api/identity/utility-bill/verify: post: summary: 'Verify Utility Bill' operationId: verifyUtilityBill description: "Submit a user's utility bill for verification." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: success: true message: 'Utility bill verified successfully' data: bill_type: electricity verified: true properties: success: type: boolean example: true message: type: string example: 'Utility bill verified successfully' data: type: object properties: bill_type: type: string example: electricity verified: type: boolean example: true 422: description: '' content: application/json: schema: type: object example: success: false message: 'Utility bill verification failed' properties: success: type: boolean example: false message: type: string example: 'Utility bill verification failed' tags: - 'Identity Verification' requestBody: required: true content: multipart/form-data: schema: type: object properties: bill_type: type: string description: 'The bill type. Must be one of electricity, water, gas, internet, cable.' example: electricity bill_image: type: string format: binary description: 'The bill image file (jpeg, png, gif, or pdf).' account_number: type: string description: 'The account number (max 100 chars).' example: '1234567890' address: type: string description: 'The address (max 500 chars).' example: '123 Main Street' required: - bill_type - bill_image /api/identity/status: get: summary: 'Get verification status' operationId: getVerificationStatus description: "Retrieve the user's current identity verification statuses." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: success: true data: bvn_verified: true bvn_verified_at: '2025-11-01T01:30:00.000000Z' nin_verified: true nin_verified_at: '2025-11-01T01:35:00.000000Z' address_verified: false address_verified_at: null utility_bill_verified: false utility_bill_verified_at: null identity_verified: true properties: success: type: boolean example: true data: type: object properties: bvn_verified: type: boolean example: true bvn_verified_at: type: string example: '2025-11-01T01:30:00.000000Z' nin_verified: type: boolean example: true nin_verified_at: type: string example: '2025-11-01T01:35:00.000000Z' address_verified: type: boolean example: false address_verified_at: type: string example: null utility_bill_verified: type: boolean example: false utility_bill_verified_at: type: string example: null identity_verified: type: boolean example: true tags: - 'Identity Verification' /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/notifications/register-token: post: summary: 'Register a device token for push notifications' operationId: registerADeviceTokenForPushNotifications description: '' parameters: [] responses: { } tags: - Notifications requestBody: required: true content: application/json: schema: type: object properties: token: type: string description: 'Must not be greater than 255 characters.' example: wmzrrphnzwtpwwrsw 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: - Notifications requestBody: required: true content: application/json: schema: type: object properties: token: type: string description: 'Must not be greater than 255 characters.' example: fxwkzr 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: - Notifications security: [] post: summary: 'Update notification settings' operationId: updateNotificationSettings description: '' parameters: [] responses: { } tags: - Notifications requestBody: required: false content: application/json: schema: type: object properties: general_notifications: type: boolean description: '' example: false payment_notifications: type: boolean description: '' example: false system_notifications: type: boolean description: '' example: false security: [] /api/notifications/fcm-token: post: summary: "Save an FCM token for the authenticated user\n\n" operationId: saveAnFCMTokenForTheAuthenticatedUserasideClassnoticeThisAPIEndpointIsOnlyAccessibleByAuthenticatedUsersaside description: '' parameters: [] responses: 200: description: success content: application/json: schema: type: object example: message: 'FCM token saved successfully.' properties: message: type: string example: 'FCM token saved successfully.' 401: description: unauthenticated content: application/json: schema: type: object example: error: 'User not authenticated' properties: error: type: string example: 'User not authenticated' 422: description: validation_error content: application/json: schema: type: object example: error: 'The fcm token field is required.' properties: error: type: string example: 'The fcm token field is required.' tags: - Notifications requestBody: required: true content: application/json: schema: type: object properties: fcm_token: type: string description: '' example: quidem required: - fcm_token /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: - Notifications 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: - Notifications security: [] '/api/notifications/{id}/read': post: summary: 'Mark a notification as read' operationId: markANotificationAsRead description: '' parameters: [] responses: { } tags: - Notifications security: [] parameters: - in: path name: id description: 'The ID of the notification.' example: et required: true schema: type: string /api/notifications/read-all: post: summary: 'Mark all notifications as read' operationId: markAllNotificationsAsRead description: '' parameters: [] responses: { } tags: - Notifications security: [] '/api/notifications/{id}': delete: summary: 'Delete a notification' operationId: deleteANotification description: '' parameters: [] responses: { } tags: - Notifications security: [] parameters: - in: path name: id description: 'The ID of the notification.' example: dolore required: true schema: type: string /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/traders/balance: get: summary: 'Get the balance of the authenticated trader.' operationId: getTheBalanceOfTheAuthenticatedTrader description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: balance: 1000 properties: balance: type: integer example: 1000 404: description: '' content: application/json: schema: type: object example: message: 'Trader not found' properties: message: type: string example: 'Trader not found' tags: - Trader '/api/traders/transactions/{id}': get: summary: 'Get a single transaction of the authenticated trader.' operationId: getASingleTransactionOfTheAuthenticatedTrader description: '' parameters: [] responses: 200: description: '' content: text/plain: schema: type: string example: "{\n \"id\": 5,\n \"amount\": 230000,\n \"type\": \"deposit\",\n \"trader\": {\n \"id\": 1,\n \"phone\": \"08132221963\",\n \"full_name\": \"Super Admin\",\n \"other_name\": null,\n \"email\": \"sabisaveinfo@gmail.com\",\n \"dob\": \"2009-07-18\",\n \"gender\": \"male\",\n \"has_cooperative\": true,\n \"cooperative\": \"Aufderhar, Olson and Boehm\",\n \"username\": \"super-admin\",\n \"balance\": 1150000,\n \"account_number\": \"8139060545\",\n \"bank_details\": {\n \"id\": 17,\n \"bank_name\": \"Zenith Bank\",\n \"account_type\": \"savings\",\n \"account_number\": \"7102866199\",\n \"bank_code\": \"812\"\n },\n \"created_at\": \"2025-05-28 19:54:26\",\n \"updated_at\": \"2025-05-28 19:54:26\"\n },\n \"recipient\": \"trader\",\n \"status\": \"completed\",\n \"agent\": {\n \"id\": 1,\n \"trader_union\": \"aspernatur\",\n \"email\": \"sabisaveinfo@gmail.com\",\n \"username\": \"super-admin\",\n \"first_name\": \"Super\",\n \"last_name\": \"Admin\",\n \"phone\": \"08132221963\",\n \"gender\": \"female\",\n \"dob\": \"2011-09-06T00:00:00.000000Z\",\n \"country\": \"Nigeria\",\n \"state\": \"Akwa Ibom State\",\n \"lga\": \"Essien Udim\",\n \"address\": \"6801 Kuhn Path\\nPort Mittie, SD 68269-5146\",\n \"post_code\": \"57378\",\n \"profile\": \"https://via.placeholder.com/640x480.png/002266?text=quisquam\",\n \"agent_number\": \"08132221963\",\n \"balance\": 1150000,\n \"bank_details\": {\n \"id\": 1,\n \"bank_name\": \"GTB\",\n \"account_type\": \"savings\",\n \"account_number\": \"4560815\",\n \"bank_code\": \"058\"\n }\n },\n \"created_at\": \"2025-06-03 10:36:00\",\n \"updated_at\": \"2025-06-03 10:36:00\",\n \"reference\": null" tags: - Trader parameters: - in: path name: id description: 'The ID of the transaction.' example: '1' required: true schema: type: string /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/search: get: summary: 'Search traders' operationId: searchTraders description: 'Searches for traders by name, email, phone, or location.' parameters: - in: query name: search description: 'Search by name, email, phone .' example: John required: false schema: type: string description: 'Search by name, email, phone .' example: John responses: 200: description: '' content: application/json: schema: type: object example: timestamp: '2023-01-01T12:00:00.000000Z' status: true message: 'Traders found' data: traders: current_page: 1 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 first_page_url: 'http://example.com/api/admin/traders?page=1' from: 1 last_page: 5 last_page_url: 'http://example.com/api/admin/traders?page=5' links: [] next_page_url: 'http://example.com/api/admin/traders?page=2' path: 'http://example.com/api/admin/traders' per_page: 10 prev_page_url: null 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 found' data: type: object properties: traders: type: object properties: current_page: type: integer example: 1 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 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 first_page_url: type: string example: 'http://example.com/api/admin/traders?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?page=5' links: type: array example: [] next_page_url: type: string example: 'http://example.com/api/admin/traders?page=2' path: type: string example: 'http://example.com/api/admin/traders' per_page: type: integer example: 10 prev_page_url: type: string example: null to: type: integer example: 10 total: type: integer example: 50 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/traders/transactions: get: summary: 'Display a listing of the resource.' operationId: displayAListingOfTheResource description: 'Retrieves a paginated list of transactions for the authenticated trader.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: data: - id: 5 amount: 230000 type: deposit trader: id: 1 phone: '08132221963' full_name: 'Super Admin' other_name: null email: sabisaveinfo@gmail.com dob: '2009-07-18' gender: male has_cooperative: true cooperative: 'Aufderhar, Olson and Boehm' username: super-admin balance: 1150000 account_number: '8139060545' bank_details: id: 17 bank_name: 'Zenith Bank' account_type: savings account_number: '7102866199' bank_code: '812' created_at: '2025-05-28 19:54:26' updated_at: '2025-05-28 19:54:26' recipient: trader status: completed agent: id: 1 trader_union: aspernatur email: sabisaveinfo@gmail.com username: super-admin first_name: Super last_name: Admin phone: '08132221963' gender: female dob: '2011-09-06T00:00:00.000000Z' country: Nigeria state: 'Akwa Ibom State' lga: 'Essien Udim' address: "6801 Kuhn Path\nPort Mittie, SD 68269-5146" post_code: '57378' profile: 'https://via.placeholder.com/640x480.png/002266?text=quisquam' agent_number: '08132221963' balance: 1150000 bank_details: id: 1 bank_name: GTB account_type: savings account_number: '4560815' bank_code: '058' created_at: '2025-06-03 10:36:00' updated_at: '2025-06-03 10:36:00' reference: null links: first: 'http://example.com?page=1' last: 'http://example.com?page=10' prev: null next: 'http://example.com?page=2' meta: current_page: 1 from: 1 last_page: 10 path: 'http://example.com' per_page: 25 to: 25 total: 250 properties: data: type: array example: - id: 5 amount: 230000 type: deposit trader: id: 1 phone: '08132221963' full_name: 'Super Admin' other_name: null email: sabisaveinfo@gmail.com dob: '2009-07-18' gender: male has_cooperative: true cooperative: 'Aufderhar, Olson and Boehm' username: super-admin balance: 1150000 account_number: '8139060545' bank_details: id: 17 bank_name: 'Zenith Bank' account_type: savings account_number: '7102866199' bank_code: '812' created_at: '2025-05-28 19:54:26' updated_at: '2025-05-28 19:54:26' recipient: trader status: completed agent: id: 1 trader_union: aspernatur email: sabisaveinfo@gmail.com username: super-admin first_name: Super last_name: Admin phone: '08132221963' gender: female dob: '2011-09-06T00:00:00.000000Z' country: Nigeria state: 'Akwa Ibom State' lga: 'Essien Udim' address: "6801 Kuhn Path\nPort Mittie, SD 68269-5146" post_code: '57378' profile: 'https://via.placeholder.com/640x480.png/002266?text=quisquam' agent_number: '08132221963' balance: 1150000 bank_details: id: 1 bank_name: GTB account_type: savings account_number: '4560815' bank_code: '058' created_at: '2025-06-03 10:36:00' updated_at: '2025-06-03 10:36:00' reference: null items: type: object properties: id: type: integer example: 5 amount: type: integer example: 230000 type: type: string example: deposit trader: type: object properties: id: type: integer example: 1 phone: type: string example: '08132221963' full_name: type: string example: 'Super Admin' other_name: type: string example: null email: type: string example: sabisaveinfo@gmail.com dob: type: string example: '2009-07-18' gender: type: string example: male has_cooperative: type: boolean example: true cooperative: type: string example: 'Aufderhar, Olson and Boehm' username: type: string example: super-admin balance: type: integer example: 1150000 account_number: type: string example: '8139060545' bank_details: type: object properties: id: type: integer example: 17 bank_name: type: string example: 'Zenith Bank' account_type: type: string example: savings account_number: type: string example: '7102866199' bank_code: type: string example: '812' created_at: type: string example: '2025-05-28 19:54:26' updated_at: type: string example: '2025-05-28 19:54:26' recipient: type: string example: trader status: type: string example: completed agent: type: object properties: id: type: integer example: 1 trader_union: type: string example: aspernatur email: type: string example: sabisaveinfo@gmail.com username: type: string example: super-admin first_name: type: string example: Super last_name: type: string example: Admin phone: type: string example: '08132221963' gender: type: string example: female dob: type: string example: '2011-09-06T00:00:00.000000Z' country: type: string example: Nigeria state: type: string example: 'Akwa Ibom State' lga: type: string example: 'Essien Udim' address: type: string example: "6801 Kuhn Path\nPort Mittie, SD 68269-5146" post_code: type: string example: '57378' profile: type: string example: 'https://via.placeholder.com/640x480.png/002266?text=quisquam' agent_number: type: string example: '08132221963' balance: type: integer example: 1150000 bank_details: 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: '4560815' bank_code: type: string example: '058' created_at: type: string example: '2025-06-03 10:36:00' updated_at: type: string example: '2025-06-03 10:36:00' reference: type: string example: null links: type: object properties: first: type: string example: 'http://example.com?page=1' last: type: string example: 'http://example.com?page=10' prev: type: string example: null next: type: string example: 'http://example.com?page=2' meta: type: object properties: current_page: type: integer example: 1 from: type: integer example: 1 last_page: type: integer example: 10 path: type: string example: 'http://example.com' per_page: type: integer example: 25 to: type: integer example: 25 total: type: integer example: 250 tags: - 'Trader Transactions' /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/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/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/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/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/delete-account/{id}': post: 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: - Traders parameters: - in: path name: id description: 'The ID of the trader.' example: 1 required: true schema: type: integer /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/{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/traders/savings-plan: get: summary: "Get Trader's Current Savings Plan" operationId: getTradersCurrentSavingsPlan description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Savings plan retrieved successfully' data: id: 1 frequency: daily amount: '1000' trader_id: 1 created_at: '2024-08-15T06:30:00.000000Z' updated_at: '2024-08-15T06:30:00.000000Z' properties: message: type: string example: 'Savings plan retrieved successfully' data: type: object properties: id: type: integer example: 1 frequency: type: string example: daily amount: type: string example: '1000' trader_id: type: integer example: 1 created_at: type: string example: '2024-08-15T06:30:00.000000Z' updated_at: type: string example: '2024-08-15T06:30:00.000000Z' 404: description: '' content: application/json: schema: type: object example: message: 'No savings plan found' properties: message: type: string example: 'No savings plan found' tags: - Traders post: summary: "Create Savings Plan (for traders who don't have one)" operationId: createSavingsPlanforTradersWhoDontHaveOne description: '' parameters: [] responses: 201: description: '' content: application/json: schema: type: object example: message: 'Savings plan created successfully' data: id: 1 frequency: daily amount: '1000' trader_id: 1 created_at: '2024-08-15T06:30:00.000000Z' updated_at: '2024-08-15T06:30:00.000000Z' properties: message: type: string example: 'Savings plan created successfully' data: type: object properties: id: type: integer example: 1 frequency: type: string example: daily amount: type: string example: '1000' trader_id: type: integer example: 1 created_at: type: string example: '2024-08-15T06:30:00.000000Z' updated_at: type: string example: '2024-08-15T06:30:00.000000Z' 409: description: '' content: application/json: schema: type: object example: message: 'Savings plan already exists' properties: message: type: string example: 'Savings plan already exists' tags: - Traders requestBody: required: true content: application/json: schema: type: object properties: frequency: type: string description: 'The frequency of savings (daily, weekly, monthly).' example: daily amount: type: numeric description: 'The amount to save (minimum 100).' example: '1000' required: - frequency - amount put: summary: "Update Trader's Savings Plan" operationId: updateTradersSavingsPlan description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Savings plan updated successfully' data: id: 1 frequency: weekly amount: '2000' trader_id: 1 created_at: '2024-08-15T06:30:00.000000Z' updated_at: '2024-08-15T06:45:00.000000Z' properties: message: type: string example: 'Savings plan updated successfully' data: type: object properties: id: type: integer example: 1 frequency: type: string example: weekly amount: type: string example: '2000' trader_id: type: integer example: 1 created_at: type: string example: '2024-08-15T06:30:00.000000Z' updated_at: type: string example: '2024-08-15T06:45:00.000000Z' 404: description: '' content: application/json: schema: type: object example: message: 'No savings plan found' properties: message: type: string example: 'No savings plan found' 422: description: '' content: application/json: schema: type: object example: message: 'Validation failed' details: frequency: - 'The selected frequency is invalid.' amount: - 'The amount must be at least 100.' properties: message: type: string example: 'Validation failed' details: type: object properties: frequency: type: array example: - 'The selected frequency is invalid.' items: type: string amount: type: array example: - 'The amount must be at least 100.' items: type: string tags: - Traders requestBody: required: true content: application/json: schema: type: object properties: frequency: type: string description: 'The frequency of savings (daily, weekly, monthly).' example: weekly amount: type: numeric description: 'The amount to save (minimum 100).' example: '2000' required: - frequency - amount delete: summary: "Delete Trader's Savings Plan" operationId: deleteTradersSavingsPlan description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: message: 'Savings plan deleted successfully' properties: message: type: string example: 'Savings plan deleted successfully' 404: description: '' content: application/json: schema: type: object example: message: 'No savings plan found' properties: message: type: string example: 'No savings plan found' tags: - Traders /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/traders/register: post: summary: 'Step 1: Create Trader Account (Simplified Registration)' operationId: step1CreateTraderAccountSimplifiedRegistration description: "This is the first step of the new simplified 4-step registration process.\nCreates a trader account with basic information and sends OTP for verification." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: status: 1 message: 'Registration successful. OTP sent to your phone number for verification' data: id: 4 first_name: John last_name: Smith phone: '+2348013221673' dob: '2000-01-15' account_number: '8013221673' created_at: '2024-01-01T12:00:00.000000Z' properties: status: type: integer example: 1 message: type: string example: 'Registration successful. OTP sent to your phone number for verification' data: type: object properties: id: type: integer example: 4 first_name: type: string example: John last_name: type: string example: Smith phone: type: string example: '+2348013221673' dob: type: string example: '2000-01-15' account_number: type: string example: '8013221673' created_at: type: string example: '2024-01-01T12:00:00.000000Z' 422: description: '' content: application/json: schema: type: object example: status: 0 message: 'Validation failed' errors: first_name: - 'The first name field is required.' phone: - 'The phone number format is invalid.' - 'The phone has already been taken.' dob: - 'The date of birth must be before today.' properties: status: type: integer example: 0 message: type: string example: 'Validation failed' errors: type: object properties: first_name: type: array example: - 'The first name field is required.' items: type: string phone: type: array example: - 'The phone number format is invalid.' - 'The phone has already been taken.' items: type: string dob: type: array example: - 'The date of birth must be before today.' items: type: string 500: description: '' content: application/json: schema: type: object example: status: 0 message: 'Unable to create user' code: 500 properties: status: type: integer example: 0 message: type: string example: 'Unable to create user' code: type: integer example: 500 tags: - Updates requestBody: required: true content: application/json: schema: type: object properties: 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: Smith phone: type: string description: 'The phone number (Nigerian format).' example: '+2348013221673' dob: type: date description: 'The date of birth (must be in the past).' example: '2000-01-15' required: - first_name - last_name - phone - dob security: [] parameters: - in: path name: none description: 'Optional parameter.' required: true schema: type: string examples: omitted: summary: 'When the value is omitted' value: '' present: summary: 'When the value is present' value: saepe /api/traders/verify-phone: post: summary: 'Step 2: Verify Phone Number (Simplified Registration)' operationId: step2VerifyPhoneNumberSimplifiedRegistration description: "Verifies the OTP code sent to the trader's phone number.\nThis is the second step in the simplified registration process.\nAfter successful verification, the user can proceed to create their PIN." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: status: 1 message: 'Verification successful' data: trader_id: 1 phone: '+2348012345678' verified_at: '2024-01-01T12:05:00.000000Z' properties: status: type: integer example: 1 message: type: string example: 'Verification successful' data: type: object properties: trader_id: type: integer example: 1 phone: type: string example: '+2348012345678' verified_at: type: string example: '2024-01-01T12:05:00.000000Z' 400: description: '' content: application/json: schema: type: object example: status: 0 message: 'Invalid or expired verification code' code: 400 properties: status: type: integer example: 0 message: type: string example: 'Invalid or expired verification code' code: type: integer example: 400 404: description: '' content: application/json: schema: type: object example: status: 0 message: 'Trader not found' code: 404 properties: status: type: integer example: 0 message: type: string example: 'Trader not found' code: type: integer example: 404 422: description: '' content: application/json: schema: type: object example: status: 0 message: 'Validation failed' errors: phone: - 'The phone field is required.' - 'The selected phone is invalid.' token: - 'The token field is required.' - 'The token must be numeric.' properties: status: type: integer example: 0 message: type: string example: 'Validation failed' errors: type: object properties: phone: type: array example: - 'The phone field is required.' - 'The selected phone is invalid.' items: type: string token: type: array example: - 'The token field is required.' - 'The token must be numeric.' items: type: string 500: description: '' content: application/json: schema: type: object example: status: 0 message: 'Verification failed' code: 500 properties: status: type: integer example: 0 message: type: string example: 'Verification failed' code: type: integer example: 500 tags: - Updates 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 6-digit verification code.' example: '123456' required: - phone - token security: [] parameters: - in: path name: none description: 'Optional parameter.' required: true schema: type: string examples: omitted: summary: 'When the value is omitted' value: '' present: summary: 'When the value is present' value: voluptatem /api/traders/resend-verification: post: summary: 'Step 2a: Resend Phone Verification Code (Simplified Registration)' operationId: step2aResendPhoneVerificationCodeSimplifiedRegistration description: "Resends the OTP verification code to the trader's phone number.\nUsed when the initial OTP expires or is not received." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: status: 1 message: 'Verification code sent successfully' data: [] properties: status: type: integer example: 1 message: type: string example: 'Verification code sent successfully' data: type: array example: [] 404: description: '' content: application/json: schema: type: object example: status: 0 message: 'Trader not found' code: 404 properties: status: type: integer example: 0 message: type: string example: 'Trader not found' code: type: integer example: 404 422: description: '' content: application/json: schema: type: object example: status: 0 message: 'Validation failed' errors: phone: - 'The phone field is required.' - 'The selected phone is invalid.' properties: status: type: integer example: 0 message: type: string example: 'Validation failed' errors: type: object properties: phone: type: array example: - 'The phone field is required.' - 'The selected phone is invalid.' items: type: string 500: description: '' content: application/json: schema: type: object example: status: 0 message: 'Failed to send verification code' code: 500 properties: status: type: integer example: 0 message: type: string example: 'Failed to send verification code' code: type: integer example: 500 tags: - Updates 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: [] parameters: - in: path name: none description: 'Optional parameter.' required: true schema: type: string examples: omitted: summary: 'When the value is omitted' value: '' present: summary: 'When the value is present' value: ipsam /api/traders/create-pin: post: summary: 'Step 3: Create PIN and Complete Registration (Simplified Registration)' operationId: step3CreatePINAndCompleteRegistrationSimplifiedRegistration description: "This is the final step of the simplified registration process.\nCreates the trader's 4-digit PIN and completes account setup.\nAfter this step, the account is fully created and ready for use." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: status: 1 message: 'Account created successfully' data: trader: id: 1 first_name: John last_name: Smith phone: '+2348012345678' account_number: '8012345678' dob: '2000-01-15' created_at: '2024-01-01T12:00:00.000000Z' phone_number_verified_at: '2024-01-01T12:05:00.000000Z' properties: status: type: integer example: 1 message: type: string example: 'Account created 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: Smith phone: type: string example: '+2348012345678' account_number: type: string example: '8012345678' dob: type: string example: '2000-01-15' created_at: type: string example: '2024-01-01T12:00:00.000000Z' phone_number_verified_at: type: string example: '2024-01-01T12:05:00.000000Z' 403: description: '' content: application/json: schema: type: object example: status: 0 message: 'Phone number not verified' code: 403 properties: status: type: integer example: 0 message: type: string example: 'Phone number not verified' code: type: integer example: 403 404: description: '' content: application/json: schema: type: object example: status: 0 message: 'Trader not found' code: 404 properties: status: type: integer example: 0 message: type: string example: 'Trader not found' code: type: integer example: 404 422: description: '' content: application/json: schema: type: object example: status: 0 message: 'Validation failed' errors: pin: - 'The pin field is required.' - 'The pin must be exactly 4 digits.' pin_confirmation: - 'The pin confirmation does not match.' properties: status: type: integer example: 0 message: type: string example: 'Validation failed' errors: type: object properties: pin: type: array example: - 'The pin field is required.' - 'The pin must be exactly 4 digits.' items: type: string pin_confirmation: type: array example: - 'The pin confirmation does not match.' items: type: string 500: description: '' content: application/json: schema: type: object example: status: 0 message: 'Failed to create PIN' code: 500 properties: status: type: integer example: 0 message: type: string example: 'Failed to create PIN' code: type: integer example: 500 tags: - Updates requestBody: required: true content: application/json: schema: type: object properties: pin: type: string description: '4-digit transaction PIN.' example: '1234' pin_confirmation: type: string description: 'PIN confirmation (must match pin).' example: '1234' trader_id: type: numeric description: 'The ID of the trader from step 1.' example: '1' required: - pin - pin_confirmation - trader_id security: [] parameters: - in: path name: none description: 'Optional parameter.' required: true schema: type: string examples: omitted: summary: 'When the value is omitted' value: '' present: summary: 'When the value is present' value: exercitationem /api/agents/register: post: summary: 'Step 1: Agent Account Setup (Simplified Registration)' operationId: step1AgentAccountSetupSimplifiedRegistration description: "Creates a new agent account with basic information and sends OTP verification.\nThis is the first step in the simplified 4-step registration process." parameters: [] responses: 201: description: '' content: application/json: schema: type: object example: status: 1 message: 'Agent registration successful. Please verify your phone number.' data: id: 1 first_name: John last_name: Doe phone: '+2348012345678' dob: '1990-01-15' account_number: '8012345678' phone_verified_at: null created_at: '2025-01-02T10:30:00.000000Z' updated_at: '2025-01-02T10:30:00.000000Z' properties: status: type: integer example: 1 message: type: string example: 'Agent registration successful. Please verify your phone number.' data: type: object properties: id: type: integer example: 1 first_name: type: string example: John last_name: type: string example: Doe phone: type: string example: '+2348012345678' dob: type: string example: '1990-01-15' account_number: type: string example: '8012345678' phone_verified_at: type: string example: null created_at: type: string example: '2025-01-02T10:30:00.000000Z' updated_at: type: string example: '2025-01-02T10:30:00.000000Z' 422: description: '' content: application/json: schema: type: object example: status: 0 message: 'Validation failed' errors: phone: - 'The phone has already been taken.' properties: status: type: integer example: 0 message: type: string example: 'Validation failed' errors: type: object properties: phone: type: array example: - 'The phone has already been taken.' items: type: string tags: - Updates requestBody: required: true content: application/json: schema: type: object properties: first_name: type: string description: 'The first name of the agent.' example: John last_name: type: string description: 'The last name of the agent.' example: Doe phone: type: string description: 'The phone number of the agent.' example: '+2348012345678' dob: type: date description: 'The date of birth of the agent.' example: '1990-01-15' required: - first_name - last_name - phone - dob security: [] parameters: - in: path name: none description: 'Optional parameter.' required: true schema: type: string examples: omitted: summary: 'When the value is omitted' value: '' present: summary: 'When the value is present' value: voluptatibus /api/agents/create-pin: post: summary: 'Step 3: Create Agent PIN (Simplified Registration)' operationId: step3CreateAgentPINSimplifiedRegistration description: "Creates a 4-digit PIN for the agent and completes the registration process.\nThis is the final step in the simplified registration flow." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: status: 1 message: 'PIN created successfully. Agent registration completed.' data: id: 1 first_name: John last_name: Doe phone: '+2348012345678' dob: '1990-01-15' account_number: '8012345678' phone_verified_at: '2025-01-02T10:35:00.000000Z' created_at: '2025-01-02T10:30:00.000000Z' updated_at: '2025-01-02T10:35:00.000000Z' properties: status: type: integer example: 1 message: type: string example: 'PIN created successfully. Agent registration completed.' data: type: object properties: id: type: integer example: 1 first_name: type: string example: John last_name: type: string example: Doe phone: type: string example: '+2348012345678' dob: type: string example: '1990-01-15' account_number: type: string example: '8012345678' phone_verified_at: type: string example: '2025-01-02T10:35:00.000000Z' created_at: type: string example: '2025-01-02T10:30:00.000000Z' updated_at: type: string example: '2025-01-02T10:35:00.000000Z' 404: description: '' content: application/json: schema: type: object example: status: 0 message: 'Agent not found or phone not verified' properties: status: type: integer example: 0 message: type: string example: 'Agent not found or phone not verified' 422: description: '' content: application/json: schema: type: object example: status: 0 message: 'Validation failed' errors: pin: - 'The pin confirmation does not match.' properties: status: type: integer example: 0 message: type: string example: 'Validation failed' errors: type: object properties: pin: type: array example: - 'The pin confirmation does not match.' items: type: string tags: - Updates requestBody: required: true content: application/json: schema: type: object properties: phone: type: string description: 'The phone number of the agent.' example: '+2348012345678' pin: type: string description: 'The 4-digit PIN.' example: '1234' pin_confirmation: type: string description: 'The PIN confirmation.' example: '1234' required: - phone - pin - pin_confirmation security: [] parameters: - in: path name: none description: 'Optional parameter.' required: true schema: type: string examples: omitted: summary: 'When the value is omitted' value: '' present: summary: 'When the value is present' value: impedit /api/agents/verify-phone: post: summary: 'Step 2: Phone Number Verification' operationId: step2PhoneNumberVerification description: "Verifies the OTP code sent to the agent's phone number during registration.\nThis is the second step in the simplified 4-step registration process." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: status: true message: 'Verification successful' data: [] properties: status: type: boolean example: true message: type: string example: 'Verification successful' data: type: array example: [] 400: description: '' content: application/json: schema: type: object example: status: false message: 'Invalid or expired verification code' data: [] properties: status: type: boolean example: false message: type: string example: 'Invalid or expired verification code' data: type: array example: [] 404: description: '' content: application/json: schema: type: object example: status: false message: 'Agent not found' data: [] properties: status: type: boolean example: false message: type: string example: 'Agent not found' data: type: array example: [] 500: description: '' content: application/json: schema: type: object example: status: false message: 'Failed to verify token' data: [] properties: status: type: boolean example: false message: type: string example: 'Failed to verify token' data: type: array example: [] tags: - Updates requestBody: required: true content: application/json: schema: type: object properties: phone: type: string description: 'The phone number of the agent.' example: '+2348012345678' token: type: string description: 'The 4-digit verification code.' example: '1234' required: - phone - token security: [] /api/agents/resend-verification: post: summary: 'Step 2a: Resend Phone Verification Code' operationId: step2aResendPhoneVerificationCode description: "Resends the OTP verification code to the agent's phone number during registration." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: status: true message: 'Verification code resent successfully' data: [] properties: status: type: boolean example: true message: type: string example: 'Verification code resent successfully' data: type: array example: [] 404: description: '' content: application/json: schema: type: object example: status: false message: 'Agent not found' data: [] properties: status: type: boolean example: false message: type: string example: 'Agent not found' data: type: array example: [] 500: description: '' content: application/json: schema: type: object example: status: false message: 'Failed to resend verification code' data: [] properties: status: type: boolean example: false message: type: string example: 'Failed to resend verification code' data: type: array example: [] tags: - Updates requestBody: required: true content: application/json: schema: type: object properties: phone: type: string description: 'The phone number of the agent.' example: '+2348012345678' required: - phone security: [] /api/agents/trader-onboarding/verify-phone: post: summary: 'Step 2: Phone Number Verification' operationId: step2PhoneNumberVerification description: "Verifies the OTP code sent to the agent's phone number during registration.\nThis is the second step in the simplified 4-step registration process." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: status: true message: 'Verification successful' data: [] properties: status: type: boolean example: true message: type: string example: 'Verification successful' data: type: array example: [] 400: description: '' content: application/json: schema: type: object example: status: false message: 'Invalid or expired verification code' data: [] properties: status: type: boolean example: false message: type: string example: 'Invalid or expired verification code' data: type: array example: [] 404: description: '' content: application/json: schema: type: object example: status: false message: 'Agent not found' data: [] properties: status: type: boolean example: false message: type: string example: 'Agent not found' data: type: array example: [] 500: description: '' content: application/json: schema: type: object example: status: false message: 'Failed to verify token' data: [] properties: status: type: boolean example: false message: type: string example: 'Failed to verify token' data: type: array example: [] tags: - Updates requestBody: required: true content: application/json: schema: type: object properties: phone: type: string description: 'The phone number of the agent.' example: '+2348012345678' token: type: string description: 'The 4-digit verification code.' example: '1234' required: - phone - token security: [] /api/agents/trader-onboarding/resend-verification: post: summary: 'Step 2a: Resend Phone Verification Code' operationId: step2aResendPhoneVerificationCode description: "Resends the OTP verification code to the agent's phone number during registration." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: status: true message: 'Verification code resent successfully' data: [] properties: status: type: boolean example: true message: type: string example: 'Verification code resent successfully' data: type: array example: [] 404: description: '' content: application/json: schema: type: object example: status: false message: 'Agent not found' data: [] properties: status: type: boolean example: false message: type: string example: 'Agent not found' data: type: array example: [] 500: description: '' content: application/json: schema: type: object example: status: false message: 'Failed to resend verification code' data: [] properties: status: type: boolean example: false message: type: string example: 'Failed to resend verification code' data: type: array example: [] tags: - Updates requestBody: required: true content: application/json: schema: type: object properties: phone: type: string description: 'The phone number of the agent.' example: '+2348012345678' required: - phone security: [] /api/wallets: post: summary: '' operationId: postApiWallets description: '' parameters: [] responses: { } tags: - Wallet requestBody: required: true content: application/json: schema: type: object properties: account_name: type: string description: 'Must not be greater than 100 characters.' example: xbdgrndusorafznbhxkwnuz phone_number: type: string description: '' example: rerum email: type: string description: 'Must be a valid email address.' example: maxwell.bergstrom@example.org bvn: type: string description: 'Must be at least 11 characters. Must not be greater than 11 characters.' example: mniqofrppy nin: type: string description: 'Must be at least 11 characters. Must not be greater than 11 characters.' example: wueqrso gender: type: string description: '' example: '0' enum: - '0' - '1' address: type: string description: '' example: laudantium date_of_birth: type: string description: 'Must be a valid date in the format d/m/Y.' example: 18/11/2025 last_name: type: string description: '' example: occaecati other_names: type: string description: '' example: ut place_of_birth: type: string description: '' example: quasi required: - account_name - phone_number - email - nin - date_of_birth - other_names security: [] '/api/wallets/{id}': get: summary: '' operationId: getApiWalletsId 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: - Wallet security: [] parameters: - in: path name: id description: 'The ID of the wallet.' example: saepe required: true schema: type: string '/api/wallets/{id}/withdraw': post: summary: '' operationId: postApiWalletsIdWithdraw description: '' parameters: [] responses: { } tags: - Wallet requestBody: required: true content: application/json: schema: type: object properties: bank_detail_id: type: string description: '' example: vel amount: type: number description: 'Must be at least 1.' example: 47 narration: type: string description: 'Must not be greater than 255 characters.' example: hogbamjvaowskng required: - bank_detail_id - amount security: [] parameters: - in: path name: id description: 'The ID of the wallet.' example: itaque required: true schema: type: string '/api/wallets/{id}/transfer': post: summary: '' operationId: postApiWalletsIdTransfer description: '' parameters: [] responses: { } tags: - Wallet requestBody: required: true content: application/json: schema: type: object properties: destination_wallet_id: type: string description: '' example: culpa amount: type: number description: 'Must be at least 1.' example: 57 narration: type: string description: 'Must not be greater than 255 characters.' example: tyvwzlwklnvjpnaj required: - destination_wallet_id - amount security: [] parameters: - in: path name: id description: 'The ID of the wallet.' example: laboriosam required: true schema: type: string '/api/wallets/{id}/transactions': get: summary: '' operationId: getApiWalletsIdTransactions 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: - Wallet security: [] parameters: - in: path name: id description: 'The ID of the wallet.' example: architecto required: true schema: type: string '/api/wallets/{id}/deposit': post: summary: '' operationId: postApiWalletsIdDeposit description: '' parameters: [] responses: { } tags: - Wallet requestBody: required: true content: application/json: schema: type: object properties: amount: type: number description: 'Must be at least 1.' example: 11 source: type: string description: '' example: sed narration: type: string description: '' example: sunt required: - amount security: [] parameters: - in: path name: id description: 'The ID of the wallet.' example: officiis required: true schema: type: string tags: - name: 'Admin - Beneficiaries' description: "\nAPIs for Admin Beneficiary Management" - name: 'Admin - Disbursements' description: "\nAPIs for Admin Disbursement Management" - 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: 'Agents - Biometric Authentication' description: "\nAPIs for agent biometric authentication and device management" - name: Banks description: '' - name: Beneficiaries description: "\nAPIs for Beneficiary Authentication and Registration" - name: 'Beneficiaries - Biometric Authentication' description: "\nAPIs for beneficiary biometric authentication and device management" - name: 'Beneficiary - Phone Verification' description: "\nAPIs for Beneficiary Phone Number Verification" - name: Chat description: "\nAPIs for chat conversations and messaging" - name: Country description: '' - name: Endpoints description: '' - name: Guarantor description: '' - name: 'Identity Verification' description: '' - name: LGA description: '' - name: Notifications description: "\nAPIs for notification management" - name: OAuth description: "\nAPIs for OAuth token refresh" - name: State description: '' - name: Trader description: '' - name: 'Trader Management' description: '' - name: 'Trader Transactions' description: '' - name: Traders description: "\nAPIs for Traders" - name: Transactions description: '' - name: Updates description: '' - name: Wallet description: "\nAPIs for wallet management, transfers, and transactions"