Create Charge
curl --request POST \
--url https://api.zebedee.io/v0/ln-address/fetch-charge \
--header 'Content-Type: application/json' \
--header 'apikey: <apikey>' \
--data '
{
"lnaddress": "<string>",
"amount": "<string>",
"description": "<string>"
}
'import requests
url = "https://api.zebedee.io/v0/ln-address/fetch-charge"
payload = {
"lnaddress": "<string>",
"amount": "<string>",
"description": "<string>"
}
headers = {
"apikey": "<apikey>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<apikey>', 'Content-Type': 'application/json'},
body: JSON.stringify({lnaddress: '<string>', amount: '<string>', description: '<string>'})
};
fetch('https://api.zebedee.io/v0/ln-address/fetch-charge', 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.zebedee.io/v0/ln-address/fetch-charge",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'lnaddress' => '<string>',
'amount' => '<string>',
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zebedee.io/v0/ln-address/fetch-charge"
payload := strings.NewReader("{\n \"lnaddress\": \"<string>\",\n \"amount\": \"<string>\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<apikey>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.zebedee.io/v0/ln-address/fetch-charge")
.header("apikey", "<apikey>")
.header("Content-Type", "application/json")
.body("{\n \"lnaddress\": \"<string>\",\n \"amount\": \"<string>\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zebedee.io/v0/ln-address/fetch-charge")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<apikey>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"lnaddress\": \"<string>\",\n \"amount\": \"<string>\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"lnaddress": "andre@zbd.gg",
"amount": "15000",
"invoice": {
"uri": "lightning:lnbc100n1p3mtxc3pp5tz4srtee9c4gsvlcqa6azu60a2ak2fvrnk7jv52j6n0rzp0musnqhp5xt5ts9t74akf67j59ynkr5qz8x3hs4g09d3dttmjrwwdhrxgc03qcqzpgxqzfvsp5529t5y03yaakumqrm9cwr5t6nysnr5cv93pnvw089a25aa7wszas9qyyssqalswdlc92983203l5azl43nksehadfy2uahc9v6qwg67xs52z02hg6vh7alrm3yx46ywdrl3dxey75t9l2ekmuwc3tu4ug03dy729fspdld2lj",
"request": "lnbc100n1p3mtxc3pp5tz4srtee9c4gsvlcqa6azu60a2ak2fvrnk7jv52j6n0rzp0musnqhp5xt5ts9t74akf67j59ynkr5qz8x3hs4g09d3dttmjrwwdhrxgc03qcqzpgxqzfvsp5529t5y03yaakumqrm9cwr5t6nysnr5cv93pnvw089a25aa7wszas9qyyssqalswdlc92983203l5azl43nksehadfy2uahc9v6qwg67xs52z02hg6vh7alrm3yx46ywdrl3dxey75t9l2ekmuwc3tu4ug03dy729fspdld2lj"
}
}
}
Lightning Address
Create Charge
Generate a payment request for a Lightning Address.
POST
/
v0
/
ln-address
/
fetch-charge
Create Charge
curl --request POST \
--url https://api.zebedee.io/v0/ln-address/fetch-charge \
--header 'Content-Type: application/json' \
--header 'apikey: <apikey>' \
--data '
{
"lnaddress": "<string>",
"amount": "<string>",
"description": "<string>"
}
'import requests
url = "https://api.zebedee.io/v0/ln-address/fetch-charge"
payload = {
"lnaddress": "<string>",
"amount": "<string>",
"description": "<string>"
}
headers = {
"apikey": "<apikey>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<apikey>', 'Content-Type': 'application/json'},
body: JSON.stringify({lnaddress: '<string>', amount: '<string>', description: '<string>'})
};
fetch('https://api.zebedee.io/v0/ln-address/fetch-charge', 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.zebedee.io/v0/ln-address/fetch-charge",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'lnaddress' => '<string>',
'amount' => '<string>',
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zebedee.io/v0/ln-address/fetch-charge"
payload := strings.NewReader("{\n \"lnaddress\": \"<string>\",\n \"amount\": \"<string>\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<apikey>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.zebedee.io/v0/ln-address/fetch-charge")
.header("apikey", "<apikey>")
.header("Content-Type", "application/json")
.body("{\n \"lnaddress\": \"<string>\",\n \"amount\": \"<string>\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zebedee.io/v0/ln-address/fetch-charge")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<apikey>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"lnaddress\": \"<string>\",\n \"amount\": \"<string>\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"lnaddress": "andre@zbd.gg",
"amount": "15000",
"invoice": {
"uri": "lightning:lnbc100n1p3mtxc3pp5tz4srtee9c4gsvlcqa6azu60a2ak2fvrnk7jv52j6n0rzp0musnqhp5xt5ts9t74akf67j59ynkr5qz8x3hs4g09d3dttmjrwwdhrxgc03qcqzpgxqzfvsp5529t5y03yaakumqrm9cwr5t6nysnr5cv93pnvw089a25aa7wszas9qyyssqalswdlc92983203l5azl43nksehadfy2uahc9v6qwg67xs52z02hg6vh7alrm3yx46ywdrl3dxey75t9l2ekmuwc3tu4ug03dy729fspdld2lj",
"request": "lnbc100n1p3mtxc3pp5tz4srtee9c4gsvlcqa6azu60a2ak2fvrnk7jv52j6n0rzp0musnqhp5xt5ts9t74akf67j59ynkr5qz8x3hs4g09d3dttmjrwwdhrxgc03qcqzpgxqzfvsp5529t5y03yaakumqrm9cwr5t6nysnr5cv93pnvw089a25aa7wszas9qyyssqalswdlc92983203l5azl43nksehadfy2uahc9v6qwg67xs52z02hg6vh7alrm3yx46ywdrl3dxey75t9l2ekmuwc3tu4ug03dy729fspdld2lj"
}
}
}
Description
If instead of sending Bitcoin payments directly to a given Lightning Address, you would rather create a Payment Request QR code for that Lightning Address, you can use this API.Usage
Depending on your system’s configuration or your product’s UX, you may need the ability to generate Charges for specific users. For ZBD users that’s easy using the ZBD Gamertag endpoints. For any user that is using a different provider, you can use this endpoint. The way to think of this is:First
Given
user@domain.com Lightning Address and an amount property, this endpoint generates a Charge.Second
If this new Charge is paid, the payment is received by
user@domain.com.Configuration
Header Parameters
string
required
ZBD Project API Key
string
Content Type
Body
string
required
The Lightning Address of the intended recipient
string
required
The amount for the Charge -> in millisatoshis
string
Note or comment of this Charge
{
"success": true,
"data": {
"lnaddress": "andre@zbd.gg",
"amount": "15000",
"invoice": {
"uri": "lightning:lnbc100n1p3mtxc3pp5tz4srtee9c4gsvlcqa6azu60a2ak2fvrnk7jv52j6n0rzp0musnqhp5xt5ts9t74akf67j59ynkr5qz8x3hs4g09d3dttmjrwwdhrxgc03qcqzpgxqzfvsp5529t5y03yaakumqrm9cwr5t6nysnr5cv93pnvw089a25aa7wszas9qyyssqalswdlc92983203l5azl43nksehadfy2uahc9v6qwg67xs52z02hg6vh7alrm3yx46ywdrl3dxey75t9l2ekmuwc3tu4ug03dy729fspdld2lj",
"request": "lnbc100n1p3mtxc3pp5tz4srtee9c4gsvlcqa6azu60a2ak2fvrnk7jv52j6n0rzp0musnqhp5xt5ts9t74akf67j59ynkr5qz8x3hs4g09d3dttmjrwwdhrxgc03qcqzpgxqzfvsp5529t5y03yaakumqrm9cwr5t6nysnr5cv93pnvw089a25aa7wszas9qyyssqalswdlc92983203l5azl43nksehadfy2uahc9v6qwg67xs52z02hg6vh7alrm3yx46ywdrl3dxey75t9l2ekmuwc3tu4ug03dy729fspdld2lj"
}
}
}
Was this page helpful?
⌘I