API Reference

Pay invoice.

Add Invoice Websocket

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-" />
    <title>index</title>
</head>
<body>
    <h>test websocket</h>
    <p id="message-json"></p>
    <script>
    function jsonWS() {
        var ws = new WebSocket("wss://{{url}}/invoice/add?bpt_id=${bpt_id}&amount_msat=1000");
            
              //Triggered when connection is open
            ws.onopen = function (evt) {
                console.log("Connection open ...");
            };
            
            //Triggered when a message is received
            // The first message the invoice informations
            // The second message will be the transaction information
            // The second message mean that the invoice is paid
            ws.onmessage = function (evt) {
                console.log("Received Message: " + evt.data);
                document.getElementById("message-json").innerText += evt.data;
            };
            
            //Triggered when connection is closed
            ws.onclose = function (evt) {
                console.log("Connection closed.");
            };
        }
    }
    jsonWS();
    </script>
</body>
</html>
Language
Credentials
Header
Click Try It! to start a request and see the response here!