Happy Business Starts Here

Savvy Scholar

Cancel Invoice in 'Draft' status

I cannot find an API endpoint to cancel/unpost an invoice that is in draft status.  I tried to delete it and I get "Only Cancelled invoices can be deleted."  Can someone link me to this API call?

Tags (3)

Re: Cancel Invoice in 'Draft' status

@will I believe you simply need to do an update to the invoice and change the status from "Draft" to "Canceled". This will cause the invoice to be cancelled in the system. Once the status is set to 'Canceled' you should be able to delete.


Reference: https://knowledgecenter.zuora.com/DC_Developers/G_SOAP_API/E1_SOAP_API_Object_Reference/Invoice#Addi...

Savvy Scholar

Re: Cancel Invoice in 'Draft' status

Thanks @feisley - there is a hybrid of API nomenclature and practices going on within Zuora's REST wrapper on it's SOAP api, and I am using the REST api.  For instance, to cancel a subscription, you make a PUT request to https://rest.zuora.com/v1/subscriptions/{subscription-key}/cancel.  


For anyone looking for the REST version of how to do this: https://www.zuora.com/developer/api-reference/#operation/Object_PUTInvoice


params = { Id: "XXXXXXX", Status: "Canceled" }
client.put("/v1/object/invoice/XXXXXXX", params)