Review an example of using Connect REST API to cancel an asset to reflect an early cancellation.
note: A lifecycle-managed asset must have at least one asset state period at least 24 hours long.
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.
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.
Endpoint
/services/data/v50.0/asset-management/assets/02iB00000007bZ6IAI/actions/cancel
Input
{
"assetStatePeriod": {
"startDate": "2020-10-01T09:00:00+08:00",
"endDate": "2020-11-30T08:59:59+08:00",
"quantity": 25.0,
"mrr": 250.0,
"amount": 500.0
},
"assetAction": {
"category": "Cancellations",
"actionDate": "2020-12-01T09:00:00+08:00",
"quantityChange": 5.0,
"mrrChange": 50.0,
"amount": 150.0
},
"assetActionSources": [
{
"transactionDate": "2020-10-01T09:00:00+08:00",
"startDate": "2020-10-01T09:00:00+08:00",
"endDate": "2020-12-31T08:59:59+08:00",
"quantity": -25.0,
"productAmount": -250.0,
"referenceEntityItem": "1WLB00000003geJOAQ"
}
]
}
Output

See Also
- Cancel Asset