Add Invoice Restfully with a web hook

Pay invoice.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

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>
Body Params
int32
required

The account that will pay the invoice.bolt11

string
required
string
required

A POST will be made at this Url when the invoice is paid. { "secret":"", "transaction": { { id: 6125, invoiceHash: "", createdAtUtc: "", settledAtUtc: "", amountMsat: 3000, receivedMsat: 2985, feeProcessMsat: 15, tag: null, accountId: "", bptId:"", isPaid:false, splitBitcoinPercentage:100 } } }

string

Secure the web hook call with a secret (optional)

string

(Optional) Maximum 50 chars

int32

(Optional) Expiration time in seconds. Default 900 seconds. The expiration time has to be between 30 and 900 seconds, if it's not in this range the closest limit is used.

Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json