Update a refill configuration.
curl --request PATCH \
--url https://api.example.com/v2/refill-configurations/{account_id}/{metric_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"minimum_balance": "100.0",
"target_balance": "100.0",
"is_active": true
}
'import requests
url = "https://api.example.com/v2/refill-configurations/{account_id}/{metric_id}"
payload = {
"minimum_balance": "100.0",
"target_balance": "100.0",
"is_active": True
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({minimum_balance: '100.0', target_balance: '100.0', is_active: true})
};
fetch('https://api.example.com/v2/refill-configurations/{account_id}/{metric_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.example.com/v2/refill-configurations/{account_id}/{metric_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([
'minimum_balance' => '100.0',
'target_balance' => '100.0',
'is_active' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.example.com/v2/refill-configurations/{account_id}/{metric_id}"
payload := strings.NewReader("{\n \"minimum_balance\": \"100.0\",\n \"target_balance\": \"100.0\",\n \"is_active\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.example.com/v2/refill-configurations/{account_id}/{metric_id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"minimum_balance\": \"100.0\",\n \"target_balance\": \"100.0\",\n \"is_active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v2/refill-configurations/{account_id}/{metric_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"minimum_balance\": \"100.0\",\n \"target_balance\": \"100.0\",\n \"is_active\": true\n}"
response = http.request(request)
puts response.read_body{
"account_id": "account_0194f4e3a2b77c6aa91c4f6b4db2a980",
"metric_id": "metric_0194f4e3a2b77c6aa91c4f6b4db2a980",
"minimum_balance": "100.0",
"target_balance": "100.0",
"is_active": true,
"created_at": 1767225600,
"updated_at": 1767225600
}"<string>""Invalid API key""<string>""not found""<string>""<string>""<string>""<string>""rate limit exceeded""<string>"Refill Configurations
Update a refill configuration.
PATCH
/
v2
/
refill-configurations
/
{account_id}
/
{metric_id}
Update a refill configuration.
curl --request PATCH \
--url https://api.example.com/v2/refill-configurations/{account_id}/{metric_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"minimum_balance": "100.0",
"target_balance": "100.0",
"is_active": true
}
'import requests
url = "https://api.example.com/v2/refill-configurations/{account_id}/{metric_id}"
payload = {
"minimum_balance": "100.0",
"target_balance": "100.0",
"is_active": True
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({minimum_balance: '100.0', target_balance: '100.0', is_active: true})
};
fetch('https://api.example.com/v2/refill-configurations/{account_id}/{metric_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.example.com/v2/refill-configurations/{account_id}/{metric_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([
'minimum_balance' => '100.0',
'target_balance' => '100.0',
'is_active' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.example.com/v2/refill-configurations/{account_id}/{metric_id}"
payload := strings.NewReader("{\n \"minimum_balance\": \"100.0\",\n \"target_balance\": \"100.0\",\n \"is_active\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.example.com/v2/refill-configurations/{account_id}/{metric_id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"minimum_balance\": \"100.0\",\n \"target_balance\": \"100.0\",\n \"is_active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v2/refill-configurations/{account_id}/{metric_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"minimum_balance\": \"100.0\",\n \"target_balance\": \"100.0\",\n \"is_active\": true\n}"
response = http.request(request)
puts response.read_body{
"account_id": "account_0194f4e3a2b77c6aa91c4f6b4db2a980",
"metric_id": "metric_0194f4e3a2b77c6aa91c4f6b4db2a980",
"minimum_balance": "100.0",
"target_balance": "100.0",
"is_active": true,
"created_at": 1767225600,
"updated_at": 1767225600
}"<string>""Invalid API key""<string>""not found""<string>""<string>""<string>""<string>""rate limit exceeded""<string>"Authorizations
LedgerUp API Key.
Path Parameters
Account identifier. LedgerUp account identifier.
Pattern:
^account_[0-9a-f]{32}$Example:
"account_0194f4e3a2b77c6aa91c4f6b4db2a980"
Metric identifier. LedgerUp metric identifier.
Pattern:
^metric_[0-9a-f]{32}$Example:
"metric_0194f4e3a2b77c6aa91c4f6b4db2a980"
Body
application/json
Update-refill-configuration request. Omitted fields are unchanged. target_balance must remain greater than minimum_balance. Unknown JSON fields are rejected.
Response
Updated.
LedgerUp account identifier.
Pattern:
^account_[0-9a-f]{32}$Example:
"account_0194f4e3a2b77c6aa91c4f6b4db2a980"
LedgerUp metric identifier.
Pattern:
^metric_[0-9a-f]{32}$Example:
"metric_0194f4e3a2b77c6aa91c4f6b4db2a980"
Decimal balance serialized as a string.
Pattern:
^-?\d+(\.\d+)?$Example:
"100.0"
Decimal balance serialized as a string.
Pattern:
^-?\d+(\.\d+)?$Example:
"100.0"
Whether automatic refills are enabled.
Example:
true
Unix timestamp in seconds.
Example:
1767225600
Unix timestamp in seconds.
Example:
1767225600