MSU Pay Documentation

Accept ETH, BTC, and LTC payments with signed payment links, webhooks, and a hosted payment page.

Overview

Create a signed payment link, share it with your customer, and receive status updates by webhook. Settlement and refunds are controlled from the payment page or your merchant account.

Quick start

cp .env.example .env   # configure your environment
npm install
npm start              # http://localhost:3000

Register a merchant account at /register, then use its company code in your payment links.

Create an invoice

Sign a payinfo with your merchant Bearer token, then create an invoice from it. The creation response includes an accessToken for the payer.

POST /api/sign
Authorization: Bearer <merchant-token>
{ "companyCode": "ABC12345", "eur": "2.50", "product": "Coffee" }

POST /api/invoice
{ "payinfo": "<signed-token>", "coin": "ETH" }

To settle or refund, send the merchant Bearer token or the invoice's X-Invoice-Token:

POST /api/invoice/<id>/pay
POST /api/invoice/<id>/cancel

Webhooks

Configure a webhook URL in the dashboard. Each POST includes an X-MSUPay-Signature header. Verify it before trusting the payload:

const expected = 'sha256=' + crypto
  .createHmac('sha256', WEBHOOK_SECRET)
  .update(rawBody)
  .digest('hex');

if (!crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected))) {
  return res.sendStatus(400);
}

Respond with any 2xx status. Failed deliveries are retried with backoff.

API

MethodPathAuth
POST/api/register—
POST/api/login—
POST/api/logoutBearer
GET/api/accountBearer
POST/api/signBearer or sign key
POST/api/invoiceSigned payinfo
GET/api/invoice/:id—
POST/api/invoice/:id/payBearer or invoice token
POST/api/invoice/:id/cancelBearer or invoice token
GET/api/invoice/:id/events—
GET/api/rates—
GET/api/webhook/configBearer
GET/api/transactionsBearer

Invoice statuses: pending, paid, underpaid, forwarded, refunded, expired, forward_failed, refund_failed.