Knowledge Center

Knowledge Center > API > REST API > REST API Reference > Revenue Schedules > Create a revenue schedule for an Invoice Item Adjustment (distribute by date range)

Create a revenue schedule for an Invoice Item Adjustment (distribute by date range)

This REST API reference describes how to create a revenue schedule for an Invoice Item Adjustment and distribute the revenue by specifying the recognition start and end dates.

Request

  • Production: POST https://api.zuora.com/rest/v1/revenue-schedules/invoice-item-adjustments/{invoice-item-adj-key}/distribute-revenue-with-date-range
  • API Sandbox: POST https://apisandbox-api.zuora.com/rest/v1/revenue-schedules/invoice-item-adjustments/{invoice-item-adj-key}/distribute-revenue-with-date-range

Request header

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

Request path parameters

invoice-item-adj-key

required

ID or number of the Invoice Item Adjustment, for example, e20b07fd416dcfcf0141c81164fd0a72.

If the specified Invoice Item Adjustment is already associated with a revenue schedule, the call will fail.

Request body parameters

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

The response includes details of the newly-created revenue schedule.

revenueScheduleNumber

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

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:

POST https://apisandbox-api.zuora.com/rest/v1/revenue-schedules/invoice-item-adjustments/e20b07fd416dcfcf0141c81164fd0a72/distribute-revenue-with-date-range

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

JSON Response:

{
    "revenueScheduleNumber": "RS-00000003",
    "success": true
}
Last modified

Tags

Classifications

(not set)