Skip to main content

Order Delta Quantity

Zuora

Order Delta Quantity

Introduces the concept and calculation of the Order Delta Quantity metric, and how to access the Order Delta Quantity object and fields through Data Query.

This article lists examples of calculating Order Delta Quantity metrics for different order actions. 

Renewal

In the following example, the order delta quantity for charge segment PRC-2 between 2025-01-01 and 2026-01-01 for the Renewal order action is 20.

order delta quantity-renew subscription.png

Add Product

In the following example, the order delta quantity for charge segment PRC 2-1 between 2025-07-01 and 2026-01-01 for the Add Product order action is 15.

order delta quantity-add product.png

Remove Product

In the following example, the order delta quantity for charge segment PRC-2 between 2025-07-01 and 2026-01-01 for the Remove Product order action is -20.

order delta quantity-remove product.png

Update Product

In the following example, for the Update Product order action, the order delta quantity for charge segment PRC-2 between 2025–07-01 and 2026-01-01 is -20 due to the shrinking of the rate plan, and the order delta quantity for charge segment PRC-3 between 2025–07-01 and 2026-01-01 is 15 due to the updated quantity. 

order delta quantity-decrease quantity.png

Object and Fields 

The Order Delta Quantity object can be accessed through Data Query with the following fields.

Field Name

Description

Id

The internal ID of the order delta metrics.

OrderNumber

The Order number for the associated Order.

StartDate

The Start Date of the metric. This is also the start date of the period where there is an impact on the metrics caused by the order.

EndDate

The End Date of the metric. This is also the end date of the period where there is an impact on the metrics caused by the order. The End Date is exclusive.

Quantity

The delta quantity for each charge segment for each order action.

ChargeNumber

The charge number of rate plan charge object that the metrics is associated with.

RatePlanChargeId

The id of the rate plan charge object that the metrics is associated with.

ProductRatePlanChargeId

The id of the product plan charge object of the rate plan charge object.

OrderActionId

The Id of the associated Order Action that creates the metric

OrderLineItemId

The ID of the order line item.

CreatedDate

The date time when the metric is created.

UpdatedDate

The date time when the metric is last updated.

deleted

Indicates whether the metric is deleted.

Data Query Use Case

Example

You create an Order O-000001 containing the following order action:

Update a rate plan with a recurring charge quantity from 20 to 30 from 2025-07-01. The charge starts on 1/1/2025 and ends on 1/1/2026 

In this example, Zuora creates two order delta metrics for the same charge.

You can get a summary for the Order Delta Quantity metrics for the order action above to see the quantity changes for one charge. See the following data query for details:

SELECT qty.ChargeNumber, oa.Type, qty.RatePlanChargeId, qty.StartDate, qty.EndDate, qty.Quantity
FROM OrderDeltaQuantity qty
INNER JOIN OrderAction oa ON oa.id = qty.OrderActionId 
WHERE qty.orderNumber ='O-000001'

The result is as in the following table:

ChargeNumber Type RatePlanChargeId StartDate EndDate Quantity
C-00002406 UpdateProduct 0461789589394a289684a5cfbccb00dd 2025-07-01 2026-01-01 -20.000000000
C-00002406 UpdateProduct 0461789589394a289684a5cfbccb00de 2025-07-01 2026-01-01 30.000000000

You can also get a summary for the Order Delta Quantity metrics at the charge number level using the following data query:

SELECT ChargeNumber, SUM(Quantity) 
FROM OrderDeltaQuantity
WHERE orderNumber = 'O-000001' AND StartDate <= date '2025-07-01' AND EndDate > date '2025-07-01'
GROUP BY ChargeNumber

The result is as in the following table:

ChargeNumber Quantity
C-00002406 10.000000000