Próxima factura del proyecto
curl --request POST \
--url https://api.truthlocks.com/v1/billing/projected-invoice \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"country_code": "<string>",
"mints": 500000000,
"plan_key": "<string>",
"verifications": 500000000
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
country_code: '<string>',
mints: 500000000,
plan_key: '<string>',
verifications: 500000000
})
};
fetch('https://api.truthlocks.com/v1/billing/projected-invoice', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/billing/projected-invoice"
payload = {
"country_code": "<string>",
"mints": 500000000,
"plan_key": "<string>",
"verifications": 500000000
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/billing/projected-invoice"
payload := strings.NewReader("{\n \"country_code\": \"<string>\",\n \"mints\": 500000000,\n \"plan_key\": \"<string>\",\n \"verifications\": 500000000\n}")
req, _ := http.NewRequest("POST", 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))
}{
"total": 123,
"subtotal": 123,
"amount_unit": "cents",
"billing_model": "pay_per_use",
"volume_pricing": "graduated",
"estimate_only": true,
"currency": "<string>",
"line_items": [
{}
]
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}Facturación
Factura proyectada
Calcule un desglose de factura proyectado basado en los volúmenes esperados de acuñación y verificación.
POST
/
v1
/
billing
/
projected-invoice
Próxima factura del proyecto
curl --request POST \
--url https://api.truthlocks.com/v1/billing/projected-invoice \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"country_code": "<string>",
"mints": 500000000,
"plan_key": "<string>",
"verifications": 500000000
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
country_code: '<string>',
mints: 500000000,
plan_key: '<string>',
verifications: 500000000
})
};
fetch('https://api.truthlocks.com/v1/billing/projected-invoice', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/billing/projected-invoice"
payload = {
"country_code": "<string>",
"mints": 500000000,
"plan_key": "<string>",
"verifications": 500000000
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/billing/projected-invoice"
payload := strings.NewReader("{\n \"country_code\": \"<string>\",\n \"mints\": 500000000,\n \"plan_key\": \"<string>\",\n \"verifications\": 500000000\n}")
req, _ := http.NewRequest("POST", 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))
}{
"total": 123,
"subtotal": 123,
"amount_unit": "cents",
"billing_model": "pay_per_use",
"volume_pricing": "graduated",
"estimate_only": true,
"currency": "<string>",
"line_items": [
{}
]
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}POST /v1/billing/projected-invoice
country_code. Este punto final utiliza la tarjeta de tarifas estándar, no un acuerdo negociado por el inquilino. Proporcione las cantidades facturables esperadas; esta calculadora no deduce asignaciones gratuitas ni clasifica la actividad de la zona de pruebas.
El precio por volumen es graduado. Cada banda solo valora las operaciones de esa banda. La respuesta identifica billing_model: "pay_per_use", volume_pricing: "graduated", amount_unit: "cents" y estimate_only: true. Una estimación no crea ni cobra una factura. Las definiciones de tarifas faltantes, superpuestas o incompletas devuelven 422 invalid_pricing; las cantidades inseguras y los planes desconocidos devuelven 400 bad_request.
Los precios aplicados exactos están en line_items. Los campos escalares de conveniencia rates_used se conservan para la compatibilidad con las tarjetas de tarifa plana; no son un precio combinado y no deben multiplicarse en las bandas de volumen.
Respuesta
Todos los montos están en centavos. Divida por 100 para convertir a dólares. Los multiplicadores regionales se aplican automáticamente cuando incluye un
country_code.Cuerpo
application/json

