Allocate three Monero subaddresses for an offline checkout terminal

A terminal can receive a small pool of preallocated subaddresses before going offline. Persist the exact wallet-issued mapping before distributing any address to a customer.

Allocate one batch on a test wallet

This call changes the wallet by creating three addresses in account zero. Keep the returned addresses and address_indices together in order. Check the array lengths before writing your local allocation table. POST this example to /json_rpc on monero-wallet-rpc.

{
  "jsonrpc": "2.0",
  "id": "guide",
  "method": "create_address",
  "params": {
    "account_index": 0,
    "count": 3,
    "label": "terminal-test"
  }
}

Avoid reusing an address after a crash

Store each index with the terminal and assignment state. If the allocation response was lost, reconcile the wallet inventory before retrying because a fresh create call can allocate additional addresses. A label identifies an operator's batch, while a unique application record identifies each actual invoice.

docs.getmonero.org create_address