Posts or cancels a bill run.
Posting a bill run is an asynchronous operation. To post a bill run, the current bill run must have a status of Completed.
When a bill run is posted, its status is changed to PostInProgress. Once all invoices for this bill run are posted then its status is changed to Posted.
When you post a bill run and query the status of a bill run, you will get one of the following results PostInProgress, Completed, or Posted. If all invoices in the bill run are posted, then the status of the bill run is Posted. If one or more invoices fail to post, the status will change back to Completed and you will need to post the bill run again.
Canceling a bill run is an asynchronous operation. When canceling a bill run, the logic is the same as when using the UI to cancel a bill run. You need to provide the BillRunId, and set the Status to Canceled.
When canceling a bill run, consider the following:
- Canceling a bill run with a
Completed status.- Only the current bill run will be canceled.
- Canceling a bill run with a
Pending status.- When canceling an Ad-hoc bill run, only the current bill run will be canceled.
- When canceling a scheduled bill, all scheduled bill runs will be canceled.
The Cancel operation may not be successful. Its success depends on its current business validation. Only a bill run that has no posted invoices can be canceled. If any posted invoices belong to the bill run then an invalid value exception will be thrown with the message, "The Bill Run cannot be Cancelled, There are Posted invoices."