Getting Started
Your journey to integrating Moneybag payments starts here
Getting Started
Welcome to Moneybag! We've made it simple to add secure payment processing to your application. This guide will walk you through everything you need to get up and running.
Integration Overview
How Moneybag Works
Payment Flow
sequenceDiagram
participant Customer
participant Your App
participant Moneybag API
participant Payment Provider
Customer->>Your App: Initiates payment
Your App->>Moneybag API: Create checkout session
Moneybag API-->>Your App: Return payment URL
Your App->>Customer: Redirect to payment page
Customer->>Payment Provider: Completes payment
Payment Provider->>Moneybag API: Payment confirmation
Moneybag API->>Your App: Webhook notification
Moneybag API->>Customer: Redirect to success URL
Your App->>Moneybag API: Verify payment
Moneybag API-->>Your App: Payment details
Key Components
- Checkout Creation: Your server creates a secure checkout session
- Payment Collection: Customer completes payment on Moneybag's hosted page
- Webhook Notification: Real-time updates about payment status
- Payment Verification: Confirm payment success before fulfilling order
Integration Steps
Step 1: Set Up Your Account
🚀
Start with Sandbox
Create a free sandbox account to begin testing immediately. No approval needed!
Create Sandbox Account
Step 2: Get Your API Credentials
- Log into your Dashboard
- Navigate to Developer Settings → API Keys
- Generate and securely store your API key
Step 3: Make Your First API Call
# Quick test with cURL
curl -X POST https://sandbox.api.moneybag.com.bd/api/v2/payments/checkout \
-H "X-Merchant-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"order_id": "TEST_001",
"order_amount": 100.00,
"currency": "BDT",
"customer": {
"name": "Test Customer",
"email": "test@example.com",
"phone": "+8801700000000"
}
}'
Step 4: Handle the Response
{
"success": true,
"data": {
"payment_url": "https://pay.moneybag.com.bd/checkout/abc123",
"transaction_id": "TXN_123456"
}
}
Step 5: Verify Payment Success
After payment, verify the transaction:
curl -X GET https://sandbox.api.moneybag.com.bd/api/v2/payments/verify/TXN_123456 \
-H "X-Merchant-API-Key: YOUR_API_KEY"
Choose Your Integration Method
Option 1: Direct API Integration
Best for custom implementations and maximum control.
// Direct API call example
const response = await fetch('https://sandbox.api.moneybag.com.bd/api/v2/payments/checkout', {
method: 'POST',
headers: {
'X-Merchant-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify(paymentData)
});
Pros: Full control, customizable, language agnostic Cons: More implementation work
Option 2: SDK Integration
Pre-built libraries for faster integration.
// PHP SDK example
$moneybag = new MoneybagClient($apiKey);
$checkout = $moneybag->createCheckout([
'amount' => 100.00,
'currency' => 'BDT'
]);
Available SDKs:
- PHP SDK - Full documentation available
- Node.js SDK - Comprehensive examples
- Python SDK - Django/Flask ready
- WooCommerce Plugin - Easy WordPress integration
Option 3: Plugin Integration
Ready-made plugins for popular platforms.
- WooCommerce: One-click installation
- Other platforms: Coming soon
Interactive Tools
Required Information
Before you start integration, have these ready:
Business Information
- Business name and registration
- Contact information
- Website/app URL
Technical Requirements
- Server-side programming capability
- HTTPS-enabled website (for production)
- Database for storing transaction records
Integration Details
- Callback URLs (success, cancel, fail)
- Webhook endpoint URL
- Customer information fields
Ready to Go Live?
After completing your integration and testing, it's time to launch in production!
🚀
Launch Your Integration
Follow our comprehensive checklist to ensure a smooth production launch.
View Going Live Guide