Knowledge Center

Knowledge Center > API > REST API > REST API Reference > Revenue Schedules > Create a revenue schedule for an Invoice Item Adjustment (manual distribution)

Create a revenue schedule for an Invoice Item Adjustment (manual distribution)

This REST API reference describes how to create a revenue schedule for an Invoice Item Adjustment and manually distribute the revenue.

Request

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

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

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.

The sum of newAmounts must equal the the Amount of the specified Invoice Item Adjustment.

accountingPeriodName

required

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

Specify an accounting period that you want to distribute revenue into.

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."

revenueEvent

Represents a change to a revenue schedule, such as posting an invoice or distributing revenue.

You must specify the eventType or the eventTypeSystemID, or both. If you have configured more than one revenue event type with the same label, you must specify the eventTypeSystemId.

eventType

conditional

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

eventTypeSystemId

conditional

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.

Required only if there is more than one revenue event type with the same label.

notes

optional

Additional information about this record.

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. 

notes

optional

Additional information about this record.

Character Limit: 2,000

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-items/e20b07fd416dcfcf0141c81164fd0a72

{
    “revenueDistributions”:[
             {“accountingPeriodName”:”Jan '16”,
               “newAmount”:”20”},
             {“accountingPeriodName”:”Open-Ended”,
                “newAmount”: “30”}
        ]
    “revenueEvent”:  {
        “eventType”:”Revenue Distributed”,
        “eventTypeSystemId”:”RevenueDistributed__z”,
         “notes”:”My notes”
        }
}

JSON Response:

{     
   "revenueScheduleNumber":"rs-00000002",
   "success":true
}
Last modified
20:12, 3 Nov 2015

Tags

Classifications

(not set)