Validate Lightning Address
curl --request GET \
--url https://api.zbdpay.com/v0/ln-address/validate/{address} \
--header 'apikey: <apikey>'import requests
url = "https://api.zbdpay.com/v0/ln-address/validate/{address}"
headers = {"apikey": "<apikey>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {apikey: '<apikey>'}};
fetch('https://api.zbdpay.com/v0/ln-address/validate/{address}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.zbdpay.com/v0/ln-address/validate/{address}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: <apikey>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.zbdpay.com/v0/ln-address/validate/{address}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "<apikey>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.zbdpay.com/v0/ln-address/validate/{address}")
.header("apikey", "<apikey>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zbdpay.com/v0/ln-address/validate/{address}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = '<apikey>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"valid": true,
"metadata": {
"minSendable": 10000,
"maxSendable": 150000000,
"commentAllowed": 150,
"tag": "payRequest",
"metadata": "[[\"text/plain\",\"andre - Welcome to ZBD! ;)\"],[\"text/identifier\",\"andre@zbd.gg\"],[\"image/png;base64\",\"/9j/2wBDAAYEBQ......IUeDcpP9akPkjm3XPid8/OmYZB//9k=\"]]",
"callback": "https://api.zbdpay.com/v0/process-static-charges/d0f2c3da-e836-480a-bf8c-f5d5b167d6f8",
"payerData": {
"name": {
"mandatory": false
},
"identifier": {
"mandatory": false
}
},
"disposable": false
}
}
}
Lightning Address
Validate Lightning Address
Verify the validity of a Lightning Address.
GET
/
v0
/
ln-address
/
validate
/
{address}
Validate Lightning Address
curl --request GET \
--url https://api.zbdpay.com/v0/ln-address/validate/{address} \
--header 'apikey: <apikey>'import requests
url = "https://api.zbdpay.com/v0/ln-address/validate/{address}"
headers = {"apikey": "<apikey>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {apikey: '<apikey>'}};
fetch('https://api.zbdpay.com/v0/ln-address/validate/{address}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.zbdpay.com/v0/ln-address/validate/{address}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: <apikey>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.zbdpay.com/v0/ln-address/validate/{address}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "<apikey>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.zbdpay.com/v0/ln-address/validate/{address}")
.header("apikey", "<apikey>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zbdpay.com/v0/ln-address/validate/{address}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = '<apikey>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"valid": true,
"metadata": {
"minSendable": 10000,
"maxSendable": 150000000,
"commentAllowed": 150,
"tag": "payRequest",
"metadata": "[[\"text/plain\",\"andre - Welcome to ZBD! ;)\"],[\"text/identifier\",\"andre@zbd.gg\"],[\"image/png;base64\",\"/9j/2wBDAAYEBQ......IUeDcpP9akPkjm3XPid8/OmYZB//9k=\"]]",
"callback": "https://api.zbdpay.com/v0/process-static-charges/d0f2c3da-e836-480a-bf8c-f5d5b167d6f8",
"payerData": {
"name": {
"mandatory": false
},
"identifier": {
"mandatory": false
}
},
"disposable": false
}
}
}
Usage
Not all internet identifiers are Lightning Addresses. Make use of this API to validate whether a user’s entered address is indeed a valid Lightning Address that can accept Bitcoin payments.The idea behind this API endpoint is to verify whether an internet-indentifier (e.g.
user@domain.com) is in fact a Lightning Address and NOT an email address. Once verified, use the Send Lightning Address Payment to perform the transaction.Configuration
Path Parameters
Header Parameters
{
"success": true,
"data": {
"valid": true,
"metadata": {
"minSendable": 10000,
"maxSendable": 150000000,
"commentAllowed": 150,
"tag": "payRequest",
"metadata": "[[\"text/plain\",\"andre - Welcome to ZBD! ;)\"],[\"text/identifier\",\"andre@zbd.gg\"],[\"image/png;base64\",\"/9j/2wBDAAYEBQ......IUeDcpP9akPkjm3XPid8/OmYZB//9k=\"]]",
"callback": "https://api.zbdpay.com/v0/process-static-charges/d0f2c3da-e836-480a-bf8c-f5d5b167d6f8",
"payerData": {
"name": {
"mandatory": false
},
"identifier": {
"mandatory": false
}
},
"disposable": false
}
}
}
Was this page helpful?