API Documentation

Official Reference to integrate FundGate securely.

Authentication Headers

All API requests must include the following headers for authentication and routing:

HeaderDescription
x-fundgate-useridYour permanent Account ID
x-fundgate-upiThe specific UPI ID from your Merchant Accounts & Keys tab.
x-api-keyThe corresponding secret API Key for that UPI ID.
POST

/api/developer/create

Create a secure payment order and retrieve the raw UPI intent URL and token for your custom UI integration.

curl -X POST https://fundgate.mazid.dev/api/developer/create \
  -H "x-fundgate-userid: usr_demo_12345" \
  -H "x-fundgate-upi: demo@ybl" \
  -H "x-api-key: sk_live_demo1234567890" \
  -H "Content-Type: application/json" \
  -d '{"amount": 199.00}'
Request Body Schema
{
  // The amount to charge (Float)
  // Minimum: 1.00
  "amount": 199.00
}
Response Schema (Success)
{
  "status": "success",
  "data": {
    "display_id": "REF-8VANECVO", // User-friendly reference ID
    "amount": 199.00, // The exact amount requested
    "upi_url": "upi://pay?pa=dummy@paytm...", // Raw intent URL for native app redirection
    "payment_token": "ab12cd34...", // Secure token required to verify the payment later
    "payment_link": "https://fundgate.mazid.dev/pay/order/..." // Hosted checkout page URL
  }
}
POST

/api/developer/verify

Verify the status of a payment using the token. You should poll this or call it on successful UI flow.

curl -X POST https://fundgate.mazid.dev/api/developer/verify \
  -H "x-fundgate-userid: usr_demo_12345" \
  -H "x-fundgate-upi: demo@ybl" \
  -H "x-api-key: sk_live_demo1234567890" \
  -H "Content-Type: application/json" \
  -d '{"payment_token": "ab12cd34..."}'
Request Body Schema
{
  // The token returned from /create endpoint
  "payment_token": "ab12cd34..."
}
Response Schema (Success)
{
  "status": "success",
  "data": {
    "status": "PAID", // Status of the payment (PAID, PENDING, EXPIRED, FAILED)
    "paytm_txn_id": "202607291111...", // The bank transaction ID from the gateway
    "amount": 199.00, // The exact amount received
    "date": "2026-07-29 12:59:40.0" // Timestamp of the successful transaction
  }
}
Response Schema (Pending)
{
  "status": "pending",
  "message": "Payment is still pending" // Or "Processing"
}
Response Schema (Edge Cases & Errors)
// 1. Amount Tampering / Mismatch
{
  "status": "error",
  "message": "Amount mismatch detected"
}

// 2. Already Redeemed
{
  "status": "success",
  "message": "Order already redeemed",
  "data": { "status": "PAID", "amount": 199.00 }
}

// 3. 10-Minute Expiry
{
  "status": "error",
  "message": "Order has expired (10 minutes validity)"
}

// 4. Invalid Token
{
  "status": "error",
  "message": "Invalid payment token"
}