Collections API Reference
The Collections API handles payment collection requests across all FundKit providers. This page documents the collection-specific interfaces, validation rules, and response formats.Collection Request
CollectionRequest
Interface
Field Specifications
amount
- Type:
number
- Required: Yes
- Validation: Must be positive integer
- Format: Minor currency units (e.g., 10000 = 100.00 UGX)
- Limits: Provider-specific (see provider limits below)
currency
- Type:
CurrencyCode
- Required: Yes
- Supported Values:
'UGX'
,'KES'
,'TZS'
,'RWF'
- Validation: Must be supported by at least one configured provider
phoneNumber
- Type:
string
- Required: Yes
- Format: International format with country code
- Validation: Must match country-specific mobile number patterns
reason
- Type:
string
- Required: Yes
- Validation: Minimum 3 characters, maximum 255 characters
- Purpose: Displayed to customer during payment
reference
- Type:
string
- Required: No
- Purpose: External reference for tracking
- Validation: Alphanumeric, maximum 50 characters
metadata
- Type:
Record<string, any>
- Required: No
- Purpose: Store custom data with transaction
- Limits: Maximum 16KB when serialized
Collection Response
CollectionResponse
Interface
Response Wrapper
All collection operations return aPayClientCollectionResponse
:
Transaction Status Flow
TransactionStatus
Enum
Status Transitions
Provider Limits
Amount Limits
Provider | Currency | Minimum | Maximum |
---|---|---|---|
HoneyCoin | UGX | 1,000 (10 UGX) | 10,000,000 (100,000 UGX) |
HoneyCoin | KES | 100 (1 KES) | 1,000,000 (10,000 KES) |
HoneyCoin | TZS | 1,000 (10 TZS) | 5,000,000 (50,000 TZS) |
EasyPay | UGX | 500 (5 UGX) | 5,000,000 (50,000 UGX) |
Tola | UGX | 1,000 (10 UGX) | 20,000,000 (200,000 UGX) |
Tola | RWF | 100 (1 RWF) | 2,000,000 (20,000 RWF) |
Validation Functions
Client-Side Validation
Custom Validation Rules
Error Handling
Collection-Specific Errors
Usage Examples
Basic Collection
Collection with Metadata
Collection with Expiration
Handling Collection Errors
Best Practices
- Validate Early: Use client-side validation before API calls
- Handle Provider Limits: Check amount limits for target providers
- Use References: Include unique references for tracking
- Set Webhooks: Use webhooks for real-time status updates
- Add Metadata: Store relevant context for later use
- Handle Timeouts: Set appropriate expiration times
- Retry Logic: Implement retry for transient failures
- Error Messages: Provide clear error messages to users