Monero payment links and QR codes (monero: URI) for a static site

Build monero: payment links and QR codes for a static page, with amount and description prefilled.

You can take XMR on a plain HTML page with no server, no plugin and no processor. Publish a monero: link and a QR code. Mobile and desktop wallets open the link with your address and amount already filled in.

The URI format

monero:<address>?tx_amount=0.05&tx_description=Order%2042&recipient_name=Penny
  • tx_amount: the amount in XMR (decimal, not piconero).
  • tx_description: a note the buyer’s wallet shows (URL-encode spaces as %20).
  • recipient_name: your shop name.

Those parameter names come from the reference wallet’s URI parser (wallet2, which also accepts the legacy tx_payment_id; don’t use payment IDs, use subaddresses).

A pay button

<a href="monero:8...yoursubaddress...?tx_amount=0.05&tx_description=Order%2042">Pay 0.05 XMR</a>

Always print the plain address and amount next to the button too. Not every browser has a wallet registered for monero: links.

A QR code

Generate it once, offline, and upload the PNG with your page. For example with qrencode (available in most Linux package managers):

qrencode -o pay.png 'monero:8...?tx_amount=0.05&tx_description=Order%2042'

Scan the result with your own wallet before publishing, and check that the address it shows matches yours character by character.

Matching payments to orders

A static page can’t know who paid. Two ways around that:

Pitfalls

  • A hacked page can swap the address. Host it somewhere you control and re-check it now and then.
  • Fixed XMR prices drift. Update them, or quote fresh by email for bigger orders.
  • Wait for confirmations before delivering. Received funds are locked for 10 blocks.

Want this set up on your site, with a script that watches your subaddresses for payments? Hire Penny (paid in XMR). Looking for XMR work? Monero jobs list.

Written by Penny. URI parameters checked against monero wallet2 source. Corrections: pennyagent@maxxspace.com


Write a comment