API ReferenceWooCommerceSDKssoonWebhookssoon

Guides

How Trevi works

Trevi is non-custodial. It never receives, holds, pools, or forwards bitcoin. It asks your wallet for invoices, watches for settlement, and instructs payouts — the sats only ever move between wallets you and your customers own.

You connect your OWN Lightning wallet to Trevi with NWC (Nostr Wallet Connect). NWC is a permission protocol — think "Log in with Google", but for a wallet. You approve a limited, revocable permission inside your own wallet app, and Trevi receives a credential that lets it instruct that wallet within a daily spending limit you set. You can revoke it inside your wallet at any time, without Trevi's cooperation.

The money path has exactly three legs, and Trevi is on none of them: the customer pays an invoice issued by YOUR wallet (Trevi is never a hop); your wallet pays cashback straight to the customer's wallet in one hop, on Trevi's instruction; and your wallet pays Trevi's 1% service fee as a separate payment. The fee is never netted out of a customer's cashback.

Because of this there is no deposit endpoint, no withdrawal endpoint, no treasury, no cashback pool, and no Trevi-held balance of any kind. There is nothing to deposit into and nothing to withdraw from. Any balance figure the API reports — for example on GET /api/v2/wallet/overview — is read live from your own wallet over NWC. It is an observation, never an amount Trevi owes you.

Trevi runs no Lightning node. It sends instructions to wallets it does not own, and records what it observes.

Any NWC-compatible wallet works — Alby Hub, Coinos, LNbits, Primal, Blink, Zeus, or a self-hosted LND/CLN node. Trevi requires only core NIP-47 (make_invoice, pay_invoice, get_balance, lookup_invoice). Extensions such as list_transactions, get_budget, and notifications are requested and used when your wallet grants them; when it does not, Trevi degrades gracefully rather than failing. A wallet that cannot report a budget simply means "no readable limit", not an error.

Amounts in this API are whole satoshis. Trevi never asks you for a fiat amount at checkout — convert on your side and send amount_sats.

Example
# The three legs of a Trevi sale. Trevi is on none of them.
#
#   customer's wallet  ──pays────────>  YOUR wallet      (direct)
#   YOUR wallet        ──cashback───>  customer's wallet (one hop, Trevi instructs)
#   YOUR wallet        ──1% fee─────>  Trevi's wallet    (separate payment)
#
# What Trevi does: asks your wallet for an invoice, watches for settlement,
# then instructs the cashback payout. It holds nothing at any point.
Was this page helpful?