Knowledge Center

Knowledge Center > API > REST API > REST API Reference > Revenue Schedules > Distribute revenue by recognition start and end dates

Distribute revenue by recognition start and end dates

This REST API reference describes how to distribute revenue by specifying the recognition start and end dates. Request and response field descriptions and sample code are provided.

Request

  • Production: PUT https://api.zuora.com/rest/v1/revenue-schedules/{rs-number}/distribute-revenue-with-date-range
  • API Sandbox: PUT https://apisandbox-api.zuora.com/rest/v1/revenue-schedules/{rs-number}/distribute-revenue-with-date-range

Request header

The Accept request header is optional. Only JSON is returned.

Request parameters

rs-number

required

path

Revenue schedule number. Specify the revenue schedule whose revenue you want to distribute.

The revenue schedule number is always prefixed with "RS", for example, "RS-00000001".

Request body

distributionType

optional

How you want to distribute the revenue. The distribution types are described in the following table.

Value Description

Daily Distribution

Distributes revenue evenly across each day between the recognitionStart and recognitionEnd dates.

Monthly Distribution (Back Load)

Back loads the revenue so you distribute the monthly amount in the partial month at the end only.

Monthly Distribution (Front Load)

Front loads the revenue so you distribute the monthly amount in the partial month at the beginning only.

Monthly Distribution (Proration by Days)

Splits the revenue amount between the two partial months.

See Components and Configuration Options for more information about Front Load, Back Load, and Proration by Days for Monthly Distribution.

The default value is Daily Distribution.

To use any of the Monthly Distribution options, you must have the "Monthly recognition over time" model enabled in Settings > Z-Finance Settings > Manage Revenue Recognition Models.

recognitionStart

required

The start date of a recognition period in YYYY-MM-DD format.

If there is a closed accounting period between the recognitionStart and recognitionEnd dates, the revenue that would be placed in the closed accounting period is instead placed in the next open accounting period.

recognitionEnd

required

The end date of a recognition period in YYYY-MM-DD format. 

The maximum difference of the recognitionStart and recognitionEnd date fields is equal to 250 multiplied by the length of an accounting period.

notes

optional

Additional information about this record.

eventType

optional

Label of the revenue event type. Revenue event type labels can be duplicated. You can configure your revenue event type labels by navigating to Settings > Z-Finance Settings > Configure Revenue Event Types in the Zuora UI. The default revenue event types are:

  • Invoice Posted
  • Invoice Item Adjustment Created
  • Invoice Canceled
  • Invoice Item Adjustment Canceled
  • Revenue Distributed

cf_txtn__c

optional

One or more optional custom fields, where n is the maximum number of custom fields allowed.

cf_pkn__c

optional

One or more optional custom fields, where n is the maximum number of custom fields allowed. 

Response

This response includes details of a revenue schedule associated with the requested revenue schedule number (rs-number).

revenueEventNumber

The revenue event number created when a revenue event occurs.

success

Returns true if the request is successful. Otherwise, returns false.

processId

The internal process ID used to assist Zuora support. Returned only if success is false.

reasons

Information describing the reason for the result. Returned only if success is false.

code

An eight-digit numeric error code.

message

A description of the error.

Example

HTTP/JSON request:

PUT https://apisandbox-api.zuora.com/rest/v1/revenue-schedules/RS-00000001/distribute-revenue-with-date-range

HTTP/JSON request:

{
   "distributionType: "Daily distribution",
   "recognitionStart": "2015-12-1",
   "recognitionEnd": "2015-12-31",
   "eventType": "Revenue Distributed",
   "eventTypeSystemId": "RevenueDistributed__z",
   "notes": "manual distribute revenue by usage",
   "cf_phases__c": "Phase 2"
 }

JSON response:

{
"revenueEventNumber": "RE-00000326",
"success": true
}
Last modified
01:15, 29 Oct 2015

Tags

Classifications

(not set)