Skip to content

Get rating results by charge

Request

Note: This operation is available only if Active Rating is enabled. The Active Rating feature is in development. If you wish to have access to the feature, submit a request at Zuora Global Support.

Retrieves the rating result of all the usage charges associated with the specified rate plan charge. The rating is based on billing period.

You can specify the date range for which you want to rate in the fromDate and toDate query parameters. For example: /rated-results/charge/chargenNumber?fromDate=2016-08-01&toDate=2016-08-21

Path
chargeNumberstringrequired

The charge number. For example, C-00000001.

Query
fromDatestring, (date)

The start date of the date range for which you want to rate. The date must be in yyyy-mm-dd format. For example, 2007-12-03.

You can specify this parameter to restrict the data returned in the response. Make sure you specify a valid date in this query parameter:

  • If you only specify the fromDate query parameter but do not specify the toDate query parameter:

    endDate > fromDate

  • If you specify both the fromDate and toDate query parameters:

    startDate <= toDate and endDate > fromDate

startDate is the start date of the rating result. endDate is the end date of the rating result.

toDatestring, (date)

The end date of the date range for which you want to rate. The date must be in yyyy-mm-dd format. For example, 2007-12-03.

Make sure you specify a valid date in this query parameters:

  • If you only specify the toDate query parameter but do not specify the fromDate query parameter:

    startDate <= toDate

  • If you specify both the fromDate and toDate query parameters:

    startDate <= toDate and endDate > fromDate

startDate is the start date of the rating result. endDate is the end date of the rating result.

cursorstring

The cursor indicator of the data page you want to retrieve. By default, the first page of data is returned in the response. If more data pages are available, the operation returns true in the hasMore response body field. The cursor response body field specifies the cursor indicator of the next page of data. If there is no data after the current page, the value of cursor is null.

pageSizeinteger, (int32), [ 25 .. 2000 ]

The maximum number of rows in a page to return in a response.

Default:100
Headers
Authorizationstringrequired

Bearer {token} for a valid OAuth token.

Zuora-Entity-Idsstring

An entity ID. If you have Zuora Multi-entity enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header.

Zuora-Track-Idstring, <= 64 characters

A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.

The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (:), semicolon (;), double quote ("), and quote (').

cURL
curl -i -X GET \
  'https://rest.zuora.com/rating/rated-results/charge/{chargeNumber}?fromDate=2019-08-24&toDate=2019-08-24&cursor=string&pageSize=100' \
  -H 'Authorization: string' \
  -H 'Zuora-Entity-Ids: string' \
  -H 'Zuora-Track-Id: string'

Responses

OK

Headers
Zuora-Request-Idstring, = 36 characters

The Zuora internal identifier of the API call. You cannot control the value of this header.

Zuora-Track-Idstring, <= 64 characters

A custom identifier for tracing the API call. If you specified a tracing identifier in the request headers, Zuora returns the same tracing identifier. Otherwise, Zuora does not set this header.

Body
dataSetArray of objects(dataSet)
cursorstring

The cursor indicator of the next page of data.

You can pass in the value of the cursor field as the cursor parameter for a subsequent call to get the next page of data. If there is no data after the current page, the cursor returns null.

countinteger

The number of data sets in the returned page of the response.

hasMoreboolean

Whether the query results have more data after the current page.

Response
{ "dataSet": [ { … } ], "cursor": "string", "count": 0, "hasMore": true }