PAYIN GATEWAY
Check Payment Status & Polling
Query or poll the real-time status of a payin deposit order to update user interfaces immediately upon vendor confirmation.
Status Response Schema
JSON
{
"payment_id": "pay_a75d6c7382fa4501",
"order_id": "MERC_TEST_4821",
"status": "completed",
"amount_inr": 1000,
"amount_usdt": 11.52,
"exchange_rate": 86.8,
"utr_number": "220912882711",
"created_at": 1784651000000,
"completed_at": 1784651100000
}Possible Payment Status Values
| Status State | Description |
|---|---|
| pending | Invoice created, waiting for user payment proof submission or vendor verification. |
| completed | Payment confirmed and verified. USDT funds credited to merchant balance. |
| expired | Invoice exceeded the 15-minute validity window without payment proof. |
| cancelled | Payment aborted by customer or rejected due to invalid transaction proof. |
Frontend Polling Implementation
We recommend polling the status endpoint every 4 to 5 seconds on custom checkout screens:
JAVASCRIPT
// Frontend Polling Example (every 4 seconds)
const checkPaymentStatus = async (paymentId) => {
const res = await fetch(`https://checkout.onnxpay.com/api/payment/${paymentId}/status`);
const data = await res.json();
if (data.status === 'completed') {
// Show success checkmark and redirect to order receipt
window.location.href = '/success';
} else if (data.status === 'expired' || data.status === 'cancelled') {
// Show timeout message
alert('Payment expired. Please try again.');
}
};