Knowledge Center

Knowledge Center > API > REST API > REST API Reference > Revenue Schedules > Distribute revenue across accounting periods

Distribute revenue across accounting periods

This REST API reference describes how to distribute revenue by specifying the revenue schedule number. 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-across-accounting-periods
  • API Sandbox: PUT https://apisandbox-api.zuora.com/rest/v1/revenue-schedules/{rs-number}/distribute-revenue-across-accounting-periods

Request header

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

Request parameters

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

Request body

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

You can create revenue event types can be created from Z-Finance Settings > Revenue Event Types.

eventTypeSystemId

optional

System ID of the revenue event type. Each eventType has a unique system ID. You can configure your revenue event type system IDs by navigating to Settings > Z-Finance Settings > Configure Revenue Event Types in the Zuora UI.

Cannot be duplicated.

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. 

revenueDistributions

An array of revenue distributions. Represents how you want to distribute revenue for this revenue schedule. You can distribute revenue into a maximum of 250 accounting periods with one revenue schedule.

accountingPeriodName

required

Name of the accounting period. The open-ended accounting period is named Open-Ended

The accounting period must be open.

newAmount

required

Amount of revenue you want to distribute into the accounting period.

The value must be formatted based on the currency, for example, JPY 30 or USD 30.15. If the value is formatted incorrectly, the following error message is returned:

"Allocation amount with wrong decimal places."

Response

If the revenue is successfully distributed, the response is the revenue event number.

revenueEventNumber

The revenue event number created when a revenue event occurs.

success

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

If the revenue distribution value in the request is the same as the previous distribution value, you will get a "No change is made to the Revenue Schedule" response message. 

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://api.zuora.com/rest/v1/revenue-schedules/RS-00000001/distribute-revenue-across-accounting-periods

JSON response:

HTTP/JSON request:


{
   "eventType": "Revenue Distributed",
   "eventTypeSystemId": "RevenueDistributed__z",
   "cf_project__c": "project A",
   "cf_phases__c": "Phase 1",
   "notes": "Manually distribute revenue for Phase 1",
   "revenueDistributions": [
      {
         "accountingPeriodName": "Jan'2013",
         "newAmount": "500"
         },
      {
         "accountingPeriodName": "Feb'2013",
         "newAmount": "600"
         }
      ]
   } 

JSON response:

{
   "revenueEventNumber": "RE-00000326",
   "success": true
 }   
   
Last modified
07:40, 9 Oct 2015

Tags

Classifications

(not set)