Charge Segment for new ramp quote product removal
This article explains how the Charge Segments are generated for a ramp Quote for a New Product removed in Interval 2 for recurring and usage-type products.
Add new recurring, usage charge, and future remove design
For ramped Quotes, if a newly added charge is removed, then the Removed Segment spans to the end of the interval in which it was removed and there are no subsequent Charge Segments in later intervals for that removed segment.
In the following ramp quote, the recurring and usage charges are added and removed in Interval 2.



The following is the list of Charge Segments created for the above quote:

The NewProduct Charge Segments are populated from the Charge Period Metrics response body. The are periods automatically returned in alignment with the ramp Interval ranges per charge:
"chargeMetrics" : [ {
"subscriptionNumber" : "Simple Ramp Quote",
"charges" : [ {
"chargeNumber" : "a0sOt000004jZYoIAM",
"periods" : [ {
"startDate" : "2025-01-01",
"endDate" : "2025-12-31",
"grossMrr" : 10.00,
"netMrr" : 10.00,
"grossTcb" : 120.00,
"netTcb" : 120.00,
"quantity" : 1.00,
"deltaGrossMrr" : 10.00,
"deltaNetMrr" : 10.00,
"deltaGrossTcb" : 120.00,
"deltaNetTcb" : 120.00,
"deltaQuantity" : 1.00,
"segment" : 1
}, {
"startDate" : "2026-01-01",
"endDate" : "2026-06-30",
"grossMrr" : 10.00,
"netMrr" : 10.00,
"grossTcb" : 60.00,
"netTcb" : 60.00,
"quantity" : 1.00,
"deltaGrossMrr" : 10.00,
"deltaNetMrr" : 10.00,
"deltaGrossTcb" : 60.00,
"deltaNetTcb" : 60.00,
"deltaQuantity" : 1.00,
"segment" : 1
} ]
} ]
} ]
Next, the Order Metrics response body is read to find Order Action metrics of type "RemoveProduct" and Removal Charge Segment records are made for each.
Below is an excerpt of the Order Metrics response from the sample Quote. Notice that the AddProduct and RemoveProduct Order Metrics are empty, which are the Usage charge metrics.
"orderMetrics" : [ {
"orderActions" : [ {
"sequence" : 0,
"type" : "CreateSubscription",
"orderMetrics" : [ ]
}, {
"sequence" : 1,
"type" : "AddProduct",
"orderMetrics" : [ ]
}, {
"sequence" : 2,
"type" : "AddProduct",
"orderMetrics" : [ {
"quantity" : [ {
"amount" : 1.000000000,
"endDate" : "2027-12-31",
"termNumber" : 1,
"startDate" : "2025-01-01"
} ],
"chargeNumber" : "a0sOt000004jZYoIAM"
} ]
}, {
"sequence" : 3,
"type" : "RemoveProduct",
"orderMetrics" : [ ]
}, {
"sequence" : 4,
"type" : "RemoveProduct",
"orderMetrics" : [ {
"quantity" : [ {
"amount" : -1.000000000,
"endDate" : "2027-12-31",
"termNumber" : 1,
"startDate" : "2026-07-01"
} ],
"chargeNumber" : "a0sOt000004jZYoIAM"
} ]
} ]
The RemoveProduct Order Metric with values is used to make the recurring removed Charge Segment, seen below.

The QCS of the ramped quote is queried and used to generate the removed Usage Charge Segment, similarly to how it's described in this section. The removed Usage Charge Segment of this quote can be seen below:

