# CRUD: Post or cancel a bill run Posts or cancels a bill run. ### Post 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. ### Cancel a Bill Run 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." Endpoint: PUT /v1/object/bill-run/{id} Version: 2025-12-17 ## Header parameters: - `Accept-Encoding` (string) Include the Accept-Encoding: gzip header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a Content-Encoding header with the compression algorithm so that your client can decompress it. - `Content-Encoding` (string) Include the Content-Encoding: gzip header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. - `Authorization` (string) The value is in the Bearer {token} format where {token} is a valid OAuth token generated by calling Create an OAuth token. - `Zuora-Entity-Ids` (string) An entity ID. If you have Zuora Multi-entity enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. - `Zuora-Track-Id` (string) A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (:), semicolon (;), double quote ("), and quote ('). ## Query parameters: - `rejectUnknownFields` (boolean) Specifies whether the call fails if the request body contains unknown fields. With rejectUnknownFields set to true, Zuora returns a 400 response if the request body contains unknown fields. The body of the 400 response is: json { "message": "Error - unrecognised fields" } By default, Zuora ignores unknown fields in the request body. ## Path parameters: - `id` (string, required) Object id ## Request fields (application/json): - `Status` (string, required) The status for this bill run. See [Status Types](https://knowledgecenter.zuora.com/CB_Billing/J_Billing_Operations/G_Bill_Runs#Status_Types) for more information. To cancel a bill run, specify Canceled. To post a bill run, specify Posted. Character limit: 20 Values: * Pending * Processing * Completed * Error * Canceled * Posted Example: "Posted" - `InvoiceDate` (string) The new invoice date of all invoices invloved in the bill run, or the new memo date of all credit memos invloved in the bill run. The date cannot fall in a closed accounting period. This field takes effect only when Status is set to Posted. Note: The Credit and Debit Memos feature is only available if you have [Invoice Settlement](https://knowledgecenter.zuora.com/Billing/Billing_and_Payments/Invoice_Settlement) enabled. The Invoice Settlement feature is generally available as of Zuora Billing Release 296 (March 2021). This feature includes Unapplied Payments, Credit and Debit Memo, and Invoice Item Settlement. If you want to enable Invoice Settlement, see [Invoice Settlement Enablement and Checklist Guide](https://knowledgecenter.zuora.com/Billing/Billing_and_Payments/Invoice_Settlement/Invoice_Settlement_Migration_Checklist_and_Guide) for more information. Example: "2020-02-18" ## Response 200 fields (application/json): - `Id` (string) Example: "2c93808457d787030157e030232f3748" - `Success` (boolean) Example: true ## Response 401 fields (application/json): - `message` (string) Error message. If the error message is "Authentication error", ensure that the Authorization request header contains valid authentication credentials, then retry the request. See [Authentication](https://developer.zuora.com/rest-api/general-concepts/authentication/) for more information. If the error message is "Failed to get user info", retry the request.