API ReferenceWooCommerceSDKssoonWebhookssoon

Wallet

Wallet overview

GET/api/v2/wallet/overview

Balance, remaining daily limit, reserved cashback, and lifetime totals in one call. Every figure is read live from the merchant's OWN wallet or derived from observed events — none of it is money Trevi holds.

  • Dashboard-only (merchant JWT).
  • wallet.balance_sats and wallet.remaining_limit_sats come from a live NWC round trip to the merchant's wallet. remaining_limit_sats is null when the wallet reports no limit or declines to report one.
  • wallet.reserved_sats is cashback already promised on the merchant's behalf and not yet sent — it is subtracted from what the next customer can be offered.
  • wallet.available_sats applies the same arithmetic as the guard rail (balance, limit and reservations together), so it never promises more headroom than a customer will really be offered.
  • A wallet that cannot be reached does not blank the page: balance_sats and remaining_limit_sats degrade to null and wallet.error carries the reason. Everything else still renders. Treat null as "unavailable", never as zero.
  • stats are lifetime totals derived from observed events, never read off a stored balance — there is no balance to read.

Authentication

Requires a dashboard session JWT in the Authorization: Bearer … header.

GET/api/v2/wallet/overview
curl "https://api.trevi.cash/api/v2/wallet/overview" --header "Authorization: Bearer $TREVI_JWT"
200Sample response
{
  "success": true,
  "connected": true,
  "wallet": {
    "balance_sats": 250000,
    "remaining_limit_sats": 100000,
    "reserved_sats": 4500,
    "available_sats": 95500,
    "error": null
  },
  "cashback_config": {
    "enabled": true,
    "percentage": 0.03,
    "max_per_transaction": 50000
  },
  "external_ln_address": "store@getalby.com",
  "stats": {
    "sales_volume_sats": 1250000,
    "cashback_sent_sats": 37500
  }
}