Get Billing Usage Data

Returns billing usage data for the specified month. This data may be filtered by one of the following criteria:

Request

A request to retrieve billing usage data is described below.

HTTP Method Request URI

GET

https://api.transactcdn.com/v2/reporting/customers/AccountNumber/media/Platform/units/0/billingtraffic?begindate=BillingMonth&region=RegionID&country=CountryCode&pops=POPs

Define the following variables when submitting the above request:

VariableA variable represents a value that must be replaced. A variable consists of either a URL segment (e.g., "0001" in /0001/) or a query string value (e.g., "3" in mediaTypes=3). Description

AccountNumber

Required

Replace this variable with a customer account number. This account number may be found in the upper left-hand corner of the TCC.

Platform

Required

Replace this variable with an integer that indicates the service for which a report will be generated.

Valid values are:

  • 14: Commerce Acceleration Network (CAN)
  • 15: Commerce Acceleration Network (CAN) - (SSL Traffic Only)

BillingMonth

Required

Replace this variable with the 1st of the month for which billing information will be returned.

Syntax:

YYYY-MM-01

RegionID

Replace this variable with the ID of the billing region for which billing information will be returned.

Use the Get Billing Regions endpoint to retrieve a list of billing regions and IDs.

The region, country, and pops query string parameters are optional and mutually exclusive. A request to this endpoint may include up to one of these filters. The region query string parameter should only be defined when billing data should be restricted to the specified billing region.

CountryCode

Replace this variable with the ISO 3166 code corresponding to the country for which billing information will be returned.

A list of country codes is available from the Country Codes (ISO 3166) article in the CDN Help Center.

The region, country, and pops query string parameters are optional and mutually exclusive. A request to this endpoint may include up to one of these filters. The country query string parameter (e.g., &country=US) should only be defined when billing data should be restricted to the specified country.

POPs

Optional. Limit report data to one or more POPs by replacing this variable with a comma-delimited list of the desired POPs.

Use the Get All Edge Nodes endpoint to retrieve a list of POPs and their codes.

The region, country, and pops query string parameters are optional and mutually exclusive. A request to this endpoint may include up to one of these filters. The pops query string parameter should only be defined when billing data should be restricted to the specified POP(s).

Request Headers

This endpointIdentifies a request's connection point to our REST API service. only takes advantage of common request headers.

Request Body

Request body parameters are not required by this endpoint.

Response

The response to the above request includes an HTTP status code, response headers, and a response body.

Status Code

A status code indicates whether the request was successfully performed.

Response Headers

The response for this endpoint only includes standard HTTP response headers.

View common response headers.

Response Body

The response body for a successful request contains the following response parameters:

Name Data Type Description

AccountNumber

String

Indicates the CDN account number associated with the requested billing data.

MediaTypeId

Integer

Indicates the service associated with the requested billing data.

Valid values are:

  • 14:Commerce Acceleration Network (CAN)
  • 15:Commerce Acceleration Network (CAN) - (SSL Traffic Only)

Country

String

Indicates the code for the country for which billing data was provided. This code will always match the value defined in the request's country query string parameter.

This response parameter is only returned when the country query string parameter is defined in the request.

RegionId

Integer

Indicates the ID of the region for which billing data was provided. This ID will always match the value defined in the request's region query string parameter.

This response parameter is only returned when the region query string parameter is defined in the request.

Pops

String

Indicates the set of POPs for which billing data was provided.

Valid values are:

  • all: Indicates that the provided billing data was derived from all POPs.
  • POP Listing: If billing data is being filtered by region, country, or POP(s), then this parameter will be set to a comma-delimited list of POPs for which billing data was provided.

UsageUnits

Integer

This parameter should always return 0.

Data

Array

Object Values

Contains a data object that describes billing data.

Bandwidth

Number

Floating Point

Data array

Indicates bandwidth usage, in Mbps, for the requested billing month.

The reported usage information reflects any filters (e.g., region, country, or POPs) that may have been defined in the request.

DataTransferred

Number

Floating Point

Data array

Indicates the total amount of data transferred, in GBs, for the requested billing month.

The reported usage information reflects any filters (e.g., region, country, or POPs) that may have been defined in the request.

StartDate

String

Data array

Indicates the month for which billing information was reported.

Syntax:

YYYY-MM-01

Errors

The response body for an unsuccessful request may contain an error parameter that provides additional information.

View common error messages.

Sample Request and Response (JSON)

A sample JSON request is shown below.

GET https://api.transactcdn.com/v2/reporting/customers/0001/media/14/units/0/billingtraffic?begindate=2022-01-01 HTTP/1.1

Authorization: TOK:12345678-1234-1234-1234-1234567890ab

Accept: application/json

Content-Type: application/json

Host: api.transactcdn.com

A sample JSON response is shown below.

HTTP/1.1 200 OK

Cache-Control: private

Content-Type: application/json; charset=utf-8

Date: Thu, 15 Apr 2021 12:00:00 GMT

Content-Length: 248

[{
		"AccountNumber": "0001",
		"MediaTypeId": 14,
		"Pops": "all",
		"UsageUnits": 0,
		"Data": [{
				"Bandwidth": 1484302.2916001333,
				"DataTransferred": 191320916.11106589,
				"StartDate": "01\/1\/2022 12:00:00 AM"
			}
		]
	}
]