Estimar o preço de uma ligação
RegistosPOST /estimates
Priced from the utility's configured connection fee (tariff charge components with accounting_role connection_fee). Without a configured price the answer has no amount and says the utility will quote (priced false).
Corpo application/json
tenant_idlocalitydistance_metersconnection_typeum de
residential,commercial,industrial,institutional,governmentchallenge_tokenBot-challenge token when security.challenge is enabled (anonymous callers). Only UI requests (browser headers, the dashboard, or X-Client mobile or desktop) are challenged; API requests never are.
Devolve
curl -X POST "$PUBLIC_API/estimates" \
-H "Content-Type: application/json" \
-d '{
"tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
"locality": "locality",
"distance_meters": 1,
"connection_type": "residential",
"challenge_token": "challenge token"
}'
# Sem comando CLI equivalente; use cURL ou HTTP directo.
const res = await fetch("$PUBLIC_API/estimates", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
"locality": "locality",
"distance_meters": 1,
"connection_type": "residential",
"challenge_token": "challenge token"
})
});
const data = await res.json();
import requests
res = requests.post(
"$PUBLIC_API/estimates",
json={
"tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
"locality": "locality",
"distance_meters": 1,
"connection_type": "residential",
"challenge_token": "challenge token"
}
)
data = res.json()
body := strings.NewReader(`{
"tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
"locality": "locality",
"distance_meters": 1,
"connection_type": "residential",
"challenge_token": "challenge token"
}`)
req, _ := http.NewRequest("POST", "$PUBLIC_API/estimates", body)
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
Resposta 200
{
"priced": true,
"min_cents": 1,
"max_cents": 1,
"currency": "MZN",
"message_code": "estimate.priced",
"message": "Leitura confirmada no local."
}