create workflow which picks up all active subscriptions which have active plan "NBN50"…
- User
create workflow which picks up all active subscriptions which have active plan "NBN50" and ammends the price(85) in zuora
- Assistant
- Start the workflow by connecting to the Zuora API and retrieving all active subscriptions.
- Filter the retrieved subscriptions to only include those with an active plan named "NBN50".
- For each subscription, update the price to 75 by making an API call to modify the subscription in Zuora.
- User
can you tell me whic tasks I can make use of with steps
- Assistant
Certainly! Here are the tasks you can make use of in each step of the workflow:
Step 1: Connect to the Zuora API and Retrieve Active Subscriptions
- Connect to the Zuora API using an API integration task.
- Use a GET request task to retrieve all active subscriptions from Zuora.
Step 2: Filter Subscriptions with Active Plan "NBN50"
- Utilize a filter task to identify subscriptions that have an active plan named "NBN50".
- This task will help you shortlist the relevant subscriptions for the next step.
Step 3: Update Price of Subscriptions
- Make use of a loop task to iterate through each filtered subscription.
- Inside the loop, utilize an API task to modify the price of the subscription in Zuora.
- Set the new price to 75 in this task.
- User
Can you provide with zuora's latest task names to tackle above workflow
- Assistant
Certainly! Here are the latest task names in Zuora that you can use to tackle the above workflow:
Step 1: Connect to the Zuora API and Retrieve Active Subscriptions
- Use the "Zuora Connect" task to establish a connection to the Zuora API.
- Utilize the "Zuora REST API - GET" task to retrieve all active subscriptions from Zuora.
Step 2: Filter Subscriptions with Active Plan "NBN50"
- Make use of the "Filter" task to identify subscriptions that have an active plan named "NBN50".
Step 3: Update Price of Subscriptions
- Utilize the "Loop" task to iterate through each filtered subscription.
- Inside the loop, use the "Zuora REST API - PUT" task to modify the price of the subscription in Zuora.
Step 4: Repeat Steps 2 and 3 Until All Subscriptions are Updated
- Use the "Conditional" task to check if there are any remaining subscriptions to update.
- If there are more subscriptions, loop back to Step 2 and filter the next set.
- User
ZOQL query to fetch the active subscription with active plan of NBN 50
- Assistant
To fetch the active subscription with an active plan of "NBN 50" using ZOQL (Zuora Object Query Language), you can use the following query:
SELECT Id, Name FROM Subscription WHERE Status = 'Active' AND Id IN (SELECT SubscriptionId FROM RatePlan WHERE ProductName = 'NBN 50' AND EffectiveEndDate >= Today)This query retrieves the
IdandNamefields from theSubscriptionobject where the subscription has a status of "Active" and itsIdis present in the result of a subquery. The subquery filters the associatedRatePlanobjects to find the ones with aProductNameof "NBN 50" and anEffectiveEndDatethat is not expired (greater than or equal to today).Please note that you may need to adjust the object and field names based on your Zuora configuration.
- User
main object I will be using Rateplancharge based on this object provide to fetch the above data
- Assistant
Based on your requirement to fetch the active subscription with an active plan of "NBN 50" using the
RatePlanChargeobject, you can use the following query:SELECT SubscriptionId, Subscription.Name FROM RatePlanCharge WHERE Subscription.Status = 'Active' AND ProductName = 'NBN 50' AND Subscription.Status = 'Active'In this query, we select the
SubscriptionIdand theNameof the associatedSubscriptionfrom theRatePlanChargeobject. We then apply filters to retrieve only thoseRatePlanChargerecords where the associatedSubscriptionhas a status of "Active" and theProductNameis "NBN 50".Please note that in Zuora, the
RatePlanChargeobject represents the individual charges associated with a subscription. You can query this object to obtain information related to subscriptions and their corresponding rate plan charges. - User
why there is no JOINs used in query
- Assistant
Apologies for the oversight. In Zuora's ZOQL query language, JOINs are not supported. However, you can achieve the desired result by modifying the query as follows:
SELECT Subscription.Id, Subscription.Name FROM RatePlanCharge WHERE Subscription.Status = 'Active' AND ProductName = 'NBN 50' AND SubscriptionId IN (SELECT Id FROM Subscription WHERE Status = 'Active')In this updated query, we are still querying the
RatePlanChargeobject. However, we now use a subquery to fetch the active subscription IDs from theSubscriptionobject that have a status of "Active". Then, in the main query, we check if theSubscriptionIdof theRatePlanChargeis present in the set of active subscriptions obtained from the subquery.By doing this, we effectively filter the
RatePlanChargerecords to only include those associated with active subscriptions and having the specified "NBN 50" product name. - User
how can update a price of active plan using zuora workflow
- Assistant
To update the price of an active plan using a Zuora workflow, you can follow these steps:
- Start the workflow by connecting to the Zuora API using the "Zuora Connect" task.
- Retrieve the active plan using a Zuora REST API GET call to fetch the details of the plan you want to update.
- Extract the necessary information from the response, such as the plan ID and other required details, using a data manipulation task.
- Modify the price value to the desired amount, such as $85, using a formula task or by manually assigning the new price value.
- Use a Zuora REST API PUT call to update the plan's price with the new value.
- Validate the response to ensure the update was successful using a conditional task.
- If the update was successful, end the workflow. Otherwise, include error handling tasks as needed.
Make sure to adjust the specific task names and parameters based on your Zuora workflow tool. Remember to refer to the Zuora API documentation for the correct API endpoints and request payload structure.