FLINPE API · Production
UPI payments,
from API to confirmation.
Create an order, show hosted checkout or app-specific UPI intents, render the returned QR, and reconcile the final status from your server.
REST APIUPI IntentDynamic QRStatic QRCallbacks
● LIVECreate & track ordersServer-to-server order creation with merchant-scoped status lookup.
● LIVECheckout, intents & QRUse the hosted payment URL or render returned UPI app links and QR.
● LIVEStatic QR captureRecord Paytm static QR credits with unique-UTR and merchant validation.
Get started
Quickstart
Complete these four steps for the first production payment.
1. Copy your tokenSign in to Merchant Dashboard → Developer and copy user_token.
2. Create an orderCall the API from your backend using a new order_id.
3. Start paymentRedirect to payment_url, open a returned deep link, or display qrUrl.
4. Confirm server-sidePoll Check Order and consume the merchant callback idempotently.
curl -X POST 'https://flinpe.com/v1/api/create-order.php' \
-H 'Content-Type: application/json' \
-d '{
"user_token": "YOUR_USER_TOKEN",
"order_id": "ORD_10001",
"amount": 500,
"customer_name": "Amit",
"customer_mobile": "9876543210",
"redirect_url": "https://merchant.example/payment-return"
}'
Get started
Authentication
Production pay-in APIs accept your merchant user_token in the request body. Obtain it from Merchant Dashboard → Developer.
Server-side only: never put the token in browser JavaScript, mobile applications, QR content, logs, screenshots, or public source control.
JSON
{"user_token":"YOUR_USER_TOKEN"}
Get started
Production base URL
HTTPShttps://flinpe.com
| API | Canonical production endpoint |
|---|
| Create order | POST /v1/api/create-order.php |
| Check order | POST /v1/api/check-order.php |
| Hosted checkout | GET /pay/checkout.php?order_id=... |
| Paytm static capture | POST /webhooks/paytm-static.php |
Send API requests from your backend. Both JSON and application/x-www-form-urlencoded bodies are accepted by pay-in endpoints.
UPI pay-ins
Create order
Creates a routed UPI order. A successful response contains hosted checkout, the raw UPI URI, app deep links, and a QR URL when supplied by the active route.
POSThttps://flinpe.com/v1/api/create-order.php
Request fields
| Field | Type | Requirement | Description |
user_token | string | Required | Merchant token |
order_id | string | Required | Your unique order reference. Never reuse it. |
amount | number | Required | Positive INR amount. Use whole-rupee values. |
customer_mobile | string | Optional | 10 digits when supplied |
customer_name | string | Optional | Payer display name |
redirect_url | URL | Optional | Browser return destination after checkout |
remark1 | string | Optional | Your internal note |
remark2 | string | Optional | Additional metadata note |
JSON request
{
"user_token": "YOUR_USER_TOKEN",
"order_id": "ORD_10001",
"amount": 500,
"customer_name": "Amit",
"customer_mobile": "9876543210",
"redirect_url": "https://merchant.example/payment-return",
"remark1": "Invoice 4821"
}
Successful response
{
"status": true,
"message": "Order created successfully.",
"result": {
"orderId": "ORD_10001",
"payment_url": "https://flinpe.com/pay/checkout?order_id=ORD_10001",
"upi": "upi://pay?pa=merchant@bank&pn=Merchant&am=500&cu=INR&tr=ORD_10001",
"qrUrl": "https://gateway.example/qr/...",
"gateway": "paytm",
"route": "Harsh Paytm",
"payin_route": 80,
"deeplinks": {
"paytm": "paytmmp://pay?...",
"phonepe": "phonepe://pay?...",
"gpay": "tez://upi/pay?...",
"bhim": "bhim://pay?...",
"upi": "upi://pay?..."
},
"securestack_order_id": "gateway-order-reference"
}
}
UPI pay-ins
Response fields
| Field | How to use it |
payment_url | Recommended hosted checkout. Redirect the customer here. |
upi | Generic UPI URI. Use unchanged or encode it into a QR. |
qrUrl | Dynamic QR image for this order and amount. |
deeplinks.paytm | Open Paytm directly on supported mobile devices. |
deeplinks.phonepe | Open PhonePe directly. |
deeplinks.gpay | Open Google Pay directly. |
deeplinks.bhim | Open BHIM directly. |
securestack_order_id | Gateway reference for support and reconciliation; do not treat it as payment success. |
Some route/provider combinations may omit an app-specific link. Hide that app button when its field is empty and retain the generic upi option.
Customer experience
Hosted checkout
The fastest integration is a redirect to the exact payment_url returned by Create Order.
const result = createOrderResponse.result;
window.location.assign(result.payment_url);
The redirect URL is a customer navigation event, not proof of payment. Always verify the order from your backend.
Customer experience
UPI deep links
Use app links exactly as returned. Do not replace their schemes with intent:// and do not rebuild signed/provider parameters.
Mobile buttons
<a href="PAYTM_LINK_FROM_RESPONSE">Pay with Paytm</a>
<a href="GPAY_LINK_FROM_RESPONSE">Pay with Google Pay</a>
<a href="PHONEPE_LINK_FROM_RESPONSE">Pay with PhonePe</a>
<a href="UPI_LINK_FROM_RESPONSE">Open any UPI app</a>
| App | Response field | Typical scheme |
|---|
| Paytm | deeplinks.paytm | paytmmp:// |
| Google Pay | deeplinks.gpay | tez:// |
| PhonePe | deeplinks.phonepe | phonepe:// |
| BHIM | deeplinks.bhim | bhim:// |
| Any UPI app | deeplinks.upi / upi | upi://pay |
UPI schemes work on compatible mobile devices with the selected app installed. On desktop, show the QR instead.
Customer experience
Intent / dynamic QR
Each API order can return an amount-locked dynamic QR. Prefer qrUrl. If it is empty, generate a QR locally from the exact upi string using a trusted QR library.
Render returned QR
<img src="QR_URL_FROM_CREATE_ORDER" alt="Scan to pay ₹500">
Generate QR locally from UPI URI
// Server receives result.upi from FLINPE.
// Encode this exact value; do not decode and rebuild it.
QRCode.toCanvas(canvasElement, result.upi, {
width: 280,
errorCorrectionLevel: "M"
});
Dynamic QR: tied to one order and amount. Static QR: permanent QR where the customer enters the amount. Use dynamic QR for ecommerce order reconciliation.
UPI pay-ins
Check order status
Call from your backend. FLINPE may refresh a pending order from the active gateway before returning the result.
POSThttps://flinpe.com/v1/api/check-order.php
Request
curl -X POST 'https://flinpe.com/v1/api/check-order.php' \
-H 'Content-Type: application/json' \
-d '{"user_token":"YOUR_USER_TOKEN","order_id":"ORD_10001"}'
Response
{
"status": true,
"message": "Order fetched.",
"result": {
"orderId": "ORD_10001",
"txnStatus": "SUCCESS",
"amount": 500,
"utr": "520003750049",
"method": "harsh_paytm",
"payin_route_used": 80
}
}
Recommended polling: every 3–5 seconds while the customer is on checkout, then reduce frequency. Stop on a terminal status.
Static QR
Permanent static QR
Admin enables Static QR for the merchant. The merchant then opens Dashboard → QR & static link to view and download the permanent QR.
Admin enables accessAdmin → Merchants → Edit → Static QR → On.
Merchant gets QRMerchant Dashboard → QR & static link.
Customer enters amountThe permanent QR does not lock an amount.
Capture confirms creditSecureStack or the Paytm capture endpoint records the payment.
For order-level checkout, use Create Order and dynamic QR. Static QR is best for counters, stores, invoices, and direct collections.
Static QR
Paytm static payment capture
An authorized notification forwarder can submit a received Paytm credit. This is an inbound FLINPE endpoint, separate from your merchant callback.
POSThttps://flinpe.com/webhooks/paytm-static.php
Headers
Content-Type: application/json
X-Klivio-Token: YOUR_USER_TOKEN
X-Klivio-Signature: OPTIONAL_HMAC_SHA256_OF_RAW_BODY
Payload
{
"provider": "paytm",
"sender": "PAYTM",
"amount": 599,
"utr": "20260920011060000308530975143710606",
"vpa": "merchant@paytm",
"payer_name": "Customer"
}
Optional signature (PHP)
$rawBody = json_encode($payload, JSON_UNESCAPED_SLASHES);
$signature = hash_hmac('sha256', $rawBody, $merchantUserToken);
UTR is mandatory and idempotent. A duplicate UTR does not credit the wallet twice. Never forward OTPs, UPI PINs, bank passwords, or unrelated SMS content.
Events
Merchant callback
Set the merchant callback URL in the dashboard. On a confirmed payment, FLINPE sends an HTTP POST using application/x-www-form-urlencoded.
Callback fields
status=SUCCESS
order_id=ORD_10001
amount=500
customer_mobile=9876543210
utr=520003750049
txn_id=520003750049
PHP receiver
<?php
$orderId = trim($_POST['order_id'] ?? '');
$status = strtoupper(trim($_POST['status'] ?? ''));
$utr = trim($_POST['utr'] ?? '');
if ($orderId === '' || $status === '') {
http_response_code(400);
exit('invalid');
}
// Confirm independently with Check Order before fulfilment.
// Apply your business action idempotently by order_id.
http_response_code(200);
echo 'ok';
Delivery contract: callback delivery is best-effort. Your system must use Check Order for recovery and must tolerate duplicate or delayed events.
Events
Safe reconciliation
Store PENDING firstPersist your order before calling FLINPE.
Verify server-sideNever trust the redirect query string or frontend success screen.
Use idempotencyFulfil once per unique order_id; store the UTR.
Run recovery pollingRecheck pending orders after callback timeouts or outages.
Code examples
PHP integration
<?php
$payload = [
'user_token' => getenv('FLINPE_API_KEY'),
'order_id' => 'ORD_' . bin2hex(random_bytes(8)),
'amount' => 500,
'customer_name' => 'Amit',
'customer_mobile' => '9876543210',
'redirect_url' => 'https://merchant.example/payment-return'
];
$ch = curl_init('https://flinpe.com/v1/api/create-order.php');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
if (!($response['status'] ?? false)) {
throw new RuntimeException($response['message'] ?? 'Order creation failed');
}
header('Location: ' . $response['result']['payment_url']);
Code examples
Node.js integration
const response = await fetch("https://flinpe.com/v1/api/create-order.php", {
method: "POST",
headers: {"content-type": "application/json"},
body: JSON.stringify({
user_token: process.env.FLINPE_API_KEY,
order_id: "ORD_" + crypto.randomUUID(),
amount: 500,
customer_name: "Amit",
customer_mobile: "9876543210",
redirect_url: "https://merchant.example/payment-return"
})
});
const data = await response.json();
if (!data.status) throw new Error(data.message);
console.log(data.result.payment_url);
Code examples
Mobile payment buttons
Your backend should create the order and return only payment presentation fields to the browser.
function setPaymentLinks(result) {
const links = {
paytm: result.deeplinks?.paytm,
gpay: result.deeplinks?.gpay,
phonepe: result.deeplinks?.phonepe,
upi: result.upi
};
for (const [id, href] of Object.entries(links)) {
const el = document.getElementById(id);
if (!href) { el.hidden = true; continue; }
el.href = href;
}
if (result.qrUrl) document.getElementById("upi-qr").src = result.qrUrl;
}
Reference
Order statuses
| Status | Meaning | Merchant action |
|---|
PENDING | Waiting for final confirmation | Keep polling; do not fulfil |
SUCCESS | Payment confirmed | Fulfil idempotently |
FAILED | Gateway reported failure | Allow a new order/payment attempt |
REJECTED | Payment/order rejected | Do not fulfil |
REFUND | Order marked refunded in reporting | Reconcile refund operations separately |
Reference
Errors
Pay-in validation errors can be returned as HTTP 200 with status:false. Always inspect the JSON body as well as HTTP status.
| Message / code | Cause | Fix |
|---|
Invalid user_token. | Token not mapped to a merchant | Copy the token again from Developer |
Duplicate order_id. | Reference already exists | Generate a new unique ID |
Amount is below merchant minimum. | Configured minimum not met | Increase amount or contact admin |
Assigned payin route is not available | Merchant route is unsupported/inactive | Ask admin to assign an active route |
Order not found. | Order/token pair does not match | Use the same merchant token used at creation |
401 | Static capture token/signature failed | Check headers and raw-body signature |
500 | Temporary server/provider issue | Retry safely with the same order reference only after checking status |
Reference
Security practices
Keep tokens in secrets storageLoad credentials from environment variables or a secret manager.
Use HTTPS callbacksReject plaintext callback URLs in production.
Verify before fulfilmentCheck status with your token and order ID.
Redact logsDo not log tokens, raw bank notifications, OTPs, or customer secrets.
Prevent SSRFKeep callback infrastructure public, fixed and monitored.
Alert on duplicate UTRNever apply the same payment reference twice.
Launch
Go-live checklist
Merchant active and KYC approvedConfirm account access, limits and route assignment.
Token stored server-sideNo production credential in frontend code.
Unique order IDsUse collision-resistant references and persist before API calls.
Mobile and desktop testedTest app intents on mobile and QR on a separate device.
Callback + polling testedRecover successfully when a callback is delayed or missed.
Support references storedKeep order ID, gateway reference and UTR with timestamps.
COLLECT / DIGITAL ASSETS
USDT Payin
Give each payment a fresh deposit address. Ask the customer to send the exact amount on the selected network, then confirm the provider status. Minimum amount: $20 USD.
● ACTIVEStatic payment linkCustomer enters the USD amount, then receives a fresh address and QR.
● ACTIVEDynamic depositMerchant creates an amount-specific deposit and tracks its provider status.
● PROVIDER CONFIGServer-side keyAdmin configures the collection key; it is not exposed to customers.
Merchant tools: Open USDT Payin. The static link and QR are shown there. A created address is not proof of payment.
How to collect: Open Merchant Dashboard → USDT Payin, create an amount-specific deposit or copy your permanent customer link. FLINPE sends provider requests using the admin-configured key.
Provider reference · server side
POST/api/external/deposits/coins
List coins
Discover the coins accepted by the active provider before creating a deposit.
POST/api/external/deposits/networks
List networks
Choose the exact network code returned for the selected coin.
{"currency":"USDT"}
POST/api/external/deposits/create
Create deposit
Generate a unique order reference and save the returned provider ID, address, exact payable amount and network.
{"amount":20,"currency":"USDT","network":"PROVIDER_NETWORK_CODE","order_id":"YOUR_UNIQUE_ORDER"}
POST/api/external/deposits/status
Check deposit
Use the provider deposit ID to check the final status. Reconcile a completed result before fulfilment or wallet credit.
{"id":"PROVIDER_DEPOSIT_ID"}
FLINPE integration: Merchants create and track deposits from the dashboard or hosted payment link. Gateway credentials stay on FLINPE servers. Confirm the final payment status before fulfilment.