Blog
    Integration6 min read

    Monetizing Your Platform with Stripe Connect

    How to set up Stripe Connect integration to enable marketplace payments and earn platform fees on credit purchases.

    By cred.diy Team

    Monetizing Your Platform with Stripe Connect

    Stripe Connect enables you to accept payments on behalf of your users while earning platform fees. This guide shows you how to integrate Stripe Connect with cred.diy for seamless marketplace monetization.

    What is Stripe Connect?

    Stripe Connect is a powerful platform that allows you to:

    • Accept payments on behalf of other businesses
    • Split payments between your platform and sellers
    • Handle compliance for multi-party payments
    • Manage payouts to connected accounts

    Why Use Stripe Connect with cred.diy?

    When combined with cred.diy, Stripe Connect enables:

    1. Platform fees: Earn a percentage on every credit purchase
    2. White-label payments: Payments appear under your brand
    3. Automated settlements: cred.diy handles the credit issuance
    4. Flexible splits: Configure fee percentages per project

    Setting Up Stripe Connect

    Step 1: Enable Stripe Connect

    In your cred.diy dashboard:

    1. Go to Payments > Stripe Connect
    2. Click Connect with Stripe
    3. Complete the Stripe onboarding flow
    4. Return to cred.diy to confirm connection

    Step 2: Configure Platform Fees

    Set your platform fee percentage:

    // Platform takes 10% of each transaction
    const platformFeePercent = 10;
    

    Step 3: Create Connect Checkout Sessions

    When users purchase credits, create a checkout with your Connect account:

    const createConnectCheckout = async (userId, tierId) => {
      const response = await fetch(
        'https://eutdgemlrpvnxfkkpvlu.supabase.co/functions/v1/hosted-checkout',
        {
          method: 'POST',
          headers: {
            'Content-Type': 'application/json',
            'x-api-key': process.env.CRED_API_KEY
          },
          body: JSON.stringify({
            user_id: userId,
            pricing_tier_id: tierId,
            success_url: 'https://yourapp.com/success',
            cancel_url: 'https://yourapp.com/cancel'
            // Platform fee is automatically applied
          })
        }
      );
      
      return response.json();
    };
    

    Step 4: Handle Payment Webhooks

    Process successful payments and issue credits:

    app.post('/webhooks/stripe', async (req, res) => {
      const event = req.body;
      
      if (event.type === 'checkout.session.completed') {
        // cred.diy automatically issues credits
        // Your webhook receives confirmation
        console.log('Payment completed:', event.data.object);
      }
      
      res.status(200).send('OK');
    });
    

    Payment Flow Overview

    1. User clicks "Buy Credits"
    2. Your app creates a checkout session via cred.diy
    3. User is redirected to Stripe Checkout
    4. Payment is processed with platform fee deducted
    5. cred.diy receives webhook and issues credits
    6. User is redirected to success URL
    7. Your platform receives the fee

    Managing Connected Accounts

    Connected accounts are managed in the dashboard rather than through the API:

    • Account status: Dashboard → Payments shows whether the connected Stripe account can take charges and receive payouts, and links to Stripe to finish onboarding.
    • Platform fee: the fee Cred applies to each Stripe Connect charge is shown on the same page. Payments that run on your own Stripe keys carry no platform fee.

    Best Practices

    1. Start with reasonable fees: 5-15% is typical for platforms
    2. Be transparent: Clearly communicate fees to users
    3. Test thoroughly: Use Stripe test mode before going live
    4. Monitor transactions: Review the Stripe Dashboard regularly
    5. Handle disputes: Set up processes for chargebacks

    Common Issues

    Account Not Verified

    If charges_enabled is false, the connected account needs to complete Stripe's verification process.

    Payout Failures

    Ensure connected accounts have valid bank details and sufficient balance.

    Currency Mismatches

    Specify the currency explicitly to avoid conversion issues.

    Conclusion

    Stripe Connect integration transforms cred.diy into a powerful monetization platform. By following this guide, you can start earning platform fees on every credit purchase while providing a seamless payment experience for your users.

    Ready to start earning? Connect Stripe in your dashboard.

    Try it on a real project.