Lewati ke konten

Pricing analytics (account)

GET
/v1/pricing_analytics
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.

start
required
integer format: int64
>= 1

Unix timestamp (seconds) for the start of the window. Daily/monthly buckets are aligned in timezone (default Asia/Jakarta / WIB).

Example
1749193200
end
required
integer format: int64
>= 1

Unix timestamp (seconds), exclusive bound; must be greater than start.

Example
1749279600
granularity
required
string

HOURLY (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
DAILY
timezone
string

IANA 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/Jakarta
dimensions
string

Breakdowns. Repeat (dimensions=PHONE&dimensions=COUNTRY) or comma-separate. Allowed: PHONE, COUNTRY, PRICING_TYPE, PRICING_CATEGORY. Empty -> totals only (Meta behavior).

Example
PRICING_TYPE,PRICING_CATEGORY
phone_numbers
string

Filter on Meta phone number IDs (comma-separated).

Example
123456789012345
country_codes
string

Filter on ISO alpha-2 country codes (comma-separated, e.g. ID, US).

Example
ID
pricing_types
string

Filter on the public pricing type. Optional; only ‘REGULAR’ has data. Other values yield empty data_points.

Example
REGULAR
pricing_categories
string

Filter on pricing categories (e.g. UTILITY, MARKETING, AUTHENTICATION, SERVICE).

Example
UTILITY
metric_types
string

Metric types to return. v1 accepts VOLUME only. COST and TIER return 400.

Example
VOLUME

Pricing analytics data points

Media type application/json
object
pricing_analytics
required
object
data
required
Array<object>
object
data_points
required
Array<object>
object
country
string | null
end
required

Bucket end (unix seconds). DAILY = next local midnight.

integer format: int64
phone_number
string | null
pricing_category
string | null
pricing_type

Always ‘REGULAR’ (billed volume only).

string | null
start
required

Bucket start (unix seconds) in the requested timezone.

integer format: int64
volume
required

Delivered billed message volume in this bucket.

integer format: int64
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)

Media type application/json

Standard error response format.

object
error
required
object
code
required
integer format: int32
message
required
string
type
required
string
Example generated
{
"error": {
"code": 1,
"message": "example",
"type": "example"
}
}

Unauthorized - Invalid API Key

Media type application/json

Standard error response format.

object
error
required
object
code
required
integer format: int32
message
required
string
type
required
string
Example generated
{
"error": {
"code": 1,
"message": "example",
"type": "example"
}
}

Forbidden - a phone_numbers filter id is not owned by this API key

Media type application/json

Standard error response format.

object
error
required
object
code
required
integer format: int32
message
required
string
type
required
string
Example generated
{
"error": {
"code": 1,
"message": "example",
"type": "example"
}
}

Internal server error

Media type application/json

Standard error response format.

object
error
required
object
code
required
integer format: int32
message
required
string
type
required
string
Example generated
{
"error": {
"code": 1,
"message": "example",
"type": "example"
}
}