Accept crypto payments in Express | Shieldz

Accept crypto payments in Express

Add non-custodial crypto checkout to your Express app: create an invoice, send the buyer to the hosted checkout, and fulfill on a signed webhook. Funds settle straight to your own wallet, $0 platform fees.

Install

npm install @shieldz/sdk

Create an invoice and redirect to checkout

import Shieldz, { constructEvent } from "@shieldz/sdk";
const shieldz = new Shieldz(process.env.SHIELDZ_API_KEY);
app.post("/checkout", async (req, res) => {
  const invoice = await shieldz.invoices.create({ amount_usd_cents: 5000 });
  res.redirect(303, invoice.pay_url);
});

Verify the webhook

app.post("/webhooks/shieldz", express.raw({ type: "application/json" }), async (req, res) => {
  try {
    const event = await constructEvent(req.body, req.header("x-shieldz-signature") ?? "", process.env.SHIELDZ_WEBHOOK_SECRET);
    if (event.type === "invoice.paid") { /* fulfill */ }
    res.sendStatus(200);
  } catch { res.sendStatus(400); }
});

Full reference: API docs, SDKs, API reference.

Explore Shieldz

Accept a coin: Bitcoin, USDC, USDT, Zcash.

Compare: vs Coinbase Commerce, vs BTCPay Server, vs CryptAPI, vs NOWPayments.

Use cases: For freelancers, For creators, For open-source projects, For online stores.

Build: SDKs, API reference, quickstart. Learn: overview, blog, how it works, supported coins, pricing, is it safe, verify it yourself.