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.
Payment links
Pass a signed payinfo token to the payment page:
https://your-host/pay?payinfo=<token>
Optional redirects (base64url-encoded) after completion or cancellation:
https://your-host/pay?payinfo=<token>&returns=<url>&returnf=<url>
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
| Method | Path | Auth |
|---|---|---|
POST | /api/register | — |
POST | /api/login | — |
POST | /api/logout | Bearer |
GET | /api/account | Bearer |
POST | /api/sign | Bearer or sign key |
POST | /api/invoice | Signed payinfo |
GET | /api/invoice/:id | — |
POST | /api/invoice/:id/pay | Bearer or invoice token |
POST | /api/invoice/:id/cancel | Bearer or invoice token |
GET | /api/invoice/:id/events | — |
GET | /api/rates | — |
GET | /api/webhook/config | Bearer |
GET | /api/transactions | Bearer |
Invoice statuses: pending, paid, underpaid, forwarded, refunded, expired, forward_failed, refund_failed.