Developer Guide
Sending
10min
sending payments this guide explains how to send lightning network payments using the voltage api prerequisites a voltage account with an active wallet an api key (get this from the "api keys" page in your dashboard) sending a payment endpoint post https //voltageapi com/v1/organizations/{organization id}/environments/{environment id}/payments headers x api key your api key content type application/json request body { "id" "68d00852 8dd8 4c71 94d2 91c84695da78", // uuid created by you "wallet id" "7a68a525 9d11 4c1e a3dd 1c2bf1378ba2", "currency" "btc", "type" "bolt11", "data" { "payment request" "lntbs1500n1p ", // required lightning invoice to pay (cannot be empty) "amount msats" 150000, // optional when payment request already contains an amount // required when payment request has no amount // if provided with an amount containing payment request, values must match // must be greater than 0 "max fee msats" 1000 // optional defaults to 1% of payment value or 1,000 msats (whichever is greater) // must be greater than 0 } } required fields id a unique identifier for the payment wallet id the id of the wallet sending the payment currency currently only "btc" is supported type currently only "bolt11" is supported data payment request the lightning invoice you want to pay data amount msats payment amount in millisatoshis data max fee msats maximum routing fee you're willing to pay monitoring payment status after sending a payment, monitor its status using get https //voltageapi com/v1/organizations/{organization id}/environments/{environment id}/payments/{payment id} the payment will transition through these states sending payment is in progress completed payment was successful failed payment failed (check error field for details) error handling common http status codes 200 success 400 invalid request (check error message) 403 authentication error 404 payment not found 500 server error example implementation \# send payment curl 'https //voltageapi com/v1/organizations/{organization id}/environments/{environment id}/payments' \\ \ request post \\ \ header 'x api key your api key' \\ \ header 'content type application/json' \\ \ data '{ "id" "68d00852 8dd8 4c71 94d2 91c84695da78", "wallet id" "7a68a525 9d11 4c1e a3dd 1c2bf1378ba2", "currency" "btc", "type" "bolt11", "data" { "amount msats" 150000, "max fee msats" 1000, "payment request" "lntbs1500n1p " } }' \# check payment status curl 'https //voltageapi com/api/v1/organizations/{organization id}/environments/{environment id}/payments/{payment id}' \\ \ header 'x api key your api key'