{"openapi":"3.1.0","info":{"title":"AgaPay API","description":"Payment processing API for Ghana","version":"1.0.0"},"paths":{"/api/auth/register":{"post":{"tags":["Authentication"],"summary":"Register","description":"Register a new user","operationId":"register_api_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/login":{"post":{"tags":["Authentication"],"summary":"Login","description":"Login user and return JWT token","operationId":"login_api_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserLogin"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/me":{"get":{"tags":["Authentication"],"summary":"Get Current User Profile","description":"Get current user profile","operationId":"get_current_user_profile_api_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/auth/refresh":{"post":{"tags":["Authentication"],"summary":"Refresh Token","description":"Refresh JWT token","operationId":"refresh_token_api_auth_refresh_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/users/":{"get":{"tags":["Users"],"summary":"Get Users","description":"Get all users","operationId":"get_users_api_users__get","parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserResponse"},"title":"Response Get Users Api Users Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/users/{user_id}":{"get":{"tags":["Users"],"summary":"Get User","description":"Get a specific user","operationId":"get_user_api_users__user_id__get","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Users"],"summary":"Update User","description":"Update a user","operationId":"update_user_api_users__user_id__put","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Users"],"summary":"Delete User","description":"Delete a user","operationId":"delete_user_api_users__user_id__delete","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/payments/initialize":{"post":{"tags":["Payments"],"summary":"Initialize Payment","description":"Initialize a payment transaction","operationId":"initialize_payment_api_payments_initialize_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentInitialize"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Initialize Payment Api Payments Initialize Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/payments/mobile-money":{"post":{"tags":["Payments"],"summary":"Process Mobile Money Payment","description":"Process mobile money payment for Ghana","operationId":"process_mobile_money_payment_api_payments_mobile_money_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MobileMoneyPayment"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Process Mobile Money Payment Api Payments Mobile Money Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/payments/verify/{reference}":{"get":{"tags":["Payments"],"summary":"Verify Payment","description":"Verify payment status","operationId":"verify_payment_api_payments_verify__reference__get","parameters":[{"name":"reference","in":"path","required":true,"schema":{"type":"string","title":"Reference"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Verify Payment Api Payments Verify Reference Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/payments/webhook":{"post":{"tags":["Payments"],"summary":"Paystack Webhook","description":"Handle Paystack webhook events","operationId":"paystack_webhook_api_payments_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/payments/stats":{"get":{"tags":["Payments"],"summary":"Get Payment Stats","description":"Get payment statistics","operationId":"get_payment_stats_api_payments_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentStats"}}}}}}},"/api/payments/":{"get":{"tags":["Payments"],"summary":"Get Payments","description":"Get all payments","operationId":"get_payments_api_payments__get","parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PaymentResponse"},"title":"Response Get Payments Api Payments Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/payments/{payment_id}":{"get":{"tags":["Payments"],"summary":"Get Payment","description":"Get a specific payment","operationId":"get_payment_api_payments__payment_id__get","parameters":[{"name":"payment_id","in":"path","required":true,"schema":{"type":"integer","title":"Payment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/":{"get":{"summary":"Root","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"summary":"Health Check","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"MobileMoneyPayment":{"properties":{"amount":{"anyOf":[{"type":"number"},{"type":"string"}],"title":"Amount"},"phone":{"type":"string","title":"Phone"},"provider":{"$ref":"#/components/schemas/MobileMoneyProvider"},"email":{"type":"string","format":"email","title":"Email"},"name":{"type":"string","title":"Name"}},"type":"object","required":["amount","phone","provider","email","name"],"title":"MobileMoneyPayment"},"MobileMoneyProvider":{"type":"string","enum":["mtn","airteltigo","vodafone"],"title":"MobileMoneyProvider"},"PaymentInitialize":{"properties":{"amount":{"anyOf":[{"type":"number"},{"type":"string"}],"title":"Amount"},"email":{"type":"string","format":"email","title":"Email"},"payment_method":{"$ref":"#/components/schemas/PaymentMethod"},"callback_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Callback Url"}},"type":"object","required":["amount","email","payment_method"],"title":"PaymentInitialize"},"PaymentMethod":{"type":"string","enum":["card","mobile_money","bank_transfer","ussd","qr_code"],"title":"PaymentMethod"},"PaymentResponse":{"properties":{"amount":{"type":"string","title":"Amount"},"currency":{"type":"string","title":"Currency","default":"GHS"},"payment_method":{"$ref":"#/components/schemas/PaymentMethod"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"customer_email":{"type":"string","format":"email","title":"Customer Email"},"customer_name":{"type":"string","title":"Customer Name"},"mobile_money_provider":{"anyOf":[{"$ref":"#/components/schemas/MobileMoneyProvider"},{"type":"null"}]},"mobile_money_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mobile Money Number"},"id":{"type":"integer","title":"Id"},"reference":{"type":"string","title":"Reference"},"user_id":{"type":"integer","title":"User Id"},"status":{"$ref":"#/components/schemas/PaymentStatus"},"paystack_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paystack Reference"},"paystack_transaction_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paystack Transaction Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"processed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Processed At"}},"type":"object","required":["amount","payment_method","customer_email","customer_name","id","reference","user_id","status","created_at"],"title":"PaymentResponse"},"PaymentStats":{"properties":{"total_payments":{"type":"integer","title":"Total Payments"},"successful_payments":{"type":"integer","title":"Successful Payments"},"failed_payments":{"type":"integer","title":"Failed Payments"},"total_revenue":{"type":"string","title":"Total Revenue"},"success_rate":{"type":"number","title":"Success Rate"}},"type":"object","required":["total_payments","successful_payments","failed_payments","total_revenue","success_rate"],"title":"PaymentStats"},"PaymentStatus":{"type":"string","enum":["pending","processing","success","failed","cancelled"],"title":"PaymentStatus"},"Token":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type"}},"type":"object","required":["access_token","token_type"],"title":"Token"},"UserCreate":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"phone":{"type":"string","title":"Phone"},"full_name":{"type":"string","title":"Full Name"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","phone","full_name","password"],"title":"UserCreate"},"UserLogin":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","password"],"title":"UserLogin"},"UserResponse":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"phone":{"type":"string","title":"Phone"},"full_name":{"type":"string","title":"Full Name"},"id":{"type":"integer","title":"Id"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["email","phone","full_name","id","is_active","created_at"],"title":"UserResponse"},"UserUpdate":{"properties":{"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"UserUpdate"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}