Get Usage
curl --request GET \
--url https://api.launchmystore.io/api/v1/billing/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.launchmystore.io/api/v1/billing/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.launchmystore.io/api/v1/billing/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://api.launchmystore.io/api/v1/billing/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://api.launchmystore.io/api/v1/billing/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://api.launchmystore.io/api/v1/billing/usage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/billing/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{
"data.unitName": {},
"data.unitAmount": {},
"data.currency": "<string>",
"data.capAmountCents": {},
"data.accruedAmountCents": 123,
"data.remainingCents": {},
"data.pendingCapAmountCents": {},
"data.billingStatus": "<string>",
"data.currentPeriodEnd": {},
"data.cancelAtPeriodEnd": true,
"data.meteredItemId": {}
}App Billing
Get Usage
Read the metered configuration and the current billing period usage of the installation that owns the token.
GET
/
api
/
v1
/
billing
/
usage
Get Usage
curl --request GET \
--url https://api.launchmystore.io/api/v1/billing/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.launchmystore.io/api/v1/billing/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.launchmystore.io/api/v1/billing/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://api.launchmystore.io/api/v1/billing/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://api.launchmystore.io/api/v1/billing/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://api.launchmystore.io/api/v1/billing/usage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/billing/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{
"data.unitName": {},
"data.unitAmount": {},
"data.currency": "<string>",
"data.capAmountCents": {},
"data.accruedAmountCents": 123,
"data.remainingCents": {},
"data.pendingCapAmountCents": {},
"data.billingStatus": "<string>",
"data.currentPeriodEnd": {},
"data.cancelAtPeriodEnd": true,
"data.meteredItemId": {}
}Returns the usage pricing, the merchant-approved cap and what has accrued in
the current billing period — typically used to render a “used X of Y this
month” bar in your app.
Scope:
read_billing. The installation is resolved from the access
token. *Cents fields are minor units of the pricing currency (see
Usage Records).
curl "https://api.launchmystore.io/api/v1/billing/usage" \
-H "Authorization: Bearer <APP_ACCESS_TOKEN>"
Response
string | null
Label of the metered unit, e.g.
SMS.number | null
Unit price in major units.
string
Pricing currency (ISO 4217).
integer | null
Merchant-approved cap (
null when no cap is declared).number
Usage recorded and not yet invoiced.
number | null
Headroom under the cap.
integer | null
A cap raise waiting for the merchant’s approval, else
null.string
active, trial, past_due, cancelled, …string | null
End of the current subscription period.
boolean
true when the subscription is scheduled to end at currentPeriodEnd.string | null
Metered subscription item the usage is reported on.
{
"status": 200,
"state": "success",
"data": {
"unitName": "SMS",
"unitAmount": 0.05,
"currency": "USD",
"capAmountCents": 5000,
"accruedAmountCents": 605,
"remainingCents": 4395,
"pendingCapAmountCents": null,
"billingStatus": "active",
"currentPeriodEnd": "2026-06-01T00:00:00.000Z",
"cancelAtPeriodEnd": false,
"meteredItemId": "si_OqW2NABCxyz"
}
}
accruedAmountCents goes down by the invoiced usage when the period’s
invoice is paid, so usage recorded after the period closed but before the
invoice was paid is not lost.
Errors
| Status | When |
|---|---|
401 | Missing or invalid access token. |
403 | Token lacks read_billing. |
404 | Installation or app not found. |