Skip to main content

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:
  1. A checkout session is created with a unique URL
  2. Customer is redirected to Fyatu’s checkout page
  3. Customer logs in and authorizes the payment
  4. Funds are transferred from customer to your business wallet
  5. 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:
  1. Verify the recipient’s account
  2. Create the payout with amount and recipient
  3. Funds are instantly transferred
  4. 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 AmountFeeNet 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 AmountFeeTotal 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

StatusDescription
PENDINGAwaiting customer payment
COMPLETEDPayment successful
FAILEDPayment failed or expired
REFUNDEDFully refunded
PARTIALLY_REFUNDEDPartially refunded

Payout Statuses

StatusDescription
PENDINGProcessing
COMPLETEDSuccessfully delivered
FAILEDFailed to process

Refund Statuses

StatusDescription
PENDINGProcessing
COMPLETEDSuccessfully refunded
FAILEDFailed 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": "[email protected]"
    },
    "completedAt": "2026-01-08T11:35:00+00:00"
  },
  "timestamp": "2026-01-08T11:35:01+00:00"
}

Webhook Security

Always verify webhooks by:
  1. Checking the source IP
  2. Validating the signature (if implemented)
  3. Verifying the payment via API before fulfilling orders

Best Practices

For Collections

  1. Use Order IDs: Link collections to your order system
  2. Set Webhook URL: Receive real-time notifications
  3. Verify via API: Always confirm payment server-side
  4. Handle Expiry: Sessions expire after 60 minutes
  5. Prevent Duplicates: Use unique order IDs

For Payouts

  1. Verify First: Always verify recipient before paying
  2. Use References: Track payouts with unique references
  3. Check Balance: Ensure sufficient wallet balance
  4. Monitor Limits: Track daily/monthly limits
  5. Store IDs: Keep payout IDs for support

For Refunds

  1. One Refund Only: Each collection can only be refunded once - choose FULL or PARTIAL wisely
  2. Use Reason Codes: Always include a predefined refund reason code
  3. Wallet Balance: Ensure balance covers refund amount
  4. Track Refunds: Monitor refund rates for fraud detection
  5. Communicate: Notify customers about refund status

Integration Checklist


Error Handling

Common Errors

ErrorResolution
INSUFFICIENT_BALANCETop up business wallet
DUPLICATE_REFERENCEUse unique order ID/reference
PAYOUT_LIMIT_EXCEEDEDWait or request limit increase
RECIPIENT_INACTIVERecipient must activate account
ALREADY_REFUNDEDCollection already refunded (only one refund per collection allowed)
INVALID_STATUSOnly 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