Configure dynamic price using the add product order action
This topic guides you through adding a product to a subscription by configuring dynamic pricing and setting pricing attributes.
To add a product to the subscription:
- Determine the values of the following variables and configure the dynamic pricing enabled charge in the product catalog accordingly:
Variable
Description
$AccountNumThe number of the account that will own the order. For example,
A00000001.$ProductRPIdThe ID of the product rate plan to add to the subscription. For example,
edcad42fa5697665a4d767394f590000..$ProductRPChargeIdThe ID of the product rate plan charge to use when adding the product rate plan. For example,
41137e9965e2445fbb57dae2daab7580..$subscriptionNumberThe number of the subscription that will own the rate plans. For example,
A-S0000001.$TodayToday's date. For example,
2025-06-20. - Refer to the example payload to create a new order. In this example, you can set the value of pricing attributes:
Site_SizeandEffectiveDatedirectly inpricingAttributes. For the pricing attributeSubscription_RatePlan_Classthat is mapped to the custom fieldRateClass__c, its value is set in customFields and automatically used by Zuora during list price lookup.Note:Assuming the subscription's renewal term length = 12 months.
Request
POST /v1/orders/Request Body
{ "orderDate": "$Today", "existingAccountNumber": "$AccountNum", "subscriptions": [ { "subscriptionNumber": "$subscriptionNumber", "orderActions": [ { "addProduct": { "productRatePlanId": "$productRatePlanId", "customFields": { "Channel__c": "Reseller", "RateClass__c": "Low" }, "chargeOverrides": [ { "productRatePlanChargeId": "$productRatePlanChargeId", "pricingAttributes": { "EffectiveDate": "2025-06-20", "Site_Size": 7 } } ] }, "triggerDates": [ { "name": "ContractEffective", "triggerDate": "$Today" }, { "name": "CustomerAcceptance", "triggerDate": "$Today" }, { "name": "ServiceActivation", "triggerDate": "$Today" } ], "type": "AddProduct" } - After the rate plan is subscribed successfully, you can retrieve the price and pricingAttributes value of the charge via the GET subscription end point. This is an example response of pricingAttributes of the charge created from "$productRatePlanChargeId" in the previous step.
"price": 9.000000000,
"pricingAttributes": {
"Site_Size": 7,
"Account_Type": "VIP",
"EffectiveDate": "2025-06-20T00:00:00+08:00",
"Subscription_Renewal_Term": 12,
"Subscription_RatePlan_Class": "Low"
}
Note:pricingAttributes includes all the pricing attribute values including both external attributes and attributes mapped to Zuora object fields.