curl --request POST \
--url https://platform.trylath.com/billing/passthrough/record \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metric": "sms.registration",
"description": "<string>",
"amountCents": 500000,
"providerRef": "<string>",
"period": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metric: 'sms.registration',
description: '<string>',
amountCents: 500000,
providerRef: '<string>',
period: '<string>'
})
};
fetch('https://platform.trylath.com/billing/passthrough/record', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://platform.trylath.com/billing/passthrough/record"
payload = {
"metric": "sms.registration",
"description": "<string>",
"amountCents": 500000,
"providerRef": "<string>",
"period": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"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://platform.trylath.com/billing/passthrough/record"
payload := strings.NewReader("{\n \"metric\": \"sms.registration\",\n \"description\": \"<string>\",\n \"amountCents\": 500000,\n \"providerRef\": \"<string>\",\n \"period\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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))
}{
"activityId": "<string>",
"result": {
"recorded": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amountCents": 0,
"period": "<string>",
"reason": "already_recorded"
}
}billing.passthrough.record
Records a fee the carrier charged, to be passed through at cost on this environment’s bill for the period. Used for carrier registration fees, which have no unit price — the amount is what was actually charged. Recording the same providerRef twice is refused rather than billed twice. This does not move money: it adds a line to the month, which is collected when the period closes.
curl --request POST \
--url https://platform.trylath.com/billing/passthrough/record \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metric": "sms.registration",
"description": "<string>",
"amountCents": 500000,
"providerRef": "<string>",
"period": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metric: 'sms.registration',
description: '<string>',
amountCents: 500000,
providerRef: '<string>',
period: '<string>'
})
};
fetch('https://platform.trylath.com/billing/passthrough/record', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://platform.trylath.com/billing/passthrough/record"
payload = {
"metric": "sms.registration",
"description": "<string>",
"amountCents": 500000,
"providerRef": "<string>",
"period": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"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://platform.trylath.com/billing/passthrough/record"
payload := strings.NewReader("{\n \"metric\": \"sms.registration\",\n \"description\": \"<string>\",\n \"amountCents\": 500000,\n \"providerRef\": \"<string>\",\n \"period\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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))
}{
"activityId": "<string>",
"result": {
"recorded": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amountCents": 0,
"period": "<string>",
"reason": "already_recorded"
}
}Authorizations
A Lath API key: lath_live_sk… or lath_test_sk… on a server, lath_live_pk… or lath_test_pk… in a browser.
Headers
Replays the stored response for the same key and input; refuses different input.
Body
Which pass-through line this belongs to
sms.registration What the fee was for, as it should read on the bill
1 - 200The amount actually charged, in cents. Zero is allowed: a waived fee is still worth showing.
0 <= x <= 1000000The carrier's own reference. Recording the same one twice is refused, which is what makes a retry safe.
1 - 200Calendar month, UTC, as YYYY-MM. Defaults to the current month.
^\d{4}-(0[1-9]|1[0-2])$Was this page helpful?

