curl --request PUT \
--url https://api.anhome.tuanle.dev/api/v1/billing-settings/{property_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"electricity_unit_price": "3500",
"electricity_fixed_amount": "0",
"water_unit_price": "15000",
"water_fixed_amount": "0",
"billing_day": 16,
"due_day": 16
}
'import requests
url = "https://api.anhome.tuanle.dev/api/v1/billing-settings/{property_id}"
payload = {
"electricity_unit_price": "3500",
"electricity_fixed_amount": "0",
"water_unit_price": "15000",
"water_fixed_amount": "0",
"billing_day": 16,
"due_day": 16
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
electricity_unit_price: '3500',
electricity_fixed_amount: '0',
water_unit_price: '15000',
water_fixed_amount: '0',
billing_day: 16,
due_day: 16
})
};
fetch('https://api.anhome.tuanle.dev/api/v1/billing-settings/{property_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.anhome.tuanle.dev/api/v1/billing-settings/{property_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'electricity_unit_price' => '3500',
'electricity_fixed_amount' => '0',
'water_unit_price' => '15000',
'water_fixed_amount' => '0',
'billing_day' => 16,
'due_day' => 16
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.anhome.tuanle.dev/api/v1/billing-settings/{property_id}"
payload := strings.NewReader("{\n \"electricity_unit_price\": \"3500\",\n \"electricity_fixed_amount\": \"0\",\n \"water_unit_price\": \"15000\",\n \"water_fixed_amount\": \"0\",\n \"billing_day\": 16,\n \"due_day\": 16\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.anhome.tuanle.dev/api/v1/billing-settings/{property_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"electricity_unit_price\": \"3500\",\n \"electricity_fixed_amount\": \"0\",\n \"water_unit_price\": \"15000\",\n \"water_fixed_amount\": \"0\",\n \"billing_day\": 16,\n \"due_day\": 16\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.anhome.tuanle.dev/api/v1/billing-settings/{property_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"electricity_unit_price\": \"3500\",\n \"electricity_fixed_amount\": \"0\",\n \"water_unit_price\": \"15000\",\n \"water_fixed_amount\": \"0\",\n \"billing_day\": 16,\n \"due_day\": 16\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"property_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"billing_day": 123,
"due_day": 123,
"electricity_unit_price": "3500",
"electricity_fixed_amount": "0",
"water_unit_price": "15000",
"water_fixed_amount": "0",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"request_id": "<string>",
"meta": {}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}Upsert billing settings
Creates or replaces billing settings for a property in one idempotent request.
curl --request PUT \
--url https://api.anhome.tuanle.dev/api/v1/billing-settings/{property_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"electricity_unit_price": "3500",
"electricity_fixed_amount": "0",
"water_unit_price": "15000",
"water_fixed_amount": "0",
"billing_day": 16,
"due_day": 16
}
'import requests
url = "https://api.anhome.tuanle.dev/api/v1/billing-settings/{property_id}"
payload = {
"electricity_unit_price": "3500",
"electricity_fixed_amount": "0",
"water_unit_price": "15000",
"water_fixed_amount": "0",
"billing_day": 16,
"due_day": 16
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
electricity_unit_price: '3500',
electricity_fixed_amount: '0',
water_unit_price: '15000',
water_fixed_amount: '0',
billing_day: 16,
due_day: 16
})
};
fetch('https://api.anhome.tuanle.dev/api/v1/billing-settings/{property_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.anhome.tuanle.dev/api/v1/billing-settings/{property_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'electricity_unit_price' => '3500',
'electricity_fixed_amount' => '0',
'water_unit_price' => '15000',
'water_fixed_amount' => '0',
'billing_day' => 16,
'due_day' => 16
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.anhome.tuanle.dev/api/v1/billing-settings/{property_id}"
payload := strings.NewReader("{\n \"electricity_unit_price\": \"3500\",\n \"electricity_fixed_amount\": \"0\",\n \"water_unit_price\": \"15000\",\n \"water_fixed_amount\": \"0\",\n \"billing_day\": 16,\n \"due_day\": 16\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.anhome.tuanle.dev/api/v1/billing-settings/{property_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"electricity_unit_price\": \"3500\",\n \"electricity_fixed_amount\": \"0\",\n \"water_unit_price\": \"15000\",\n \"water_fixed_amount\": \"0\",\n \"billing_day\": 16,\n \"due_day\": 16\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.anhome.tuanle.dev/api/v1/billing-settings/{property_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"electricity_unit_price\": \"3500\",\n \"electricity_fixed_amount\": \"0\",\n \"water_unit_price\": \"15000\",\n \"water_fixed_amount\": \"0\",\n \"billing_day\": 16,\n \"due_day\": 16\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"property_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"billing_day": 123,
"due_day": 123,
"electricity_unit_price": "3500",
"electricity_fixed_amount": "0",
"water_unit_price": "15000",
"water_fixed_amount": "0",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"request_id": "<string>",
"meta": {}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Property ID
Body
JSON payload used to upsert billing settings.
Request payload for upsert billing settings.
Unit price applied to electricity usage.
"3500"
Fixed electricity charge applied during invoice generation.
"0"
Unit price applied to water usage.
"15000"
Fixed water charge applied during invoice generation.
"0"
Day of month used as the default billing day.
1 <= x <= 31Day of month used to calculate invoice due dates.
1 <= x <= 31Pricing mode used for electricity charges.
NONE, FIXED, METERED, PER_OCCUPANT Pricing mode used for water charges.
NONE, FIXED, METERED, PER_OCCUPANT Response
Upserted billing settings
Endpoint-specific response payload. See the referenced schema for the resource fields.
Show child attributes
Show child attributes
Request correlation identifier returned from X-Request-Id or generated by the API.
Optional response metadata such as pagination limits, counts, or export context.