{
  "id": 19612810,
  "title": "Accept crypto payments in Node.js",
  "url": "https://urgent.news/2026/11/12/accept-crypto-payments-in-node-js",
  "topic": "finance",
  "section": "Finance & Markets",
  "published": "2026-11-12T06:37:34.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/moonvex/accept-crypto-payments-in-nodejs-561o"
  },
  "original_language": "en",
  "account": "To accept cryptocurrency payments in a Node.js application, follow these steps. First, obtain an API key and webhook secret from the Moonvex dashboard. The API key is required for creating invoices, while the webhook secret is used for generating signing secrets. Store both values securely on your server.\n\nNext, install the @moonvex/node SDK and PostgreSQL, which are the only dependencies needed for this integration. Set up environment variables for the API key, webhook secret, and database connection URL.\n\nCreate a function that uses the SDK to generate an invoice for an order. The function should take an order object and an optional attempt parameter. The Moonvex.create method should be used to create the invoice, passing the order ID, total amount in string format, currency, network, customer ID, and expiration time. To prevent duplicate payments, use an idempotency key that combines the order ID, amount, and attempt number.\n\nIf a duplicate order error occurs, retrieve the existing payment from the database using a GET request. If a payment already exists, return it; otherwise, re-throw the error.\n\nFinally, redirect the customer to the paymentUrl generated by the SDK. This hosted payment page will display the exact amount, including fees, the recipient address, a QR code, the official token contract, and a timer. It is essential to redirect or open the payment page using a GET request, as iframe embedding is not allowed. Monitor the payment status using a webhook or by retrieving the payment details from the API.",
  "summary": "A step-by-step Moonvex integration in plain Node.js with the official @moonvex /node SDK: your server creates an invoice, the customer pays on a hosted page, and an HMAC-signed webhook marks the order paid. No framework, just node:http and PostgreSQL. Step by step 1. Get an API key and a webhook secret In the Moonvex dashboard go to “Integration” → “Create key” → type “Secret” (sk_live_…). The…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}