Accept Bitcoin payments
in three lines of code.
The Trevi API is the same surface our merchant dashboard runs on. Create invoices, manage cashback, run referral programmes, and read every metric the dashboard shows — directly from your code.
curl --request POST "https://api.trevi.cash/pay/create" \
--header "Content-Type: application/json" \
--header "X-API-Key: $BTPAY_API_KEY" \
--data '{
"amount": 49.99,
"currency": "CHF",
"description": "Order #12345"
}'One call, hosted page
POST /pay/create and Trevi gives you back a hosted URL, QR, and live status. No payment UI to build.
Push, don't poll
Webhooks fire the moment a payment completes — HMAC-signed with your API key, idempotent by design.
Live Try-it on every endpoint
Every endpoint page in here has a real request runner. Paste your key, fire, see the actual response.
Authentication
Most endpoints accept X-API-Key: btpay_… (server-to-server) or Authorization: Bearer … (dashboard session). Generate keys in the API Keys page.
Keys are shown once on creation and can be re-revealed with your account password (sudo mode).
Endpoint catalogue
33 endpoints across 8 categories. Click any to open the reference + Try-it.
