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

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.

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.
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.

What’s Next?