Skip to main content

Overview

Request Network provides advanced features that enable enterprise-grade payment processing, real-time integrations, and sophisticated business logic. These capabilities ensure your payment infrastructure can scale with your business needs.

Webhooks & Real-Time Updates

Webhook Events

Stay synchronized with payment events through real-time webhook notifications.

Payment Events

Event Types:
  • payment_detected - Payment initiated
  • payment_confirmed - Payment confirmed on blockchain
  • payment_failed - Payment failed or rejected
Use Cases: Order fulfillment, inventory updates, customer notifications

Request Events

Event Types:
  • request_created - New payment request created
  • request_updated - Request metadata or status changed
  • request_cancelled - Request cancelled by merchant
Use Cases: CRM integration, accounting system updates

Subscription Events

Event Types:
  • subscription_activated - New subscription started
  • subscription_renewed - Successful recurring payment
  • subscription_failed - Recurring payment failed
  • subscription_cancelled - Subscription terminated
Use Cases: Subscription management, customer lifecycle

Payout Events

Event Types:
  • payout_initiated - Payout process started
  • payout_completed - Payout successfully sent
  • batch_payout_completed - All batch payments processed
Use Cases: Payroll confirmation, vendor notifications

Webhook Configuration

  • Setup
  • Security
  • Retry Logic
Webhook Endpoint Setup:
  1. Configure endpoint URL in Request Portal
  2. Select event types to receive
  3. Set up authentication (optional)
  4. Test webhook delivery
// Example webhook endpoint
app.post('/webhooks/request-network', (req, res) => {
  const { eventType, data } = req.body;
  
  // Verify webhook signature (recommended)
  if (!verifyWebhookSignature(req)) {
    return res.status(401).send('Unauthorized');
  }
  
  // Process event
  handlePaymentEvent(eventType, data);
  
  res.status(200).send('OK');
});

Platform Fees & Revenue Sharing

Fee Configuration

Collect platform fees automatically from every transaction.
Fixed Percentage Model:
  • Set percentage fee (e.g., 2.5% per transaction)
  • Automatic fee calculation and collection
  • Fees collected to specified address
  • Real-time fee tracking and reporting
Perfect For: Marketplaces, payment processors, SaaS platforms
Flat Fee Model:
  • Set fixed fee amount per transaction
  • Independent of transaction size
  • Predictable fee structure
  • Suitable for high-volume, low-value transactions
Perfect For: Micropayments, subscription services, utility payments
Volume-Based Pricing:
  • Different fee rates based on transaction volume
  • Automatic tier calculation
  • Incentivize higher volume usage
  • Enterprise-friendly pricing models
Perfect For: Enterprise platforms, high-volume merchants
Multi-Party Fee Distribution:
  • Split fees between multiple parties
  • Automatic revenue distribution
  • Configurable split percentages
  • Real-time settlement
Perfect For: Affiliate programs, partner ecosystems, marketplaces

Fee Implementation

const requestWithFee = await requestNetwork.createRequest({
  requestInfo: {
    currency: 'USDC-matic',
    expectedAmount: '1000',
    // ... other request details
  },
  paymentNetwork: {
    id: 'erc20-fee-proxy-contract',
    parameters: {
      paymentAddress: merchantAddress,
      feeAddress: platformFeeAddress,
      feeAmount: '25' // 2.5% fee
    }
  }
});

Custom Metadata & Business Logic

Metadata Capabilities

Attach business-specific data to payment requests and transactions.
  • Standard Metadata
  • Custom Fields
  • Searchable Data
Built-in Fields:
  • Invoice numbers and references
  • Customer information
  • Product/service descriptions
  • Due dates and payment terms
  • Tax information and rates
const requestWithMetadata = await requestNetwork.createRequest({
  // ... request configuration
  contentData: {
    reason: 'Professional Services - Q1 2025',
    invoiceNumber: 'INV-2025-001',
    dueDate: '2025-04-01',
    customerInfo: {
      name: 'Acme Corporation',
      email: 'billing@acme.com',
      taxId: 'US123456789'
    },
    lineItems: [
      {
        description: 'Consulting Services',
        quantity: 40,
        unitPrice: '150',
        total: '6000'
      }
    ]
  }
});

Error Handling & Resilience

Payment Failure Management

Robust error handling ensures reliable payment processing.

Automatic Retry Logic

Smart Retry Mechanisms:
  • Automatic retry for transient failures
  • Exponential backoff strategies
  • Maximum retry attempt limits
  • Configurable retry policies
Failure Types:
  • Network connectivity issues
  • Temporary blockchain congestion
  • Insufficient gas fee scenarios

Grace Periods

Payment Grace Handling:
  • Configurable grace periods for late payments
  • Automatic payment retry scheduling
  • Customer notification workflows
  • Account suspension management
Use Cases: Subscription billing, enterprise accounts

Error Response Handling

try {
  const payment = await requestNetwork.payRequest(requestId, {
    amount: paymentAmount,
    currency: paymentCurrency
  });
  
  console.log('Payment successful:', payment.transactionHash);
  
} catch (error) {
  switch (error.code) {
    case 'INSUFFICIENT_FUNDS':
      // Handle insufficient balance
      showInsufficientFundsError();
      break;
      
    case 'NETWORK_ERROR':
      // Retry payment after delay
      setTimeout(() => retryPayment(requestId), 5000);
      break;
      
    case 'INVALID_REQUEST':
      // Handle invalid request (don't retry)
      showInvalidRequestError();
      break;
      
    default:
      // Generic error handling
      showGenericPaymentError();
  }
}

Performance & Optimization

Gas Fee Optimization

Minimize transaction costs through intelligent optimization.
Efficient Batch Processing:
  • Multiple payments in single transaction
  • Shared gas costs across recipients
  • Up to 90% gas savings for batch operations
  • Atomic execution guarantees
Optimal Network Routing:
  • Automatic network selection based on cost
  • Real-time gas price monitoring
  • Cross-chain routing for best rates
  • User preference consideration
Smart Timing Strategies:
  • Off-peak transaction scheduling
  • Gas price prediction and queuing
  • Priority fee optimization
  • Network congestion avoidance

What’s Next?

⌘I