API ReferenceWooCommerceSDKssoonWebhookssoon

Cashback

Update cashback config

PUT/api/merchants/cashback/config

Change your cashback rules. Changes apply to every future sale immediately.

  • Every field is optional; only what you send is changed.
  • 400 — "Connect your Alby Hub wallet before enabling cashback." Setting enabled: true requires an active NWC wallet connection, because Trevi will not promise a payout without a wallet that can make it.
  • There is no minimum balance to enable cashback. Cover is checked per sale, live against your wallet, at the moment an offer would be made. Enabling with an empty wallet simply means no offer is shown — no promise without cover.

Authentication

Accepts either an API key (X-API-Key) or a dashboard JWT (Authorization: Bearer …).

Body parameters

enabledbooleanoptional
percentagenumber (fraction)optional

0.01 – 0.10. A FRACTION, not a percent: 0.03 means 3%.

max_per_transactionnumber (sats)optional

integer, 100 – 1 000 000. Caps any single payout.

PUT/api/merchants/cashback/config
curl --request PUT "https://api.trevi.cash/api/merchants/cashback/config" \
  --header "Content-Type: application/json" \
  --header "X-API-Key: $TREVI_API_KEY" \
  --data '{ "enabled": true, "percentage": 0.03, "max_per_transaction": 50000 }'