curl --request GET \
--url https://lazyapp.in/v1/platform/customers/{customer}/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://lazyapp.in/v1/platform/customers/{customer}/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://lazyapp.in/v1/platform/customers/{customer}/usage', 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://lazyapp.in/v1/platform/customers/{customer}/usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://lazyapp.in/v1/platform/customers/{customer}/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://lazyapp.in/v1/platform/customers/{customer}/usage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://lazyapp.in/v1/platform/customers/{customer}/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"totals": {
"messages": 123,
"freeMessages": 123,
"paidMessages": 123,
"metaCharges": "<string>",
"providerCost": "<string>",
"lazyappCharge": "<string>",
"tax": "<string>",
"paymentFee": "<string>",
"totalCharge": "<string>",
"currency": "<string>",
"averageCostPerMessage": "<string>"
},
"previousTotals": {
"messages": 123,
"freeMessages": 123,
"paidMessages": 123,
"metaCharges": "<string>",
"providerCost": "<string>",
"lazyappCharge": "<string>",
"tax": "<string>",
"paymentFee": "<string>",
"totalCharge": "<string>",
"currency": "<string>",
"averageCostPerMessage": "<string>",
"period": "<string>"
},
"comparison": {
"messagesDelta": 123,
"totalChargeDelta": "<string>",
"messagesDeltaPct": 123,
"totalChargeDeltaPct": 123
},
"costStack": [
{
"key": "lazyapp",
"label": "<string>",
"amount": "<string>",
"sharePct": 123
}
],
"daily": [
{
"day": "<string>",
"messages": 123,
"paidMessages": 123,
"freeMessages": 123,
"metaCharges": "<string>",
"lazyappCharge": "<string>",
"totalCharge": "<string>"
}
],
"byCategory": [
{
"category": "<string>",
"messages": 123,
"metaCharges": "<string>",
"lazyappCharge": "<string>",
"totalCharge": "<string>",
"sharePct": 123
}
],
"byRegion": [
{
"region": "<string>",
"messages": 123,
"totalCharge": "<string>",
"sharePct": 123
}
],
"byPhoneNumber": [
{
"phoneNumber": "<string>",
"messages": 123,
"totalCharge": "<string>",
"sharePct": 123
}
],
"byTemplate": [
{
"templateName": "<string>",
"messages": 123,
"totalCharge": "<string>"
}
],
"freeVsPaid": {
"paidMessages": 123,
"freeMessages": 123,
"paidSharePct": 123,
"freeSharePct": 123
},
"spending_limit_cents": 123,
"wallet_balance_cents": 123,
"billing_mode": "inherit"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "The API is on the Pro plan. Upgrade in Billing to use live keys. Test keys keep working.",
"code": "plan_limit_reached"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}Retrieve customer usage
Message counts and charges for one billing period, broken down by day, category, region, number and template.
Required scope: customers:write
curl --request GET \
--url https://lazyapp.in/v1/platform/customers/{customer}/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://lazyapp.in/v1/platform/customers/{customer}/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://lazyapp.in/v1/platform/customers/{customer}/usage', 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://lazyapp.in/v1/platform/customers/{customer}/usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://lazyapp.in/v1/platform/customers/{customer}/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://lazyapp.in/v1/platform/customers/{customer}/usage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://lazyapp.in/v1/platform/customers/{customer}/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"totals": {
"messages": 123,
"freeMessages": 123,
"paidMessages": 123,
"metaCharges": "<string>",
"providerCost": "<string>",
"lazyappCharge": "<string>",
"tax": "<string>",
"paymentFee": "<string>",
"totalCharge": "<string>",
"currency": "<string>",
"averageCostPerMessage": "<string>"
},
"previousTotals": {
"messages": 123,
"freeMessages": 123,
"paidMessages": 123,
"metaCharges": "<string>",
"providerCost": "<string>",
"lazyappCharge": "<string>",
"tax": "<string>",
"paymentFee": "<string>",
"totalCharge": "<string>",
"currency": "<string>",
"averageCostPerMessage": "<string>",
"period": "<string>"
},
"comparison": {
"messagesDelta": 123,
"totalChargeDelta": "<string>",
"messagesDeltaPct": 123,
"totalChargeDeltaPct": 123
},
"costStack": [
{
"key": "lazyapp",
"label": "<string>",
"amount": "<string>",
"sharePct": 123
}
],
"daily": [
{
"day": "<string>",
"messages": 123,
"paidMessages": 123,
"freeMessages": 123,
"metaCharges": "<string>",
"lazyappCharge": "<string>",
"totalCharge": "<string>"
}
],
"byCategory": [
{
"category": "<string>",
"messages": 123,
"metaCharges": "<string>",
"lazyappCharge": "<string>",
"totalCharge": "<string>",
"sharePct": 123
}
],
"byRegion": [
{
"region": "<string>",
"messages": 123,
"totalCharge": "<string>",
"sharePct": 123
}
],
"byPhoneNumber": [
{
"phoneNumber": "<string>",
"messages": 123,
"totalCharge": "<string>",
"sharePct": 123
}
],
"byTemplate": [
{
"templateName": "<string>",
"messages": 123,
"totalCharge": "<string>"
}
],
"freeVsPaid": {
"paidMessages": 123,
"freeMessages": 123,
"paidSharePct": 123,
"freeSharePct": 123
},
"spending_limit_cents": 123,
"wallet_balance_cents": 123,
"billing_mode": "inherit"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "The API is on the Pro plan. Upgrade in Billing to use live keys. Test keys keep working.",
"code": "plan_limit_reached"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}Authorizations
Your API key, e.g. sk_live_... or sk_test_....
Path Parameters
Customer public id, e.g. cus_....
Query Parameters
Billing period, YYYY-MM. Defaults to the current month.
Response
Usage.
Usage for one customer and one billing period, in this key's mode. LazyApp adds 0% to Meta's rates, so charges are non-zero only for sends LazyApp pays Meta for.
Show child attributes
Show child attributes
The same totals for the month before, plus its period.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
What totals.totalCharge is made of.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Top 15 templates by charge.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Prepaid balance in minor units, used when billing_mode is prepaid. It is debited only for sends LazyApp pays Meta for, at Meta's rate. Sends on numbers where Meta bills the business directly cost nothing here.
inherit, prepaid, postpaid