Example: Generate a Lifecycle-Managed Asset
Example: Change a Lifecycle-Managed Asset
Example: Cancel a Lifecycle-Managed Asset
Recommendations
Salesforce Files
Retired Resources
PDF Archive
Review an example of using Connect REST API to cancel an asset to reflect an early cancellation.
A lifecycle-managed asset must have at least one asset state period at least 24 hours long.
Note
On 12/01, your customer wants to cancel all 25 of their licenses for the rest of the year. The cancel order results in the following order product.
ID: 1250
Date of Cancellation: 12/01/20 9:00:00am PST
Start Date: 12/01/20 9:00:00am PST
End Date: 12/31/20 8:59:59am PST
Amount: –$250
Quantity: –25
To represent the cancellation, create an asset state period running from 10/01 through 11/30, but use the same quantity, monthly recurring revenue, and amount as the period that originally ended on 12/31. Because the latest period now runs through 11/30, Customer Asset Lifecycle Management removes all 25 licenses in December from the asset’s total amount. The asset’s Amount field reflects the –$250 in canceled licenses.
/services/data/v50.0/asset-management/assets/02iB00000007bZ6IAI/actions/cancel
1{
2 "assetStatePeriod": {
3 "startDate": "2020-10-01T09:00:00+08:00",
4 "endDate": "2020-11-30T08:59:59+08:00",
5 "quantity": 25.0,
6 "mrr": 250.0,
7 "amount": 500.0
8 },
9
10 "assetAction": {
11 "category": "Cancellations",
12 "actionDate": "2020-12-01T09:00:00+08:00",
13 "quantityChange": 5.0,
14 "mrrChange": 50.0,
15 "amount": 150.0
16 },
17
18 "assetActionSources": [
19 {
20 "transactionDate": "2020-10-01T09:00:00+08:00",
21 "startDate": "2020-10-01T09:00:00+08:00",
22 "endDate": "2020-12-31T08:59:59+08:00",
23 "quantity": -25.0,
24 "productAmount": -250.0,
25 "referenceEntityItem": "1WLB00000003geJOAQ"
26 }
27 ]
28}