Documentation Index
Fetch the complete documentation index at: https://docs.fyatu.com/llms.txt
Use this file to discover all available pages before exploring further.
Payments Overview
FYATU’s payment system allows businesses to accept payments (collections) from customers and send money (payouts) to Fyatu account holders.
Core Concepts
Collections (Incoming Payments)
Collections are payments received from customers. When you create a collection:
- A checkout session is created with a unique URL
- Customer is redirected to Fyatu’s checkout page
- Customer logs in and authorizes the payment
- Funds are transferred from customer to your business wallet
- You receive a webhook notification
Customer → Checkout Page → Authorization → Your Business Wallet
Payouts (Outgoing Payments)
Payouts send money from your business wallet to Fyatu account holders:
- Verify the recipient’s account
- Create the payout with amount and recipient
- Funds are instantly transferred
- Recipient receives notification
Your Business Wallet → Fyatu Account → Recipient
Refunds
Refunds return money from a collection back to the original payer:
- Choose between
FULL or PARTIAL refund mode at refund time
- Each collection can only be refunded once - choose wisely
- Processing fees are non-refundable
- Maximum refundable amount = Net amount (original - fee)
- Debited from your business wallet
- Use a predefined reason code (see
GET /refunds/reasons)
Payment Flow
Collection Flow
Payout Flow
Fees
Collection Fees
Collection fees are deducted from the payment amount:
| Payment Amount | Fee | Net Amount |
|---|
| $25.00 | $0.75 | $24.25 |
| $100.00 | $3.00 | $97.00 |
The customer pays the full amount; you receive the net amount.
Payout Fees
Payout fees are added on top of the payout amount:
| Payout Amount | Fee | Total Debited |
|---|
| $25.00 | $0.50 | $25.50 |
| $100.00 | $0.50 | $100.50 |
Your wallet is debited for the total (amount + fee).
Refund Fees
- No additional fee for refunds
- Original collection fee is not refundable
- Maximum refund = Net amount (original - fee)
Statuses
Collection Statuses
| Status | Description |
|---|
PENDING | Awaiting customer payment |
COMPLETED | Payment successful |
FAILED | Payment failed or expired |
REFUNDED | Fully refunded |
PARTIALLY_REFUNDED | Partially refunded |
Payout Statuses
| Status | Description |
|---|
PENDING | Processing |
COMPLETED | Successfully delivered |
FAILED | Failed to process |
Refund Statuses
| Status | Description |
|---|
PENDING | Processing |
COMPLETED | Successfully refunded |
FAILED | Failed to process |
Webhooks
Webhook notifications are sent for payment events. Configure your webhook URL in app settings or per-collection.
Collection Webhook Payload
{
"event": "collection.completed",
"data": {
"collectionId": "SCI679A1B2C3D4E5",
"reference": "A2B4C6D8E0F2",
"orderId": "INV-001",
"amount": 25.00,
"fee": 0.75,
"netAmount": 24.25,
"currency": "USD",
"status": "COMPLETED",
"payer": {
"name": "John Doe",
"email": "john@example.com"
},
"completedAt": "2026-01-08T11:35:00+00:00"
},
"timestamp": "2026-01-08T11:35:01+00:00"
}
Webhook Security
Always verify webhooks by:
- Checking the source IP
- Validating the signature (if implemented)
- Verifying the payment via API before fulfilling orders
Best Practices
For Collections
- Use Order IDs: Link collections to your order system
- Set Webhook URL: Receive real-time notifications
- Verify via API: Always confirm payment server-side
- Handle Expiry: Sessions expire after 60 minutes
- Prevent Duplicates: Use unique order IDs
For Payouts
- Verify First: Always verify recipient before paying
- Use References: Track payouts with unique references
- Check Balance: Ensure sufficient wallet balance
- Monitor Limits: Track daily/monthly limits
- Store IDs: Keep payout IDs for support
For Refunds
- One Refund Only: Each collection can only be refunded once - choose FULL or PARTIAL wisely
- Use Reason Codes: Always include a predefined refund reason code
- Wallet Balance: Ensure balance covers refund amount
- Track Refunds: Monitor refund rates for fraud detection
- Communicate: Notify customers about refund status
Integration Checklist
Error Handling
Common Errors
| Error | Resolution |
|---|
INSUFFICIENT_BALANCE | Top up business wallet |
DUPLICATE_REFERENCE | Use unique order ID/reference |
PAYOUT_LIMIT_EXCEEDED | Wait or request limit increase |
RECIPIENT_INACTIVE | Recipient must activate account |
ALREADY_REFUNDED | Collection already refunded (only one refund per collection allowed) |
INVALID_STATUS | Only COMPLETED collections can be refunded |
Retry Logic
For transient errors (5xx), implement exponential backoff:
async function retryRequest(fn, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
try {
return await fn();
} catch (error) {
if (error.status >= 500 && i < maxRetries - 1) {
await sleep(Math.pow(2, i) * 1000);
continue;
}
throw error;
}
}
}
Collections
POST /collections - Create checkout session
GET /collections/{id} - Get collection details
GET /collections - List collections
Refunds
POST /collections/{id}/refund - Create refund
GET /refunds - List refunds
GET /refunds/reasons - Get available refund reason codes
Payouts
GET /accounts/{clientId} - Verify recipient
POST /payouts - Create payout
GET /payouts/{id} - Get payout details
GET /payouts - List payouts