Learn how to activate payouts in Stripe step-by-step: set up your account, verify identity, add a bank, configure payout settings, and troubleshoot common issues.
Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
How to Activate Payouts in Stripe: A Comprehensive Tutorial
Step 1: Create and Set Up Your Stripe Account
Before you can activate payouts, you need to have a Stripe account properly set up. If you don't have one yet, follow these steps:
Step 2: Complete Your Business Information
To activate payouts, you need to provide complete business details:
Step 3: Verify Your Identity
Stripe requires identity verification to comply with financial regulations:
Step 4: Add and Verify Your Bank Account
To receive payouts, you must connect a bank account:
For international accounts, you may need to provide additional details like:
Step 5: Configure Your Payout Settings
Once your bank account is verified, configure your payout preferences:
Step 6: Implement Payout Functionality in Your Code (Optional)
If you need to programmatically manage payouts, you can use Stripe's API:
For Node.js:
const stripe = require('stripe')('sk_test_your_secret_key');
async function createPayout() {
try {
const payout = await stripe.payouts.create({
amount: 1000, // amount in cents
currency: 'usd',
});
console.log('Payout created successfully:', payout.id);
return payout;
} catch (error) {
console.error('Error creating payout:', error);
throw error;
}
}
createPayout();
For Python:
import stripe
stripe.api_key = "sk_test_your_secret\_key"
try:
payout = stripe.Payout.create(
amount=1000, # amount in cents
currency="usd",
)
print(f"Payout created successfully: {payout.id}")
except Exception as e:
print(f"Error creating payout: {str(e)}")
For PHP:
1000, // amount in cents
'currency' => 'usd',
]);
echo 'Payout created successfully: ' . $payout->id;
} catch (\Exception $e) {
echo 'Error creating payout: ' . $e->getMessage();
}
Step 7: Monitor Your Payout Status
After configuring payouts, it's important to monitor their status:
To set up webhooks for payout notifications:
// Server-side code to handle webhook events (Node.js example)
const express = require('express');
const stripe = require('stripe')('sk_test_your_secret_key');
const app = express();
// Use JSON parser for webhook requests
app.use('/webhook', express.raw({type: 'application/json'}));
app.post('/webhook', async (req, res) => {
const sig = req.headers['stripe-signature'];
let event;
try {
event = stripe.webhooks.constructEvent(
req.body,
sig,
'whsec_your_webhook_signing_secret'
);
} catch (err) {
return res.status(400).send(`Webhook Error: ${err.message}`);
}
// Handle payout events
if (event.type === 'payout.created') {
const payout = event.data.object;
console.log(`Payout created: ${payout.id} for ${payout.amount / 100} ${payout.currency}`);
} else if (event.type === 'payout.paid') {
const payout = event.data.object;
console.log(`Payout paid: ${payout.id}`);
} else if (event.type === 'payout.failed') {
const payout = event.data.object;
console.log(`Payout failed: ${payout.id}, reason: ${payout.failure_message}`);
}
res.json({received: true});
});
app.listen(3000, () => console.log('Running on port 3000'));
Step 8: Troubleshoot Common Payout Issues
If you encounter issues with payouts, follow these troubleshooting steps:
Step 9: Setting Up Connect for Marketplace Payouts (Optional)
If you're building a marketplace or platform where you need to pay out to third parties:
Code example for creating a payout to a connected account:
const stripe = require('stripe')('sk_test_your_secret_key');
async function createConnectedAccountPayout(connectedAccountId) {
try {
const payout = await stripe.payouts.create(
{
amount: 1000, // amount in cents
currency: 'usd',
},
{
stripeAccount: connectedAccountId, // ID of the connected account
}
);
console.log(`Payout created for connected account: ${payout.id}`);
return payout;
} catch (error) {
console.error('Error creating connected account payout:', error);
throw error;
}
}
// Example usage
createConnectedAccountPayout('acct\_123456789');
Step 10: Best Practices for Managing Payouts
Follow these best practices to ensure smooth payout operations:
When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.