API Documentation

The Monetiflow API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes.

Quick Setup

Get started in under 10 minutes with our official SDKs for Python, Node.js, PHP, Ruby, and more

📚

Full Examples

Production-ready code samples for payments, payouts, refunds, and webhooks

🔔

Webhooks

Real-time event notifications with automatic retries and signature verification

💡
Base URL https://api.monetiflow.co/v2

All API requests must be made over HTTPS. Calls made over plain HTTP will fail.

Installation

# Python
pip install monetiflow

# Node.js
npm install monetiflow-node

# PHP
composer require monetiflow/monetiflow-php

Authentication

All API requests require authentication using your API key. Keep your keys secure and never share them publicly.

Authorization: Bearer mk_live_YOUR_KEY

# Example
curl https://api.monetiflow.co/v2/payments \
  -H "Authorization: Bearer mk_live_YOUR_KEY"

Create Payment

create_payment.py
import monetiflow

client = monetiflow.Client(
    api_key='mk_live_3x8Hj2k...'
)

# Create payment
payment = client.payments.create(
    amount=25000,
    currency='INR',
    customer_id='usr_8x2k9Lm',
    payment_method='upi',
    success_url='https://example.com/success',
    callback_url='https://example.com/webhook',
    metadata={
        'order_ref': 'ORD-2025-4892',
        'customer_email': 'user@example.com',
        'customer_phone': '+91-9876543210'
    }
)

print(payment.id)  # pay_9kL2mN4x
print(payment.payment_url)

Webhook Events

Receive real-time notifications for payment events. Configure your webhook URL in the dashboard.

webhook_handler.py
@app.route('/webhook', methods=['POST'])
def handle_webhook():
    payload = request.get_json()
    event_type = payload['event']
    
    if event_type == 'payment.success':
        payment_id = payload['data']['id']
        amount = payload['data']['amount']
        # Update your database
        process_successful_payment(payment_id, amount)
        
    elif event_type == 'payment.failed':
        # Handle failed payment
        handle_payment_failure(payload['data'])
        
    return {'status': 'received'}, 200

API Endpoints

Core API endpoints for payment processing

POST
/v2/payments/create
Initialize payment transaction
GET
/v2/payments/:id
Fetch payment details
POST
/v2/payouts/send
Process payout request
GET
/v2/transactions
List all transactions
POST
/v2/refunds/create
Issue refund
GET
/v2/balance
Get account balance

Error Codes

Monetiflow uses conventional HTTP response codes to indicate the success or failure of an API request.

200 OK - Everything worked as expected
201 Created - Resource created successfully
400 Bad Request - Invalid parameters
401 Unauthorized - Invalid API key
403 Forbidden - Insufficient permissions
404 Not Found - Resource doesn't exist
500 Server Error - Something went wrong

Rate Limiting

API requests are rate-limited to ensure system stability. Monitor response headers for rate limit information.

1,000
requests per minute
50,000
requests per hour
Response Headers:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 872
X-RateLimit-Reset: 1698765432
⚠️ Exceeded Rate Limit Returns HTTP 429. Retry after cooldown period specified in Retry-After header.

Need Help?

Our support team is available 24/7.