After triggering Billing Preview Run api call, why does error "There is already a billingPreview run scheduled" happen and how to solve it?
Solved! Go to Solution.
A single batch of customer accounts can only have one BPR (Billing Preview Run) triggered at a time. If the previous submitted BPR for a specific batch is still processing, you cannot trigger another one until the first one completed.
We can get the BPR status via query or Generic API Utility on BillingPreviewObject. Reference https://knowledgecenter.zuora.com/DC_Developers/G_SOAP_API/E1_SOAP_API_Object_Reference/BillingPrevi...
For example, here is a query to list all the processing BPRs.
“queryString”: “Select Id, Batch, ChargeTypeToExclude, CreatedById, CreatedDate, EndDate, ErrorMessage, IncludingEvergreenSubscription, ResultFileUrl, RunNumber, StartDate, Status, SucceededAccounts, TargetDate, TotalAccounts, UpdatedById, UpdatedDate From BillingPreviewRun where Status='Processing'”
In very rare case, a BPR was stuck in Pending status and you cannot trigger another BPR against the same batch. In this case, you can use where condition Update Status='Pending' to get the stuck BPR and reach out to zuora support team to cancle that stuck BPR.
Please note BPR is a backend job and it may take hours or days to complete. The factors could be the number of customer accounts included, the targetDate, assume renew or not. Reference https://www.zuora.com/developer/api-reference/#operation/POST_BillingPreviewRun
If you accidentally triggered a bill run and want to terminate it, please submit a request via support portal http://support.zuora.com and let the support team know your tenant id, BPR number and support team can help you terminate it from the backend. Currently, you cannot terminate a BPR via self-service yet.
If you have subscribed Zuora Developer tools, you can easily trigger Billing Preview Run, check the status in UI and query much easier. https://knowledgecenter.zuora.com/Marketplace/Market_Apps/Developer_Tools/Configure_Billing_Preview