VMESH Payment API, Webhooks & Pay Button Integration
Create payment intents, poll public status or receive signed webhooks. Your server never shares a wallet private key with VargaMesh Pay.
Merchant quick start
For production checkout, create the payment on your server, redirect the customer to checkout_url and fulfil the order only after a signed webhook reports payment.paid or payment.overpaid.
- 1. Your server creates a payment through POST /api/v1/payments.
- 2. Redirect the customer to checkout_url returned by the API.
- 3. Verify X-VMESH-Pay-Signature on incoming webhooks.
- 4. Mark the order paid only for payment.paid or payment.overpaid.
curl -X POST https://pay.vargamesh.com/api/v1/payments \
-H 'X-VMESH-Pay-API-Key: YOUR_KEY' \
-H 'Content-Type: application/json' \
-d '{"use_address_pool":true,"amount":"125.00","description":"Order #1841","confirmations_required":2,"expires_in":1800,"webhook_url":"https://shop.example/vmesh/webhook"}'Embeddable Pay Button
For donations, invoices and simple checkout links, add one script and a <vmesh-pay-button> element. The button opens VargaMesh Pay with recipient and amount prefilled; no API key is exposed in the browser.
<script src="https://pay.vargamesh.com/assets/vmesh-pay-button.js" async></script>
<vmesh-pay-button recipient="shop.vmesh" amount="25" label="My Shop" reference="Order #1841" confirmations="2" expires="1800" lang="en">Pay with VMESH</vmesh-pay-button>Supported attributes: recipient, amount, label, reference, confirmations, expires, lang and theme.
PHP example
<?php
$payload = json_encode([
'use_address_pool' => true,
'amount' => '125.00',
'description' => 'Order #1841',
'confirmations_required' => 2,
'expires_in' => 1800,
'webhook_url' => 'https://shop.example/vmesh/webhook',
]);
$ch = curl_init('https://pay.vargamesh.com/api/v1/payments');
curl_setopt_array($ch, [CURLOPT_POST=>true, CURLOPT_POSTFIELDS=>$payload, CURLOPT_RETURNTRANSFER=>true, CURLOPT_HTTPHEADER=>['Content-Type: application/json','X-VMESH-Pay-API-Key: '.getenv('VMESH_PAY_API_KEY')]]);
$payment = json_decode(curl_exec($ch), true);
header('Location: '.$payment['checkout_url']);Node/JavaScript example
const response = await fetch('https://pay.vargamesh.com/api/v1/payments', {
method: 'POST',
headers: {'Content-Type':'application/json','X-VMESH-Pay-API-Key':process.env.VMESH_PAY_API_KEY},
body: JSON.stringify({use_address_pool:true, amount:'125.00', description:'Order #1841', confirmations_required:2, expires_in:1800, webhook_url:'https://shop.example/vmesh/webhook'})
});
const payment = await response.json();
// Redirect the customer to payment.checkout_urlMarket price API
GET /api/v1/market returns the cached VMESH/USDT NestEx ticker used by this site. It is public market data and must not be treated as a guaranteed execution price.
GET /api/v1/marketMerchant receive-address pool
Import fresh public VMESH receive addresses through POST /api/v1/merchant/addresses, then create a payment with "use_address_pool": true and omit recipient. Each address is leased once and never automatically reused.
Webhook verification
Every webhook carries X-VMESH-Pay-Signature: sha256=…. Verify HMAC-SHA256 over the exact request body using your configured webhook secret.
X-VMESH-Pay-Event: payment.paid
X-VMESH-Pay-Signature: sha256=<hex HMAC>Security checklist
Keep API_KEY and WEBHOOK_SECRET server-side, use fresh receive addresses for orders, require HTTPS webhooks, verify HMAC signatures, use an idempotent order update and never fulfil from an unverified browser callback.
Integrate VMESH payments without custody
VargaMesh Pay separates payment coordination from wallet custody. Merchants can use their own public receive addresses, monitor on-chain settlement and connect order systems through signed webhooks.
