Transfers Between Wallets

This section describes how to transfer sats between wallets within LNPay

post
PostWalletTransfer

https://lnpay.co/v1/wallet/:wallet_access_key/transfer
Transfer satoshis from source wallet to destination wallet
Request
Response
Request
Path Parameters
wallet_access_key
required
string
Source wallet key for the transfer. Must be admin key
Body Parameters
dest_wallet_id
required
string
destination wallet access key (WAK) or wallet_id
num_satoshis
required
number
sats for this transfer
memo
optional
string
memo note for this transfer
lnPayParams
optional
array
JSON array of custom data to pass thru
Response
200: OK
Transfer executed
{
"wtx_transfer_in": {
"id": "wtx_D2MOU88MTPpOytfdflCoGSs8",
"created_at": 1582297599,
"num_satoshis": 1,
"user_label": "Test transfer from Postman Collection",
"wallet": {
"id": "w_n743yizWqe43Oz",
"created_at": 1579001314,
"updated_at": 1582297599,
"user_label": "Paywall Wallet",
"balance": 4,
"statusType": {
"type": "wallet",
"name": "active",
"display_name": "Active"
}
},
"walletTransactionType": {
"layer": "ln",
"name": "ln_transfer_in",
"display_name": "Transfer In"
},
"lnTx": null,
"passThru": {
"lnPayParams": null,
"dest_wallet_id": "w_n743yizWqe43Oz",
"source_wallet_id": "w_hkjS9r6mTYeABc"
}
},
"wtx_transfer_out": {
"id": "wtx_LiAIfLI6x1T9sepE80aMYnlw",
"created_at": 1582297599,
"num_satoshis": -1,
"user_label": "Test transfer from Postman Collection",
"wallet": {
"id": "w_hkjS9r6mTYeABc",
"created_at": 1577654988,
"updated_at": 1582297599,
"user_label": "DEFAULT WALLET",
"balance": 2,
"statusType": {
"type": "wallet",
"name": "active",
"display_name": "Active"
}
},
"walletTransactionType": {
"layer": "ln",
"name": "ln_transfer_out",
"display_name": "Transfer Out"
},
"lnTx": null,
"passThru": {
"lnPayParams": null,
"dest_wallet_id": "w_n743yizWqe43Oz",
"source_wallet_id": "w_hkjS9r6mTYeABc"
}
}
}
400: Bad Request
Error reported
{
"name":"Bad Request",
"message":"insufficient funds",
"code":0,
"status":400
}
curl
JavaScript
Python
curl
$ curl -u pak_O0iUMxk8kK_qUzkT4YKFvp1ZsUtp: \
-H "Content-Type: application/json" \
-X POST \
-d '{"dest_wallet_id":"w_n743yizWqe43Oz","num_satoshis":1,"memo":"Test transfer"}' \
https://lnpay.co/v1/wallet/waka_kqvaiFFl4Tjq4rgAXlwsu6/transfer
JavaScript
LNPay.Initialize('pak_O0iUMxk8kK_qUzkT4YKFvp1ZsUtp');
let myWallet = new LNPayWallet('wa_Opnn4kGOGBMnfCLFXtsDnjTb');
let transferParams = {"dest_wallet_id":"wa_xxxxx","num_satoshis":22,"memo":"Transfer Memo"};
myWallet.internalTransfer(transferParams,
function(result) {
console.log(result);
}
);
Python
lnpay_py.initialize('pak_O0iUMxk8kK_qUzkT4YKFvp1ZsUtp')
from lnpay_py.wallet import LNPayWallet
my_wallet = LNPayWallet('wa_Opnn4kGOGBMnfCLFXtsDnjTb')
transfer_params = {
'dest_wallet_id': 'w_XXX',
'num_satoshis': 1,
'memo': 'Transfer Memo'
}
transfer_result = my_wallet.internal_transfer(transfer_params)
print(transfer_result)