Payment API Documentation
Overview
The Payment API provides endpoints for processing various types of payments, including card payments, USSD payments, and POS card payments. It supports multiple payment providers and currencies.Base URL
/api/v1/payment
Authentication
All endpoints require authentication using an API key in the request headers:X-API-KEY: Your API key
Endpoints
Card Payment
Initiate a payment using a card. Endpoint:POST /card/pay
Headers:
X-API-KEY: API key for authentication
USSD Payment
Initiate a payment using USSD. Endpoint:POST /ussd/pay
Headers:
X-API-KEY: API key for authentication
POS Card Payment
Process a card payment through a POS terminal. Endpoint:POST /pos/purchase
Headers:
X-API-KEY: API key for authentication
Error Responses
401 UnauthorizedNotes
- Payment Methods:
- Card payments (online)
- USSD payments
- POS card payments
- Payment Requirements:
- Minimum amount is 100
- Accounts must be active
- Currencies must be supported
- User must own the account
- Platform admins cannot perform payments
- Payment Processing:
- Card payments are processed through payment gateways
- USSD payments generate USSD codes
- POS payments require terminal data
- All payments are tracked with unique references
- Security:
- All payments require authentication
- Duplicate request IDs are rejected
- Account ownership is verified
- Platform admins are restricted
- Payment Status:
- Processing
- Approved
- Failed
- Pending
- Payment Notifications:
- Users are notified of payment status
- Callback URLs are supported
- Webhook notifications are sent
- Payment Tracking:
- All payments are logged
- Payment history is maintained
- Payment status can be queried
- Payment Fees:
- Fees are calculated based on payment type
- Fees are included in the payment amount
- Fee formulas are configurable
- Payment Validation:
- Amounts are validated
- Currencies are validated
- Account status is checked
- User permissions are verified
- Payment Settlement:
- Card payments are settled immediately
- USSD payments are settled after confirmation
- POS payments are settled after terminal response
- Settlement status is tracked