Keysend

Initiate a keysend payment from your wallet to a destination pubkey

PostWalletKeysend Synchronous

POST https://<yourdomain>/v1/wallet/:wallet_key/keysend

Path Parameters

NameTypeDescription

wallet_key

string

wal_ for server side waka_ for client side

Request Body

NameTypeDescription

fee_limit_msat

integer

max fee e.g. 1000 (1 sat) LNPay default is 5% of payment amount

passThru

object

data to pass along with this invoice for webhooks (e.g. ticketId, etc)

dest_pubkey

string

Pubkey of destination node

num_satoshis

integer

satoshis

custom_records

object

key:value pairs for the onion.

ex. {"7629169":{"app_name":"Podcast Player"}}

{
    "id": "wtx_s1xa5yZFlCegcgtXkaeo34",
    "created_at": 1595165573,
    "num_satoshis": -2,
    "user_label": "2 keysend to 033868c219bdb51a33560d854d500fe7d3898a1ad9e05dd89d0007e11313588500",
    "wal": {
        "id": "wal_czDztN5eJ4r5sJ",
        "created_at": 1582461859,
        "updated_at": 1595165573,
        "user_label": "My Postman Collection Wallet",
        "balance": 211,
        "statusType": {
            "type": "wallet",
            "name": "active",
            "display_name": "Active"
        }
    },
    "wtxType": {
        "layer": "ln",
        "name": "ln_withdrawal",
        "display_name": "LN Withdrawal"
    },
    "lnTx": {
        "id": "lntx_gTMCJKFywtc2ZMWFwge0vpcE",
        "created_at": 1595165573,
        "ln_node_id": "lnod_2s4yfYA",
        "dest_pubkey": "033868c219bdb51a33560d854d500fe7d3898a1ad9e05dd89d0007e11313588500",
        "payment_request": "033868c219bdb51a33560d854d500fe7d3898a1ad9e05dd89d0007e11313588500:2",
        "r_hash_decoded": "efa5d7a28c26566dbc854dce4b4c15c16afa4488e0130b393a88c2d255ae6599",
        "memo": "2 keysend to 033868c219bdb51a33560d854d500fe7d3898a1ad9e05dd89d0007e11313588500",
        "description_hash": null,
        "num_satoshis": 2,
        "expiry": 432000,
        "expires_at": null,
        "payment_preimage": "6e5a9be8db789bdd6c4d603b8a357561c0dd1be0fe278a4ecdbfd8e228a8fc11",
        "settled": 1,
        "settled_at": 1595165573,
        "is_keysend": 1,
        "custom_records": {
            "5482373484": "6e5a9be8db789bdd6c4d603b8a357561c0dd1be0fe278a4ecdbfd8e228a8fc11"
        }
    },
    "passThru": {
        "method": "api",
        "ticketId": "23"
    }
}

PostWalletKeysend Asynchronous

POST https://<yourdomain>/v1/wallet/:wallet_key/keysend

Path Parameters

NameTypeDescription

wallet_key

string

wal_ for server side waka_ for client side

Headers

NameTypeDescription

X-LNPAY-ASYNC

boolean

If set to 1, the keysend request will be asynchronously processed. An immediate response will returned

Request Body

NameTypeDescription

fee_limit_msat

integer

max fee e.g. 1000 (1 sat) LNPay default is 5% of payment amount

passThru

object

data to pass along with this invoice for webhooks (e.g. ticketId, etc)

dest_pubkey

string

Pubkey of destination node

num_satoshis

integer

satoshis

custom_records

object

key:value pairs for the onion.

ex. {"7629169":{"app_name":"Podcast Player"}}

{
   "id":"382883",
   "success":"1"
}
curl -u sak_XXXXXXX: \
-H "Content-Type: application/json" \
-X POST \
-d '{"dest_pubkey":"033868c219bdb51a33560d854d500fe7d3898a1ad9e05dd89d0007e11313588500","num_satoshis":2}' \
https://<yourdomain>/v1/wallet/waka_XXXXXXX/keysend

# Note we are using the "admin" access_key as denoted by "wa_"

Last updated