getRatingPeriods()

RatingPeriodList getRatingPeriods(string usn)

This method returns information about a subscription's rating periods. Use this method to retrieve the rating period ID before you call getRatingsForPeriod().

Parameters

usn
Format: string
Purpose: Specifies the USN of the subscription for which to retrieve rating period information.

Results

This method returns a RatingPeriodList XML document that contains information about the rating periods for which the subscription has usage data.

If the subscription is not yet activated, this method returns an empty list. If the subscription is closed, the status of each rating period is Closed.

There are no messages defined by this method.

Example: A returned RatingPeriodList XML document

This example shows a returned RatingPeriodList XML document for a subscription with USN 2142420815. The <releaseDate> element specifies the date that the rating period becomes available for billing. Each <ratingPeriodId> is unique to this subscription.

The <status> element has one of the following values:
Open
The billing run for the period has not begun, and usage can be associated with the rating period.
Holding
The invoicing period has been removed from automatic billing. Smile cannot set this status, but it may occur as a result of manual intervention.
Waiting
The billing run is processing and awaiting results. From this status, a rating period moves to Approving or Closed status.
Approving
The billing run is complete and awaiting approval.
Closed
The billing run is complete and approved. Any charges have been added to the subscription's account as an invoice or a set of deferred charges.

This example shows two rating periods with Closed status, and three rating periods with Open status.

<RatingPeriodList>
  <RatingPeriodSummary>
    <USN>2142420815</USN>
    <ratingPeriodId>3045</ratingPeriodId>
    <invoicingPeriodEnd>2012-04-30+10:00</invoicingPeriodEnd>
    <ratingPeriodEnd>2012-04-30+10:00</ratingPeriodEnd>
    <releaseDate>2012-05-01+10:00</releaseDate>
    <status>Closed</status>
  </RatingPeriodSummary>
  <RatingPeriodSummary>
    <USN>2142420815</USN>
    <ratingPeriodId>3046</ratingPeriodId>
    <invoicingPeriodEnd>2012-05-31+10:00</invoicingPeriodEnd>
    <ratingPeriodEnd>2012-05-31+10:00</ratingPeriodEnd>
    <releaseDate>2012-06-01+10:00</releaseDate>
    <status>Closed</status>
  </RatingPeriodSummary>
  <RatingPeriodSummary>
    <USN>2142420815</USN>
    <ratingPeriodId>3047</ratingPeriodId>
    <invoicingPeriodEnd>2012-06-30+10:00</invoicingPeriodEnd>
    <ratingPeriodEnd>2012-06-30+10:00</ratingPeriodEnd>
    <releaseDate>2012-07-01+10:00</releaseDate>
    <status>Open</status>
  </RatingPeriodSummary>
  <RatingPeriodSummary>
    <USN>2142420815</USN>
    <ratingPeriodId>3048</ratingPeriodId>
    <invoicingPeriodEnd>2012-07-31+10:00</invoicingPeriodEnd>
    <ratingPeriodEnd>2012-07-31+10:00</ratingPeriodEnd>
    <releaseDate>2012-08-01+10:00</releaseDate>
    <status>Open</status>
  </RatingPeriodSummary>
  <RatingPeriodSummary>
    <USN>2142420815</USN>
    <ratingPeriodId>3049</ratingPeriodId>
    <invoicingPeriodEnd>2012-08-31+10:00</invoicingPeriodEnd>
    <ratingPeriodEnd>2012-08-31+10:00</ratingPeriodEnd>
    <releaseDate>2012-09-01+10:00</releaseDate>
    <status>Open</status>
  </RatingPeriodSummary>
</RatingPeriodList>

Faults

NoSuchItemException

This fault is returned when the specified USN is not a subscription.

Java client syntax

java -cp build/smilewsv2-client.jar [options] com.inomial.smile.client.v2.examples.GetRatingPeriods usn
usn
Purpose: Specifies the USN to retrieve rating periods for.
Note: For more information about the Java client and the options it accepts, see Java client syntax.