Update Static Charge
curl --request PATCH \
--url https://api.zbdpay.com/v0/static-charges/{id} \
--header 'Content-Type: application/json' \
--header 'apikey: <apikey>' \
--data '
{
"minAmount": "<string>",
"maxAmount": "<string>",
"description": "<string>",
"successMessage": "<string>",
"allowedSlots": 123,
"internalId": "<string>",
"callbackUrl": "<string>"
}
'import requests
url = "https://api.zbdpay.com/v0/static-charges/{id}"
payload = {
"minAmount": "<string>",
"maxAmount": "<string>",
"description": "<string>",
"successMessage": "<string>",
"allowedSlots": 123,
"internalId": "<string>",
"callbackUrl": "<string>"
}
headers = {
"apikey": "<apikey>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {apikey: '<apikey>', 'Content-Type': 'application/json'},
body: JSON.stringify({
minAmount: '<string>',
maxAmount: '<string>',
description: '<string>',
successMessage: '<string>',
allowedSlots: 123,
internalId: '<string>',
callbackUrl: '<string>'
})
};
fetch('https://api.zbdpay.com/v0/static-charges/{id}', 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/static-charges/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'minAmount' => '<string>',
'maxAmount' => '<string>',
'description' => '<string>',
'successMessage' => '<string>',
'allowedSlots' => 123,
'internalId' => '<string>',
'callbackUrl' => '<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.zbdpay.com/v0/static-charges/{id}"
payload := strings.NewReader("{\n \"minAmount\": \"<string>\",\n \"maxAmount\": \"<string>\",\n \"description\": \"<string>\",\n \"successMessage\": \"<string>\",\n \"allowedSlots\": 123,\n \"internalId\": \"<string>\",\n \"callbackUrl\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.zbdpay.com/v0/static-charges/{id}")
.header("apikey", "<apikey>")
.header("Content-Type", "application/json")
.body("{\n \"minAmount\": \"<string>\",\n \"maxAmount\": \"<string>\",\n \"description\": \"<string>\",\n \"successMessage\": \"<string>\",\n \"allowedSlots\": 123,\n \"internalId\": \"<string>\",\n \"callbackUrl\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zbdpay.com/v0/static-charges/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["apikey"] = '<apikey>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"minAmount\": \"<string>\",\n \"maxAmount\": \"<string>\",\n \"description\": \"<string>\",\n \"successMessage\": \"<string>\",\n \"allowedSlots\": 123,\n \"internalId\": \"<string>\",\n \"callbackUrl\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message":"Successfully editted Static Charge.",
"data":{
"id":"45c225b1-022b-4a37-98d6-5a5568f78d11",
"unit":"msats",
"slots":0,
"minAmount":"10000",
"maxAmount":"100000",
"createdAt":"2023-03-07T20:07:06.910Z",
"expiresAt":null,
"internalId":"myInternalId",
"description":"This is my static charge",
"callbackUrl":"https://my-website/zbd-callback",
"allowedSlots":1000,
"successMessage":"Congratulations your payment was successful!",
"status":"active",
"invoice":{
"request":"lnurl1dp68gurn8ghj7ctsdyh85etzv4jx2efwd9hj7a3s9aex2ut4v4ehgttnw3shg6tr943ksctjvajhxte5x43nyv34vgcj6vpjxf3z6drpxvmj6wfcvsmz6dtpx56nvwrxxuuxgvf3uzvpfy",
"uri":"lightning:lnurl1dp68gurn8ghj7ctsdyh85etzv4jx2efwd9hj7a3s9aex2ut4v4ehgttnw3shg6tr943ksctjvajhxte5x43nyv34vgcj6vpjxf3z6drpxvmj6wfcvsmz6dtpx56nvwrxxuuxgvf3uzvpfy"
}
}
}
Lightning Charges
Update Static Charge
Change the configuration of a Static Charge QR code.
PATCH
/
v0
/
static-charges
/
{id}
Update Static Charge
curl --request PATCH \
--url https://api.zbdpay.com/v0/static-charges/{id} \
--header 'Content-Type: application/json' \
--header 'apikey: <apikey>' \
--data '
{
"minAmount": "<string>",
"maxAmount": "<string>",
"description": "<string>",
"successMessage": "<string>",
"allowedSlots": 123,
"internalId": "<string>",
"callbackUrl": "<string>"
}
'import requests
url = "https://api.zbdpay.com/v0/static-charges/{id}"
payload = {
"minAmount": "<string>",
"maxAmount": "<string>",
"description": "<string>",
"successMessage": "<string>",
"allowedSlots": 123,
"internalId": "<string>",
"callbackUrl": "<string>"
}
headers = {
"apikey": "<apikey>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {apikey: '<apikey>', 'Content-Type': 'application/json'},
body: JSON.stringify({
minAmount: '<string>',
maxAmount: '<string>',
description: '<string>',
successMessage: '<string>',
allowedSlots: 123,
internalId: '<string>',
callbackUrl: '<string>'
})
};
fetch('https://api.zbdpay.com/v0/static-charges/{id}', 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/static-charges/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'minAmount' => '<string>',
'maxAmount' => '<string>',
'description' => '<string>',
'successMessage' => '<string>',
'allowedSlots' => 123,
'internalId' => '<string>',
'callbackUrl' => '<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.zbdpay.com/v0/static-charges/{id}"
payload := strings.NewReader("{\n \"minAmount\": \"<string>\",\n \"maxAmount\": \"<string>\",\n \"description\": \"<string>\",\n \"successMessage\": \"<string>\",\n \"allowedSlots\": 123,\n \"internalId\": \"<string>\",\n \"callbackUrl\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.zbdpay.com/v0/static-charges/{id}")
.header("apikey", "<apikey>")
.header("Content-Type", "application/json")
.body("{\n \"minAmount\": \"<string>\",\n \"maxAmount\": \"<string>\",\n \"description\": \"<string>\",\n \"successMessage\": \"<string>\",\n \"allowedSlots\": 123,\n \"internalId\": \"<string>\",\n \"callbackUrl\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zbdpay.com/v0/static-charges/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["apikey"] = '<apikey>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"minAmount\": \"<string>\",\n \"maxAmount\": \"<string>\",\n \"description\": \"<string>\",\n \"successMessage\": \"<string>\",\n \"allowedSlots\": 123,\n \"internalId\": \"<string>\",\n \"callbackUrl\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message":"Successfully editted Static Charge.",
"data":{
"id":"45c225b1-022b-4a37-98d6-5a5568f78d11",
"unit":"msats",
"slots":0,
"minAmount":"10000",
"maxAmount":"100000",
"createdAt":"2023-03-07T20:07:06.910Z",
"expiresAt":null,
"internalId":"myInternalId",
"description":"This is my static charge",
"callbackUrl":"https://my-website/zbd-callback",
"allowedSlots":1000,
"successMessage":"Congratulations your payment was successful!",
"status":"active",
"invoice":{
"request":"lnurl1dp68gurn8ghj7ctsdyh85etzv4jx2efwd9hj7a3s9aex2ut4v4ehgttnw3shg6tr943ksctjvajhxte5x43nyv34vgcj6vpjxf3z6drpxvmj6wfcvsmz6dtpx56nvwrxxuuxgvf3uzvpfy",
"uri":"lightning:lnurl1dp68gurn8ghj7ctsdyh85etzv4jx2efwd9hj7a3s9aex2ut4v4ehgttnw3shg6tr943ksctjvajhxte5x43nyv34vgcj6vpjxf3z6drpxvmj6wfcvsmz6dtpx56nvwrxxuuxgvf3uzvpfy"
}
}
}
Usage
Use this API endpoint with the specific Static Charge ID to update its properties. Usually you’d use this API for the purposes ofincreasing slots or changing min/max amount settings.
Updating a Static Charge WILL NOT modify its QR code. The point of a Static Charge is that it does not change, while its contents can remain dynamic.
Configuration
Path Parameters
Header Parameters
Body
{
"message":"Successfully editted Static Charge.",
"data":{
"id":"45c225b1-022b-4a37-98d6-5a5568f78d11",
"unit":"msats",
"slots":0,
"minAmount":"10000",
"maxAmount":"100000",
"createdAt":"2023-03-07T20:07:06.910Z",
"expiresAt":null,
"internalId":"myInternalId",
"description":"This is my static charge",
"callbackUrl":"https://my-website/zbd-callback",
"allowedSlots":1000,
"successMessage":"Congratulations your payment was successful!",
"status":"active",
"invoice":{
"request":"lnurl1dp68gurn8ghj7ctsdyh85etzv4jx2efwd9hj7a3s9aex2ut4v4ehgttnw3shg6tr943ksctjvajhxte5x43nyv34vgcj6vpjxf3z6drpxvmj6wfcvsmz6dtpx56nvwrxxuuxgvf3uzvpfy",
"uri":"lightning:lnurl1dp68gurn8ghj7ctsdyh85etzv4jx2efwd9hj7a3s9aex2ut4v4ehgttnw3shg6tr943ksctjvajhxte5x43nyv34vgcj6vpjxf3z6drpxvmj6wfcvsmz6dtpx56nvwrxxuuxgvf3uzvpfy"
}
}
}
Was this page helpful?