Prochaine facture du projet
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
}Facturation
Facture projetée
Calculez une ventilation de facture projetée basée sur les volumes de création et de vérification attendus.
POST
/
v1
/
billing
/
projected-invoice
Prochaine facture du projet
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. Ce point de terminaison utilise la grille tarifaire standard, et non un accord négocié par le locataire. Fournissez les quantités facturables attendues ; ce calculateur ne déduit pas les allocations gratuites et ne classe pas l’activité de la sandbox.
La tarification au volume est graduée. Chaque tranche ne tarifie que les opérations de cette tranche. La réponse identifie billing_model: "pay_per_use", volume_pricing: "graduated", amount_unit: "cents" et estimate_only: true. Une estimation ne crée ni ne facture de facture. Les définitions de taux manquantes, qui se chevauchent ou incomplètes renvoient 422 invalid_pricing ; les quantités dangereuses et les plans inconnus renvoient 400 bad_request.
Les prix exacts appliqués se trouvent dans line_items. Les champs scalaires de commodité rates_used sont conservés pour la compatibilité avec les tarifs forfaitaires ; ils ne sont pas un prix mixte et ne doivent pas être multipliés sur les tranches de volume.
Réponse
Tous les montants sont en cents. Divisez par 100 pour convertir en dollars. Les multiplicateurs régionaux s’appliquent automatiquement lorsque vous incluez un
country_code.Corps
application/json

