Create Charge
curl --request POST \
--url https://api.zebedee.io/v0/charges \
--header 'Content-Type: application/json' \
--header 'apikey: <apikey>' \
--data '
{
"amount": "<string>",
"description": "<string>",
"expiresIn": 123,
"callbackUrl": "<string>",
"internalId": "<string>"
}
'import requests
url = "https://api.zebedee.io/v0/charges"
payload = {
"amount": "<string>",
"description": "<string>",
"expiresIn": 123,
"callbackUrl": "<string>",
"internalId": "<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({
amount: '<string>',
description: '<string>',
expiresIn: 123,
callbackUrl: '<string>',
internalId: '<string>'
})
};
fetch('https://api.zebedee.io/v0/charges', 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/charges",
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([
'amount' => '<string>',
'description' => '<string>',
'expiresIn' => 123,
'callbackUrl' => '<string>',
'internalId' => '<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/charges"
payload := strings.NewReader("{\n \"amount\": \"<string>\",\n \"description\": \"<string>\",\n \"expiresIn\": 123,\n \"callbackUrl\": \"<string>\",\n \"internalId\": \"<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/charges")
.header("apikey", "<apikey>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"<string>\",\n \"description\": \"<string>\",\n \"expiresIn\": 123,\n \"callbackUrl\": \"<string>\",\n \"internalId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zebedee.io/v0/charges")
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 \"amount\": \"<string>\",\n \"description\": \"<string>\",\n \"expiresIn\": 123,\n \"callbackUrl\": \"<string>\",\n \"internalId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Successfully created Charge.",
"data": {
"unit": "msats",
"amount": "10000",
"confirmedAt": null,
"status": "pending",
"description": "My Charge Description",
"createdAt": "2020-05-09T15:09:05.765Z",
"expiresAt": "2020-05-09T15:14:05.618Z",
"id": "1907b0fe-789b-4e25-b18a-0c4c0f5cced7",
"internalId": "11af01d092444a317cb33faa6b8304b8",
"callbackUrl": "https://your-website.com/callback",
"invoice": {
"request": "lnbc100n1p0td3u3pp5z2ed9yjfrz0rgu0fzuc5cdwfu8dtjlgrfztz5uga8hakkjy2yzgsdpzf4ujqsmgv9exwefqg3jhxcmjd9c8g6t0dccqzpgxqzfvsp5q8z5mkghmuzrnusxdwtmls7x8vuy63j25rt4z55gj3s7340dv72q9qy9qsqz02rlmlzcvew3vk90c6l0369ewk7tkr2tx0yrk3qa235v07w6d3qeksk99wm7y8f8ug7zqy6yjudu4cs2f4umpey43cw7msyj7uqj2qq8x03te",
"uri": "lightning:lnbc100n1p0td3u3pp5z2ed9yjfrz0rgu0fzuc5cdwfu8dtjlgrfztz5uga8hakkjy2yzgsdpzf4ujqsmgv9exwefqg3jhxcmjd9c8g6t0dccqzpgxqzfvsp5q8z5mkghmuzrnusxdwtmls7x8vuy63j25rt4z55gj3s7340dv72q9qy9qsqz02rlmlzcvew3vk90c6l0369ewk7tkr2tx0yrk3qa235v07w6d3qeksk99wm7y8f8ug7zqy6yjudu4cs2f4umpey43cw7msyj7uqj2qq8x03te"
}
}
}
Lightning Charges
Create Charge
Start receiving instant Bitcoin payments through the ZBD API.
POST
/
v0
/
charges
Create Charge
curl --request POST \
--url https://api.zebedee.io/v0/charges \
--header 'Content-Type: application/json' \
--header 'apikey: <apikey>' \
--data '
{
"amount": "<string>",
"description": "<string>",
"expiresIn": 123,
"callbackUrl": "<string>",
"internalId": "<string>"
}
'import requests
url = "https://api.zebedee.io/v0/charges"
payload = {
"amount": "<string>",
"description": "<string>",
"expiresIn": 123,
"callbackUrl": "<string>",
"internalId": "<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({
amount: '<string>',
description: '<string>',
expiresIn: 123,
callbackUrl: '<string>',
internalId: '<string>'
})
};
fetch('https://api.zebedee.io/v0/charges', 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/charges",
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([
'amount' => '<string>',
'description' => '<string>',
'expiresIn' => 123,
'callbackUrl' => '<string>',
'internalId' => '<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/charges"
payload := strings.NewReader("{\n \"amount\": \"<string>\",\n \"description\": \"<string>\",\n \"expiresIn\": 123,\n \"callbackUrl\": \"<string>\",\n \"internalId\": \"<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/charges")
.header("apikey", "<apikey>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"<string>\",\n \"description\": \"<string>\",\n \"expiresIn\": 123,\n \"callbackUrl\": \"<string>\",\n \"internalId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zebedee.io/v0/charges")
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 \"amount\": \"<string>\",\n \"description\": \"<string>\",\n \"expiresIn\": 123,\n \"callbackUrl\": \"<string>\",\n \"internalId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Successfully created Charge.",
"data": {
"unit": "msats",
"amount": "10000",
"confirmedAt": null,
"status": "pending",
"description": "My Charge Description",
"createdAt": "2020-05-09T15:09:05.765Z",
"expiresAt": "2020-05-09T15:14:05.618Z",
"id": "1907b0fe-789b-4e25-b18a-0c4c0f5cced7",
"internalId": "11af01d092444a317cb33faa6b8304b8",
"callbackUrl": "https://your-website.com/callback",
"invoice": {
"request": "lnbc100n1p0td3u3pp5z2ed9yjfrz0rgu0fzuc5cdwfu8dtjlgrfztz5uga8hakkjy2yzgsdpzf4ujqsmgv9exwefqg3jhxcmjd9c8g6t0dccqzpgxqzfvsp5q8z5mkghmuzrnusxdwtmls7x8vuy63j25rt4z55gj3s7340dv72q9qy9qsqz02rlmlzcvew3vk90c6l0369ewk7tkr2tx0yrk3qa235v07w6d3qeksk99wm7y8f8ug7zqy6yjudu4cs2f4umpey43cw7msyj7uqj2qq8x03te",
"uri": "lightning:lnbc100n1p0td3u3pp5z2ed9yjfrz0rgu0fzuc5cdwfu8dtjlgrfztz5uga8hakkjy2yzgsdpzf4ujqsmgv9exwefqg3jhxcmjd9c8g6t0dccqzpgxqzfvsp5q8z5mkghmuzrnusxdwtmls7x8vuy63j25rt4z55gj3s7340dv72q9qy9qsqz02rlmlzcvew3vk90c6l0369ewk7tkr2tx0yrk3qa235v07w6d3qeksk99wm7y8f8ug7zqy6yjudu4cs2f4umpey43cw7msyj7uqj2qq8x03te"
}
}
}
Description
Creates a new Charge in the Bitcoin Lightning Network, payable by any Lightning-capable wallet.These payment requests are single-use, fixed-amount QR codes. If you’re looking for multi-use and multi-amount payment requests you want Static Charges.
Usage
This API is used forreceiving funds into your ZBD Project. The primary idea is to create one of these Charges anytime someone wishes to perform a payment TO you.
On a successful 200 HTTP response from the ZBD API, you should render the contents of data.invoice.uri in a QR code. This QR code can be scanned by any Bitcoin Lightning wallet.
Configuration
Header Parameters
string
required
ZBD Project API Key
string
Content Type
Body
string
required
The amount for the Charge -> in millisatoshis
string
required
Note or comment for this Charge (visible to payer)
number
Time until Charge expiration -> in seconds
string
The endpoint ZBD will POST Charge updates to
string
Open metadata string property
{
"success": true,
"message": "Successfully created Charge.",
"data": {
"unit": "msats",
"amount": "10000",
"confirmedAt": null,
"status": "pending",
"description": "My Charge Description",
"createdAt": "2020-05-09T15:09:05.765Z",
"expiresAt": "2020-05-09T15:14:05.618Z",
"id": "1907b0fe-789b-4e25-b18a-0c4c0f5cced7",
"internalId": "11af01d092444a317cb33faa6b8304b8",
"callbackUrl": "https://your-website.com/callback",
"invoice": {
"request": "lnbc100n1p0td3u3pp5z2ed9yjfrz0rgu0fzuc5cdwfu8dtjlgrfztz5uga8hakkjy2yzgsdpzf4ujqsmgv9exwefqg3jhxcmjd9c8g6t0dccqzpgxqzfvsp5q8z5mkghmuzrnusxdwtmls7x8vuy63j25rt4z55gj3s7340dv72q9qy9qsqz02rlmlzcvew3vk90c6l0369ewk7tkr2tx0yrk3qa235v07w6d3qeksk99wm7y8f8ug7zqy6yjudu4cs2f4umpey43cw7msyj7uqj2qq8x03te",
"uri": "lightning:lnbc100n1p0td3u3pp5z2ed9yjfrz0rgu0fzuc5cdwfu8dtjlgrfztz5uga8hakkjy2yzgsdpzf4ujqsmgv9exwefqg3jhxcmjd9c8g6t0dccqzpgxqzfvsp5q8z5mkghmuzrnusxdwtmls7x8vuy63j25rt4z55gj3s7340dv72q9qy9qsqz02rlmlzcvew3vk90c6l0369ewk7tkr2tx0yrk3qa235v07w6d3qeksk99wm7y8f8ug7zqy6yjudu4cs2f4umpey43cw7msyj7uqj2qq8x03te"
}
}
}
Was this page helpful?
⌘I