AWS Billing

2026/09/23 - AWS Billing - 1 new api methods

Changes  Added the ListBillingViewSegments API, which returns billing view segment information for a specified billing view ARN and time range. This API enables customers and integrated tools to programmatically determine the billing context of their accounts.

ListBillingViewSegments (new) Link ΒΆ

Lists the segments of a billing view over a given time period. Each segment identifies the billing domain ( PRO_FORMA or BILLABLE) and the account relationships that apply during its time range.

If you don't provide an arn, the response includes segments for the caller's PRIMARY billing view.

If a mid-period change occurs, the response includes multiple segments, each with its own time range. The response omits hidden segments, so the segments it returns might not cover the entire requested time period.

See also: AWS API Documentation

Request Syntax

client.list_billing_view_segments(
    timeRange={
        'beginDateInclusive': datetime(2015, 1, 1),
        'endDateExclusive': datetime(2015, 1, 1)
    },
    arn='string',
    maxResults=123,
    nextToken='string'
)
type timeRange:

dict

param timeRange:

The billing period to query. If you don't provide a time range, the current billing period, which is the calendar month in UTC, is used.

  • beginDateInclusive (datetime) --

    The inclusive start of the time range. This value can't be in the future.

  • endDateExclusive (datetime) --

    The exclusive end of the time range. This value must be after beginDateInclusive.

type arn:

string

param arn:

The Amazon Resource Name (ARN) that uniquely identifies the billing view to query. If you don't provide an ARN, the caller's PRIMARY billing view is used. The ARN must reference a primary billing view. Custom billing views aren't supported.

type maxResults:

integer

param maxResults:

The number of entries a paginated response contains. Valid values range from 1 to 100. The default is 100.

type nextToken:

string

param nextToken:

The pagination token that is used on subsequent calls to list billing view segments.

rtype:

dict

returns:

Response Syntax

{
    'items': [
        {
            'domain': 'BILLABLE'|'PRO_FORMA',
            'timeRange': {
                'beginDateInclusive': datetime(2015, 1, 1),
                'endDateExclusive': datetime(2015, 1, 1)
            },
            'billingTransferAccountId': 'string',
            'managementAccountId': 'string',
            'billingGroupPrimaryAccountId': 'string'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • items (list) --

      A list of billing view segments. Each segment covers a portion of the requested time period. The response omits hidden segments, so the segments it returns might not cover the entire requested time period.

      • (dict) --

        A billing view segment. A segment represents a time range during which the billing domain and account relationships for a billing view remained unchanged.

        • domain (string) --

          The billing domain for this segment. The following values are valid:

          • PRO_FORMA - Data shaped by Billing Conductor that doesn't reflect the final charges owed to Amazon Web Services.

          • BILLABLE - Data that represents the final charges owed to Amazon Web Services.

        • timeRange (dict) --

          The time range during which this segment is effective.

          • beginDateInclusive (datetime) --

            The inclusive start of the time range. This value can't be in the future.

          • endDateExclusive (datetime) --

            The exclusive end of the time range. This value must be after beginDateInclusive.

        • billingTransferAccountId (string) --

          The billing transfer account ID. The response includes this field only when the caller is a billing transfer source account. The response omits this field for billing group billing views.

        • managementAccountId (string) --

          The management account ID of the organization. The response includes this field for organization member accounts.

        • billingGroupPrimaryAccountId (string) --

          The billing group primary account ID. The response includes this field for billing group members. Compare this value to your own account ID to determine whether you are the primary account.

    • nextToken (string) --

      The pagination token that is used on subsequent calls to list billing view segments.