Pricing analytics (account)
const url = 'https://example.com/v1/pricing_analytics?start=1749193200&end=1749279600&granularity=DAILY&timezone=Asia%2FJakarta&dimensions=PRICING_TYPE%2CPRICING_CATEGORY&phone_numbers=123456789012345&country_codes=ID&pricing_types=REGULAR&pricing_categories=UTILITY&metric_types=VOLUME';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/v1/pricing_analytics?start=1749193200&end=1749279600&granularity=DAILY&timezone=Asia%2FJakarta&dimensions=PRICING_TYPE%2CPRICING_CATEGORY&phone_numbers=123456789012345&country_codes=ID&pricing_types=REGULAR&pricing_categories=UTILITY&metric_types=VOLUME' \ --header 'Authorization: Bearer <token>'Mahadata pricing analytics for WhatsApp Cloud deliveries, shaped like Meta Graph GET /{waba-id}/pricing_analytics.
Reports billed message volume from our ledger (financial_report_hourly). All reported volume has pricing_type = REGULAR. Does not proxy Graph, and does not report Meta free tiers or unbilled traffic. Does not return COST or TIER. Default timezone Asia/Jakarta (WIB). Date-range caps: 7d (HOURLY), 90d (DAILY), 12mo (MONTHLY). Note: HALF_HOUR granularity is unsupported and returns 400.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters ”Unix timestamp (seconds) for the start of the window.
Daily/monthly buckets are aligned in timezone (default Asia/Jakarta / WIB).
Example
1749193200Unix timestamp (seconds), exclusive bound; must be greater than start.
Example
1749279600HOURLY (min) | DAILY | MONTHLY (case-insensitive). Note: HALF_HOUR returns 400 as financial_report_hourly is aggregated hourly. Caps: HOURLY <= 7 days; DAILY <= 90 days; MONTHLY <= 12 months.
Example
DAILYIANA timezone used to fold hourly UTC rows into calendar buckets. Default Asia/Jakarta (WIB). Do not pass UTC if you want WIB days.
Example
Asia/JakartaBreakdowns. Repeat (dimensions=PHONE&dimensions=COUNTRY) or comma-separate.
Allowed: PHONE, COUNTRY, PRICING_TYPE, PRICING_CATEGORY.
Empty -> totals only (Meta behavior).
Example
PRICING_TYPE,PRICING_CATEGORYFilter on Meta phone number IDs (comma-separated).
Example
123456789012345Filter on ISO alpha-2 country codes (comma-separated, e.g. ID, US).
Example
IDFilter on the public pricing type. Optional; only ‘REGULAR’ has data. Other values yield empty data_points.
Example
REGULARFilter on pricing categories (e.g. UTILITY, MARKETING, AUTHENTICATION, SERVICE).
Example
UTILITYMetric types to return. v1 accepts VOLUME only. COST and TIER return 400.
Example
VOLUMEResponses
Section titled “ Responses ”Pricing analytics data points
object
object
object
object
Bucket end (unix seconds). DAILY = next local midnight.
Always ‘REGULAR’ (billed volume only).
Bucket start (unix seconds) in the requested timezone.
Delivered billed message volume in this bucket.
Example
{ "pricing_analytics": { "data": [ { "data_points": [ { "start": 1749193200, "end": 1749279600, "country": "ID", "phone_number": "123456789012345", "pricing_type": "REGULAR", "pricing_category": "UTILITY", "volume": 40 } ] } ] }}Invalid query (range, granularity, caps, unknown metric_types/dimensions)
Standard error response format.
object
object
Example generated
{ "error": { "code": 1, "message": "example", "type": "example" }}Unauthorized - Invalid API Key
Standard error response format.
object
object
Example generated
{ "error": { "code": 1, "message": "example", "type": "example" }}Forbidden - a phone_numbers filter id is not owned by this API key
Standard error response format.
object
object
Example generated
{ "error": { "code": 1, "message": "example", "type": "example" }}Internal server error
Standard error response format.
object
object
Example generated
{ "error": { "code": 1, "message": "example", "type": "example" }}