Quick Start
Quick Start Guide
This guide will get you all set up and ready to use MyBerryFlow. We'll cover how to get started with API keys and how to make your first integration. We'll also look at where to go next to find all the information you need to take full advantage of our powerful deferred KYC platform.
Before you start
Make sure you have the following ready:
- - A MyBerryFlow account (sign up takes 30 seconds)
- - A website where you want to add marketplace payments
- - Basic knowledge of HTML/JavaScript
Step 1: Get your API keys
After creating your MyBerryFlow account, you'll need to get your API keys from the dashboard. You'll get both test and live keys to help you integrate safely.
Publishable Key: pk_test_1234567890abcdef
Secret Key: sk_test_abcdef1234567890 (keep this secure!)Step 2: Create your first seller
Create a seller account with minimal information - just email and country. They can start earning immediately with deferred KYC.
fetch('/api/sellers/create-deferred-account-for-seller-as-default', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer sk_test_...'
},
body: JSON.stringify({
email: 'seller@example.com',
country: 'US'
})
});
// Response
{
"sellerId": "seller_abc123",
"status": "active",
"canReceivePayments": true,
"kycRequired": false
}Step 3: Add the checkout widget
Embed our checkout widget to start accepting payments immediately. The widget handles card validation, payment processing, and error states automatically.
<!-- Include the widget script -->
<script src="https://myberryflow.com/widgets/checkout.js"></script>
<!-- Add the checkout form -->
<div id="myberryflow-checkout"
data-api-key="pk_test_..."
data-seller-id="seller_abc123"
data-amount="2999"
data-currency="usd"
data-product-name="Premium Service">
</div>Step 4: Handle webhook events
Set up a webhook endpoint to receive payment confirmations and seller status updates.
app.post('/webhook/myberryflow', (req, res) => {
const event = req.body;
switch (event.type) {
case 'payment.succeeded':
// Payment was successful
// Update your database, send confirmation email, etc.
break;
case 'seller.kyc_required':
// Seller hit revenue threshold, needs KYC
// Send them the onboarding link
break;
case 'seller.verified':
// Seller completed KYC, can now receive direct payouts
break;
}
res.json({ received: true });
});Test the integration
Use Stripe's test card numbers to verify everything works end-to-end:
- Test Card:
4242 4242 4242 4242 - Expiry:
12/34 - CVC:
123
Expected Result: Payment succeeds, funds held in platform account until seller verification