GETTING STARTED

5-Minute Quickstart Guide

This step-by-step guide will walk you through processing your first payin deposit order and receiving webhook notifications in under 5 minutes.

1

Obtain your Merchant API Key

Navigate to your Merchant DashboardProfile SettingsAPI Keys section. Generate or copy your secret key.

💡 Secret keys grant full access to initiate payins and payouts. Keep your secret key protected and never commit it to public repositories.

2

Create a Payin Order

Send a POST request to /api/create-order with the customer info and deposit amount in INR:

JAVASCRIPT
const response = await fetch('https://checkout.onnxpay.com/api/create-order', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'YOUR_MERCHANT_API_KEY'
  },
  body: JSON.stringify({
    amount_inr: 1000,
    currency: 'INR',
    order_id: 'ORDER_109283',
    customer_details: {
      name: 'John Doe',
      merchant_user_id: 'USR_109283'
    },
    callback_url: 'https://yourdomain.com/'
  })
});

const data = await response.json();
console.log(data);
// Output: { success: true, payment_id: "pay_xxx", checkout_url: "https://checkout.onnxpay.com/pay/pay_xxx" }
3

Redirect Customer to Checkout URL

Redirect the user to the returned checkout_url. The customer views the matched vendor bank or UPI payment details and submits their payment proof.

Once the vendor approves the payment proof and the order settles, the checkout page automatically redirects the customer back to your merchant site URL (callback_url).

4

Receive Webhook Callback

When the vendor confirms receipt of the INR payment, OnnXpay posts the completion payload to your configured callback_url:

JAVASCRIPT
app.post('/', (req, res) => {
  const { payment_id, order_id, status, amount_usdt, amount_inr, utr_number } = req.body;

  if (status === 'completed') {
    // 1. Credit user account in your database
    console.log(`Payment ${payment_id} succeeded for order ${order_id}. UTR: ${utr_number}`);
  }

  // Always respond with HTTP 200 OK
  res.status(200).json({ received: true });
});