All API requests should be made to the following base URL:
https://cryptoapi.onegateway.in/api/v1/publicReplace your-domain.com with your actual production domain.
All public API requests must be authenticated using your API Key. Include your API Key in the X-API-Key header of your HTTP requests. You can generate and view your API keys on the Settings page.
X-API-Key: pk_live_your_api_key_hereCreates a new cryptocurrency payment session and returns a checkout URL to redirect your customer.
POST /payment-linksHeaders:
Content-Type: application/jsonX-API-Key: <YOUR_API_KEY>Body:
{
"amount": 1000,
"currency": "INR",
"customer_name": "John Doe",
"customer_email": "john@example.com",
"customer_number": "+1234567890",
"order_id": "ORD-12345",
"redirect_url": "https://your-domain.com/checkout/success",
"expires_in_minutes": 60,
"metadata": {
"internal_tracking_id": "ABC-123",
"campaign": "summer_sale"
}
}{
"link_id": "pl_a1b2c3d4e5f6g7h8",
"checkout_url": "https://oneapi.in/pay/v2/pl_a1b2c3d4e5f6g7h8",
"deposit_address": "0x55d398326f99059fF775485246999027B3197955",
"amount_usdt": 11.976048,
"original_amount": 1000,
"original_currency": "INR",
"status": "pending"
}Redirect your user to the checkout_url provided in the response.
Poll the status of a specific payment link. Useful if you want to verify payment completion before fulfilling an order.
GET /payment-links/:link_idHeaders:
X-API-Key: <YOUR_API_KEY>{
"link_id": "pl_a1b2c3d4e5f6g7h8",
"amount_usdt": 11.976048,
"original_amount": 1000,
"original_currency": "INR",
"status": "paid",
"deposit_address": "0x55d398326f99059fF775485246999027B3197955",
"expires_at": "2024-01-01T12:30:00.000Z",
"metadata": {},
"redirect_url": "https://your-domain.com/checkout/success",
"customer_name": "John Doe",
"customer_email": "john@example.com",
"customer_number": "",
"order_id": "ORD-12345",
"created_at": "2024-01-01T12:00:00.000Z"
}The status field will be one of: pending, paid, failed, expired, cancelled, overpaid.
Instead of polling the status API, we highly recommend setting up Webhooks. Webhooks will instantly notify your server when a payment is successful. Configure your Webhook URL in the Settings page.
When a payment status changes to paid, we will send a POST request to your configured webhook URL:
{
"event":"payment.paid",
"link_id":"pl_f90f3258e9eb7d3a",
"amount_usdt":0.018868,
"received_usdt":0.018868,
"original_amount":2,
"original_currency":"INR",
"customer_name":"John Doe",
"customer_email":"john@example.com",
"customer_number":"+1234567890",
"order_id":"ORD-12345",
"tx_hash":"0xaf75617dcfcbe1d724159a15a8bf92212ecf1107fc14937abf2f7dae7cbdf612",
"metadata":{
"internal_tracking_id":"ABC-123",
"campaign":"summer_sale"
},
"timestamp":"2026-06-26T20:32:32.525Z"
}To ensure the webhook is genuinely from us, you should verify the X-Signature header using your Webhook Secret (available in your dashboard).
Node.js Verification Example:
import crypto from 'crypto';
import express from 'express';
const app = express();
// Use raw body parsing for webhook signature verification
app.use(express.json({
verify: (req, res, buf) => {
(req as any).rawBody = buf;
}
}));
app.post('/webhook', (req, res) => {
const signature = req.headers['x-signature'];
const webhookSecret = process.env.WEBHOOK_SECRET;
// Generate expected signature using HMAC SHA256
const expectedSignature = crypto
.createHmac('sha256', webhookSecret)
.update((req as any).rawBody)
.digest('hex');
if (signature !== expectedSignature) {
return res.status(401).send('Invalid signature');
}
const payload = req.body;
if (payload.event === 'payment.success') {
// Fulfill the order
console.log(`Order ${payload.data.order_id} was paid!`);
}
res.status(200).send('Webhook received');
});