Learn how to instantly send Bitcoin to any Lightning Address.
Lightning Address API
To send Bitcoin to a given Lightning Address, all you need to do is call the Send Lightning Address Payment API with a POST call providing the following properties:
Property
Description
lnAddress
Recipient Lightning Address to send payment to.
amount
Total amount of satoshis to send (in millisatoshis).
comment
comment to be sent with the payment (max 150 characters).
Example: If you wish to reward 20 satoshis to a user for their completion of a challenge, and you have the user’s Lightning Address, you can use the information below to send it in 1 API call.
Sending Transaction
// Using ZBD's NodeJS SDKimport { zbd } from '@zbdpay/payments-sdk';// Instantiate ZBD clientconst ZBD = new zbd(API_KEY_HERE);// Set the payloadconst payload = { amount: "20000", lnAddress: "andre@zbd.gg", comment: "Sending to a Lightning Address"};// Send Lightning Address paymenttry { const response = await ZBD.sendLightningAddressPayment(payload);} catch(error) { console.log({ error });}
curl --location --request POST 'https://api.zbdpay.com/v0/ln-address/send-payment' \--header 'Content-Type: application/json' \--header 'apikey: API_KEY_HERE' \--data-raw '{ "amount": "20000", "lnAddress": "andre@zbd.gg", "comment": "Sending to a Lightning Address"}'
API Response
Response payloads will usually look similar to this:
Wow that’s easy. Welcome to instantaneous payments!
Fees are added post-send given that the routing fees for the Lightning Network are variable.(e.g if you send a 10,000 satoshi transaction to a Lightning Address and the fee ends up being 10 satoshis, the total paid by the API wallet is 10,010 satoshis).