DEVELOPER DOCUMENTATION

Integrate in minutes.

Create a payment order, show the hosted dynamic UPI QR checkout, and receive a signed event when a supported payment notification is matched.

API v1 · HTTPS · JSON

Quick start

  1. Create a merchant account and connect your receiving Gmail inbox and UPI ID.
  2. Create an API key in the dashboard.
  3. Call POST /api/v1/orders.php from your own backend.
  4. Show the returned pay_url to your customer.
  5. Receive a signed order event on your HTTPS webhook endpoint or poll the order status. Email matching is a notification signal, not final bank settlement proof.
Your server → FAMGATEWAY → UPI QR → Gmail match → Webhook

Authentication

Send your API key in the Authorization header. Keep this key on your backend only. Never put it in browser code or a publicly distributed app.

Authorization: Bearer fg_live_YOUR_SECRET_KEY
Content-Type: application/json

Test mode

Create separate Live and Test API keys from the API Keys page. Test keys only create sandbox orders; they do not generate a real UPI payment request or access a merchant inbox. The test checkout has a labelled “Simulate test payment” action and emits payment.test_paid.

You can also create a no-money test checkout from Test Payment in the merchant workspace. Never deliver a real product, credit a balance or mark a customer invoice paid from a test event, even if its test status is paid.

Account recovery

Use Forgot password on the sign-in page. The system stores only a hash of the one-time reset token; links expire after 30 minutes and are single-use. Email delivery requires your hosting provider's outgoing mail service to be configured.

Create an order

POST https://ventexmods.vipsite.in/api/v1/orders.php

Request body:

{
  "amount": 499,
  "order_id": "INV-1001",
  "expires_in": 300,
  "metadata": { "user_id": 42 }
}

Amount must be from ₹1.00 to ₹50,000.00, with up to 2 decimal places. FAMGATEWAY uses the exact requested amount; it does not add paise. The order_id is optional: omit it and the server generates one. Because exact amounts are preserved, two simultaneous orders from the same merchant with the same amount can be ambiguous in Gmail-only matching; ambiguous notifications are not auto-marked paid. It is embedded in the UPI request as a transaction reference, so the customer does not type it. Expiry range is 120–3600 seconds.

Successful response:

{
  "status": "success",
  "data": {
    "order_id": "INV-1001",
    "status": "pending",
    "amount": 499.00,
    "expires_at": "2026-11-22T13:00:00+05:30",
    "pay_url": "https://your-domain/pay.php?o=...",
    "upi_link": "upi://pay?pa=merchant%40upi&pn=Shop&tr=FGW0123456789ABCDEF0123456789ABCD&am=499.00&cu=INR&tn=Order%20INV-1001"
  }
}

Get order status

GET https://ventexmods.vipsite.in/api/v1/orders.php?order_id=INV-1001

Use either id (the returned public token) or your own order_id. A matched order returns UTR, transaction ID, payer name when extracted, and the matched timestamp. Validate final payment status with your authorised provider/account before fulfillment.

{ "status": "success", "data": { "order_id": "INV-1001", "status": "paid", "amount": 499.00,
  "payment": { "utr": "412345678901", "txn_id": "FAM8K2X91Q" } } }

Webhooks

Configure an HTTPS URL in your dashboard. Each matched notification triggers payment.verified; unpaid orders trigger order.expired. Treat the email match as provisional until confirmed by the authorised payment provider/account. Failed deliveries retry after 1, 5, 30 minutes, 2 hours and 6 hours.

Verify the raw request body using HMAC-SHA256. For replay protection, also validate the timestamp is within five minutes.

$expected = hash_hmac('sha256', $timestamp . '.' . $rawBody, $signingSecret);
if (!hash_equals($expected, $receivedSignatureV2)) {
    http_response_code(401); exit;
}

Connect your own bot or website

Use this prompt with your developer or coding assistant. It is designed for a Telegram bot, PHP website, Node.js app, or another backend. Replace the placeholders with your own values; never paste a live API key into a public chat or frontend.

Integrate FAMGATEWAY payments into my existing project without removing or changing any existing features, UI, database records, commands, or workflows.

Gateway base URL: https://YOUR-GATEWAY-DOMAIN
API endpoint: POST /api/v1/orders.php
Authentication: Authorization: Bearer YOUR_MERCHANT_API_KEY

When a customer chooses a product or adds balance:
1. On my SERVER/BACKEND only, create a unique order_id and send a JSON POST request with amount, order_id (optional; gateway can generate it), expires_in (300 to 3600 seconds), and optional metadata.
2. Read the returned data.pay_url, data.upi_link, data.amount, data.id, and data.expires_at. Show the exact amount returned by FAMGATEWAY. Do not calculate or alter the amount returned by FAMGATEWAY.
3. Show a QR code generated from data.upi_link inside my bot or website. Also provide a Pay button that opens data.pay_url. If QR display is not supported (for example, some Telegram clients), send the hosted pay_url as a clickable button. Do not claim payment is complete just because the QR was scanned or the link was opened.
4. Confirm payment only from a verified FAMGATEWAY server response or a valid signed webhook. For polling, call GET /api/v1/orders.php?id=RETURNED_PUBLIC_ID with the same Bearer API key. Treat the gateway status as a notification match only; before fulfilment, also confirm payment through the authorised provider or merchant account. Check the returned mode: if mode is test, never deliver goods or credit balance, even when status is paid. Pending, expired, failed, missing, or network-error states must not deliver goods or credit balance.
5. For webhooks, expose an HTTPS endpoint on my backend, validate the FAMGATEWAY HMAC-SHA256 signature against the raw request body and timestamp (reject timestamps older than 5 minutes), deduplicate event IDs/order IDs, and make fulfillment idempotent. Respond with HTTP 2xx only after safely recording the event.
6. After confirmed payment, update my existing order/balance exactly once, then show a success message. On expiry, allow the customer to create a fresh order. Never trust a client-side success redirect or a screenshot as proof of payment.

Implementation requirements:
- Keep the API key in server-side environment/config storage; never expose it in HTML, JavaScript, mobile app source, or Telegram messages.
- Use HTTPS, validate amounts and order ownership, add request timeouts, handle API errors, and log safely without logging secrets.
- Preserve my current project structure and existing features. First inspect the project and tell me which files need changes; then implement the smallest safe integration.
- Provide a test mode or clearly labelled test order flow before enabling live customer payments. Reject all test-mode events from real fulfilment, balance credit or customer invoices.

Return the exact files changed, setup steps, webhook URL to register, and a test checklist. Do not invent API fields or mark a payment paid without a verified gateway status.

For websites, render the returned upi_link as a QR and use pay_url as a redirect/button. For Telegram bots, send a URL button and, where supported, an image QR generated by your bot backend. The API key must remain server-side.

Security and limitations

  • Gmail App Passwords are encrypted using AES-256-GCM and never displayed after saving.
  • Only messages from approved payment sender domains with Gmail authentication results passing DKIM, SPF or DMARC are considered. Auto-matching additionally requires an extracted transaction reference, the exact credited UPI ID, unique amount and an order-time match.
  • Duplicate message IDs and UTRs are blocked per merchant.
  • Gmail notification matching is an automated status signal, not a bank statement or a guarantee of settlement. Check your account/provider records for disputes, reversals or delayed notifications.
  • Funds go directly to the merchant's UPI account. This software does not hold, pool or settle funds.