Knowledge Base
  1. Home
  2. Knowledge Base
  3. Developer guides
Developer guides

Monero payment API (XMR) for developers

Accept Monero with the PayGate.to API: a one-time XMR address per order, amount and QR code, the 10-block lock, pending callbacks and payouts to your subaddress.

3 min readUpdated Intermediate
On this page
  1. Your payout wallet
  2. Step 1: Create the payment address
  3. Step 2: Amount and QR code
  4. Step 3: Timing and callbacks
  5. With the SDKs
  6. Privacy notes
  7. Frequently asked questions

Monero (XMR) is a privacy coin: amounts and parties aren't visible on its blockchain, so a payment can't be matched to an order by looking at the chain. The usual answer is a fresh address per order, and that's exactly what the PayGate.to API gives you, with forwarding to your own wallet and a signed callback. Merchant overview: Accept Monero payments.

Your payout wallet

A Monero address you control: a primary address (4…) or, better, a subaddress (8…), both 95 characters. A dedicated subaddress keeps shop income separate in your wallet. We created payment addresses with both kinds. Wallet guides: Feather Wallet or Cake Wallet.

Step 1: Create the payment address

bash
curl "https://api.paygate.to/crypto/xmr/wallet.php?address=8YourMoneroSubaddress&callback=https%3A%2F%2Fshop.example8585859.com%2Fpaygate%2Fcallback%3Forder%3D1001"
json
{ "address_in": "8Ajb…(95 characters)", "callback_url": "https://shop.example8585859.com/paygate/callback?order=1001", "ipn_token": "…" }

address_in is a one-time subaddress for this order. Add &pending=1 to also get a callback when the payment is first seen.

Step 2: Amount and QR code

bash
curl "https://api.paygate.to/crypto/xmr/convert.php?value=49.90&from=USD"
# {"status": "success", "value_coin": "0.09953503", "exchange_rate": "0.00199469"}

curl "https://api.paygate.to/crypto/xmr/qrcode.php?address=ADDRESS_IN&amount=0.09953503"

Monero amounts have up to 12 decimals; keep them as strings. The minimum is 0.01 XMR at the time of writing (GET /crypto/xmr/info.php).

Step 3: Timing and callbacks

Monero blocks arrive about every 2 minutes, and received funds are locked for 10 blocks (about 20 minutes) before they can be moved. So:

  1. The customer pays. If you created the address with pending=1, you can also get an early callback marked pending=1 once the transaction is seen: show "payment received, confirming", but don't ship yet.
  2. After the lock, PayGate.to forwards the XMR to your wallet and sends the confirmed callback with txid_in, txid_out, value_coin and address_out.
  3. Verify the signature, credit txid_in once, check coin=xmr and the amount, and check that your own address received its share. Details: Verify PayGate.to callback signatures.

Tell customers the order updates automatically and they don't need to keep the page open.

With the SDKs

php
$wallet = $paygate->crypto()->createWallet('xmr', '8YourMoneroSubaddress', $callback, ['pending' => true]);
$quote  = $paygate->crypto()->convert('xmr', '49.90', 'USD');
$qr     = $paygate->crypto()->qrCode('xmr', $wallet->getAddressIn(), $quote['value']);
js
const wallet = await paygate.crypto.createWallet('xmr', '8YourMoneroSubaddress', callback, { pending: true });

In the hosted checkout, the key is xmr: Build a hosted multi-coin checkout.

We created Monero payment addresses, conversions and QR codes with the PHP SDK and with plain HTTP against the live API while writing this guide.

Privacy notes

  • PayGate.to never needs your view key or spend key: you only give an address.
  • On the Monero blockchain, outsiders can't link the customer's payment to your wallet.
  • Your server still knows which order paid. Keep callback logs as private as order data.

Frequently asked questions

Why didn't the callback arrive right after the customer paid?

Monero's 10-block lock: funds can't be forwarded for about 20 minutes. Enable pending=1 if you want an early notice.

Can I use an integrated address or a payment ID?

Use a plain primary address or subaddress. Each order already gets its own one-time address, so payment IDs aren't needed.

Does the customer need a special wallet?

Any Monero wallet can pay the one-time address.

This guide is also available as Markdown for AI assistants and offline reading.