Skip to content

Charge Metrics

Charge Metrics provides a service to access key metrics for rate plan charges in Zuora, for example, Gross MRR, Net MRR, Gross TCV, and Net TCV.

List charge metrics by time range

Request

Retrieves key charge metrics about rate plan charges that have changes in a specified time range.

The purpose of fromTimestamp and toTimestamp is to synchronize charge metrics data incrementally.

Query
fromTimestampstring, (date-time)required

The starting date and time of a time range when changes are made to charge metrics, in yyyy-mm-ddThh:mm:ssZ format. For example, 2020-08-18T09:01:11Z. The timestamp maps to the UpdatedOn timestamp of the to-be-exported object.

toTimestampstring, (date-time)required

The end date and time of a time range when changes are made to charge metrics, in yyyy-mm-ddThh:mm:ssZ format. For example, 2020-08-20T09:01:11Z. The timestamp maps to the UpdatedOn timestamp of the to-be-exported object.

Headers
Accept-Encodingstring

Include the Accept-Encoding: gzip header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.

If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a Content-Encoding header with the compression algorithm so that your client can decompress it.

Content-Encodingstring

Include the Content-Encoding: gzip header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload.

Authorizationstringrequired

The value is in the Bearer {token} format where {token} is a valid OAuth token generated by calling Create an OAuth token.

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 (').

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.

Acceptstring

Expressed as MIME types that the client is able to understand. Using content negotiation, the server then selects one of the proposals, uses it and informs the client of its choice with the Content-Type response header. The possible response MIME types are application/json-seq compatible with http://jsonlines.org/, and text/csv compatible with RFC 4180. application/json-seq is the default response MIME type. If the Accept header is not sepecified, or set /, the response body is returned in application/json-seq MIME type.

cURL
curl -i -X GET \
  'https://rest.zuora.com/charge-metrics/data/charge-metrics?fromTimestamp=2019-08-24T14%3A15%3A22Z&toTimestamp=2019-08-24T14%3A15%3A22Z' \
  -H 'Accept: string' \
  -H 'Accept-Encoding: string' \
  -H 'Authorization: string' \
  -H 'Content-Encoding: string' \
  -H 'Zuora-Entity-Ids: string' \
  -H 'Zuora-Track-Id: string'

Responses

Headers
Content-Encodingstring

This header is returned if you specify the Accept-Encoding: gzip request header and the response contains over 1000 bytes of data.

Note that only the following MIME types support gzipped responses:

  • application/json
  • application/xml
  • text/html
  • text/csv
  • text/plain
RateLimit-Limitstring

The request limit quota for the time window closest to exhaustion. See rate limits for more information.

RateLimit-Remainingnumber

The number of requests remaining in the time window closest to quota exhaustion. See rate limits for more information.

RateLimit-Resetnumber

The number of seconds until the quota resets for the time window closest to quota exhaustion. See rate limits for more information.

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
amendmentIdstring

The ID of the corresponding amendment that results in the charge metrics record.

amendmentTypestring

The type of the corresponding amendment that results in the charge metrics record.

chargeNumberstring

The corresponding charge number of the charge metrics record.

createdOnstring, (date-time)

The date and time when the charge metrics record was created, in yyyy-mm-ddThh:mm:ssZ format.

currencystring

The currency of the charge metrics record.

deletedboolean

Whether the charge metrics record is deleted.

endDatestring, (date)

The end date of the charge metrics record.

idstring

The ID of the charge metrics record.

invoiceOwnerAccountNumberstring

The account number of the corresponding invoice owner.

mrrDiscountAmountnumber

The discount amount for the MRR.

See Monthly Recurring Revenue for more MRR information.

mrrGrossAmountnumber

The Gross MRR amount before discounts charges are applied.

See Monthly Recurring Revenue for more MRR information.

mrrNetAmountnumber

The NET MRR amount after discounts charges are applied.

See Monthly Recurring Revenue for more MRR information.

productIdstring

The corresponding product ID of the charge metrics record.

productRatePlanChargeIdstring

The corresponding product rate plan charge ID of the charge metrics record.

productRatePlanIdstring

The corresponding product rate plan ID of the charge metrics record.

ratePlanChargeIdstring

The corresponding rate plan charge ID of the charge metrics record.

startDatestring, (date)

The start date of the charge metrics record.

subscriptionNamestring

The name of the corresponding subscription.

subscriptionOwnerAccountNumberstring

The account number of the corresponding subscription owner.

tcvDiscountAmountnumber

The discount amount for the TCV.

tcvGrossAmountnumber

The Gross TCV amount before discount charges are applied.

tcvNetAmountnumber

The Net TCV amount after discount charges are applied.

updatedOnstring, (date-time)

The date and time when the charge metrics record was last updated, in yyyy-mm-ddThh:mm:ssZ format.

Response
{ "amendmentId": "string", "amendmentType": "string", "chargeNumber": "string", "createdOn": "2019-08-24T14:15:22Z", "currency": "string", "deleted": true, "endDate": "2019-08-24", "id": "string", "invoiceOwnerAccountNumber": "string", "mrrDiscountAmount": 0, "mrrGrossAmount": 0, "mrrNetAmount": 0, "productId": "string", "productRatePlanChargeId": "string", "productRatePlanId": "string", "ratePlanChargeId": "string", "startDate": "2019-08-24", "subscriptionName": "string", "subscriptionOwnerAccountNumber": "string", "tcvDiscountAmount": 0, "tcvGrossAmount": 0, "tcvNetAmount": 0, "updatedOn": "2019-08-24T14:15:22Z" }