cURL
curl --request POST \
--url https://service-sandbox.tazapay.com/v3/lightning_invoice_bolt11 \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "12345600",
"d_tag_memo": "Payment for order #7890",
"h_tag_memo": "<string>",
"expiry_interval": "4800",
"metadata": "<string>"
}
'import requests
url = "https://service-sandbox.tazapay.com/v3/lightning_invoice_bolt11"
payload = {
"amount": "12345600",
"d_tag_memo": "Payment for order #7890",
"h_tag_memo": "<string>",
"expiry_interval": "4800",
"metadata": "<string>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: '12345600',
d_tag_memo: 'Payment for order #7890',
h_tag_memo: '<string>',
expiry_interval: '4800',
metadata: '<string>'
})
};
fetch('https://service-sandbox.tazapay.com/v3/lightning_invoice_bolt11', 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://service-sandbox.tazapay.com/v3/lightning_invoice_bolt11",
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' => '12345600',
'd_tag_memo' => 'Payment for order #7890',
'h_tag_memo' => '<string>',
'expiry_interval' => '4800',
'metadata' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$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://service-sandbox.tazapay.com/v3/lightning_invoice_bolt11"
payload := strings.NewReader("{\n \"amount\": \"12345600\",\n \"d_tag_memo\": \"Payment for order #7890\",\n \"h_tag_memo\": \"<string>\",\n \"expiry_interval\": \"4800\",\n \"metadata\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://service-sandbox.tazapay.com/v3/lightning_invoice_bolt11")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"12345600\",\n \"d_tag_memo\": \"Payment for order #7890\",\n \"h_tag_memo\": \"<string>\",\n \"expiry_interval\": \"4800\",\n \"metadata\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://service-sandbox.tazapay.com/v3/lightning_invoice_bolt11")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": \"12345600\",\n \"d_tag_memo\": \"Payment for order #7890\",\n \"h_tag_memo\": \"<string>\",\n \"expiry_interval\": \"4800\",\n \"metadata\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "",
"data": {
"id": "l11_abc123xyz",
"object": "lightning_invoice_bolt11",
"amount": 123456,
"d_tag_memo": "Payment for order #7890",
"collect": "col_98765",
"expiry_interval": 3600,
"metadata": {
"order_id": "7890",
"customer_id": "cust_456"
},
"status": "active",
"payment_status": "unpaid",
"created_at": "2025-09-28T08:15:30Z",
"updated_at": "2025-09-28T08:20:45Z"
}
}Lightning Invoice
Create a lightning invoice
POST
/
v3
/
lightning_invoice_bolt11
cURL
curl --request POST \
--url https://service-sandbox.tazapay.com/v3/lightning_invoice_bolt11 \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "12345600",
"d_tag_memo": "Payment for order #7890",
"h_tag_memo": "<string>",
"expiry_interval": "4800",
"metadata": "<string>"
}
'import requests
url = "https://service-sandbox.tazapay.com/v3/lightning_invoice_bolt11"
payload = {
"amount": "12345600",
"d_tag_memo": "Payment for order #7890",
"h_tag_memo": "<string>",
"expiry_interval": "4800",
"metadata": "<string>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: '12345600',
d_tag_memo: 'Payment for order #7890',
h_tag_memo: '<string>',
expiry_interval: '4800',
metadata: '<string>'
})
};
fetch('https://service-sandbox.tazapay.com/v3/lightning_invoice_bolt11', 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://service-sandbox.tazapay.com/v3/lightning_invoice_bolt11",
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' => '12345600',
'd_tag_memo' => 'Payment for order #7890',
'h_tag_memo' => '<string>',
'expiry_interval' => '4800',
'metadata' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$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://service-sandbox.tazapay.com/v3/lightning_invoice_bolt11"
payload := strings.NewReader("{\n \"amount\": \"12345600\",\n \"d_tag_memo\": \"Payment for order #7890\",\n \"h_tag_memo\": \"<string>\",\n \"expiry_interval\": \"4800\",\n \"metadata\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://service-sandbox.tazapay.com/v3/lightning_invoice_bolt11")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"12345600\",\n \"d_tag_memo\": \"Payment for order #7890\",\n \"h_tag_memo\": \"<string>\",\n \"expiry_interval\": \"4800\",\n \"metadata\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://service-sandbox.tazapay.com/v3/lightning_invoice_bolt11")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": \"12345600\",\n \"d_tag_memo\": \"Payment for order #7890\",\n \"h_tag_memo\": \"<string>\",\n \"expiry_interval\": \"4800\",\n \"metadata\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "",
"data": {
"id": "l11_abc123xyz",
"object": "lightning_invoice_bolt11",
"amount": 123456,
"d_tag_memo": "Payment for order #7890",
"collect": "col_98765",
"expiry_interval": 3600,
"metadata": {
"order_id": "7890",
"customer_id": "cust_456"
},
"status": "active",
"payment_status": "unpaid",
"created_at": "2025-09-28T08:15:30Z",
"updated_at": "2025-09-28T08:20:45Z"
}
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Body
application/json
Amount in BTC. The precision is 8 decimal places
This will be included in the d-tag. If both d_tag_memo and h_tag_memo are provided, only h_tag will be used
SHA-256 of the d_tag_memo. If both d_tag_memo and h_tag_memo are provided, only h_tag_memo will be used
The expiry of the invoice in seconds. Default value is 3600 (1 hour)
Set of key-value pairs to attach to the lightning_invoice_bolt11 object
Was this page helpful?
⌘I