Newer Version Available

This content describes an older version of this product. View Latest

Product Schedules

Work with revenue and quantity schedules for opportunity products. Establish or reestablish a product schedule with multiple installments for an opportunity product. Delete all installments in a schedule.

This resource is available in REST API version 43.0 and later.

In API version 46.0 and later, established and re-established schedules support custom fields, validation rules, and Apex triggers. Deleting all schedules now also fires delete triggers.

URI
/services/data/vXX.X/sobjects/OpportunityLineItem/OpportunityLineItemId/OpportunityLineItemSchedules
Formats
JSON, XML
HTTP Method
GET, PUT, DELETE
Authentication
Authorization: Bearer token
Parameters
Parameter Description
type The type of the schedule. Required when establishing OpportunityLineItemSchedules. Valid values include Quantity, Revenue, or Both.
quantity The total number of units to be repeated or divided in a quantity schedule. Must be an integer other than 0.
quantityScheduleType The type of the quantity schedule, if the product has one. Valid values are Divide or Repeat.
quantityScheduleInstallmentPeriod If the product has a quantity schedule, the amount of time covered by the schedule. Valid values are Daily, Weekly, Monthly, Quarterly, or Yearly.
quantityScheduleInstallmentsNumber If the product has a quantity schedule, the number of installments. Can be an integer from 1 to 150.
quantityScheduleStartDate The date the quantity schedule starts. Format is YYYY-MM-DD.
revenue The amount of revenue to be repeated or divided.
revenueScheduleType The type of the revenue schedule, if the product has one. Valid values are Divide or Repeat.
revenueScheduleInstallmentPeriod If the product has a revenue schedule, the amount of time covered by the schedule. Valid values are Daily, Weekly, Monthly, Quarterly, or Yearly.
revenueScheduleInstallmentsNumber If the product has a revenue schedule, the number of installments. Can be an integer from 1 to 150.
revenueScheduleStartDate The date the revenue schedule starts. Format is YYYY-MM-DD.

Example

Establish both quantity and revenue schedules for an opportunity product; establish a revenue schedule only; establish a quantity schedule only.
1curl https://yourInstance.salesforce.com/services/data/v52.0/sobjects/OpportunityLineItem/00kR0000001WJJAIA4/OpportunityLineItemSchedules -H "Authorization: Bearer token"
JSON Request body
1{
2"type": "Both",
3"quantity": 100,
4"quantityScheduleType": "Repeat",
5"quantityScheduleInstallmentPeriod": "Monthly",
6"quantityScheduleInstallmentsNumber": 12,
7"quantityScheduleStartDate": "2018-09-15",
8"revenue": 100,
9"revenueScheduleType": "Repeat",
10"revenueScheduleInstallmentPeriod": "Monthly",
11"revenueScheduleInstallmentsNumber": 12,
12"revenueScheduleStartDate": "2018-09-15"
13}
14
15{
16"type": “Revenue”,
17"revenue": 100,
18"revenueScheduleType": “Divide”,
19"revenueScheduleInstallmentPeriod": “Quarterly”,
20"revenueScheduleInstallmentsNumber": 10,
21"revenueScheduleStartDate": "2018-09-15"
22}
23
24{
25"type": “Quantity”,
26"quantity": 10,
27"quantityScheduleType": "Repeat",
28"quantityScheduleInstallmentPeriod": “Daily”,
29"quantityScheduleInstallmentsNumber": 150,
30"quantityScheduleStartDate": "2020-09-15",
31}